Пример #1
0
 function Presentation(&$base, $what, $typ = 0)
 {
     global ${"gorum{$what}template"}, $gorumroll;
     $this->base =& $base;
     if ($typ) {
         $this->typ =& $typ;
     } else {
         $this->typ =& $base->getTypeInfo(TRUE);
     }
     if (isset($this->typ["{$gorumroll->list}: {$what}Template"])) {
         $this->template = $this->typ["{$gorumroll->list}: {$what}Template"];
     }
     if (isset($this->typ["{$gorumroll->method}: {$what}Template"])) {
         $this->template = $this->typ["{$gorumroll->method}: {$what}Template"];
     } elseif (isset($this->typ["{$what}Template"])) {
         $this->template = $this->typ["{$what}Template"];
     } else {
         $this->template = ${"gorum{$what}template"};
     }
     $this->innerBordersOnly = G::getSetting($this->typ, "innerBordersOnly");
     if ($this->innerBordersOnly) {
         // a szelso td-k kulso bordereit toroljuk:
         JavaScript::addOnload("\n            \$('.template > table').find('tbody tr:not(.noapply), tfoot tr').find('td:first, th:first').css('border-left', 'none').end().\n                                    find('td:last, th:last').css('border-right', 'none').end().\n                                    find('td.groupsep_v + td').css('border-left', 'none').end().\n                                    find('td.groupsep_v').prev().css('border-right', 'none').end().end().\n                                    slice(-1).find('td').css('border-bottom', 'none');\n        ", "innerBordersOnly");
     }
 }
Пример #2
0
 function init()
 {
     global $gorumroll;
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.curvycorners.js");
     JavaScript::addInclude(THEME_DIR . "/javascripts/modern.js");
     if (($gorumroll->list == "item" || $gorumroll->list == "user") && $gorumroll->method == "showdetails") {
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.preload.js");
         JavaScript::addOnload("\n          \$('.smallpic img').preload({\n              find:'small',\n              replace:'large'\n          });\n          \$('.smallpic a').hover(function(){\n              var dim = \$(this).find('img').attr('rel').split('x');\n              var src = \$(this).find('img').attr('src');\n              \$('.mainpic img').attr({\n                  src: src.replace('small','large'),\n                  width: dim[0],\n                  height: dim[1]\n              });\n              \$('.mainpic a').attr('href', this.href);\n          },function(){});\n        ");
     }
 }
Пример #3
0
 function init()
 {
     global $curvyCorners, $jQueryLib;
     if (!empty($curvyCorners)) {
         //JavaScript::addInclude(GORUM_DIR . "/js/niftycube.js");
         //JavaScript::addCss(GORUM_DIR . "/js/niftyCorners.css");
         //JavaScript::addOnload("
         //    Nifty('div.template','normal');
         //");
         JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.curvycorners.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.livequery.js");
         JavaScript::addOnload("\$.noah.addCurvyCornersToPresentationDivs();");
     }
 }
Пример #4
0
 function modifyForm()
 {
     global $gorumroll, $customfield_typ;
     $this->id = $gorumroll->rollid;
     if (!Roll::isPreviousFormSubmitInvalid()) {
         if ($this->load()) {
             handleErrorNotFound($this, __FILE__, __LINE__);
         }
     }
     $this->hasObjectRights($hasRight, "modify", TRUE);
     $this->initializeMultipleSelectionFieldsAndDefaults();
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/json.js");
     JavaScript::addInclude(JS_DIR . "/propagate.js");
     JavaScript::addOnload('$.noah.submitOptionValueModificationStack();');
     if ($this->isFixField()) {
         $customfield_typ["attributes"]["values"][] = "form invisible";
     }
     $this->generForm();
     if ($this->isFixField()) {
         Roll::setInfoText("customfield_fixInfoText");
     }
 }
