Пример #1
0
 function processContent(&$tpl)
 {
     global $lll, $upperTemplate;
     global $gorumroll, $jsInclude, $jsOnLoad, $scriptName;
     global $maxInputLength, $maxFieldLength, $noFileUpload, $onSubmit;
     $formAttrs = "";
     if (!isset($noFileUpload)) {
         $formAttrs = " enctype='multipart/form-data'";
     }
     if ($onSubmit) {
         $formAttrs .= " onsubmit='{$onSubmit}'";
     }
     $tpl->assign("formAttrs", $formAttrs);
     $tpl->assign("scriptName", $scriptName);
     $tpl->assign("listAndMethod", "{$gorumroll->list}-{$gorumroll->method}");
     $class = $gorumroll->getClass();
     $method = $gorumroll->method;
     // A kovetkezo method beallitasa:
     $ctrl =& new AppController(array("method" => str_replace("_form", "", $method)));
     $hiddens = $ctrl->generHiddenFields();
     foreach ($this->typ["attributes"] as $attr => $val) {
         if (in_array("{$gorumroll->method}: form hidden", $val)) {
             $hiddens .= GenerWidget::generHiddenField($attr, $this->base->{$attr});
         } elseif (in_array("form hidden", $val)) {
             $hiddens .= GenerWidget::generHiddenField($attr, $this->base->{$attr});
         }
     }
     $tpl->assign("hiddens", $hiddens);
     $lllGlobProp =& new LllGlobalProperties($this->base);
     $title = sprintf($lll["beforeDelete"], $lllGlobProp->getLabel());
     if ($sd = $lllGlobProp->getLabel("seriousDeleteQuestion", FALSE)) {
         if ($title) {
             $title .= "<br>";
         }
         $title .= $sd;
     }
     $tpl->assign("title", $title);
     if (isset($this->typ["delete_confirm"]) && isset($this->base->{$this->typ["delete_confirm"]}) && $this->base->{$this->typ["delete_confirm"]}) {
         $tpl->assign("confirm", $this->base->showListVal($this->typ["delete_confirm"]));
     }
     $submits = array();
     $submits[] = "<input type=submit value='{$lll['ok']}' name=gsubmit class='button'>\n";
     $submits[] = "<input type=submit value='{$lll['cancel']}' name=gsubmit class='button'>\n";
     $tpl->assign("submits", $submits);
     $tpl->assign("rows", array());
     //var_dump($tpl);die();
     return ok;
 }
Пример #2
0
 function generRedirectForm(&$base)
 {
     global $gorumroll, $scriptName;
     $ctrl =& new AppController(array("method" => str_replace("_form", "", $gorumroll->method)));
     $hiddens = $ctrl->generHiddenFields();
     $typ =& $base->getTypeInfo();
     $attributeList = array_keys($typ["attributes"]);
     for ($i = 0; $i < count($attributeList); $i++) {
         $attr = $attributeList[$i];
         if (!($val =& $typ["attributes"][$attr])) {
             continue;
         }
         $visibility = $base->getVisibility($val, $attr);
         if ($visibility == Form_hidden) {
             $hiddens .= GenerWidget::generHiddenField($attr, $base->{$attr});
         }
     }
     return "\n    <form action='{$scriptName}' method='post' name='frm'>\n        {$hiddens}\n    </form>\n    <script language='JavaScript'>\n        document.frm.submit();\n    </script>";
 }
Пример #3
0
 function generHiddenFieldsCore($attr, $val, $postfix)
 {
     if (!$val) {
         return "";
     }
     return GenerWidget::generHiddenField($attr, $val, $postfix);
 }
Пример #4
0
 function showListVal($attr)
 {
     global $gorumroll;
     if ($gorumroll->rollid !== "alternative") {
         return parent::showListVal($attr);
     }
     if ($attr == "name") {
         $s = parent::showListVal($attr);
         if (isset($this->depth)) {
             return "<div style='padding-left: " . 20 * $this->depth . "px;'>{$s}</div>";
         }
         return $s;
     } elseif ($attr == "sortId") {
         return GenerWidget::generTextField("text", "sortId[{$this->id}]", $this->sortId, 6);
     } elseif ($attr == "up") {
         $s = GenerWidget::generTextField("text", "up[{$this->id}]", $this->up, 6);
         $s .= GenerWidget::generHiddenField("name[{$this->id}]", htmlspecialchars($this->name));
         $s .= GenerWidget::generHiddenField("oldUp[{$this->id}]", $this->up);
         return $s;
     } else {
         return parent::showListVal($attr);
     }
 }