public function __toString() { $parent_string = parent::__toString(); $output = array(); $output[] = sprintf("<LabelStyle%s>", isset($this->id) ? sprintf(" id=\"%s\"", $this->id) : ""); $output[] = $parent_string; if (isset($this->scale)) { $output[] = sprintf("\t<scale>%s</scale>", $this->scale); } $output[] = "</LabelStyle>"; return implode("\n", $output); }
public function __toString() { $parent_string = parent::__toString(); $output = array(); $output[] = sprintf("<PolyStyle%s>", isset($this->id) ? sprintf(" id=\"%s\"", $this->id) : ""); $output[] = $parent_string; if (isset($this->fill)) { $output[] = sprintf("\t<fill>%i</fill>", $this->fill); } if (isset($this->outline)) { $output[] = sprintf("\t<width>%i</width>", $this->outline); } $output[] = "</PolyStyle>"; return implode("\n", $output); }
public function __toString() { $parent_string = parent::__toString(); $output = array(); $output[] = sprintf("<IconStyle%s>", isset($this->id) ? sprintf(" id=\"%s\"", $this->id) : ""); $output[] = $parent_string; if (isset($this->scale)) { $output[] = sprintf("\t<scale>%s</scale>", $this->scale); } if (isset($this->heading)) { $output[] = sprintf("\t<heading>%s</heading>", $this->heading); } if (isset($this->icon)) { $output[] = $this->icon->__toString(); } if (isset($this->hotSpot)) { $output[] = sprintf("\t<hotSpot %s />", $this->hotSpot); } $output[] = "</IconStyle>"; return implode("\n", $output); }
/** * Process a string. * * @param string $string The string to process. * * @return string * * @since 2.0 */ public function process($string) { preg_match_all($this->tagFilter, $string, $matches); if (!$matches) { return $string; } foreach ($matches[0] as $i => $m) { if (array_key_exists($matches[1][$i], $this->styles)) { $string = $this->replaceColors($string, $matches[1][$i], $matches[2][$i], $this->styles[$matches[1][$i]]); } elseif (strpos($matches[1][$i], '=')) { $string = $this->replaceColors($string, $matches[1][$i], $matches[2][$i], ColorStyle::fromString($matches[1][$i])); } } return $string; }