Пример #5
0
 function generTextField($attr, $val)
 {
     global $jQueryLib;
     $this->getTextFieldLengths($val, $inputLength, $fieldLength);
     if (isset($val["onkeypress"])) {
         JavaScript::addEvent('#' . $attr, "keypress", $val["onkeypress"]);
     }
     if (isset($val["onkeyup"])) {
         JavaScript::addEvent('#' . $attr, "keyup", $val["onkeyup"]);
     }
     if (isset($val["onchange"])) {
         JavaScript::addEvent('#' . $attr, "change", $val["onchange"]);
     }
     if (isset($val["onblur"])) {
         JavaScript::addEvent('#' . $attr, "blur", $val["onblur"]);
     }
     if (isset($val["default"]) && $val["default"] === "" && $this->base->{$attr} === "0") {
         $this->base->{$attr} = "";
     }
     if (isset($val["masked"])) {
         JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.maskedinput.js");
         JavaScript::addOnload("\n            \$('#{$attr}').mask('{$val['masked']}');\n        ");
     }
     if (isset($val["filterCharacters"])) {
         JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.alphanumeric.js");
         JavaScript::addOnload("\n            \$('#{$attr}').{$val['filterCharacters']};\n        ");
     }
     return GenerWidget::generTextField("text", $attr, $this->base->{$attr}, $inputLength, $fieldLength);
 }
Пример #6
0
 function OverlayController($param = 0, $id = 0)
 {
     global $lll, $gorumroll;
     static $counter = 0;
     static $objects = array();
     if (!$param) {
         return;
     }
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.overlay.js");
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.livequery.js");
     JavaScript::addCss(CSS_DIR . "/overlay.css");
     // $ajaxTarget-be gyujtjul a load fuggveny parameteret:
     $text = $ajaxTarget = "";
     if (is_string($param)) {
         $this->id = $id ? $id : "overlay_" . $counter++;
         $this->triggerSelector = "[rel=#{$this->id}]";
         $text = isset($lll[$param]) ? $lll[$param] : $param;
     } elseif (is_object($param)) {
         $this->id = $id ? $id : "overlay_" . $counter++;
         $this->triggerSelector = "[rel=#{$this->id}]";
         $ajaxTarget = "'" . $param->makeUrl() . "'";
     } else {
         if (isset($param["id"])) {
             $this->id = $param["id"];
             if (array_key_exists($this->id, $objects)) {
                 foreach (get_object_vars($objects[$this->id]) as $attr => $value) {
                     $this->{$attr} =& $objects[$this->id]->{$attr};
                 }
                 return;
             }
         } else {
             $this->id = "overlay_" . $counter++;
         }
         if (isset($param["class"])) {
             $this->class = $param["class"];
         }
         if (isset($param["ajaxFromHref"])) {
             $this->ajaxFromHref = $param["ajaxFromHref"];
         }
         if (isset($param["ajaxFromContent"])) {
             $this->ajaxFromContent = $param["ajaxFromContent"];
         }
         if (isset($param["triggerSelector"])) {
             $this->triggerSelector = $param["triggerSelector"];
         } else {
             $this->triggerSelector = "[rel=#{$this->id}]";
         }
         if (isset($param["content"])) {
             if (is_string($param["content"])) {
                 if (substr($param["content"], 0, 6) == "http://") {
                     $ajaxTarget = "'{$param['content']}'";
                 } elseif ($this->ajaxFromContent) {
                     $ctrl =& new AppController($param["content"]);
                     $ajaxTarget = "'" . $ctrl->makeUrl() . "'";
                 } else {
                     $text = isset($lll[$param["content"]]) ? $lll[$param["content"]] : $param["content"];
                 }
             } elseif (is_array($param["content"])) {
                 $text = call_user_func($param["content"]);
             } elseif (is_object($param["content"])) {
                 if ($this->ajaxFromContent) {
                     $ajaxTarget = "'" . $param["content"]->makeUrl() . "'";
                 } else {
                     $gorumroll->processMethod($param["content"], $this->id);
                     $tpl =& View::getView($this->id);
                     $text = $tpl->__toString();
                 }
             }
         }
         if ($this->ajaxFromHref) {
             $ajaxTarget = "this.getTrigger().attr('href')";
         }
         if (isset($param["expose"])) {
             $this->expose = $param["expose"];
         }
         if (isset($param["closeOnClick"])) {
             $this->closeOnClick = $param["closeOnClick"];
         }
         $this->closeOnClick = $this->closeOnClick ? 'true' : 'false';
         if (isset($param["postponeOnloadAction"])) {
             $this->postponeOnloadAction = $param["postponeOnloadAction"];
         }
         if (isset($param["speed"])) {
             $this->speed = $param["speed"];
         }
         if (isset($param["top"])) {
             $this->top = $param["top"];
         }
         if (isset($param["height"])) {
             $this->height = $param["height"];
         }
         if (isset($param["close"])) {
             $this->close = $param["close"];
         }
         if ($this->expose) {
             JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.expose.js");
             $this->onBeforeLoad = "function() { \n                this.getBackgroundImage().expose({\n                    speed: {$this->speed}, \n                    color: '#fff',\n                    closeOnClick: {$this->closeOnClick}\n                }); \n                /*insertionPoint*/\n            }";
             $this->onClose = "function() { \n                \$.expose.close();\t\t\t\n                /*insertionPoint*/\n            }";
         }
     }
     if ($ajaxTarget) {
         $onBeforeLoadForAjax = "\n            this.getContent().find('.ajaxOverlayContent').load({$ajaxTarget}, '', function(){\n                \$(this).find('.submitfooter input').eq(1).click( function() { \n                    \$('{$this->triggerSelector}').overlay().close(); \n                    return false; \n                });\n            }); \n            /*insertionPoint*/\n        ";
         if ($this->onBeforeLoad != 'null') {
             $this->onBeforeLoad = str_replace("/*insertionPoint*/", $onBeforeLoadForAjax, $this->onBeforeLoad);
         } else {
             $this->onBeforeLoad = "function() { {$onBeforeLoadForAjax} }";
         }
         $ajaxOverlayContent = "<div class='ajaxOverlayContent'></div>";
     } else {
         $ajaxOverlayContent = "";
     }
     // ha parameterben erkeznek callback JS sorok, akkor azokat a fentebb definialt callback body-k utan szurjuk be az /*insertionPoint*/ helyere:
     foreach (array("onLoad", "onBeforeLoad", "onClose") as $callback) {
         if (is_array($param) && isset($param[$callback]) && $this->{$callback} != 'null') {
             $this->{$callback} = str_replace("/*insertionPoint*/", $param[$callback], $this->{$callback});
         } elseif (is_array($param) && isset($param[$callback])) {
             $this->{$callback} = $param[$callback];
         } elseif ($this->{$callback} != 'null') {
             $this->{$callback} = str_replace("/*insertionPoint*/", "", $this->{$callback});
         }
     }
     // ajaxFromHref eseten, ha content-ben atadunk valamit, azt be lehet szurni az Ajax tartalom ele:
     $this->content = "<div id='{$this->id}' class='{$this->class}' style='height: {$this->height}px;'> \\\n                         <div class='close'></div>" . preg_replace("/\n|\r/", "", addcslashes($text, '"')) . "{$ajaxOverlayContent} \\\n                     </div>";
     $this->prependAction = "\$('body').prepend(\"{$this->content}\");";
     //var_dump($this->closeOnClick);
     $this->overlayAction = "\n    \$('{$this->triggerSelector}').livequery(function(){ \$(this).overlay({\n            onLoad: {$this->onLoad}, \n            onBeforeLoad: {$this->onBeforeLoad}, \n            onClose: {$this->onClose},\n            closeOnClick: {$this->closeOnClick},\n            speed: {$this->speed},\n            close: '{$this->close}'\n            });});\n    ";
     if (!$this->postponeOnloadAction) {
         JavaScript::addOnload($this->prependAction, $this->id);
         JavaScript::addOnload($this->overlayAction, $this->triggerSelector);
     }
     if (!isset($objects[$this->id])) {
         $objects[$this->id] = $this;
     }
 }
