本文整理汇总了PHP中HC_Html_Factory类的典型用法代码示例。如果您正苦于以下问题:PHP HC_Html_Factory类的具体用法?PHP HC_Html_Factory怎么用?PHP HC_Html_Factory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HC_Html_Factory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render
function render()
{
$slim = $this->slim();
$out = HC_Html_Factory::element('div');
$out->add_attr('class', 'row');
if ($slim) {
$out->add_attr('class', 'row-slim');
}
$attr = $this->attr();
foreach ($attr as $k => $v) {
$out->add_attr($k, $v);
}
$scale = $this->scale();
$items = $this->items();
foreach ($items as $item) {
list($item, $width, $more_attr) = $item;
$slot = HC_Html_Factory::element('div')->add_attr('class', 'col-' . $scale . '-' . $width);
if ($more_attr) {
foreach ($more_attr as $k => $v) {
$slot->add_attr($k, $v);
}
}
$slot->add_child($item);
$out->add_child($slot);
}
return $out->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:27,代码来源:grid.php
示例2: render
function render()
{
$error = $this->error();
$label = $this->label();
$content = $this->content();
$div = HC_Html_Factory::element('div')->add_attr('class', 'form-group');
if ($error) {
$div->add_attr('class', 'has-error');
}
$attr = $this->attr();
foreach ($attr as $k => $v) {
$div->add_attr($k, $v);
}
if ($label) {
$label_c = HC_Html_Factory::element('label')->add_attr('class', 'control-label')->add_child($label);
$div->add_child($label_c);
}
$content_holder = HC_Html_Factory::element('div')->add_attr('class', 'control-holder');
if ($this->content_static()) {
$content_holder->add_attr('class', 'form-control-static');
}
foreach ($content as $cont) {
$content_holder->add_child($cont);
}
$div->add_child($content_holder);
return $div->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:27,代码来源:label_row.php
示例3: render
function render()
{
/* tabs */
$id = $this->id();
if (!$id) {
$id = 'nts' . hc_random();
}
$tabs = HC_Html_Factory::widget('list')->add_attr('class', array('nav'))->add_attr('class', array('nav-tabs'))->add_attr('class', array('hc-tab-links'))->add_attr('id', $id);
$my_tabs = $this->tabs();
reset($my_tabs);
foreach ($my_tabs as $key => $tab_array) {
list($tab_label, $tab_content) = $tab_array;
$tabs->add_item($key, HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#' . $key)->add_attr('class', 'tab-toggler')->add_attr('data-toggle-tab', $key)->add_child($tab_label));
}
$active = $this->active();
$tabs->add_item_attr($active, 'class', 'active');
/* content */
$content = HC_Html_Factory::element('div')->add_attr('class', 'hc-tab-content')->add_attr('style', 'overflow: visible;');
reset($my_tabs);
foreach ($my_tabs as $key => $tab_array) {
list($tab_label, $tab_content) = $tab_array;
$tab = HC_Html_Factory::element('div')->add_attr('class', 'hc-tab-pane')->add_attr('id', $key)->add_attr('data-tab-id', $key);
if ($active == $key) {
$tab->add_attr('class', 'active');
}
$tab->add_child($tab_content);
$content->add_child($tab);
}
/* javascript */
/* out */
$out = HC_Html_Factory::widget('list')->add_attr('class', array('list-unstyled'))->add_attr('class', array('hc-tabs'));
$out->add_item($tabs);
$out->add_item($content);
return $out->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:35,代码来源:tabs.php
示例4: title
function title($model, $vlevel = HC_PRESENTER::VIEW_HTML)
{
$return = array();
switch ($vlevel) {
case HC_PRESENTER::VIEW_HTML:
case HC_PRESENTER::VIEW_HTML_ICON:
$icon = HC_Html::icon(HC_App::icon_for('conflict'));
$icon->add_attr('class', 'text-danger');
$span = HC_Html_Factory::element('span')->add_attr('title', $model->present_title(HC_PRESENTER::VIEW_TEXT))->add_child($icon)->add_child($model->present_title(HC_PRESENTER::VIEW_TEXT));
$return[] = $span;
break;
case HC_PRESENTER::VIEW_TEXT:
$return[] = HCM::__('Conflict');
$return[] = ': ';
$return[] = $model->type;
$return[] = ': ';
$return[] = $model->details;
break;
case HC_PRESENTER::VIEW_RAW:
$return[] = $model->type;
$return[] = ': ';
$return[] = $model->details;
break;
}
$return = join('', $return);
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:27,代码来源:conflict.php
示例5: title
function title($model, $vlevel = HC_PRESENTER::VIEW_HTML)
{
$return = array();
$label = $this->label($model, $vlevel);
if (strlen($label)) {
$return[] = $label;
}
switch ($vlevel) {
case HC_PRESENTER::VIEW_TEXT:
$return[] = ': ';
break;
}
switch ($vlevel) {
case HC_PRESENTER::VIEW_HTML_ICON:
break;
default:
if ($model->exists()) {
$return[] = $model->name;
} else {
$return[] = HCM::__('Unknown');
}
break;
}
$return = join('', $return);
switch ($vlevel) {
case HC_PRESENTER::VIEW_HTML:
$color = $model->present_color();
$color = HC_Lib::adjust_color_brightness($color, -30);
$return = HC_Html_Factory::element('span')->add_attr('class', 'label')->add_attr('class', 'label-success')->add_attr('class', 'label-lg')->add_child($return)->add_attr('style', 'background-color: ' . $color . ';');
break;
}
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:33,代码来源:location.php
示例6: render
function render()
{
$folded = array();
$items = $this->items();
foreach ($items as $item) {
list($item, $folding_key) = $item;
if (!isset($folded[$folding_key])) {
$folded[$folding_key] = array();
}
$folded[$folding_key][] = $item;
}
$out = HC_Html_Factory::element('ul')->add_attr('class', 'list-unstyled')->add_attr('class', 'collapse-panel');
$attr = $this->attr();
foreach ($attr as $k => $v) {
$out->add_attr($k, $v);
}
reset($folded);
foreach ($folded as $fk => $items) {
$collapser = HC_Html_Factory::element('a')->add_attr('href', '#')->add_attr('class', 'hc-collapse-next')->add_attr('class', 'display-block')->add_child('HAHA');
$out->add_child(HC_Html_Factory::element('li')->add_child($collapser));
$subout = HC_Html_Factory::widget('list');
foreach ($items as $item) {
$subout->add_item($item);
}
$out->add_child(HC_Html_Factory::element('li')->add_attr('class', 'collapse')->add_child($subout));
}
return $out->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:28,代码来源:list_folded.php
示例7: render
function render()
{
$out = array();
/* build trigger */
$title = $this->title();
if (($active = $this->active()) && $this->item($active)) {
$title = $this->item($active);
$this->remove_item($active);
}
if (is_object($title) && $title->tag() == 'a') {
$trigger = $title;
} else {
$full_title = $title;
$title = strip_tags($title);
$title = trim($title);
$trigger = HC_Html_Factory::element('a')->add_attr('title', $title)->add_child($full_title);
}
$trigger->add_attr('href', '#')->add_attr('class', 'dropdown-toggle')->add_attr('data-toggle', 'dropdown');
if (!$this->no_caret()) {
$trigger->add_child(' ')->add_child(HC_Html_Factory::element('b')->add_attr('class', 'caret'));
}
$out[] = $trigger->render();
$this->add_attr('class', 'dropdown-menu');
$out[] = parent::render();
$return = '';
foreach ($out as $o) {
$return .= $o;
}
if ($this->wrap()) {
$wrap = HC_Html_Factory::element('div')->add_attr('class', 'dropdown')->add_child($return);
$return = $wrap->render();
}
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:34,代码来源:dropdown.php
示例8: render
function render()
{
$wrap = HC_Html_Factory::widget('list')->add_attr('class', array('list-inline', 'list-separated'));
$wrap->add_item($this->fields['start']);
$wrap->add_item(' - ');
$wrap->add_item($this->fields['end']);
return $this->decorate($wrap->render());
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:8,代码来源:timeframe.php
示例9: render
function render()
{
$wrap = HC_Html_Factory::element('div')->add_attr('class', 'hc-ajax-parent');
$container = HC_Html_Factory::element('div')->add_attr('class', 'hc-ajax-container');
$list = parent::render();
$wrap->add_child($list);
$wrap->add_child($container);
return $wrap->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:9,代码来源:list_ajax.php
示例10: get_dates
public function get_dates()
{
$date_input = HC_Html_Factory::input('recurring_date');
$date_value = $date_input->unserialize($this->details, 'no-dates');
$date_value['datestart'] = $this->date_start;
$date_value['dateend'] = $this->date_end;
$date_input->set_value($date_value);
$return = $date_input->dates();
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:10,代码来源:availability.php
示例11: set_input
function set_input($name, $type, $convert = array())
{
$input = HC_Html_Factory::input($type, $name);
$this->inputs[$name] = $input;
if ($convert) {
foreach ($convert as $kmodel => $kform) {
$this->convert[$kmodel] = $name . '.' . $kform;
}
}
return $this;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:11,代码来源:form2.php
示例12: render
function render()
{
$closer = $this->closer();
if (!$closer) {
$closer = HC_Html_Factory::element('a')->add_child('Back')->add_attr('class', array('btn btn-warning-o'));
$closer = HC_Html_Factory::element('a')->add_child(HC_Html::icon('times')->add_attr('class', array('text-muted')))->add_attr('title', HCM::__('Back'))->add_attr('class', array('close'));
}
$closer->add_attr('class', array('hc-flatmodal-closer'))->add_attr('href', '#')->add_attr('style', 'display: none;')->add_attr('style', 'margin-bottom: 1em;');
$out = HC_Html_Factory::element('div')->add_attr('class', 'hc-flatmodal-parent')->add_child($closer)->add_child(HC_Html_Factory::element('div')->add_attr('class', array('hc-flatmodal-container', 'hc-ajax-container')))->add_child($this->content());
$return = $out->render();
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:12,代码来源:flatmodal.php
示例13: render
function render()
{
$name = $this->name();
$value = $this->value();
$id = 'nts-' . $name;
$t = HC_Lib::time();
$t->setNow();
$t->setStartDay();
if ($value) {
$t->modify('+' . $value . ' seconds');
// $value = $t->formatTime();
}
$out = HC_Html_Factory::widget('container');
/* hidden field to store our value */
$hidden = HC_Html_Factory::input('hidden')->set_name($name)->set_value($value)->set_id($id);
$out->add_item($hidden);
/* text field to display */
$display_name = $name . '_display';
$display_id = 'nts-' . $display_name;
$text = HC_Html_Factory::input('text')->set_name($display_name)->set_id($display_id)->add_attr('size', 7);
if (strlen($value)) {
$display_value = $t->formatTime();
$text->set_value($display_value);
}
$out->add_item($text);
$time_format = $t->timeFormat();
$script = HC_Html_Factory::element('script');
$script->add_attr('language', 'JavaScript');
$js_code = <<<EOT
jQuery("#{$display_id}").timepicker(
{
\t'appendTo' : '#nts',
\t'timeFormat' :'{$time_format}',
\t'step' : 5,
}
);
jQuery("#{$display_id}").on('change', function(){
\tvar dbTime = jQuery(this).timepicker('getSecondsFromMidnight');
\tjQuery('#{$id}').val( dbTime );
});
EOT;
$script->add_child($js_code);
$out->add_item($script);
$return = $this->decorate($out->render());
return $return;
}
开发者ID:kumarkvk,项目名称:vz_emp_shiftsSchedule,代码行数:49,代码来源:timepicker.php
示例14: details
function details($model, $vlevel = HC_PRESENTER::VIEW_HTML)
{
$conflicting_one = HC_App::model('availability');
$conflicting_one->where('id', $model->details)->get();
switch ($vlevel) {
case HC_PRESENTER::VIEW_HTML:
$return = HC_Html_Factory::widget('availability_view')->set_new_window(TRUE)->set_wide(TRUE);
$return->set_model($conflicting_one);
break;
case HC_PRESENTER::VIEW_TEXT:
case HC_PRESENTER::VIEW_RAW:
$return = $conflicting_one->present_details($vlevel);
break;
}
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:16,代码来源:conflict_availability_unavailable.php
示例15: render
function render()
{
$out = HC_Html_Factory::element('div')->add_attr('class', 'alert')->add_attr('class', 'display-block');
$attr = $this->attr();
foreach ($attr as $k => $v) {
$out->add_attr($k, $v);
}
$items = $this->items();
if (count($items) > 1) {
$list = HC_Html_Factory::widget('list')->add_attr('class', 'list-unstyled');
$list->set_items($items);
$out->add_child($list);
} else {
$out->add_child($items);
}
return $out->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:17,代码来源:alert.php
示例16: render
function render()
{
list($csrf_name, $csrf_value) = HC_App::csrf();
$out = HC_Html_Factory::element('form')->add_attr('method', $this->method())->add_attr('accept-charset', 'utf-8')->add_attr('id', $this->id());
$attr = $this->attr();
foreach ($attr as $k => $v) {
$out->add_attr($k, $v);
}
/* add csrf */
if ($this->method() != 'get') {
if (strlen($csrf_name) && strlen($csrf_value)) {
$hidden = HC_Html_Factory::input('hidden', $csrf_name)->set_value($csrf_value);
$out->add_child(HC_Html_Factory::element('div')->add_attr('style', 'display:none')->add_child($hidden));
}
}
$out->add_child(parent::render());
return $out->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:18,代码来源:form.php
示例17: render
function render()
{
$left = HC_Html_Factory::element('li')->add_attr('class', 'squeeze-in')->add_attr('class', 'pull-left')->add_attr('style', 'width: 50%;')->add_child($this->left());
$right = HC_Html_Factory::element('li')->add_attr('class', 'squeeze-in')->add_attr('class', 'pull-right')->add_attr('style', 'width: 50%;')->add_child($this->right());
if ($this->align_right) {
$right->add_attr('class', 'text-right');
}
$clearfix = HC_Html_Factory::element('div')->add_attr('class', 'clearfix')->add_child('');
$out = HC_Html_Factory::element('ul')->add_attr('class', 'list-inline')->add_child($left)->add_child($right);
$total = array();
$total[] = $out;
$total[] = $clearfix;
$return = '';
foreach ($total as $t) {
$return .= $t->render();
}
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:18,代码来源:leftright.php
示例18: render
function render()
{
$out = array();
/* build trigger */
$title = $this->title();
if (is_object($title) && $title->tag() == 'a') {
$trigger = $title;
} else {
$full_title = $title;
$title = strip_tags($title);
$title = trim($title);
$trigger = HC_Html_Factory::element('a')->add_attr('title', $title)->add_child($full_title);
}
$trigger->add_attr('class', 'hc-ajax-loader');
$wrap = HC_Html_Factory::element('div')->add_attr('class', 'hc-ajax-parent');
$container = HC_Html_Factory::element('div')->add_attr('class', 'hc-ajax-container');
$wrap->add_child($trigger);
$wrap->add_child($container);
return $wrap->render();
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:20,代码来源:ajax_loader.php
示例19: render
function render()
{
$out = array();
$items = $this->items();
$per_row = $this->per_row();
$number_of_rows = ceil(count($items) / $per_row);
$row_class = 'row';
switch ($per_row) {
case 1:
$tile_class = array('col-sm-12');
break;
case 2:
$tile_class = array('col-sm-6');
break;
case 3:
$tile_class = array('col-sm-4');
break;
case 4:
$tile_class = array('col-sm-3');
break;
case 6:
$tile_class = array('col-sm-6');
break;
}
for ($ri = 0; $ri < $number_of_rows; $ri++) {
$row = HC_Html_Factory::element('div')->add_attr('class', $row_class, 1);
for ($ii = $ri * $per_row; $ii < ($ri + 1) * $per_row; $ii++) {
if (isset($items[$ii])) {
$tile = HC_Html_Factory::element('div')->add_attr('class', $tile_class, 1);
$row->add_child($tile->add_child($items[$ii]));
}
}
$out[] = $row;
}
$return = '';
foreach ($out as $o) {
$return .= $o->render();
}
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:40,代码来源:tiles.php
示例20: render
function render()
{
$name = $this->name();
$value = $this->value();
$id = 'nts-' . $name;
$t = HC_Lib::time();
$value ? $t->setDateDb($value) : $t->setNow();
$value = $t->formatDate_Db();
$out = HC_Html_Factory::widget('container');
/* hidden field to store our value */
$hidden = HC_Html_Factory::input('hidden')->set_name($name)->set_value($value)->set_id($id);
$out->add_item($hidden);
/* text field to display */
$display_name = $name . '_display';
$display_id = 'nts-' . $display_name;
$datepicker_format = $t->formatToDatepicker();
$display_value = $t->formatDate();
$text = HC_Html_Factory::input('text')->set_name($display_name)->set_value($display_value)->set_id($display_id)->add_attr('data-date-format', $datepicker_format)->add_attr('data-date-week-start', $t->weekStartsOn)->add_attr('style', 'width: 8em')->add_attr('class', 'hc-datepicker');
$out->add_item($text);
$return = $this->decorate($out->render());
return $return;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:22,代码来源:date.php
注:本文中的HC_Html_Factory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论