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 .= '<li><a href="' . system::au() . '/users/user_add/0/' . $bclass->getSName() . '" >' . $bclass->getName() . '</a></li>'; } $java = '<script> $("#usel").parent().css("width", "150px"); </script>'; ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add", 'class_list', '<ul id="usel">' . $class_list . '</ul>' . $java); } else { ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add"); } ui::newButton(lang::get('BTN_NEW_UGROUP'), "/users/group_add"); $sel = new ormSelect('user_group'); $sel->orderBy('name', asc); $table = new uiTable($sel); $table->showSearch(true); $table->addColumn('name', lang::get('USERS_TABLE_FIELD_5'), 0, true); $table->addColumn('children', lang::get('USERS_TABLE_FIELD_6'), 0, true, true, 'count'); $table->defaultRight('userlist'); $table->addRight('userlist', 'users', single); $table->addRight('group_upd', 'edit', single); $table->addRight('group_act', 'active', multi); $table->addRight('group_del', 'drop', multi); $table->setDelMessage(lang::get('USERS_DEL_TITLE2'), lang::get('USERS_DEL_TEXT2')); $table->setMultiDelMessage(lang::get('USERS_DEL_TITLE_MULTI2'), lang::get('USERS_DEL_TEXT_MULTI2')); return $table->getHTML(); }
public function defAction() { $count = ormObjects::getCountTrashObjects(); $max_count = uiTable::getMaxCount(); if (uiTable::getCurPage() != 1) { $niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0; $objects = ormObjects::getTrashObjects($niz, $max_count); } else { $objects = ormObjects::getTrashObjects($max_count); } if (user::issetRight('object_del') && !empty($objects)) { ui::newButton(lang::get('BTN_NEW_CLEAК_TRASH'), 'javascript:clearTrash();'); } $table = new uiTable($objects, $count); $table->addColumn('name', lang::get('TRASH_TABLE_1'), 400); $table->addColumn('class', lang::get('TRASH_TABLE_2')); $table->addColumn('date', lang::get('TRASH_TABLE_3'), 0, false, false, 'viewDateTime'); $table->addColumn('user', lang::get('TRASH_TABLE_4'), 200); $table->addRight('object_restore', 'restore', multi, 'restoreObj(this)', lang::get('TRASH_TABLE_RESTORE')); $table->addRight('object_del', 'drop', multi); $table->setDelMessage(lang::get('TRASH_DEL_TITLE'), lang::get('TRASH_DEL_MSG')); $table->setMultiDelMessage(lang::get('TRASH_DEL_TITLE2'), lang::get('TRASH_DEL_MSG2')); $table->emptyText(lang::get('TRASH_EMPTY_MSG')); $html = ' <script type="text/javascript" src="/css_mpanel/restore_objects.js"></script> <input id="clearTrashTitle" type="hidden" value="' . lang::get('TRASH_DEL_TITLE3') . '"> <input id="clearTrashText" type="hidden" value="' . lang::get('TRASH_DEL_MSG3') . '"> '; return $html . $table->getHTML(); }
public function defAction() { function getSubscribersCount($id, $obj) { $sel = new ormSelect('subscribe_user'); $sel->where('parents', '=', $id); return $sel->getCount(); } ui::newButton(lang::get('SUBSCRIBE_BTN_ADD'), '/subscription/subscribe_add'); $sel = new ormSelect('subscription'); $sel->where('lang', '=', languages::curId()); $sel->where('domain', '=', domains::curId()); $table = new uiTable($sel); $table->formatValues(true); $table->addColumn('name', lang::get('SUBSCRIBE_TT1'), 200); $table->addColumn('last_subscribe', lang::get('SUBSCRIBE_TT2'), 200); $table->addColumn('id', lang::get('SUBSCRIBE_TT3'), 200, 0, 1, 'getSubscribersCount'); $table->defaultRight('msg'); $table->addRight('msg', 'list', single); $table->addRight('user', 'users', single); $table->addRight('subscribe_upd', 'edit', single); $table->addRight('subscribe_history', 'history', single); $table->addRight('subscribe_del', 'drop', multi); $table->addRight('subscribe_act', 'active', multi); $table->setDelMessage(lang::get('SUBSCRIBE_DEL_TITLE2'), lang::get('SUBSCRIBE_DEL_TEXT2')); $table->setMultiDelMessage(lang::get('SUBSCRIBE_DEL_TITLE_MULTI2'), lang::get('SUBSCRIBE_DEL_TEXT_MULTI2')); return $table->getHTML(); }
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(); }
public function defAction() { $_SESSION['STRUCTURE_LIST_FLAG'] = 1; // Если страниц нет, предлагаем добавить новую if (ormPages::getCountOfSection(0) == 0) { ui::MessageBox(lang::get('STRUCTURE_PAGE_NOT_FOUND'), lang::get('STRUCTURE_PAGE_NOT_FOUND2')); system::redirect('/structure/page_add'); } $obj_id = system::issetUrl(2) ? system::url(2) : 0; function getPageNotice($page) { $notice = ''; if ($page->is_home_page) { $notice = lang::get('STRUCTURE_TREE_TEXT12'); } if ($page->other_link != '') { $notice = lang::get('STRUCTURE_TREE_TEXT32'); } if (!$page->view_in_menu) { if (!empty($notice)) { $notice .= ', '; } $notice .= lang::get('STRUCTURE_TREE_TEXT22'); } if (!empty($notice)) { return '(' . $notice . ')'; } else { return ''; } } // Вывод дерева объектов $tree = new ormTree(328, 57); $tree->setClass('ormPage'); $tree->setRoot(0, reg::getKey(ormPages::getPrefix() . '/title_prefix'), 'list/0'); $tree->setNotice('getPageNotice'); $tree->setRightEdit('list'); $tree->setRightActive('page_proc_act'); $tree->setRightRemove('page_proc_moveto'); $tree->setRightAjaxLoad('list'); $tree->setDelMessage(lang::get('STRUCTURE_DEL_TITLE'), lang::get('STRUCTURE_DEL_TEXT')); $tree->addRight('page_upd', lang::right('page_upd'), 'compose_image'); $tree->addRight('page_add', lang::right('page_add'), 'add_image'); //, 'class_list', $class_list ui::setLeftPanel($tree->getHTML()); // Заголовок страницы ui::setHeader(lang::right('tree')); if (!empty($obj_id) && ($obj = ormPages::get($obj_id))) { ui::setNaviBar(lang::right('list')); ui::setHeader($obj->name); ui::setBackButton('/structure/list/' . $obj->getParentId()); } else { $obj_id = 0; } // Формируем список классов для быстрого добавления $class_name = ormPages::getPopularClass($obj_id); $class = ormClasses::get($class_name); $types = ormClasses::get('section')->getAllInheritors(); $no_edit = reg::getList(ormPages::getPrefix() . '/no_edit'); $elem_list = $cat_list = ''; while (list($id, $name) = each($types)) { if (!in_array($id, $no_edit)) { $bc = ormClasses::get($id); $pach = '/css_mpanel/tree/images/'; $ico = 'classes/' . $bc->getSName() . '.png'; if (!file_exists(ROOT_DIR . $pach . $ico)) { $ico = 'file1.gif'; } if ($bc->isInheritor('category') || $bc->getSName() == 'section') { $cat_list .= ' <li><img src="' . $pach . $ico . '"> <a href="' . system::au() . '/structure/page_add/' . $obj_id . '/' . $bc->getSName() . '">' . $bc->getName() . '</a></li>'; } else { $elem_list .= ' <li ><img src="' . $pach . $ico . '"> <a href="' . system::au() . '/structure/page_add/' . $obj_id . '/' . $bc->getSName() . '">' . $bc->getName() . '</a></li>'; } } } $class_list = '<ul>' . $cat_list . '</ul><ul>' . $elem_list . '</ul>'; ui::newButton(lang::get('PANEL_BTN_ADD_PART') . $class->getPadej(0), "/structure/page_add/" . $obj_id, 'class_list', $class_list); // Формируем выборку страниц для таблицы $sel = new ormSelect(); $sel->findInPages(); $sel->where('parents', '=', $obj_id); // Определяем способ сортировки списка $order_by = !empty($obj_id) ? $obj->order_by : ''; if (!empty($order_by)) { $pos = strpos($order_by, ' '); if ($pos) { $parram = substr($order_by, $pos + 1); $order_by = substr($order_by, 0, $pos); } else { $parram = ''; } $sel->orderBy($order_by, $parram); } else { $sel->orderBy(position, asc); } // Вывод таблицы $table = new uiTable($sel); $table->formatValues(true); $table->showSearch(true); $table->hideEmptyColumns(true); $table->addColumn('name', lang::get('STRUCTURE_TABLE_FIELD_1'), 500, true); $table->addColumn('image', lang::get('STRUCTURE_TABLE_FIELD_2'), 400, false, false); $table->addColumn('price', lang::get('STRUCTURE_TABLE_FIELD_3'), 400); $table->addColumn('publ_date', lang::get('STRUCTURE_TABLE_FIELD_4'), 400); $table->defaultRight('page_upd'); $table->addRight('page_upd', 'edit', single); $table->addRight('list', 'list', single); $table->addRight('page_history', 'history', single); $table->addRight('page_proc_act', 'active', multi); $table->addRight('page_del', 'drop', multi); $table->setDelMessage(lang::get('STRUCTURE_DEL_TITLE'), lang::get('STRUCTURE_DEL_TITLE')); $table->setMultiDelMessage(lang::get('STRUCTURE_DEL_TITLE_MULTI'), lang::get('STRUCTURE_DEL_TEXT_MULTI')); return $table->getHTML(); }