Пример #7
0
 function processContent(&$tpl)
 {
     global $lll, $headerHeight, $gorumroll;
     $this->base->loadHtmlList($list);
     $tpl->assign("wrapForm", in_array("wrap_form", $this->typ));
     if ($tpl->wrapForm) {
         $this->getFormHeader($tpl);
         $this->getFormSubmit($submits);
         $tpl->assign("submits", $submits);
         $tpl->assign("additionalHiddens", $this->base->getAdditionalHiddens($list));
     }
     $this->base->hasGeneralRights($rights);
     if (!in_array("no_pager", $this->typ)) {
         $pager =& $this->base->getPager();
         $tpl->assign("pager", $pager->showPagerTool());
     } else {
         $tpl->assign("pager", "");
     }
     $tpl->assign("footer", "");
     $tpl->assign("listAndMethod", "{$gorumroll->list}-{$gorumroll->method}");
     $tpl->assign("zebraList", $this->zebraList);
     if ($this->tableRowHighlight) {
         JavaScript::addOnload("\$('#{$tpl->listAndMethod} table').tableHover({rowClass: 'hover-row', clickClass: 'hover-click'});");
     }
     $isEmptyList = !count($list);
     if ($isEmptyList && in_array("empty_list", $this->typ)) {
         return 1;
         // ezzel azt jelezzuk, a hivo fg-nek, hogy ures sztringgel kell visszaternie rogton
     }
     if ($this->tableSort) {
         $tpl->assign("tableClass", "table-autosort");
     }
     $tpl->assign("title", $lll[$gorumroll->list . "_ttitle"]);
     $attributeList = isset($this->typ["listOrder"]) ? $this->typ["listOrder"] : array_keys($this->typ["attributes"]);
     $noSpanList = $colSpanList = $rowSpanList = $customListPlacementAttrList = array();
     $numberOfCellsInColSpan = $numberOfCellsInRowSpan = $numberOfCellsInNoSpan = 0;
     foreach ($attributeList as $attr) {
         $val =& $this->typ["attributes"][$attr];
         if (!in_array("list", $val)) {
             continue;
         }
         if ($isNewLine = in_array("in new line", $val)) {
             $colSpanList[] = $attr;
         } elseif ($isRowSpan = in_array("rowspan", $val)) {
             $rowSpanList[] = $attr;
         } elseif (in_array("customListPlacement", $val)) {
             $customListPlacementAttrList[] = $attr;
             continue;
         } else {
             $noSpanList[] = $attr;
         }
         if ($isNewLine) {
             $numberOfCellsInColSpan++;
         } elseif ($isRowSpan) {
             $numberOfCellsInRowSpan++;
         } else {
             $numberOfCellsInNoSpan++;
         }
     }
     $tpl->assign("numberOfCellsInColSpan", $numberOfCellsInColSpan);
     $tpl->assign("numberOfCellsInRowSpan", $numberOfCellsInRowSpan);
     $tpl->assign("numberOfCellsInNoSpan", $numberOfCellsInNoSpan);
     // Ezzel atrendezzuk az $attributeList-et ugy, hogy elol legyenek a normal oszlopok,
     // utana a rowspanos oszlopok es vegul az uj sorba szant oszlopok:
     $attributeList = array_merge($noSpanList, $rowSpanList, $colSpanList);
     $tpl->assign("indexesOfCellsInNoSpan", $numberOfCellsInNoSpan ? range(0, $numberOfCellsInNoSpan - 1) : array());
     $tpl->assign("indexesOfCellsInRowSpan", $numberOfCellsInRowSpan ? range($numberOfCellsInNoSpan, $numberOfCellsInNoSpan + $numberOfCellsInRowSpan - 1) : array());
     $tpl->assign("indexesOfCellsInColSpan", $numberOfCellsInColSpan ? range($numberOfCellsInNoSpan + $numberOfCellsInRowSpan, $numberOfCellsInNoSpan + $numberOfCellsInRowSpan + $numberOfCellsInColSpan - 1) : array());
     $tpl->assign("cellFieldNames", $attributeList);
     $tpl->assign("numberOfToolsCells", in_array("notools", $this->typ) ? 0 : 1);
     $tpl->assign("colHeadersExists", !in_array("nocolheaders", $this->typ));
     $this->setHeaderMethods($rights, $headerMethods);
     $colHeaders = $colHeaderAttrs = $colHeaderClasses = $filterHeaders = $cellAttrs = $cellSpans = array();
     if ($tpl->colHeadersExists && $tpl->numberOfToolsCells) {
         // ha nincs header, de vannak header methodok, azokat ide ficcantjuk be:
         if (!$tpl->title && count($headerMethods)) {
             $colHeaders[-1] = implode(" | ", $headerMethods);
         } else {
             $colHeaders[-1] = "&nbsp;";
         }
         $colHeaderAttrs[-1] = isset($headerHeight) ? "height='{$headerHeight}'" : "";
         $colHeaderClasses[-1] = "";
         if ($this->tableFilter) {
             $filterHeaders[-1] = "Filter:";
         }
     }
     foreach ($attributeList as $attr) {
         $val =& $this->typ["attributes"][$attr];
         if (!in_array("in new line", $val)) {
             $this->setColHeader($val, $attr, $colHeaders, $colHeaderAttrs, $colHeaderClasses, $filterHeaders);
         }
         $this->setCellAttrs($val, $cellAttrs, $cellSpans);
     }
     $listMethods = $cells = $customListPlacementList = $rowClasses = $cellClasses = array();
     $listMethodExists = FALSE;
     for ($i = 0; $i < count($list); $i++) {
         $listItem = $list[$i];
         // egy az objektum osztalyaban feluldefinialt fg-el lehetoseget adunk
         // arra, hogy az objektum erteketol fuggoen belemanipulaljunk a
         // typeInfo-ba:
         $listItem->preprocessRow();
         if ($tpl->numberOfToolsCells) {
             $listMethods[$i] = array();
             $s1 = $gorumroll->method != "showdetails" ? $listItem->showDetailsTool() : "";
             if ($s1) {
                 $listMethods[$i][] = $s1;
             }
             if ($s2 = $listItem->showModTool($rights)) {
                 $listMethods[$i][] = $s2;
             }
             if ($s3 = $listItem->showDelTool($rights)) {
                 $listMethods[$i][] = $s3;
             }
             if ($s1 || $s2 || $s3) {
                 $listMethodExists = TRUE;
             }
         }
         $cells[$i] = array();
         $customListPlacementList[$i] = array();
         foreach ($attributeList as $attr) {
             $listItem->preprocessCell($this->typ["attributes"][$attr], $attr);
             $cells[$i][] = $listItem->showListVal($attr);
             $cellClasses[$i][] = isset($this->typ["attributes"][$attr]["customCss"]) ? $this->typ["attributes"][$attr]["customCss"] : "";
         }
         foreach ($customListPlacementAttrList as $attr) {
             $listItem->preprocessCell($this->typ["attributes"][$attr], $attr);
             $customListPlacementList[$i][$attr] = $listItem->showListVal($attr);
         }
     }
     // ha nincs listMethodos sor, nem kell a legelso ures oszlopot megmutatni:
     if ($tpl->numberOfToolsCells && !$listMethodExists) {
         $tpl->assign("numberOfToolsCells", 0);
         $listMethods = array();
         array_shift($colHeaders);
         array_shift($colHeaderAttrs);
         array_shift($colHeaderClasses);
     }
     $tpl->assign("emptyList", $isEmptyList);
     if ($isEmptyList) {
         $cells[] = array($lll["emptylist"]);
         $cellClasses[] = array("");
         $cellAttrs = array("align='center'");
         $cellSpans = array("colspan");
     }
     $tpl->assign("headerMethods", $headerMethods);
     $tpl->assign("colHeaders", $colHeaders);
     $tpl->assign("colHeaderAttrs", $colHeaderAttrs);
     $tpl->assign("colHeaderClasses", $colHeaderClasses);
     $tpl->assign("filterHeaders", $filterHeaders);
     $tpl->assign("listMethods", $listMethods);
     $tpl->assign("cells", $cells);
     $tpl->assign("cellAttrs", $cellAttrs);
     $tpl->assign("cellClasses", $cellClasses);
     $tpl->assign("cellSpans", $cellSpans);
     $tpl->assign("rowClasses", $rowClasses);
     $tpl->assign("customListPlacementList", $customListPlacementList);
     $tpl->assign("customListPlacementAttrList", $customListPlacementAttrList);
 }
