示例#1
0
 function __construct($text, $value = '', $selected = false)
 {
     parent::__construct('option');
     $this->_text = $this->add(new jqmText($text), true);
     $this->_value = $this->attribute('value', $value, true);
     $this->_selected = $this->attribute('selected', $selected ? 'selected' : '', true);
 }
示例#2
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param bool $fullscreen
  * @param bool $nobackbtn
  */
 function __construct($id, $attributes = array(), $items = array(), $theme = '', $fullscreen = false, $nobackbtn = false)
 {
     parent::__construct('div', $id, $attributes, '', $theme);
     if (is_array($items)) {
         for ($i = 0; $i < count($items); $i++) {
             if (is_object($items[$i]) && get_class($items[$i]) == 'jqmHeader') {
                 $this->_header = $this->add($items[$i], true);
             }
             if (is_object($items[$i]) && get_class($items[$i]) == 'jqmContent') {
                 $this->_content = $this->add($items[$i], true);
             }
             if (is_object($items[$i]) && get_class($items[$i]) == 'jqmFooter') {
                 $this->_footer = $this->add($items[$i], true);
             }
         }
     }
     if (!$this->_header) {
         $this->_header = $this->add(new jqmHeader(), true);
     }
     if (!$this->_content) {
         $this->_content = $this->add(new jqmContent(), true);
     }
     if (!$this->_footer) {
         $this->_footer = $this->add(new jqmFooter(), true);
     }
     $this->_role = $this->attribute('data-role', 'page', true);
     $this->_fullscreen = $this->attribute('data-fullscreen', $fullscreen ? 'true' : '', true);
     $this->_nobackbtn = $this->attribute('data-add-back-btn', $nobackbtn ? 'true' : '', true);
 }
示例#3
0
 /**
  *
  * @param string $href
  */
 function __construct($href = '')
 {
     parent::__construct('link');
     $this->attribute('type', 'text/css');
     $this->attribute('rel', 'stylesheet');
     $this->_href = $this->attribute('href', $href, true);
 }
示例#4
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '')
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'navbar', true);
     $this->items()->prefix('<ul><li>');
     $this->items()->separator('</li><li>');
     $this->items()->suffix('</li></ul>');
 }
示例#5
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param string $title
  * @param bool $collapsed
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $title = '', $collapsed = true)
 {
     parent::__construct('div', $id, $attributes, '', $theme);
     $this->_role = $this->attribute('data-role', 'collapsible', true);
     $this->_collapsed = $this->attribute('data-collapsed', $collapsed ? 'true' : 'false', true);
     $this->_title = $this->add(new jqmTitle($title), true);
     $this->items()->addFromArray($items);
 }
示例#6
0
 /**
  * @access private
  * @return string
  */
 function __toString()
 {
     $string = '';
     if ($this->title() != '' || $this->items()->size() > 1) {
         $string = parent::__toString();
     }
     return $string;
 }
示例#7
0
 /**
  *
  * @param string $id
  * @param string $href
  * @param string $text
  * @param string $icon
  * @param string $theme
  * @param bool $active
  * @param bool $inline
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $href = '', $text = '', $icon = '', $active = false, $inline = false)
 {
     parent::__construct('a', $id, $attributes, $items, $theme);
     $this->_href = $this->attribute('href', $href, true);
     $this->_icon = $this->attribute('data-icon', $icon, true);
     $this->_role = $this->attribute('data-role', 'button', true);
     $this->active($active);
     $this->_inline = $this->attribute('data-inline', $inline ? 'true' : '', true);
     $this->_text = $this->add(new jqmText($text), true);
 }
示例#8
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param bool $inset
  * @param bool $filter
  * @param bool $ordered
  * @param string $splitIcon
  * @param string $splitTheme
  * @param string $dividerTheme
  * @param string $countTheme
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $inset = false, $filter = false, $ordered = false, $splitIcon = '', $splitTheme = '', $dividerTheme = '', $countTheme = '')
 {
     parent::__construct($ordered ? 'ol' : 'ul', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'listview', true);
     $this->_inset = $this->attribute('data-inset', $inset ? 'true' : '', true);
     $this->_filter = $this->attribute('data-filter', $filter ? 'true' : '', true);
     $this->_splitIcon = $this->attribute('data-split-icon', $splitIcon, true);
     $this->_splitTheme = $this->attribute('data-split-theme', $splitTheme, true);
     $this->_dividerTheme = $this->attribute('data-divider-theme', $dividerTheme, true);
     $this->_countTheme = $this->attribute('data-count-theme', $countTheme, true);
 }
示例#9
0
 /**
  *
  * @param string $xmlns
  * @param string $charset
  * @param string $title
  * @param string $css
  * @param string $jq
  * @param string $jqm
  */
 function __construct($xmlns = JQMPHP_XMLNS, $charset = JQMPHP_CHARSET, $title = JQMPHP_TITLE, $css = JQMPHP_CSS, $jq = JQMPHP_JQ, $jqm = JQMPHP_JQM)
 {
     parent::__construct('head');
     $this->_xmlns = $this->attribute('xmlns', $xmlns, true);
     $this->_charset = new jqmAttribute('charset', $charset);
     $this->add(new jqmTag('meta', '', array($this->_charset)));
     $this->_css = $this->add(new jqmLink($css), true);
     $this->_jq = $this->add(new jqmScript($jq), true);
     $this->_jqm = $this->add(new jqmScript($jqm), true);
     $this->_title = new jqmText($title);
     $this->add(new jqmTag('title', '', '', array($this->_title)));
 }
