本文整理汇总了PHP中HC_Lib::generate_rand方法的典型用法代码示例。如果您正苦于以下问题:PHP HC_Lib::generate_rand方法的具体用法?PHP HC_Lib::generate_rand怎么用?PHP HC_Lib::generate_rand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HC_Lib
的用法示例。
在下文中一共展示了HC_Lib::generate_rand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($name = '')
{
if (!strlen($name)) {
$name = 'nts_' . HC_Lib::generate_rand();
}
$this->set_name($name);
}
示例2: array
<?php
$link = HC_Lib::link('shift_groups/bulk');
$display_form = HC_Html_Factory::widget('form')->add_attr('action', $link->url());
$display_form->add_item($form->input('action'));
$btn_bar = HC_Html_Factory::widget('list')->add_attr('class', 'list-inline')->add_attr('class', 'list-separated');
$my_id = 'hc_actions_' . HC_Lib::generate_rand();
if ($act_on_all) {
$ids_input = $form->input('ids')->set_value(join('|', $ids));
$display_form->add_item($ids_input);
$btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-toggle')->add_attr('data-target', '#' . $my_id)->add_child(HC_Html::icon('cog') . HCM::__('With All')));
} else {
$btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-all-checker')->add_attr('data-collect', 'id')->add_child(HC_Html::icon('check') . HCM::__('Select All')));
$btn_bar->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', '#')->add_attr('class', array('btn', 'btn-default'))->add_attr('class', array('btn-sm'))->add_attr('class', 'hc-toggle')->add_attr('data-target', '#' . $my_id)->add_child(HC_Html::icon('cog') . HCM::__('With Selected')));
}
/* ACTION OPTIONS */
$shift = HC_App::model('shift');
$actions = HC_Html_Factory::widget('list')->add_attr('class', 'list-unstyled')->add_attr('class', 'list-separated')->add_attr('id', $my_id)->add_attr('style', 'display: none;');
/* NEW EDIT */
$edit_actions = HC_Html_Factory::widget('list')->add_attr('class', 'list-unstyled')->add_attr('class', 'list-separated');
/* NEW EDIT - STATUS */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('Status'))->set_content($form->input('status')->set_holder(HC_Html_Factory::widget('list')->add_attr('class', array('list-unstyled'))->add_attr('class', array('list-separated')))->add_option(SHIFT_HC_MODEL::STATUS_DRAFT, $shift->set('status', SHIFT_HC_MODEL::STATUS_DRAFT)->present_status())->add_option(SHIFT_HC_MODEL::STATUS_ACTIVE, $shift->set('status', SHIFT_HC_MODEL::STATUS_ACTIVE)->present_status())->set_default(SHIFT_HC_MODEL::STATUS_DRAFT)->add_attr('disabled', 'disabled')));
/* NEW EDIT - START TIME */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('Start Time'))->set_content($form->input('start')->add_attr('disabled', 'disabled')));
/* NEW EDIT - END TIME */
$edit_actions->add_item(HC_Html_Factory::widget('collapse')->set_panel('default')->add_attr('class', 'input-holder')->set_title(HCM::__('End Time'))->set_content($form->input('end')->add_attr('disabled', 'disabled')));
/* SOME JS TO DISABLE HIDDEN INPUTS */
$fid = $display_form->id();
$addon = array();
$addon[] = '<script language="JavaScript">';
$addon[] = <<<EOT