Пример #8
0
 function addDeleteMediaStuff()
 {
     global $lll;
     foreach ($this->getFields() as $field) {
         if ($field->type != customfield_media || empty($this->{$field->columnIndex})) {
             continue;
         }
         $ctrl =& new AppController($this->get_class() . "/delete_media/{$this->id}_{$field->columnIndex}");
         $deleteLink = $ctrl->generAnchor($lll["deleteMedia"]);
         $lll["{$field->columnIndex}_afterfield"] = "<p id='deleteAfterSuccess_{$field->columnIndex}'>{$deleteLink}</p>";
         JavaScript::addOnload("\n            \$('.cell[name=\"{$field->columnIndex}\"] a').click(function (){\n                \$.get(this.href, function(){\n                    \$('#deleteAfterSuccess_{$field->columnIndex}').remove();\n                });\n                return false;\n            });    \n        ");
     }
 }
Пример #9
0
 function showSelector($what)
 {
     global $lll;
     $_S =& new AppSettings();
     if (!$_S->{"allowSelect{$what}"}) {
         return "";
     }
     $labels = array($lll["change{$what}"]);
     $values = array("0");
     $allowedItems = explode(",", $_S->{"allowed{$what}s"});
     foreach ($allowedItems as $item) {
         $values[$item] = $item;
         if (isset($lll["allowed{$what}s_{$item}"])) {
             $labels[$item] = $lll["allowed{$what}s_{$item}"];
         } else {
             $labels[$item] = str_replace("_", " ", $item);
         }
     }
     JavaScript::addInclude(GORUM_JS_DIR . "/cookie.js");
     $base = Controller::getBaseUrl();
     JavaScript::addOnload("\$.noah.themeSelectorWidget(" . G::js($what, $base) . ")");
     return GenerWidget::generSelectField("{$what}SelectorWidget", $labels, $values, "{$what}SelectorWidget", "0");
 }