示例#10
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param array $pages
  */
 function __construct($id = '', $attributes = array(), $items = array(), $pages = array())
 {
     parent::__construct('body', $id, $attributes, $items);
     $this->_pages = $this->add(new jqmCollection($pages), true);
 }
示例#11
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param string $action
  * @param string $method
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $action = '', $method = 'POST')
 {
     parent::__construct('form', $id, $attributes, $items, $theme);
     $this->_action = $this->attribute('action', $action, true);
     $this->_method = $this->attribute('method', $method, true);
 }
示例#12
0
 /**
  * @access private
  * @return string
  */
 function closeTag()
 {
     $string = '';
     if ($this->_count != '') {
         $string .= '<span class="ui-li-count">' . $this->_count . '</span>';
     }
     $string .= parent::closeTag();
     return $string;
 }
示例#13
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '')
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'fieldcontain', true);
 }
示例#14
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '')
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->attribute('data-inline', 'true');
 }
示例#15
0
 /**
  * @access private
  * @return string
  */
 function closeTag()
 {
     $string = '';
     $string .= parent::closeTag();
     if ($this->_fieldContain) {
         $string .= '</div>';
     }
     return $string;
 }
示例#16
0
 /**
  * @access private
  * @return string
  */
 function closeTag()
 {
     $string = '';
     $string .= parent::closeTag();
     if ($this->_fieldContain) {
         $string .= '</div>';
     }
     if ($this->_label->text() != '' && ($this->type() == 'radio' || $this->type() == 'checkbox')) {
         $string .= $this->_label;
     }
     return $string;
 }
示例#17
0
 /**
  *
  * @param string $id
  * @param string $type
  * @param array $a
  * @param array $b
  * @param array $c
  * @param array $d
  * @param array $e
  */
 function __construct($id = '', $type = 'a', $a = array(), $b = array(), $c = array(), $d = array(), $e = array())
 {
     if (is_string($a) && $a != '') {
         $a = array($a);
     }
     if (is_string($b) && $b != '') {
         $b = array($b);
     }
     if (is_string($c) && $c != '') {
         $c = array($c);
     }
     if (is_string($d) && $d != '') {
         $d = array($d);
     }
     if (is_string($e) && $e != '') {
         $e = array($e);
     }
     if (!is_array($a)) {
         $a = array();
     }
     if (!is_array($b)) {
         $b = array();
     }
     if (!is_array($c)) {
         $c = array();
     }
     if (!is_array($d)) {
         $d = array();
     }
     if (!is_array($e)) {
         $e = array();
     }
     parent::__construct('div', $id);
     $this->grid($type);
     $this->_a = $this->add(new jqmCollection($a), true);
     $this->_b = $this->add(new jqmCollection($b), true);
     $this->_c = $this->add(new jqmCollection($c), true);
     $this->_d = $this->add(new jqmCollection($d), true);
     $this->_e = $this->add(new jqmCollection($e), true);
     $this->_a->prefix('<div class="ui-block-a">')->suffix('</div>');
     $this->_b->prefix('<div class="ui-block-b">')->suffix('</div>');
     $this->_c->prefix('<div class="ui-block-c">')->suffix('</div>');
     $this->_d->prefix('<div class="ui-block-d">')->suffix('</div>');
     $this->_e->prefix('<div class="ui-block-e">')->suffix('</div>');
 }
示例#18
0
 /**
  *
  * @param string $src
  */
 function __construct($src = '')
 {
     parent::__construct('script');
     $this->attribute('type', 'text/javascript');
     $this->_src = $this->attribute('src', $src, true);
 }
示例#19
0
 /**
  *
  * @param string $id
  * @param string $text
  * @param string $forField 
  */
 function __construct($id = '', $text = '', $forField = '')
 {
     parent::__construct('label', $id);
     $this->_text = $this->add(new jqmText($text), true);
     $this->_forField = $this->attribute('for', $forField, true);
 }
示例#20
0
 /**
  *
  * @param string $id
  * @param array $attributes
  * @param array $items
  * @param string $theme
  * @param string $dataType
  */
 function __construct($id = '', $attributes = array(), $items = array(), $theme = '', $dataType = 'vertical')
 {
     parent::__construct('div', $id, $attributes, $items, $theme);
     $this->_role = $this->attribute('data-role', 'controlgroup', true);
     $this->_dataType = $this->attribute('data-type', $dataType, true);
 }
示例#21
0
 /**
  * @access private
  * @return string
  */
 function __toString()
 {
     $string = '<!DOCTYPE ' . $this->doctype() . '>';
     $string .= parent::__toString();
     return $string;
 }