Exemple #1
0
 function sortFieldForm($elementName = "")
 {
     global $jQueryLib, $gorumroll;
     JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/form.js");
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
     // to center the loading animation image
     JavaScript::addInclude(JS_DIR . "/sort_custom_fields.js");
     JavaScript::addInclude(JS_DIR . "/propagate.js");
     // Propagate into all other categories:
     $propagatePostfix = OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting");
     // Propagate into the subcategories only:
     if ($gorumroll->rollid) {
         getDbCount($count, array("SELECT COUNT(*) FROM @category WHERE up=#cid#", $gorumroll->rollid));
         if ($count) {
             $propagatePostfix .= " " . OverlayController::addPropagateOverlay($gorumroll->rollid, "_sorting", "_subcat");
         }
     }
     JavaScript::addOnload("\n        \$('#itemfield-sortfield_form .submitfooter').append(" . G::js($propagatePostfix) . ");\n    ");
     $this->showHtmlList($elementName);
 }
Exemple #2
0
 function modifyForm()
 {
     global $lll, $gorumroll, $category_typ;
     $this->id = $gorumroll->rollid;
     load($this);
     if ($this->picture) {
         $picture = CAT_PIC_DIR . "/{$this->id}.{$this->picture}";
         shrinkPicture($width, $height, 70, 70, $picture);
         $ctrl =& new AppController("cat/delete_picture/{$this->id}");
         $deleteLink = $ctrl->generAnchor($lll["deletePicture"]);
         $lll["category_picture_embedfield"] = "\n        <table id='deletePicture'>\n          <tr>\n            <td>%s</td>\n            <td rowspan='2' class='deleteAfterSuccess'>\n              <img src='{$picture}', width='{$width}' height='{$height}'>\n            </td>\n          </tr>\n          <tr class='deleteAfterSuccess'>\n            <td>{$deleteLink}</td>\n          </tr>\n        </table>";
         JavaScript::addOnload("\n            \$('#deletePicture a').click(function (){\n                \$.get(this.href, function(){\n                    \$('#deletePicture .deleteAfterSuccess').remove();\n                });\n                return false;\n            });    \n        ");
     }
     // Propagation:
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
     // to center the loading animation image
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/field.js");
     // to retrieve the form field values
     JavaScript::addInclude(JS_DIR . "/propagate.js");
     // Propagate into all other categories:
     $propagatePostfix = OverlayController::addPropagateOverlay($this->id, "_cat");
     // Propagate into the subcategories only:
     getDbCount($count, array("SELECT COUNT(*) FROM @category WHERE up=#id#", $this->id));
     if ($count) {
         $propagatePostfix .= " " . OverlayController::addPropagateOverlay($this->id, "_cat", "_subcat");
     }
     foreach (array_keys($category_typ["attributes"]) as $attr) {
         if (!in_array($attr, array("name", "notificationLinksProperties", "expirationAndModerationProperties", "seoProperties", "otherProperties")) && $this->getVisibility($category_typ["attributes"][$attr], $attr) == Form_visible) {
             if (isset($lll["category_{$attr}"])) {
                 $lll["category_{$attr}"] .= $propagatePostfix;
             } elseif (isset($lll["appcategory_{$attr}"])) {
                 $lll["appcategory_{$attr}"] .= $propagatePostfix;
             } elseif (isset($lll[$attr])) {
                 $lll[$attr] .= $propagatePostfix;
             }
         }
     }
     parent::modifyForm();
 }
Exemple #3
0
 function modifyForm()
 {
     global $itemfield_typ, $gorumroll, $lll, $jQueryLib;
     $this->id = $gorumroll->rollid;
     if (!Roll::isPreviousFormSubmitInvalid()) {
         $ret = $this->load();
     }
     // hogy ezek ne legyenek a formban, mikor egy global common field-et nezunk:
     if ($this->isCommon && !$this->cid) {
         $fieldsToLeaveOut = array("detailsProperties", "showInDetails", "formProperties", "expl", "default_text", "mandatory", "allowHtml");
         foreach ($fieldsToLeaveOut as $attr) {
             $itemfield_typ["attributes"][$attr][] = "form invisible";
         }
         // hogy a customfield.js-ben a feltetelek jol mukodjenek:
         $fieldsToMakeHidden = array("type", "subType");
         foreach ($fieldsToMakeHidden as $attr) {
             $itemfield_typ["attributes"][$attr][] = "form hidden";
         }
     }
     JavaScript::addInclude(GORUM_JS_DIR . $jQueryLib);
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/jquery.center.js");
     // to center the loading animation image
     JavaScript::addInclude(GORUM_JS_DIR . "/jquery/field.js");
     // to retrieve the form field values
     // Propagate into all other categories:
     $propagatePostfix = OverlayController::addPropagateOverlay($this->id);
     // Propagate into the subcategories only:
     if ($this->cid) {
         getDbCount($count, array("SELECT COUNT(*) FROM @category WHERE up=#cid#", $this->cid));
         if ($count) {
             $propagatePostfix .= " " . OverlayController::addPropagateOverlay($this->id, "", "_subcat");
         }
     }
     foreach (array_keys($itemfield_typ["attributes"]) as $attr) {
         if (!in_array($attr, array("name", "isCommon", "type", "userField"))) {
             if (isset($lll["itemfield_{$attr}"])) {
                 $lll["itemfield_{$attr}"] .= $propagatePostfix;
             } elseif (isset($lll["customfield_{$attr}"])) {
                 $lll["customfield_{$attr}"] .= $propagatePostfix;
             }
         }
     }
     parent::modifyForm();
 }