Пример #10
0
 function generDateTextField($name, $value, &$attrInfo, $size = "", $maxlength = "")
 {
     global $now;
     if ($value->isEmpty() && in_array("defaultnow", $attrInfo)) {
         $display = $now->getDbFormat();
     } else {
         $display = $value->getDbFormat();
     }
     $jsCalendar = in_array("jscalendar", $attrInfo);
     $s = GenerWidget::generTextField('text', $name, $display, $size, $maxlength);
     if ($jsCalendar) {
         JavaScript::addInclude(GORUM_JS_DIR . "/jscalendar/calendar.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jscalendar/lang/calendar-en.js");
         JavaScript::addInclude(GORUM_JS_DIR . "/jscalendar/calendar-setup.js");
         JavaScript::addCss(GORUM_JS_DIR . "/jscalendar/skins/aqua/theme.css");
         //$s.="<button type='reset' id='trigger'>...</button>";
         $s .= "<img src='" . GORUM_JS_DIR . "/jscalendar/img.gif' id='{$name}_trigger'\n             style='cursor: pointer; border: 1px solid red;'\n             title='Date selector'\n             onmouseover=\"this.style.background='red';\"\n             onmouseout=\"this.style.background=''\" >";
         $calendarDisplay = $display ? "'{$display}'" : "null";
         if (!isset($attrInfo["fromyear"])) {
             $fromyear = $now->getYear();
         } elseif ($attrInfo["fromyear"] == "now") {
             $fromyear = $now->getYear();
         } elseif (preg_match("{now-(\\d+)}", $attrInfo["fromyear"], $matches)) {
             $fromyear = $now->getYear() - intval($matches[1]);
         } else {
             $fromyear = $attrInfo["fromyear"];
         }
         if (!isset($attrInfo["toyear"])) {
             $toyear = $now->getYear();
         } elseif ($attrInfo["toyear"] == "now") {
             $toyear = $now->getYear();
         } elseif (preg_match("{now\\+(\\d+)}", $attrInfo["toyear"], $matches)) {
             $toyear = $now->getYear() + intval($matches[1]);
         } else {
             $toyear = $attrInfo["toyear"];
         }
         $format = preg_replace("/\\b\\w\\b/", "%\$0", $attrInfo["display_format"]);
         // minden betu ele beteszunk egy % jelet
         $format = str_replace("%i", "%M", $format);
         $showsTime = in_array("showstime", $attrInfo) ? "true" : "false";
         JavaScript::addOnload("\n          Calendar.setup(\n            {\n              inputField  : '{$name}',         // ID of the input field\n              ifFormat    : '{$format}',    // the date format\n              button      : '{$name}_trigger',       // ID of the button\n              date        : {$calendarDisplay},                 // initial date\n              range       : [{$fromyear}, {$toyear}],   // range of years\n              showsTime       : {$showsTime}\n            }\n          );\n        ");
     }
     return $s;
 }
