本文整理汇总了PHP中ui::loadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP ui::loadFile方法的具体用法?PHP ui::loadFile怎么用?PHP ui::loadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui
的用法示例。
在下文中一共展示了ui::loadFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defAction
public function defAction()
{
if (file_exists(MODUL_DIR . '/core/template/change.tpl')) {
include MODUL_DIR . '/core/template/change.tpl';
}
// Выводим (если нужно) форму изменения свойств домена (AJAX)
$this->changeDomainInfo($TEMPLATE);
ui::newButton(lang::get('BTN_SAVE_ONLY'), "javascript:saveConfig();");
page::assignArray(lang::get('CONFIG_FORM_FIELD'));
ui::CheckBox('gzip', 1, reg::getKey('/core/gzip'), lang::get('CONFIG_FORM_FIELD', 9));
ui::CheckBox('delToTrash', 1, reg::getKey('/core/delToTrash'), lang::get('CONFIG_FORM_FIELD', 12));
ui::CheckBox('noIE6', 1, reg::getKey('/core/noIE6'), lang::get('CONFIG_FORM_FIELD', 34));
ui::CheckBox('noIE7', 1, reg::getKey('/core/noIE7'), lang::get('CONFIG_FORM_FIELD', 35));
ui::CheckBox('noIE8', 1, reg::getKey('/core/noIE8'), lang::get('CONFIG_FORM_FIELD', 37));
ui::CheckBox('noDelMiniTexts', 1, reg::getKey('/core/noDelMiniTexts'), lang::get('CONFIG_FORM_FIELD', 36));
ui::loadFile('watermark', reg::getKey('/core/watermark'));
ui::CheckBox('scaleBigJpeg', 1, reg::getKey('/core/scaleBigJpeg'), lang::get('CONFIG_FORM_FIELD', 33));
page::assign('sizeBigJpeg', reg::getKey('/core/sizeBigJpeg'));
// Форма редактирования языков
$form = new uiMultiForm('langs');
$form->insideForm();
$form->setData(languages::getAll());
$form->addColumn('l_name', lang::get('CONFIG_FORM_FIELD', 13), 255);
$form->addColumn('l_prefix', lang::get('CONFIG_FORM_FIELD', 14), 120, lang::get('CONFIG_FORM_FIELD', 15));
page::assign('langs', $form->getHTML());
// Форма редактирования доменов
$form = new uiMultiForm('domains');
$form->insideForm();
$form->setData(domains::getAll());
$form->addColumn('d_name', lang::get('CONFIG_FORM_FIELD', 18), 150, lang::get('CONFIG_FORM_FIELD', 23));
$form->addColumn('d_def_lang', lang::get('CONFIG_FORM_FIELD', 19), 140, lang::get('CONFIG_FORM_FIELD', 24), 0, 'getLangList');
$form->addColumn('d_online', lang::get('CONFIG_FORM_FIELD', 20), 40, lang::get('CONFIG_FORM_FIELD', 25), 0, 'getCheckBox');
$form->addColumn('d_sitename', lang::get('CONFIG_FORM_FIELD', 4), 250, lang::get('CONFIG_FORM_FIELD', 16));
$form->addColumn('d_email', lang::get('CONFIG_FORM_FIELD', 5), 250, lang::get('CONFIG_FORM_FIELD', 17));
$form->addColumn('d_id', ' ', 25, '', 0, 'getEditButt');
function getLangList($val, $obj)
{
return ui::SelectBox('objdomains[' . $obj['id'] . '][d_def_lang]', languages::getAll(), $val, 130);
}
function getCheckBox($val, $obj)
{
return '<div align="center">' . ui::CheckBox('objdomains[' . $obj['id'] . '][d_online]', 1, $val) . '</div>';
}
function getEditButt($val, $obj)
{
if (empty($val)) {
return '';
} else {
return '<div name="' . $val . '" class="header_tree" style="float:left;margin-left:15px;">
<font class="compose_image"></font></div>';
}
}
page::assign('domains', $form->getHTML());
return page::parse($TEMPLATE['frame']);
}
示例2: parseField
private function parseField($obj, $field, $TEMPLATE, $current_id)
{
$is_upd = $obj->id == '' ? false : true;
$is_editable = !isset($field['editable']) || $field['editable'];
$width = empty($field['width']) ? $this->width : $field['width'];
page::assign('width', $width);
if (isset($_SESSION['SAVING_POST']['obj' . $this->form_name]) && ($field['f_type'] < 70 || $field['f_type'] > 85)) {
$tmp = $_SESSION['SAVING_POST']['obj' . $this->form_name];
if (isset($tmp[$current_id][$field['f_sname']])) {
$value = $tmp[$current_id][$field['f_sname']];
}
} else {
$value = '';
}
if (empty($value)) {
if ($field['f_type'] == 105) {
$value = $obj->__get('_' . $field['f_sname']);
} else {
$value = $obj->__get($field['f_sname']);
}
$function = !empty($field['funct_name']) ? $field['funct_name'] : '';
if (!$is_editable) {
$value = parent::processValue($obj, $field['f_sname'], $field['f_type'], $value, $function);
}
}
if ($is_editable) {
page::assign('field.id', $field['f_id']);
page::assign('field.name', $field['f_name']);
page::assign('field.sname', $field['f_sname']);
page::assign('field.value', $value);
$obj_id = $field['f_sname'] . '_' . $current_id;
$elem_name = 'obj' . $this->form_name . '[' . $current_id . '][' . $field['f_sname'] . ']';
// Специальная обработка данных
if ($field['f_type'] == 50) {
page::assign('element', ui::CheckBox($elem_name, 1, $value, '', '', $obj_id));
} else {
if ($field['f_type'] == 32) {
if (empty($value) || $value == '0000-00-00 00:00:00') {
page::assign('field.date', '');
page::assign('field.time', '00:00');
} else {
page::assign('field.date', date('d.m.Y', strtotime($value)));
page::assign('field.time', date('H:i', strtotime($value)));
}
} else {
if ($field['f_type'] == 25) {
$time = empty($value) || $value == '0000-00-00' ? '' : date('d.m.Y', strtotime($value));
page::assign('field.date', $time);
} else {
if ($field['f_type'] == 30) {
$time = empty($value) ? '' : date('H:i:s', strtotime($value));
page::assign('field.time', $time);
} else {
if ($field['f_type'] > 69 && $field['f_type'] < 86) {
// файлы
if (system::$isAdmin) {
page::assign('element', ui::loadFile($elem_name, $value, 'load_file_mini', $obj_id));
} else {
page::fParse('element', '');
}
} else {
if ($field['f_type'] == 90 || $field['f_type'] == 95) {
// Выпадающий список или Список со множественным выбором
// Получаем список объектов справочника
$data = ormObjects::getObjectsByClass($field['f_list_id']);
$multi = $field['f_type'] == 95 ? 'selectbox_multi' : 'selectbox_template';
$empty = !$field['f_required'] ? ' ' : '';
if ($field['f_quick_add']) {
$width = $width - 22;
}
$min = $field['f_type'] == 95 ? 8 : 30;
page::assign('width_plu', $width - $min);
page::assign('element', ui::SelectBox($elem_name, $data, $value, $width, $empty, '', $multi, $obj_id));
if ($field['f_quick_add']) {
page::fParse('plus', $TEMPLATE['field_' . $field['f_type'] . '_plus']);
} else {
page::assign('plus', '');
}
} else {
if ($field['f_type'] == 100) {
// Связь с объектом
page::assign('element', ui::objectLinks($obj, $field['f_id'], '_' . $current_id, $elem_name, $width - 30, 'objectLinks2'));
}
}
}
}
}
}
}
// Генерируем яву (создаем правила проверки для элементов формы)
if ($field['f_required'] && ($field['f_type'] == 35 && $this->action == 'add' || $field['f_type'] != 35)) {
$msg = str_replace('%title%', $field['f_name'], lang::get('CONSTR_BASE_FIELD_E2'));
$zpt = !empty($this->requred_field) ? ', ' : '';
$empty = $field['f_type'] == 90 || $field['f_type'] == 95 ? 'null' : '""';
if ($field['f_type'] == 100) {
$this->requred_field .= $zpt . '["' . $obj_id . '", "' . $current_id . '", "' . $msg . '", ' . $empty . ', 1]';
} else {
$this->requred_field .= $zpt . '["' . $obj_id . '", "' . $current_id . '", "' . $msg . '", ' . $empty . ']';
}
}
//.........这里部分代码省略.........
示例3: parseField
private function parseField($field, $TEMPLATE)
{
if (in_array($field['f_sname'], $this->read_only)) {
$value = $this->obj->__get($field['f_sname']);
page::assign('value', $value);
if ($field['f_type'] == 90 || $field['f_type'] == 95 || $field['f_type'] == 105) {
page::assign('val', $this->obj->__get('_' . $field['f_sname']));
} else {
page::assign('val', $value);
}
$value = page::parse($TEMPLATE['read_only']);
page::assign('content', $value);
return page::parse($TEMPLATE['field_standart']);
}
// Определяем значение поля
if (isset($_SESSION['SAVING_POST']) && ($field['f_type'] < 70 || $field['f_type'] > 85) && isset($_SESSION['SAVING_POST'][$field['f_sname']])) {
$value = $_SESSION['SAVING_POST'][$field['f_sname']];
} else {
if ($field['f_type'] == 105) {
$value = $this->obj->__get('_' . $field['f_sname']);
} else {
$value = $this->obj->__get($field['f_sname']);
}
}
page::assign('field.value', $value);
// Для страниц, для кнопки "Показать \ скрыть доп. поля"
if ($this->obj instanceof ormPage && in_array($field['f_sname'], $this->page_fields)) {
$sh_page = isset($_SESSION['SH_FIELDS']) && $_SESSION['SH_FIELDS'] == 'show' ? '' : ' style="display:none;"';
page::assign('sh_page', $sh_page);
} else {
page::assign('sh_page', '');
}
// Специальная обработка данных
if ($field['f_type'] == 50) {
page::assign('element', ui::CheckBox($field['f_sname'], 1, $value));
} else {
if ($field['f_type'] == 32) {
if (empty($value) || $value == '0000-00-00 00:00:00') {
page::assign('field.date', '');
page::assign('field.time', '00:00');
} else {
page::assign('field.date', date('d.m.Y', strtotime($value)));
page::assign('field.time', date('H:i', strtotime($value)));
}
} else {
if ($field['f_type'] == 25) {
$time = empty($value) || $value == '0000-00-00' ? '' : date('d.m.Y', strtotime($value));
page::assign('field.date', $time);
} else {
if ($field['f_type'] == 30) {
$time = empty($value) ? '' : date('H:i:s', strtotime($value));
page::assign('field.time', $time);
} else {
if ($field['f_type'] == 70 || $field['f_type'] == 75 || $field['f_type'] == 80 || $field['f_type'] == 85) {
if (system::$isAdmin) {
page::assign('element', ui::loadFile($field['f_sname'], $value));
} else {
page::fParse('element', $TEMPLATE['upload_file_field']);
}
} else {
if ($field['f_type'] == 73) {
page::assign('element', ui::listFile($field['f_sname'], $value));
} else {
if ($field['f_type'] == 90 || $field['f_type'] == 95) {
// Выпадающий список или Список со множественным выбором
// Получаем список объектов справочника
page::assign('field.sname', $field['f_sname']);
$data = ormObjects::getObjectsByClass($field['f_list_id']);
$multi = $field['f_type'] == 95 ? 'selectbox_multi' : 'selectbox_template';
$empty = !$field['f_required'] ? ' ' : '';
if (system::$isAdmin) {
page::assign('element', ui::SelectBox($field['f_sname'], $data, $value, 400, $empty, '', $multi));
if ($field['f_quick_add']) {
page::fParse('plus', $TEMPLATE['field_' . $field['f_type'] . '_plus']);
} else {
page::assign('plus', '');
}
} else {
page::assign('element', ui::SelectBox($field['f_sname'], $data, $value, 200, $empty, '', $multi));
}
} else {
if ($field['f_type'] == 97) {
// Подчиненный справочник
// Получаем список объектов справочника
$sel = new ormSelect($field['f_list_id']);
$sel->where('parents', '=', $this->obj->id);
// Выводим мультиформу для добавления и редактирования
$form = new ormMultiForm('subject_list_' . $field['f_id']);
$form->setData($sel);
$form->insideForm();
$re = $form->getHTML();
// echo $re;
page::assign('element', $re);
} else {
if ($field['f_type'] == 100) {
// Связь с объектом
page::assign('element', ui::objectLinks($this->obj, $field['f_id']));
}
}
}
//.........这里部分代码省略.........