public static function selector($langXml) { // create lang selector $langSelector = new simpleXmlElement("<lang_selector/>"); if ($langXml) { foreach ($langXml as $entry) { $langCode = $entry->getName(); //echoall($langCode); $countryCode = OLIVLang::defaultCountry($langCode); // make current language bigger $id = "oliv_lang_flag"; if ($langCode == status::lang()) { $id = "oliv_lang_flag_selected"; } //get string for url title language name $title = OLIVText::_("change_language", $langCode); $title .= " - " . OLIVText::_($langCode, $langCode); // full language name // create flag image // $img = new simpleXmlElement("<img url='" . status::url() . "' urllang='" . $langCode . "' urltitle='{$title}' src='oliv_flag' id='{$id}' lang='" . $countryCode . "' />"); $img = new simpleXmlElement("<selector><a href='current()' title='{$title}' lang='" . $langCode . "'/><img id='{$id}' lang='" . $countryCode . "'>oliv_flag</img></selector>"); // insert image olivxml_insert($langSelector, $img, "ALL"); } //echoall($langSelector->asXML()); return $langSelector; } }
public function draw() { $display = ""; $o = "<ul id='" . $this->context->attributes()->name . "' class='contextMenu'>"; // create ouput string from xml foreach ($this->context as $entry) { // disable entry if ($display = (string) $entry->attributes()->display) { $display = " " . $display; } // set entry to url or status::url if (($url = (string) $entry->attributes()->url) == "#CURRENT") { $url = status::url(); } // set val if ($val = (string) $this->context->attributes()->value) { } else { $val = (string) $this->context->attributes()->name; } // set parameters $class = (string) $entry->attributes()->class; $cmd = (string) $entry->attributes()->cmd; $command = OLIVText::_($cmd); $text = OLIVText::_($entry->getName()); $o .= "<li class='{$class}{$display}'>"; $o .= "<a href='#{$cmd};{$command};" . OLIVRoute::url("", array("url" => $url)) . ";{$val}'>{$text}</a>"; $o .= "</li>"; } $o .= "</ul>"; // output to display echo $o; }
public static function tagEditString($tag, $value, $options) { $content = $options['template']; $source = $content->attributes()->source; //echoall($options); $retArray = imgRender::tagString($tag, $value, $options); // set link if permission granted && source found if (OLIVRight::x($content) and $source) { $retArray['link']['url'] = status::url(); $retArray['link']['val'] = OLIVText::_("edit"); $retArray['link']['lang'] = status::lang(); $retArray['value'] = "edit"; } return $retArray; }
private static function makeParam($param) { $paramArray = array(); if (is_array($param)) { foreach ($param as $key => $value) { if ($key == "title") { // use multilingual expression for title $value = OLIVText::_($value); } array_push($paramArray, "{$key}='{$value}'"); } } return implode(" ", $paramArray); }