示例#1
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    mixed $data
  * @return   void
  */
 function setData(WidgetResultSet $data)
 {
     $h = Header::get();
     $h->setTitleSeparator(Language::encodePair($data->get('separator')));
     $h->setTitleStart(Language::encodePair($data->get('start')));
     $h->setTitleEnd(Language::encodePair($data->get('end')));
     if ($data->get('add')) {
         $h->addTitleItem(Language::encodePair($data->get('add')));
     }
     parent::setData($data);
 }
示例#2
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    string $text
  * @return   void
  */
 function setText($text)
 {
     if (!isset($text) || !is_scalar($text)) {
         return;
     }
     $this->text = $text;
     $controller = Controller::getInstance();
     $controller->getNavigator()->setTitle(0, Language::encodePair($this->text));
 }
示例#3
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("legend" => Language::encodePair($this->getLegend()), "fieldset_content" => $this->items->generateAllHTML()));
     parent::assignVars();
 }
示例#4
0
 function generateAllHTML()
 {
     if (isset($this->str)) {
         if (($p = Controller::getInstance()->getWidget($this->parent_id)) instanceof iStringProcessable) {
             return StringProcessorFactory::create($p->getStringProcess())->process(Language::encodePair($this->str));
         } else {
             return Language::encodePair($this->str);
         }
     }
     return parent::generateAllHTML();
 }
示例#5
0
文件: WRadio.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     parent::assignVars();
     $this->tpl->setParamsArray(array("checked" => $this->getChecked() ? "checked=\"1\"" : "", "label" => !empty($this->text) ? "<label for=\"" . $this->getHTMLId() . "\">&nbsp;" . Language::encodePair($this->getText()) . "</label>" : ""));
 }
示例#6
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array('code' => $this->getUseLang() ? Language::encodePair($this->getCode()) : $this->getCode(), "condition" => $this->getCond()));
     parent::assignVars();
 }
示例#7
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     //move to messageInterchange
     if (!isset($this->text)) {
         $this->setText($this->getValue());
     }
     if (empty($this->value) && !is_numeric($this->value)) {
         $this->setValue('checkbox');
     }
     $this->tpl->setParamsArray(array("text" => Language::encodePair($this->getText()), "checked" => $this->getChecked() ? 'checked="1"' : ''));
     parent::assignVars();
 }
示例#8
0
文件: WForm.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("action" => $this->getAction(), "enctype" => $this->getEnctype(), "method" => $this->getMethod(), "form_content" => $this->items->generateAllHTML(), "vc_rules" => !empty($this->vc_rules) ? implode(", ", $this->vc_rules) : null, "vc_messages" => !empty($this->vc_messages) ? Language::encodePair(implode(", ", $this->vc_messages)) : null, "signature" => $this->getMethod() != "post" ? null : $this->form_signature, "signature_name" => $this->getMethod() != "post" ? null : self::signature_name, "widget_id" => $this->getId()));
     parent::assignVars();
 }
示例#9
0
文件: WSpinner.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("step" => $this->getStep(), "min" => $this->getMin(), "max" => $this->getMax(), "text" => Language::encodePair($this->getText())));
     parent::assignVars();
 }
示例#10
0
文件: WText.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     if ($this->is_h) {
         $this->tpl->setParamsArray(array("heading" => $this->heading));
     }
     $this->tpl->setParamsArray(array('value' => StringProcessorFactory::create($this->getStringProcess())->process(Language::encodePair($this->text)), 'repeat_count' => $this->getRepeatCount()));
     parent::assignVars();
 }
示例#11
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     if (isset($this->text)) {
         $this->tpl->setParamsArray(array("text" => StringProcessorFactory::create($this->getStringProcess())->process(Language::encodePair($this->getText()))));
     } else {
         $this->tpl->setParamsArray(array("text" => Language::encodePair($this->items->generateAllHTML())));
     }
     parent::assignVars();
 }
示例#12
0
    /**
     * method description
     *
     * more detailed method description
     * @param    string $tooltip
     * @return   void
     */
    function assignVars()
    {
        if (!$this->getState()) {
            return;
        }
        //TODO rework this part
        if (!empty($this->html_id)) {
            $final_html_id = $this->getHTMLId();
        }
        if ($this->inside_roll || $this->do_increment) {
            //$final_html_id = ltrim($this->id,"_")."_".$this->add_html_id;
            //$this->setHTMLId($final_html_id);
            $this->setHTMLId($final_html_id = $this->html_id . "_" . $this->add_html_id);
        }
        /*else 
        		{
        			$final_html_id = ltrim($this->id,"_");
        			$this->setHTMLId($final_html_id);
        		}*/
        if (isset($this->tooltip)) {
            $html_id = $this->getHTMLId();
            $js = <<<EOD
\$(document).ready(function(){
\t\$('#{$html_id}').tooltip({track: true,delay: 0,showURL: false,showBody:false,opacity: 0.85 });
});
EOD;
            $this->javascript->addBeforeWidget($js);
            $this->setTitle($this->getTooltip());
        }
        if (isset($this->tpl)) {
            $this->tpl->setParamsArray(array("title" => isset($this->title) ? " title=\"" . Language::encodePair($this->getTitle()) . "\" " : "", "id" => $this->getHTMLId()));
            if (!empty($this->style_class)) {
                $this->tpl->setParamsArray(array("class" => " class=\"" . $this->getStyleClass() . "\" "));
            }
            if (isset($this->style) && !$this->style->isEmpty()) {
                $this->tpl->setParamsArray(array("style" => " style=\"" . $this->style->generateStyle() . "\" "));
            }
            if (!empty($this->javascript)) {
                $this->tpl->setParamsArray(array("javascript" => Language::encodePair(" " . $this->javascript->generateJS()), "javascript_before" => Language::encodePair($this->javascript->getBeforeWidget()), "javascript_after" => Language::encodePair($this->javascript->getAfterWidget())));
            }
        }
    }