Пример #11
0
 function organizeFormAlternative()
 {
     global $gorumroll, $contentSeparator, $lll, $tA;
     $_S =& new AppSettings();
     $contentSeparator = "";
     $tA["appcategory-organize_form"] = $tA["appcategory-organize_form-alternative"];
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.alphanumeric.js");
     JavaScript::addOnload("\$('#appcategory-showhtmllist input:text').numeric();");
     JavaScript::addCss(CSS_DIR . "/checkconf.css");
     $lll["appcategory_ttitle"] = $lll["alwaysUseAlternativeOrganizer"];
     $lll["appcategory_ttitle"] .= GenerWidget::generBoolField("alternativeOrganizer", "", $_S->alternativeOrganizer);
     $ctrl =& new AppController("cat/list/alternative");
     $gorumroll->processMethod($ctrl, "categoryList");
 }
Пример #12
0
 function handleCategorySelect($tableId)
 {
     global $gorumroll, $jQueryLib;
     JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
     JavaScript::addInclude(JS_DIR . "/categoryselect.js");
     if ($this->cascadingCategorySelectEnabled() && !$gorumroll->rollid && $gorumroll->list != "customlist") {
         $ctrl =& new AppController("cat/get_one_level_of_categories");
         // Ajax target
         $url = $ctrl->makeUrl();
         JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.livequery.js");
         JavaScript::addScript("\$JQ.noah.addNextSelectRow(" . G::js($url, "subCategory", $tableId) . ");");
         JavaScript::addOnload("\$.noah.cascadingSelectOnLoad('{$tableId}');");
     } elseif (!$this->cascadingCategorySelectEnabled() || $gorumroll->list == "customlist") {
         JavaScript::addOnload("\$.noah.simpleCategoryReload();");
     }
 }
