Exemplo n.º 1
0
 public function header()
 {
     $base = system::OLIV_PROTOCOL() . system::OLIV_HOST() . system::OLIV_BASE();
     $o = "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>";
     // set page to utf-8
     $o .= "<base href='{$base}'>";
     // link base referenz
     $o .= "<title>" . status::oliv_page() . "</title>";
     // page title in browser
     $o .= "<link href='" . OLIVImage::_(system::OLIV_ICON()) . "' type='image/x-icon' rel='shortcut icon'>";
     // icon in browser
     return $o;
 }
Exemplo n.º 2
0
 public static function tagString($tag, $value, $options)
 {
     $class = "";
     $retArray = array();
     //echoall($options);
     $content = $options['template'];
     // get language code of text snippet and mark field if not translated
     $lang = OLIVText::_($value, "lang");
     $ownerLang = $content->attributes()->lang;
     $imgUrl = OLIVImage::_((string) $content->attributes()->src);
     // set link if permission granted
     if (OLIVRight::x($content) and $url = $content->attributes()->url) {
         $retArray['link']['url'] = (string) $url;
         if ($urlLang = $content->attributes()->urllang) {
             $retArray['link']['lang'] = (string) $urlLang;
         } else {
             $retArray['link']['lang'] = (string) status::lang();
         }
         if ($urlTitle = $content->attributes()->urltitle) {
             $retArray['link']['title'] = OLIVText::_((string) $urlTitle, "lang=" . $urlLang);
         }
     }
     // check for permissions to display translation mark
     if (OLIVRight::w($content) and $ownerLang and $ownerLang != system::OLIV_LANG()) {
         // mark for no translation
         if ($lang != system::OLIV_LANG() and OLIVText::_((string) $value)) {
             $class = "oliv_not_translated";
         }
     }
     $imgUrl = OLIVImage::img($value);
     $retArray['startTag'] = "";
     $retArray['value'] = $imgUrl;
     // textPlugin::getText($value,$header);
     $retArray['endTag'] = "";
     return $retArray;
 }
Exemplo n.º 3
0
 public static function img($image, $lang = "")
 {
     $o = "";
     if (is_object($image)) {
         $id = (string) $image->attributes()->id;
         // tag id
         $src = (string) $image->attributes()->src;
         // image name -> src path via OLIVImage
         $lang = (string) $image->attributes()->lang;
         // image language
         $alt = (string) $image->attributes()->alt;
         // alternative text
         $width = (string) $image->attributes()->width;
         // image width
         $height = (string) $image->attributes()->height;
         // image height
         $link = (string) $image->attributes()->link;
         // link an image
         $float = (string) $image->attributes()->float;
         // float definition: left, right
         $margin = (string) $image->attributes()->margin;
         // margin distance
         $margin_left = (string) $image->attributes()->margin_left;
         // margin distance
         $margin_right = (string) $image->attributes()->margin_right;
         // margin distance
         $margin_top = (string) $image->attributes()->margin_top;
         // margin distance
         $margin_bottom = (string) $image->attributes()->margin_bottom;
         // margin distance
         $margin_side = (string) $image->attributes()->margin_side;
         // margin distance
         if ($path = OLIVImage::_($src, $lang)) {
             $style = "";
             // create inline style
             if ($float) {
                 $style .= "float:{$float};";
                 // intelligent side margin
                 if ($margin_side) {
                     switch ($float) {
                         case 'left':
                             $style .= "margin-right:{$margin_side}";
                             break;
                         case 'right':
                             $style .= "margin-left:{$margin_side}";
                             break;
                     }
                 }
             } else {
                 if ($margin_side) {
                     $style .= "margin-right:{$margin_side};margin-left:{$margin_side}";
                 }
             }
             if ($margin) {
                 $style .= "margin:{$margin};";
             }
             if ($margin_left) {
                 $style .= "margin-left:{$margin_left};";
             }
             if ($margin_right) {
                 $style .= "margin-right:{$margin_right};";
             }
             if ($margin_top) {
                 $style .= "margin-top:{$margin_top};";
             }
             if ($margin_bottom) {
                 $style .= "margin-bottom:{$margin_bottom};";
             }
             // insert data in parameter string
             $o .= "<img src='{$path}'";
             if ($alt) {
                 $o .= " alt='{$alt}'";
             }
             if ($height) {
                 $o .= " height='{$height}'";
             }
             if ($width) {
                 $o .= " width='{$width}'";
             }
             if ($style) {
                 $o .= " style='{$style}'";
             }
             if ($id) {
                 $o .= " id='{$id}'";
             }
             $o .= ">";
         }
         // end style
         //echoall($path);
         //echoall($o);
         return $o;
     }
 }