コード例 #1
0
ファイル: RadioElement.php プロジェクト: torbenkoehn/php-xtpl
 public function render($nice = false, $level = 0)
 {
     if ($this->display) {
         return parent::render();
     }
     return $this->renderChildren($nice, $level);
 }
コード例 #2
0
 public function render()
 {
     $addons = array();
     if (!empty($this->prepend)) {
         $addons[] = "input-prepend";
     }
     if (!empty($this->append)) {
         $addons[] = "input-append";
     }
     if (!empty($addons)) {
         echo '<div class="', implode(" ", $addons), '">';
     }
     $suffix = mt_rand(1, 500);
     $this->renderSortable('start', $suffix);
     for ($i = 0; $i <= $_SERVER['RM_COUNTER']; $i++) {
         $this->renderSortable("prepend", $suffix);
         $this->renderAddOn("prepend", $suffix);
         parent::render();
         if (!empty($this->others)) {
             $this->renderOthers($this->others, $i);
         }
         $this->renderAddOn("append", $suffix);
         $this->renderSortable("append", $suffix);
     }
     $this->renderSortable('close', $suffix);
     $this->renderSortable('add_action', $suffix);
     $this->renderSortable('extra_option', $suffix);
     if (!empty($addons)) {
         echo '</div>';
     }
 }
コード例 #3
0
 public function render()
 {
     $addons = array();
     if (!empty($this->prepend)) {
         $addons[] = "input-prepend";
     }
     if (!empty($this->append)) {
         $addons[] = "input-append";
     }
     if (!empty($addons)) {
         echo '<div class="', implode(" ", $addons), '">';
     }
     if (substr($this->_attributes["name"], -2) != "[]") {
         $this->_attributes["name"] .= "[]";
     }
     $this->renderRepeatable('start');
     for ($i = 0; $i <= $_SERVER['RM_COUNTER']; $i++) {
         $this->renderRepeatable("prepend");
         $this->renderAddOn("prepend");
         parent::render();
         $this->renderAddOn("append");
         $this->renderRepeatable("append");
     }
     $this->renderRepeatable('close');
     if (!empty($addons)) {
         echo '</div>';
     }
 }
コード例 #4
0
ファイル: TitleElement.php プロジェクト: torbenkoehn/php-xtpl
 public function render($nice = false, $level = 0)
 {
     if ($this->getParent()->hasAttribute('DATA-TOGGLE') && $this->getParent()->getAttribute('DATA-TOGGLE') == 'tab') {
         return $this->renderChildren($nice, $level);
     }
     return parent::render($nice, $level);
 }
コード例 #5
0
ファイル: items.php プロジェクト: Divian/flot
function s_element_replace(array $matches)
{
    if (isset($matches[1])) {
        $dD = new DataStore();
        $o_Element = new Element($dD->get_element_data($matches[1]));
        $o_Element->_set_full_element($dD->o_get_full_element($matches[1]));
        return $o_Element->render();
    }
}
コード例 #6
0
ファイル: VarElement.php プロジェクト: torbenkoehn/php-xtpl
 public function render($nice = false, $level = 0)
 {
     if ($this->hasAttribute('NAME')) {
         //render only the children, since this is the var-command, not the HTML tag
         return $this->renderChildren($nice, $level);
     }
     //else we just render the normal var-tag
     return parent::render($nice, $level);
 }
コード例 #7
0
 public function render()
 {
     $multiple = get_option('rm_option_allow_multiple_file_uploads');
     if ($multiple == "yes") {
         $this->_attributes['multiple'] = "multiple";
         $this->_attributes['name'] = $this->_attributes['name'] . '[]';
     }
     if ($this->isRequired()) {
         $this->validation[] = new Validation_File("", true);
     } else {
         $this->validation[] = new Validation_File();
     }
     parent::render();
 }
コード例 #8
0
 public function render()
 {
     $addons = array();
     if (!empty($this->prepend)) {
         $addons[] = "input-prepend";
     }
     if (!empty($this->append)) {
         $addons[] = "input-append";
     }
     if (!empty($addons)) {
         echo '<div class="', implode(" ", $addons), '">';
     }
     $this->renderAddOn("prepend");
     parent::render();
     $this->renderAddOn("append");
     if (!empty($addons)) {
         echo '</div>';
     }
 }
コード例 #9
0
 public function element($elementName, array $data = array())
 {
     class_exists('Element') or (require dirname(__FILE__) . '/Element.php');
     $subView = new Element($elementName, array_merge($this->data, $data));
     return $subView->render();
 }
コード例 #10
0
ファイル: Form.php プロジェクト: Niloofareyjey/ellie-ui
 public function render()
 {
     return parent::render();
 }
コード例 #11
0
    public function videoReplace($text)
    {
        // get normal videos
        if (preg_match_all('@\\[{2}
			video=([^|]+)
			\\|?(\\d+)?
			\\|?([^\\]]+)?
			\\]{2}@ix', $text, $found, PREG_SET_ORDER)) {
            foreach ($found as $arr) {
                $videoUrl = WEBROOT . STATIC_DIR . 'swf/VideoPlayer.swf?url=' . $arr[1] . '&name=' . urlencode(@$arr[3]);
                $videoTag = $this->HTML->tag('embed', null, array('src' => $videoUrl, 'allowFullScreen' => 'true', 'type' => 'application/x-shockwave-flash', 'width' => 440, 'height' => coalesce(@$arr[2], 440)));
                $text = str_replace($arr[0], $videoTag, $text);
            }
        }
        // get dailymotion / youtube videos
        if (preg_match_all('@\\[{2}
			(?:http:\\/{1,}(?:www\\.)?)?
			(?P<type>youtube|dailymotion|vimeo|traileraddict)=?
				 (
					(\\.com\\/(video\\/|watch\\?v=)|:)?
					(?P<id>[a-z0-9_-]+)
				)
				([^\\]]+)?
			\\]{2}@ix', $text, $found, PREG_SET_ORDER)) {
            foreach ($found as $arr) {
                class_exists('Element') or Library::load('ephFrame.lib.view.Element');
                $videoElement = new Element('video/' . $arr['type'], array('id' => $arr['id']));
                $text = str_replace($arr[0], $videoElement->render(), $text);
            }
        }
        return $text;
    }