/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object DockMenuItem * @since 1.0.35 */ public function render($ajax_render = false) { $html = ""; $item_link = createHrefLink($this->link); if ($item_link != "") { if (gettype($this->img) == "object" && get_class($this->img) == "Picture") { $this->img = $this->img->getSrc(); } if (strtoupper(substr($this->img, 0, 7)) != "HTTP://" && strtoupper(substr($this->img, 0, 8)) != "HTTPS://") { $this->img = BASE_URL . $this->img; } $html .= "<a href=\"" . $item_link . "\">"; $html .= "<img src=\"" . $this->img . "\" border=\"0\" alt=\"" . str_replace("\"", " ", $this->value) . "\" title=\"" . str_replace("\"", " ", $this->value) . "\" />"; $html .= "</a>\n"; } $this->object_change = false; return $html; }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object TreeViewItem * @since 1.0.35 */ public function render($ajax_render = false) { $html = ""; if ($this->parent_treeview_item != null) { if (!$ajax_render) { $html .= "\t<li"; if (!$this->is_file && $this->is_close) { $html .= " class=\"closed\""; } $html .= ">"; $html .= "<span class=\""; if ($this->is_file) { $html .= "file"; } else { $html .= "folder"; } $html .= "\">"; if (gettype($this->value) != "object") { $html .= "<a href=\"" . str_replace("{#file}", $this->path, str_replace("{#filename}", basename($this->path), createHrefLink($this->link))) . "\" id=\"" . $this->getId() . "_id\" style=\"white-space: nowrap;\"> "; $html .= $this->value . "</a>"; } else { if (in_array(get_class($this->value), $this->array_object_ok)) { if (get_class($this->value) == "Button") { $this->value->forceSpanTag(); } $html .= "<span id=\"" . $this->getId() . "_id\" style=\"white-space: nowrap;\"> "; $html .= $this->value->render($ajax_render); $html .= "</span>"; } else { throw new NewException("Error TreeViewItem: value need to be a string, " . implode(", ", $array_object_ok), 0, getDebugBacktrace(1)); } } $html .= "</span>"; if ($this->tooltip_obj != null) { $this->tooltip_obj->setId($this->getId() . "_id"); $html .= $this->getJavascriptTagOpen(); $html .= $this->tooltip_obj->render(); $html .= $this->getJavascriptTagClose(); } } if ($this->treeview_items != null && sizeof($this->treeview_items) > 0) { $html .= "\n" . $this->treeview_items->render(false); } if (!$ajax_render) { $html .= "</li>\n"; } $this->object_change = false; } return $html; }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object Link * @since 1.0.35 */ public function render($ajax_render = false) { if (!$this->getUserHaveRights()) { return ""; } // write link $html = ""; if ($this->tagH != "") { $html .= "<" . $this->tagH . ">"; } if ($this->track_categ != "") { if (get_class($this->link) == "Link") { $this->onclick .= "var link_url=\$(this).attr('href');"; } $this->onclick .= "if (isGoogleAnalyticsLoaded()) { ga('send', 'event', '" . addslashes($this->track_categ) . "', '" . addslashes($this->track_action) . "', '" . addslashes($this->track_label) . "'"; if (get_class($this->link) == "Link" && $this->link->getUserHaveRights() && $this->link->getTarget() == Link::TARGET_NONE) { $this->onclick .= ", {'hitCallback': function(){window.location.href = link_url;}}); return false;"; } else { $this->onclick .= ");"; } $this->onclick .= "} else { window.location.href = link_url; }"; } $html .= "<a"; if ($this->link != null) { $html .= " href=\"" . createHrefLink($this->link, $this->target, $this->onclick) . "\""; } if ($this->id != "") { $html .= " id=\"" . $this->id . "\""; } if ($this->is_lightbox) { $html .= " rel=\"lightbox"; if ($this->lightbox_name != "") { $html .= $this->lightbox_name; } $html .= "\""; } if ($this->tagH != "" || $this->style != "") { $html .= " style=\""; if ($this->tagH == "h1" && !$this->tagH_bold) { $html .= "font-weight:normal;"; } else { if ($this->tagH != "h1" && $this->tagH_bold) { $html .= "font-weight:bold;"; } } if ($this->style != "") { $html .= $this->style; } $html .= "\""; } if ($this->nofollow && !$this->is_lightbox && $this->rel == "") { $html .= " rel=\"nofollow\""; } if ($this->rel != "" && !$this->is_lightbox && !$this->nofollow) { $html .= " rel=\"" . $this->rel . "\""; } if ($this->property != "") { $html .= " property=\"" . $this->property . "\""; } if ($this->onclick != "" && find($html, "javascript:void(0);\" onClick=\"", 1) == 0) { $html .= " onClick=\"" . $this->onclick . "\""; } if ($this->tooltip_obj != null) { $html .= " oldtitle=\"" . str_replace("'", "'", str_replace("\"", """, str_replace("\n", "", str_replace("\r", "", $this->tooltip_title)))) . "\" data-hasqtip=\"true\""; } if ($this->itemprop) { $html .= " itemprop=\"url\""; } if ($this->class != "") { $html .= " class=\"" . $this->class . "\""; } $html .= ">"; if (gettype($this->content) == "object" && method_exists($this->content, "render")) { $html_content = ""; if (get_class($this->content) == "Object") { $html_content = str_replace(">\n <br/>", "><br/>", str_replace(">\n <BR/>", "><BR/>", str_replace(">\n <br />", "><br />", str_replace(">\n <BR />", "><BR />", $this->content->render())))); } else { $html_content = $this->content->render(); } // Revove carriage return on the end of the string before writing </a> $ind_security = 0; while ($html_content[strlen($html_content) - 1] == "\n" || $html_content[strlen($html_content) - 1] == "\r") { $html_content = substr($html_content, 0, strlen($html_content) - 1); $ind_security++; if ($ind_security > 10) { break; } } $html .= $html_content; } else { $html .= $this->content; } $html .= "</a>"; if ($this->tagH != "") { $html .= "</" . $this->tagH . ">"; } if ($this->is_lightbox) { if (!self::$array_lightbox[$this->lightbox_name]) { $html .= $this->getJavascriptTagOpen(); $html .= "\$(function() { \$('a[rel=lightbox"; if ($this->lightbox_name != "") { $html .= $this->lightbox_name; } $html .= "]').lightBox(); });\n"; $html .= $this->getJavascriptTagClose(); self::$array_lightbox[$this->lightbox_name] = true; } } if ($this->tooltip_obj != null) { $this->tooltip_obj->setId($this->getId()); $html .= $this->getJavascriptTagOpen(); $html .= $this->tooltip_obj->render(); $html .= $this->getJavascriptTagClose(); } $this->object_change = false; return $html; }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object NivoSlider * @since 1.2.1 */ public function render($ajax_render = false) { $control_nav_thumbs = false; $html = "<div class=\"slider-wrapper theme-" . $this->theme . "\">\n"; $html .= "<div id=\"slider-" . $this->id . "\" class=\"nivoSlider\""; if ($this->width != "" || $this->height != "" || $this->style != "") { $html .= " style=\""; if ($this->width != "") { $html .= "width:" . $this->width . "px;"; } if ($this->height != "") { $html .= "height:" . $this->height . "px;"; } if ($this->style != "") { $html .= $this->style; } $html .= "\""; } $html .= ">\n"; for ($i = 0; $i < sizeof($this->array_img_src); $i++) { $item_link = createHrefLink($this->array_img_link[$i]); if ($item_link != "") { $html .= "<a href=\"" . $item_link . "\">"; } $html .= "<img src=\"" . $this->array_img_src[$i] . "\" alt=\"\""; if ($this->array_img_thumbnail[$i] != "") { $html .= " data-thumb=\"" . $this->array_img_thumbnail[$i] . "\""; $control_nav_thumbs = true; } if ($this->array_img_title[$i] != "") { $html .= " title=\"#slider-" . $this->id . "_" . $i . "_htmlcaption\""; } $html .= "/>"; if ($item_link != "") { $html .= "</a>"; } $html .= "\n"; } $html .= "</div>\n"; $html .= "</div>\n"; for ($i = 0; $i < sizeof($this->array_img_title); $i++) { if ($this->array_img_title[$i] != "") { $html .= "<div id=\"slider-" . $this->id . "_" . $i . "_htmlcaption\" class=\"nivo-html-caption\">\n"; if (gettype($this->array_img_title[$i]) == "object" && method_exists($this->objects[$i], "render")) { $html .= $this->array_img_title[$i]->render(); } else { $html .= $this->array_img_title[$i]; } $html .= "\n</div>\n"; } } $html .= $this->getJavascriptTagOpen(); $html .= "\$(window).load(function() {\n"; $html .= "\t\$('#slider-" . $this->id . "').nivoSlider({ effect:\"" . $this->transition . "\""; if ($this->rotate_time > 0) { $html .= ", animSpeed:" . $this->rotate_time; } if ($control_nav_thumbs) { $html .= ", controlNavThumbs:true"; } $html .= " });\n"; if ($this->pic_list_height != "") { $html .= " \$('.nivo-thumbs-enabled').css('height', '" . $this->pic_list_height . "px').css('overflow', 'auto');\n"; } $html .= "});\n"; $html .= $this->getJavascriptTagClose(); $this->object_change = false; return $html; }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object MenuItem * @since 1.0.35 */ public function render($ajax_render = false) { $html = ""; $item_link = createHrefLink($this->link); if ($item_link != "") { $html = "\t<li"; if ($this->current) { $html .= " class=\"current\""; } $html .= ">"; $html .= "<a "; if ($this->menu_items != null && sizeof($this->menu_items) > 0) { $html .= "class=\"sf-with-ul\" "; } $html .= "href=\"" . $item_link . "\" style=\"white-space: nowrap;\">"; if ($this->img != "") { if (gettype($this->img) != "object") { $this->img = new Picture($this->img); $this->img->setAlign(Picture::ALIGN_ABSMIDDLE); } $html .= str_replace("\n", "", str_replace("\r", "", $this->img->render())) . " "; } $html .= $this->value . "</a>"; if ($this->menu_items != null && sizeof($this->menu_items) > 0) { $html .= "\n" . $this->menu_items->render(); } $html .= "</li>\n"; } $this->object_change = false; return $html; }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @since 1.0.35 */ public function render($ajax_render = false) { $html = ""; if (!$this->is_render) { $ind = 0; $html .= "<map name=\"" . $this->getId() . "\" id=\"" . $this->getId() . "\">\n"; for ($i = 0; $i < sizeof($this->array_polygon); $i++) { if ($this->array_polygon[$i]['link']->getUserHaveRights()) { $html .= "\t<area shape=\"poly\" coords=\""; $coords = ""; for ($j = 0; $j < sizeof($this->array_polygon[$i]); $j++) { if (is_numeric($this->array_polygon[$i][$j])) { if ($coords != "") { $coords .= ","; } $coords .= $this->array_polygon[$i][$j]; } } $html .= $coords . "\" "; $html .= "href=\"" . createHrefLink($this->array_polygon[$i]['link']->getLink(), $this->array_polygon[$i]['link']->getTarget()) . "\" "; $html .= "alt=\"" . str_replace("\"", " ", $this->array_polygon[$i]['title']) . "\" title=\"" . str_replace("\"", " ", $this->array_polygon[$i]['title']) . "\""; if ($this->array_polygon[$i]['onclick_js'] != "") { $html .= " onClick=\"" . str_replace("\n", "", $this->array_polygon[$i]['onclick_js']) . "\""; } if ($this->array_polygon[$i]['onmouseover_js'] != "") { $html .= " onMouseOver=\"" . str_replace("\n", "", $this->array_polygon[$i]['onmouseover_js']) . "\""; } if ($this->array_polygon[$i]['onmouseout_js'] != "") { $html .= " onMouseOut=\"" . str_replace("\n", "", $this->array_polygon[$i]['onmouseout_js']) . "\""; } $html .= ">\n"; $ind++; } } for ($i = 0; $i < sizeof($this->array_rect); $i++) { if ($this->array_rect[$i]['link']->getUserHaveRights()) { $html .= "\t<area shape=\"rect\" coords=\""; $html .= $this->array_rect[$i]['x1'] . "," . $this->array_rect[$i]['y1'] . "," . $this->array_rect[$i]['x2'] . "," . $this->array_rect[$i]['y2'] . "\" "; $html .= "href=\"" . createHrefLink($this->array_rect[$i]['link']->getLink(), $this->array_rect[$i]['link']->getTarget()) . "\" "; $html .= "alt=\"" . str_replace("\"", " ", $this->array_rect[$i]['title']) . "\" title=\"" . str_replace("\"", " ", $this->array_rect[$i]['title']) . "\""; if ($this->array_rect[$i]['onclick_js'] != "") { $html .= " onClick=\"" . str_replace("\n", "", $this->array_rect[$i]['onclick_js']) . "\""; } if ($this->array_rect[$i]['onmouseover_js'] != "") { $html .= " onMouseOver=\"" . str_replace("\n", "", $this->array_rect[$i]['onmouseover_js']) . "\""; } if ($this->array_rect[$i]['onmouseout_js'] != "") { $html .= " onMouseOut=\"" . str_replace("\n", "", $this->array_rect[$i]['onmouseout_js']) . "\""; } $html .= ">\n"; $ind++; } } for ($i = 0; $i < sizeof($this->array_circle); $i++) { if ($this->array_circle[$i]['link']->getUserHaveRights()) { $html .= "\t<area shape=\"circle\" coords=\""; $html .= $this->array_circle[$i]['x'] . "," . $this->array_circle[$i]['y'] . "," . $this->array_circle[$i]['r'] . "\" "; $html .= "href=\"" . createHrefLink($this->array_circle[$i]['link']->getLink(), $this->array_circle[$i]['link']->getTarget()) . "\" "; $html .= "alt=\"" . str_replace("\"", " ", $this->array_circle[$i]['title']) . "\" title=\"" . str_replace("\"", " ", $this->array_circle[$i]['title']) . "\""; if ($this->array_circle[$i]['onclick_js'] != "") { $html .= " onClick=\"" . str_replace("\n", "", $this->array_circle[$i]['onclick_js']) . "\""; } if ($this->array_circle[$i]['onmouseover_js'] != "") { $html .= " onMouseOver=\"" . str_replace("\n", "", $this->array_circle[$i]['onmouseover_js']) . "\""; } if ($this->array_circle[$i]['onmouseout_js'] != "") { $html .= " onMouseOut=\"" . str_replace("\n", "", $this->array_circle[$i]['onmouseout_js']) . "\""; } $html .= ">\n"; $ind++; } } if ($this->default_link != "") { if ($this->default_link->getUserHaveRights()) { $html .= "\t<area shape=\"default\" href=\"" . createHrefLink($this->default_link->getLink(), $this->default_link->getTarget()) . "\""; if ($this->default_onclick_js != "") { $html .= " onClick=\"" . str_replace("\n", "", $this->default_onclick_js) . "\""; } if ($this->default_onmouseover_js != "") { $html .= " onMouseOver=\"" . str_replace("\n", "", $this->default_onmouseover_js) . "\""; } if ($this->default_onmouseout_js != "") { $html .= " onMouseOut=\"" . str_replace("\n", "", $this->default_onmouseout_js) . "\""; } $html .= ">\n"; $ind++; } } $html .= "</map>\n"; if ($this->default_tooltip_obj != null) { $html .= $this->getJavascriptTagOpen(); $html .= "\$(document).ready(function() { \$('#" . $this->getId() . "').find('area').qtip({ content: { attr: 'alt' }, style: { widget: true }"; if (trim($this->default_tooltip_obj->getParams()) != "") { $html .= ", " . $this->default_tooltip_obj->getParams(); } $html .= " }); });"; $html .= $this->getJavascriptTagClose(); } $this->is_render = true; $this->object_change = false; } return $html; }