本文整理汇总了PHP中ui::setBackButton方法的典型用法代码示例。如果您正苦于以下问题:PHP ui::setBackButton方法的具体用法?PHP ui::setBackButton怎么用?PHP ui::setBackButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui
的用法示例。
在下文中一共展示了ui::setBackButton方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defAction
public function defAction()
{
if (!system::issetUrl(2)) {
system::redirect('/reference');
}
if ($class = ormClasses::get(system::url(2))) {
if (!$class->isInheritor('handbook') || $class->getSName() == 'handbook') {
system::redirect('/reference');
}
ui::setNaviBar(lang::right('values'));
ui::setHeader($class->getName());
ui::setBackButton('/reference');
if (user::issetRight('val_upd')) {
$count = 0;
$fields = $class->loadFields();
foreach ($fields as $field) {
if ($field['f_view'] == 1) {
$count++;
}
}
} else {
$count = 4;
}
$sel = new ormSelect($class->getSName());
if ($count > 5) {
ui::newButton(lang::get('BTN_NEW_LIST'), '/reference/val_add/' . system::url(2));
$table = new uiTable($sel);
$table->showSearch(true);
$table->addColumn('name', 'Имя объекта');
$table->addColumn('id', '#', 200);
$table->defaultRight('val_upd');
$table->addRight('val_upd', 'edit', single);
$table->addRight('val_del', 'drop', multi);
return $table->getHTML();
} else {
ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
$form = new ormMultiForm('change');
$form->setData($sel);
$form->showColumnID();
$form->setRight('val_proc_upd');
$form->moreParam(system::url(2));
if (!user::issetRight('val_upd') || !user::issetRight('val_add')) {
$form->withoutAdditions();
}
if (!user::issetRight('val_del')) {
$form->withoutRemoving();
}
return $form->getHTML();
}
} else {
system::redirect('/reference');
}
}
示例2: defAction
public function defAction()
{
if (!system::issetUrl(2)) {
system::redirect('/constructor');
}
$class = ormClasses::get(system::url(2));
if (!$class->isInheritor('handbook') || $class->getSName() == 'handbook') {
system::redirect('/constructor');
}
ui::setHeader(lang::get('CONSTR_LIST') . '"' . $class->getName() . '"');
ui::setBackButton('/constructor');
$count = 0;
$fields = $class->loadFields();
while (list($key, $field) = each($fields)) {
if ($field['f_view'] == 1) {
$count++;
}
}
$sel = new ormSelect($class->getSName());
if ($count > 3) {
ui::newButton(lang::get('BTN_NEW_LIST'), '/constructor/list_add/' . system::url(2));
//$objects = ormObjects::getObjectsByClass(system::url(2));
$table = new uiTable($sel);
$table->showSearch(true);
$table->addColumn('name', 'Имя объекта');
$table->defaultRight('list_upd');
$table->addRight('list_upd', 'edit', single);
$table->addRight('list_del', 'drop', multi);
return $table->getHTML();
} else {
ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
$form = new ormMultiForm('change');
$form->setData($sel);
$form->setRight('list_proc_upd');
$form->moreParam(system::url(2));
/*
// $form->addColumn('name', '', 150, '', 0);
// $form->addColumn('nositeli', '', 120, '', 0);
$form->addColumn('e_mail', '', 200, 'правпы', 1);
$form->addColumn('spiska', '', 150, '', 1);
$form->addColumn('url', '', 150, '', 1);
function email($val, $obj){
return '<a href="mailto:'.$val.'">'.$val.'</a>';
}
*/
//$form->withoutAdditions();
//$form->withoutRemoving();
return $form->getHTML();
}
示例3: defAction
public function defAction()
{
if ($parent = ormObjects::get(system::url(2))) {
ui::setNaviBar(lang::right('msg'));
ui::setHeader($parent->name);
} else {
system::redirect('/subscription');
}
ui::setBackButton('/subscription');
ui::newButton(lang::get('SUBSCRIBE_BTN_ADD2'), '/subscription/msg_add/' . system::url(2));
function getState($date, $obj)
{
if ($obj->error_part_num > 0) {
$time = time() - strtotime($obj->last_subscribe);
if ($time > 4) {
return str_replace('%part%', $obj->error_part_num, lang::get('SUBSCRIBE_MSG', 1));
} else {
return str_replace('%part%', $obj->error_part_num, lang::get('SUBSCRIBE_MSG', 2));
}
} else {
if ($obj->part_count_awaiting > 0) {
page::assign('part1', $obj->part_count - $obj->part_count_awaiting);
page::assign('part2', $obj->part_count);
return page::parse(lang::get('SUBSCRIBE_MSG', 3));
} else {
if ($obj->last_subscribe == '0000-00-00 00:00:00') {
return lang::get('SUBSCRIBE_MSG', 4);
} else {
return lang::get('SUBSCRIBE_MSG', 5) . ' ' . date('d.m.Y ' . lang::get('SUBSCRIBE_MSG', 6) . ' H:i', strtotime($obj->last_subscribe));
}
}
}
}
// Выводим список сообщений рассылки
$sel = new ormSelect('subscribe_msg');
$sel->fields('name, last_subscribe, part_count, part_count_awaiting, error_part_num');
$sel->where('parents', '=', system::url(2));
$sel->orderBy('create_date', desc);
$table = new uiTable($sel);
$table->formatValues(true);
$table->addColumn('name', lang::get('SUBSCRIBE_MSG_TT1'), 300);
$table->addColumn('last_subscribe', lang::get('SUBSCRIBE_MSG_TT2'), 300, 0, 1, 'getState');
$table->defaultRight('msg_upd');
$table->addRight('msg_upd', 'edit', single);
$table->addRight('msg_del', 'drop', multi);
return $table->getHTML();
}
示例4: defAction
public function defAction()
{
// Определяем какие кнопки будут
$types = ormClasses::get('user')->getAllInheritors();
if (count($types) > 1) {
$class_list = '';
while (list($id, $name) = each($types)) {
$bclass = ormClasses::get($id);
$class_list .= '<a href="' . system::au() . '/users/user_add/' . system::url(2) . '/' . $bclass->getSName() . '" style="line-height:17px;">' . $bclass->getName() . '</a><br />';
}
ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add/" . system::url(2), 'class_list', $class_list);
} else {
ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add/" . system::url(2));
}
ui::setBackButton('/users');
// Заголовок страницы
if ($group = ormObjects::get(system::url(2))) {
ui::setNaviBar($group->name);
ui::setHeader(lang::right('userlist'));
}
// Выбираем пользователей
$sel = new ormSelect('user');
if (system::issetUrl(2) && system::url(2) != 0) {
$sel->where('parents', '=', system::url(2));
}
$sel->orderBy('create_date', desc);
// Строим таблицу
$table = new uiTable($sel);
$table->formatValues(true);
$table->showSearch(true);
$table->addColumn('login', lang::get('USERS_TABLE_FIELD_1'), 0, true);
$table->addColumn('surname name', lang::get('USERS_TABLE_FIELD_2'), 0, true);
$table->addColumn('create_date', lang::get('USERS_TABLE_FIELD_7'), 0, true, true, '', 1);
$table->addColumn('last_visit', lang::get('USERS_TABLE_FIELD_3'), 0, true, true, '', 1);
$table->addColumn('parents', lang::get('USERS_TABLE_FIELD_4'), 0, false, true);
$table->defaultRight('user_upd');
$table->addRight('user_upd', 'edit', single);
$table->addRight('user_act', 'active', multi);
$table->addRight('user_del', 'drop', multi);
$table->setDelMessage(lang::get('USERS_DEL_TITLE'), lang::get('USERS_DEL_TEXT'));
$table->setMultiDelMessage(lang::get('USERS_DEL_TITLE_MULTI'), lang::get('USERS_DEL_TEXT_MULTI'));
return $table->getHTML();
}
示例5: defAction
public function defAction()
{
if (!system::issetUrl(2)) {
system::redirect('/subscription');
}
if ($parent = ormObjects::get(system::url(2))) {
ui::setNaviBar(lang::right('user'));
ui::setHeader($parent->name);
}
ui::newButton(lang::get('SUBSCRIBE_BTN_ADD3'), '/subscription/user_add/' . system::url(2));
ui::newButton(lang::get('SUBSCRIBE_BTN_ADD4'), '/subscription/user_addlist/' . system::url(2));
ui::setBackButton('/subscription');
$sel = new ormSelect('subscribe_user');
$sel->where('parents', '=', system::url(2));
$table = new uiTable($sel);
$table->showSearch(true);
$table->moreParam(system::url(2));
$table->addColumn('name', lang::get('SUBSCRIBE_USER_TT1'), 300);
$table->addColumn('second_name first_name', lang::get('SUBSCRIBE_USER_TT2'), 300);
$table->defaultRight('user_upd');
$table->addRight('user_upd', 'edit', single);
$table->addRight('user_del', 'drop', multi);
return $table->getHTML();
}
示例6: history
public function history()
{
if (system::url(2) == 0) {
system::redirect('/subscription');
}
if ($obj = ormObjects::get(system::url(2))) {
ui::setBackButton('/subscription');
ui::setNaviBar(lang::right('subscribe_history'));
ui::setHeader($obj->name);
return ui::getHistoryTable($obj->id);
}
system::redirect('/subscription');
}
示例7: upd
public function upd()
{
$is_page = false;
if (file_exists(MODUL_DIR . '/constructor/template/class.tpl')) {
include MODUL_DIR . '/constructor/template/class.tpl';
}
if (system::action() == "upd") {
// форма обновления информации
$class = new ormClass(system::url(2));
if ($class->id() == '') {
system::redirect('/constructor/tree');
}
page::assign('obj.class_name', $class->getName());
page::assign('obj.sname', $class->getSName());
page::assign('obj.text', $class->getPadej());
page::assign('obj.id', $class->id());
$system = $class->isSystem();
$is_list = $class->isList();
$is_page = $class->isPage();
$is_user = $class->isInheritor('user');
$base_class = $class->getBaseClass();
page::assign('right', 'class_proc_upd');
// Выводим дерево для отображения структуры класса
$tree = new ormFieldsTree();
page::assign('fields', $tree->getHTML($class));
} else {
if (system::action() == "add") {
// форма добавления информации
$system = $is_list = $uniqum = $base_class = 0;
// Проверяем существует ли родитель?
if (system::issetUrl(2)) {
$parent = new ormClass(system::url(2));
if ($parent->id() == '') {
system::redirect('/constructor/tree');
}
$is_list = $parent->isList();
$is_page = $parent->isPage();
$is_user = $parent->isInheritor('user');
} else {
$is_user = false;
}
page::assign('obj.id', system::url(2));
page::assign('right', 'class_proc_add');
}
}
if ($is_page) {
ui::SelectBox('class_list', ormClasses::getPagesClassList(), $base_class, 400, ' ');
ui::SelectBox('template_list1', templates::getByDestination(0, true), isset($class) ? $class->getDefTemplate(0) : 0, 400, ' ');
ui::SelectBox('template_list2', templates::getByDestination(1, true), isset($class) ? $class->getDefTemplate(1) : 0, 400, ' ');
page::fParse('page_fields', $TEMPLATE['page_fields']);
} else {
if ($is_user) {
page::fParse('page_fields', $TEMPLATE['user_fields']);
} else {
page::assign('page_fields', '');
}
}
if (system::action() == "add" || !$class->isSystem()) {
ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
ui::setCancelButton('/constructor');
} else {
ui::setBackButton('/constructor');
}
page::assignArray(lang::get('CONSTR_FORM_FIELD'));
page::assignSavingPost();
ui::CheckBox('system', 1, $system, lang::get('CONSTR_FORM_FIELD', 3));
ui::CheckBox('is_list', 1, $is_list, lang::get('CONSTR_FORM_FIELD', 4));
return page::parse($TEMPLATE['frame'], 1);
}
示例8: history
public function history()
{
if (system::url(2) == 0) {
system::redirect('/structure');
}
if ($obj = ormPages::get(system::url(2))) {
if (isset($_SESSION['STRUCTURE_LIST_FLAG']) && $_SESSION['STRUCTURE_LIST_FLAG']) {
ui::setBackButton('/structure/list/' . $obj->getParentId());
} else {
ui::setBackButton('/structure/tree');
}
ui::setNaviBar(lang::right('page_history') . ' ' . $obj->getClass()->getPadej(1));
ui::setHeader($obj->name);
return ui::getHistoryTable($obj->id);
}
system::redirect('/structure');
}