Пример #1
0
 public function toXul()
 {
     if ($this->cfg->mode == 'view') {
         return $this->getValue();
     }
     return utils::htmlTag($this->xulTagName, array_merge($this->xul, array('id' => $this->id, 'value' => $this->getRawValue())));
 }
Пример #2
0
    public function toHtml()
    {
        if ($this->cfg->mode == 'view') {
            return $this->getValue();
        }
        $options = $this->tinyMce;
        if (is_array($this->cfg->tinyBrowser) && $this->cfg->getInArray('tinyBrowser', 'active')) {
            $tinyBrowser = $this->cfg->tinyBrowser;
            $options['file_browser_callback'] = 'function(field_name, url, type, win) {
				tinyMCE.activeEditor.windowManager.open({
					file : "' . $tinyBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type=" + type' . ($tinyBrowser['subdir'] ? '+"&subdir=' . $tinyBrowser['subdir'] . '"' : '') . ',
					title : "' . $tinyBrowser['title'] . '",
					width : ' . $tinyBrowser['width'] . ',
					height : ' . $tinyBrowser['height'] . ',
					resizable : "yes",
					scrollbars : "yes",
					inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
					close_previous : "no"
				}, {
					window : win,
					input : field_name
				});
				return false;
			}';
        } else {
            if (is_array($this->cfg->nyroBrowser) && $this->cfg->getInArray('nyroBrowser', 'active')) {
                $nyroBrowser = $this->cfg->nyroBrowser;
                $options['file_browser_callback'] = 'function(field_name, url, type, win) {
				tinyMCE.activeEditor.windowManager.open({
					file : "' . $nyroBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type="+type+"&config=' . $nyroBrowser['config'] . '&",
					title : "' . $nyroBrowser['title'] . '",
					width : ' . $nyroBrowser['width'] . ',
					height : ' . $nyroBrowser['height'] . ',
					resizable : "yes",
					scrollbars : "yes",
					inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
					close_previous : "no"
				}, {
					window : win,
					input : field_name
				});
				return false;
			}';
            }
        }
        if (array_key_exists('content_css', $options) && $options['content_css']) {
            $contentCss = $options['content_css'];
            $options['setup'] = 'function(ed) {ed.onInit.add(function(ed) {setTimeout(function() {ed.dom.add(ed.dom.select("head"), "link", {rel : "stylesheet", href : "' . $contentCss . '"});}, 5);});}';
        }
        unset($options['content_css']);
        $resp = response::getInstance()->getProxy();
        $resp->addJs('jquery.tinymce');
        $resp->blockjQuery('$("#' . $this->id . '").tinymce(' . utils::jsEncode($options) . ');');
        return utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name, 'id' => $this->id)), utils::htmlOut($this->getValue()));
    }
Пример #3
0
 /**
  * Get the view for the uploaded element
  *
  * @return string
  */
 public function getView()
 {
     $ret = null;
     if ($current = $this->getCurrent()) {
         if (!($ret = $this->callHelper('view', $current, null))) {
             $ret = utils::htmlTag('a', array_merge($this->cfg->previewPrm, array('href' => request::uploadedUri($current))), $this->cfg->previewText ? $this->cfg->previewText : basename($current));
         }
     }
     return $ret;
 }
Пример #4
0
 public function toXul()
 {
     return utils::htmlTag($this->xulTagName, array_merge($this->xul, array('id' => $this->id, 'min' => $this->min, 'min' => $this->max, 'increment' => $this->step, 'value' => $this->getRawValue())));
 }
Пример #5
0
 public function toHtml()
 {
     return str_replace('[name]', $this->name, sprintf($this->cfg->template, utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name . '[0]', 'id' => $this->makeId($this->name . '[0]'), 'value' => $this->getValue('min', 'input')))), utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name . '[1]', 'id' => $this->makeId($this->name . '[1]'), 'value' => $this->getValue('max', 'input'))))));
 }
Пример #6
0
	/**
	 * Get the HTML Meta
	 *
	 * @param string $ln New line character
	 * @return strings
	 */
	protected function getHtmlMeta($ln = "\n") {
		$ret = null;

		if (array_key_exists('Content-Type', $this->headers))
			$ret.= '<meta http-equiv="Content-Type" content="'.$this->headers['Content-Type'].'" />'.$ln;

		if ($this->cfg->titleInDes)
			$this->cfg->setInArray('meta', 'description',
					$this->cfg->getInarray('meta', 'title').
					$this->cfg->titleInDes.
					$this->cfg->getInarray('meta', 'description'));
		foreach($this->cfg->meta as $k=>$v) {
			if ($k != 'title' || $this->cfg->useTitleInMeta)
				$ret.= '<meta name="'.$k.'" content="'.utils::htmlOut($v).'" />'.$ln;
		}
		foreach($this->cfg->metaProperty as $k=>$v)
			$ret.= '<meta property="'.$k.'" content="'.utils::htmlOut($v).'" />'.$ln;
		foreach($this->cfg->link as $k=>$v)
			$ret.= utils::htmlTag('link', array_merge(array('rel'=>$k), utils::htmlOut($v))).$ln;
		return $ret;
	}
Пример #7
0
 public function toXul()
 {
     return utils::htmlTag($this->xulTagName, array_merge($this->xul, array('id' => $this->id, 'value' => $this->getRawValue())));
 }
Пример #8
0
 public function toXul()
 {
     return utils::htmlTag($this->xulTagName, array_merge($this->xul, array('id' => $this->id, 'value' => $this->date->format('date', 'short2'))));
 }
Пример #9
0
 public function toXul()
 {
     return utils::htmlTag($this->xulTagName, array_merge($this->xul, array('id' => $this->id)));
 }
Пример #10
0
 /**
  * Make an image with the configuration parameter
  *
  * @return string|null The HTML string or null if the image doesn't exists
  */
 protected function html(array $options = array())
 {
     if (file::exists($this->cfg->fileSave)) {
         $w = $this->cfg->wAct ? $this->cfg->wAct : null;
         $h = $this->cfg->hAct ? $this->cfg->hAct : null;
         if ($this->cfg->forceHtmlSize && (!$w || !$h)) {
             $size = getimagesize($this->cfg->fileSave);
             if (!$w) {
                 $w = $size[0];
             }
             if (!$h) {
                 $h = $size[1];
             }
         }
         return utils::htmlTag('img', array_merge($options, $this->cfg->htmlDefOptions, array('src' => $this->cfg->fileSave, 'alt' => $this->cfg->alt, 'width' => $w, 'height' => $h)));
     }
     return null;
 }