Пример #13
0
 function generSelectFilterField($name, &$labels, $width)
 {
     if (!$width) {
         $width = 0;
         foreach ($labels as $label) {
             $width = max($width, strlen($label));
         }
     }
     $s = "Filter:<br>";
     $s .= GenerWidget::generTextField("text", "{$name}_selectfilter", "", $width);
     $s .= "<br>";
     JavaScript::addOnload("\n    function filterSelectField(e)\n    {\n        e=e||window.event;\n        var k=e.charCode||e.keyCode||e.which;\t\t\t\t\t\t                        \n        if(e.ctrlKey || e.altKey) return true;  // ignore\n        else if ((k>=41 && k<=122) ||k==32 || k>186 || k==8)  //typeable characters\n        {\n            var name = this.name.slice(0, -13);  // levagjuk '_selectfilter'-t\n            var filter=this.value.toLowerCase();\n            // betesszuk egy tombbe az osszes option-t\n            if( eval('typeof('+name+'OptionsRepository)!=\"object\"') )\n            {\n                eval(name+'OptionsRepository = new Array;');\n                \$JQ('#' + name).find('option').each(function(){\n                    eval(name+'OptionsRepository').push([\$JQ(this).val(), \$JQ(this).html()]);\n                });\n            }\n            \$JQ('#' + name).find('option').remove();  // kiuritjuk a szelekt mezot teljesen\n            var x=0;\n            \$JQ.each(eval(name+'OptionsRepository'), function(i, val)\n            {\n                // es csak azokat tesszuk vissza, amiben a filter megtalalhato:\n                if( val[1].toLowerCase().indexOf(filter)>-1 )\n                {\n                    \$JQ('#' + name).get(0).options[x++]=new Option(val[1], val[0]);\n                }\n            });\n        }\n    }\n    \$JQ('input[id\$=_selectfilter]').keyup(filterSelectField);\n    ", "filterSelectField");
     return $s;
 }
Пример #14
0
 function addSidebarDependentCss($listToPageAssignment)
 {
     if (!count($listToPageAssignment[customlist_left]) && !count($listToPageAssignment[customlist_right])) {
         View::assign("mainClass", 'main_withoutSidebar');
         View::assign("outerMainClass", 'outerMain_withoutSidebar');
     } elseif (count($listToPageAssignment[customlist_left])) {
         View::assign("mainClass", 'main_twoSidebars');
         View::assign("outerMainClass", 'outerMain_twoSidebars');
     } elseif (count($listToPageAssignment[customlist_right])) {
         View::assign("mainClass", 'main_rightSidebar');
         View::assign("outerMainClass", 'outerMain_rightSidebar');
     }
     if (!count($listToPageAssignment[customlist_left])) {
         JavaScript::addOnload("\n            \$('#sidebarLeft').hide();\n        ");
     }
     if (!count($listToPageAssignment[customlist_right])) {
         JavaScript::addOnload("\n            \$('#sidebarRight').hide();\n        ");
     }
 }