Example #1
0
 function setupCustomListAppearance($elementName)
 {
     global $lll, $item_typ, $jQueryLib, $curvyCorners, $gorumroll;
     // ha tobb item list is van egy oldalon, mindegyiknek teljesen kulonbozo typeinfo-ja lehet:
     include "item_typ.php";
     // resetting $item_typ
     CustomField::addCustomColumns("item");
     $lll["item_search_ttitle"] = htmlspecialchars($this->listTitle);
     $columns = $gorumroll->list == "export" ? $this->exportFields : $this->columns;
     G::load($columns, "SELECT * FROM @itemfield WHERE FIND_IN_SET(id, '{$columns}')!=0");
     $item = new Item();
     $item_typ["listOrder"] = array();
     foreach (explode(",", $this->columns) as $id) {
         for ($i = 0; $i < count($columns); $i++) {
             if ($columns[$i]->id == $id) {
                 $columns[$i]->showInList = 1;
                 if (!$columns[$i]->customListPlacement) {
                     $item_typ["listOrder"][] = $columns[$i]->columnIndex;
                 }
                 $item_typ["attributes"][$columns[$i]->columnIndex][] = "list";
                 if ($columns[$i]->customListPlacement) {
                     $item_typ["attributes"][$columns[$i]->columnIndex][] = "customListPlacement";
                 }
                 break;
             }
         }
     }
     $item->fields =& $columns;
     $item->cid = $this->cid;
     $item->activateVariableFields();
     $item->fields = 0;
     CustomList::getSortingSql($this->primarySort, $this->primaryDir, $this->primaryPersistent, $this->secondarySort, $this->secondaryDir, $this->secondaryPersistent);
     if ($specialSortAttrs = $item->getSpecialSortAttrs($this->cid ? 0 : 1, $this->cid)) {
         $this->query = str_replace("n.*", "n.* {$specialSortAttrs}", $this->query);
     }
     if ($this->limit) {
         $item_typ["limit"] = $this->limit;
     }
     if ($this->listStyle != customlist_scrollable && $gorumroll->list != "export") {
         $_S =& new AppSettings();
         if ($this->customAdListTemplate) {
             $item_typ["listTemplate"] = $this->customAdListTemplate;
         } elseif ($_S->customAdListTemplate) {
             $item_typ["listTemplate"] = $_S->customAdListTemplate;
         }
     }
     //var_dump($item_typ);
     if ($this->listStyle == customlist_scrollable && $gorumroll->list != "export") {
         // Neheny szajton, az orientattiont egyszeruen nem tudtam a typeInfoban atvinni a
         // item_scrollablepresentationbe - kenytelen voltan globalba tenni:
         global $scrollablePlacement, $orientation;
         if (!isset($item_typ["listTemplate"])) {
             $item_typ["listTemplate"] = "scrollable_widget.tpl.php";
         }
         $item_typ["listPresentationClassName"] = "ItemScrollablePresentation";
         $params = "";
         $scrollablePlacement = $elementName;
         if ($elementName == "customListLeft" || $elementName == "customListRight") {
             $item_typ["scrollableOrientation"] = $orientation = "vertical";
             $scrollableParams = "vertical: true";
         } else {
             $scrollableParams = "vertical: false";
             $item_typ["scrollableOrientation"] = $orientation = "horizontal";
         }
         if ($this->loop) {
             $scrollableParams .= ", loop: true";
         }
         include_once NOAH_APP . "/item_scrollablepresentation.php";
         JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.dimensions.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.scrollable.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.em.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.jscrollpane.js");
         JavaScript::addInclude(JS_DIR . "/scrollable.js");
         JavaScript::addCss(CSS_DIR . "/scrollable.css");
         JavaScript::addCss(GORUM_JS_DIR . "/jquery/jscrollpane.css");
         JavaScript::addOnload("\$.noah.globalScrollableOnLoad();", "scrollable");
         JavaScript::addOnload("\$.noah.scrollableOnLoad(" . G::js($this->id, $elementName, $scrollableParams) . ");");
         if ($this->autoScroll) {
             JavaScript::addOnload("\$.noah.autoscrollOnLoad(" . G::js($this->id, $elementName, $this->autoScroll) . ");");
         }
     }
 }