MDL-61657 block_myoverview: implement course images for the myoverview block
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
4450d19ae1
commit
c8cc25caba
@@ -0,0 +1,55 @@
|
||||
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
|
||||
|
||||
abstract class Base
|
||||
{
|
||||
protected $tag;
|
||||
protected $elements;
|
||||
protected $args;
|
||||
|
||||
function __construct($args)
|
||||
{
|
||||
$this->args = $args;
|
||||
}
|
||||
|
||||
public function elementsToString()
|
||||
{
|
||||
$string = ' ';
|
||||
foreach ($this->elements as $key => $value)
|
||||
{
|
||||
$string .= "$key=\"$value\" ";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function argsToString()
|
||||
{
|
||||
$string = '';
|
||||
foreach ($this->args as $key => $value)
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
$string .= "$key=\"";
|
||||
foreach ($value as $k => $v)
|
||||
{
|
||||
$string .= "$k:$v;";
|
||||
}
|
||||
$string .= '" ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$string .= "$key=\"$value\" ";
|
||||
}
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function getString()
|
||||
{
|
||||
return "<{$this->tag}{$this->elementsToString()}{$this->argsToString()}/>";
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
return $this->getString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user