示例#13
0
文件: WTabs.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $hrefs = array();
     $titles = array();
     $selected = -1;
     for ($i = 0, $c = $this->tabs->count(); $i < $c; $i++) {
         if ($this->tabs->getItem($i)->getHref()) {
             $hrefs[$i] = $this->tabs->getItem($i)->getHref();
         } else {
             $hrefs[$i] = "#" . $this->tabs->getItem($i)->getHTMLId();
         }
         $titles[$i] = Language::encodePair($this->tabs->getItem($i)->getTabTitle());
         if ($this->tabs->getItem($i)->getSelected()) {
             $selected = $i;
         }
     }
     $this->tpl->setParams(t(new TemplateParams())->set("href", $hrefs)->set("title", $titles)->set("tabs", $this->tabs->generateAllHTML())->set('selected', $selected));
     parent::assignVars();
 }
示例#14
0
 public function addNotify($text)
 {
     if (!is_object($this->notifyStorage)) {
         $this->notifyStorage = Storage::createWithSession('ControllerNotify');
     }
     $notes = $this->notifyStorage['notify'];
     $notes[] = Language::encodePair($text);
     $this->notifyStorage['notify'] = $notes;
 }
示例#15
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("text" => Language::encodePair($this->getText()), "value" => Language::encodePair($this->getValue()), "selected" => $this->getSelected() ? "selected=\"1\"" : ""));
     parent::assignVars();
 }
示例#16
0
文件: WImage.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("alt" => Language::encodePair($this->getAlt()), "width" => $this->getWidth() ? ' width="' . $this->getWidth() . '"' : '', "height" => $this->getHeight() ? ' height="' . $this->getHeight() . '"' : '', "src" => $this->getSrc(), 'preview' => $this->getWithPreview()));
     parent::assignVars();
 }
示例#17
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   string
  */
 function getMessages()
 {
     if (empty($this->rules) || empty($this->widget_ids)) {
         return "";
     }
     $t1 = $t2 = "";
     $ta1 = $ta2 = array();
     foreach ($this->getWidgetFullNames() as $w) {
         $t1 = "'" . $w . "': {\n";
         foreach ($this->rules as $i => $r) {
             if ($this->messages[$i] !== null) {
                 $ta2[] = $r . ": \"" . Language::encodePair($this->messages[$i]) . "\"";
             }
         }
         $t1 .= implode(",\n", $ta2) . "\n}";
         if (empty($ta2)) {
             continue;
         }
         unset($ta2);
         $ta1[] = $t1;
     }
     $this->widget_ids = array();
     $this->widget_fnames = array();
     return implode(",\n", $ta1);
 }
示例#18
0
文件: WControl.php 项目: point/cassea
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array("name" => isset($this->additional_id) ? $this->getName() . '[' . $this->additional_id . ']' . ($this->name_w_braces ? "[]" : "") : $this->getName() . ($this->name_w_braces ? "[]" : ""), "value" => Language::encodePair($this->getValue()), "readonly" => $this->getReadonly() ? 'readonly="' . $this->getReadonly() . '"' : '', "disabled" => $this->getDisabled() ? 'disabled="' . $this->getDisabled() . '"' : '', "tabindex" => $this->getTabIndex() ? 'tabindex="' . $this->getTabIndex() . '"' : ''));
     if ($this instanceof iStringProcessable) {
         $this->tpl->setParams(t(new TemplateParams())->set('value', StringProcessorFactory::create($this->getStringProcess())->process(Language::encodePair($this->getValue()))));
     } else {
         $this->tpl->setParams(t(new TemplateParams())->set('value', Language::encodePair($this->getValue())));
     }
     if (isset($this->filter_error_string)) {
         $this->tpl->setParamsArray(array("error_string" => "<span class=\"w-error\">" . Language::encodePair($this->getFilterError()) . "</span>"));
     }
     parent::assignVars();
 }
示例#19
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    void
  * @return   void
  */
 function assignVars()
 {
     $this->tpl->setParamsArray(array('href' => $this->getHREF(), 'name' => !empty($this->name) ? " name=\"" . $this->getName() . "\" " : '', "rev" => !empty($this->rev) ? ' rev="' . $this->rev . '" ' : '', "rel" => !empty($this->rel) ? ' rel="' . $this->rel . '" ' : '', "target" => !empty($this->target) ? ' target="' . $this->target . '" ' : '', "text" => Language::encodePair($this->items->generateAllHTML())));
     parent::assignVars();
 }