当前位置: 首页>>代码示例>>PHP>>正文


PHP ui::SelectBox方法代码示例

本文整理汇总了PHP中ui::SelectBox方法的典型用法代码示例。如果您正苦于以下问题:PHP ui::SelectBox方法的具体用法?PHP ui::SelectBox怎么用?PHP ui::SelectBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ui的用法示例。


在下文中一共展示了ui::SelectBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: templList

 private function templList($name, $value, $size = 420)
 {
     $array = array();
     $old_file = '';
     $patch = TEMPL_DIR . '/subscription/mails';
     if ($handle = opendir($patch)) {
         while (false !== ($file = readdir($handle))) {
             if (substr($file, strlen($file) - 3, 3) == 'tpl') {
                 include_once $patch . '/' . $file;
                 $file_name = substr($file, 0, strlen($file) - 4);
                 $title = !empty($TEMPLATE['name']) ? $TEMPLATE['name'] : $file_name;
                 /* if (!empty($TEMPLATE['name']) && $old_file != $file_name) {
                     $title = $TEMPLATE['name'];
                        $old_file = $file_name;
                    } else $title = $file_name;  */
                 $temp[0] = $file_name;
                 $temp[1] = $title;
                 $array[] = $temp;
                 $TEMPLATE['name'] = '';
             }
         }
         closedir($handle);
     }
     if (empty($value)) {
         $value = 'default';
     }
     return ui::SelectBox($name, $array, $value, $size);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:28,代码来源:__subscribe.php

示例2: view

 function view()
 {
     // Устанавливаем кнопки для формы
     ui::setCancelButton('/eshop/list');
     ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
     ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
     if (file_exists(MODUL_DIR . '/eshop/template/order.tpl')) {
         include MODUL_DIR . '/eshop/template/order.tpl';
     }
     if (!($obj = ormObjects::get(system::url(2), 'eshop_order'))) {
         system::redirect('/eshop/list');
     }
     $order = new eShopOrder($obj);
     // Вывод информации о товарах
     function getGoodsName($val, $obj)
     {
         if ($obj = ormPages::get($val, 'goods')) {
             return '<a href="' . $obj->url . '" target="_blank">' . $obj->name . '</a>';
         }
     }
     function getPrice($val, $obj)
     {
         return '&nbsp;&nbsp;&nbsp;&nbsp;' . $obj->cost * $obj->count . ' руб.';
     }
     $sel = new ormSelect('eshop_goods');
     $sel->where('parents', '=', $obj->id);
     $table = new ormMultiForm('goods');
     $table->setData($sel);
     $table->insideForm();
     $table->addColumn('goods_id', 0, 400, 0, false, 'getGoodsName');
     $table->addColumn('cost', 0, 100, 0, false);
     $table->addColumn('count', 0, 100);
     $table->addColumn('id', 'Общая стоимость', 100, 0, false, 'getPrice');
     $table->withoutAdditions();
     page::assign('goods_list', $table->getHTML());
     page::assign('order.number', $order->getNumber());
     page::assign('order.cost', $order->getCost());
     page::assign('order.cost_all', $order->getTotalCost());
     page::assign('order.delivery_price', $order->getDeliveryPrice());
     page::assign('order.delivery', $order->_delivery);
     $obj->parseAllFields();
     page::assign('obj.id', $order->id);
     page::assign('obj.date', date('d.m.Y в H:i', strtotime($obj->date)));
     page::assign('user_link', '/mpanel/users/user_upd/' . $order->getUserId());
     ui::SelectBox('state', ormObjects::getObjectsByClass('eshop_status'), $obj->state, 200);
     ui::CheckBox('is_payment', 1, $obj->is_payment, 'Оплачено');
     // Создаем форму и выводим ее на страницу
     // $form = new ormEditForm($obj, $right);
     //return $form->getHTML();
     return page::parse($TEMPLATE['frame']);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:51,代码来源:__order.php

示例3: defAction

 public function defAction()
 {
     if (file_exists(MODUL_DIR . '/eshop/template/settings.tpl')) {
         include MODUL_DIR . '/eshop/template/settings.tpl';
     }
     ui::newButton(lang::get('BTN_SAVE_ONLY'), "javascript:sendForm('save');");
     page::assignArray(lang::get('ESHOP_TEXT_SETTINGS'));
     ui::SelectBox('fisrt_state', ormObjects::getObjectsByClass('eshop_status'), reg::getKey('/eshop/fisrt_state'));
     ui::CheckBox('only_reg', 1, reg::getKey('/eshop/only_reg'), lang::get('ESHOP_TEXT_SETTINGS', 1));
     ui::CheckBox('check_count', 1, reg::getKey('/eshop/check_count'), lang::get('ESHOP_TEXT_SETTINGS', 2));
     ui::CheckBox('dubl_to_email', 1, reg::getKey('/eshop/dubl_to_email'), lang::get('ESHOP_TEXT_SETTINGS', 3));
     //page::assign('nds', reg::getKey('/eshop/nds'));
     page::assign('min_count', reg::getKey('/eshop/min_count'));
     return page::parse($TEMPLATE['frame']);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:15,代码来源:__settings.php

示例4: defAction

 public function defAction()
 {
     $obj = user::getObject();
     // Если произошли ошибки, перенаправляем на главную страницу админки
     if (!$obj instanceof ormObject) {
         system::redirect('/');
     }
     // Устанавливаем кнопки для формы
     ui::newButton(lang::get('BTN_SAVE_CHANGE'), "javascript:sendForm('save');");
     // Создаем форму и выводим ее на страницу
     $form = new ormEditForm($obj, 'profile_proc');
     $modules = user::getModulesForObject($obj);
     $form->replaceField('def_modul', ui::SelectBox('def_modul', $modules, $obj->def_modul, 400));
     // Зануляем не нужные поля
     $form->replaceField('active', '');
     $form->replaceField('groups', '');
     $form->replaceField('login', '');
     return $form->getHTML();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:19,代码来源:__profile.php

示例5: navigation

 private function navigation($smeshenie = 5, $TEMPLATE)
 {
     $max_count = $_SESSION['table_' . $this->prefix]['max_count'];
     $current_num = $_SESSION['table_' . $this->prefix]['page_num'];
     if ($this->isSelection) {
         $count_page = ceil($this->select->getCount() / $max_count);
     } else {
         $count_page = ceil((!empty($this->all_count) ? $this->all_count : count($this->data)) / $max_count);
     }
     if ($current_num > $count_page) {
         $current_num = $_SESSION['table_' . $this->prefix]['page_num'] = $count_page;
     }
     $start = $current_num * $max_count - $max_count;
     if ($count_page > 1) {
         // Просчитывает какие страницы показывать
         $niz = $current_num - $smeshenie;
         if ($niz < 1) {
             $niz = 1;
         }
         $verx = $current_num + $smeshenie;
         if ($verx > $count_page) {
             $verx = $count_page;
         }
         // Определяемся с левым блоком
         page::assign('num_l', $current_num - 1);
         page::assign('first_num', 1);
         page::assign('num_r', $current_num + 1);
         page::assign('last_num', $count_page);
         if ($current_num == 1 && isset($TEMPLATE['left_block'])) {
             page::fParse('left_block', $TEMPLATE['noact_left_block']);
             page::fParse('first_block', $TEMPLATE['noact_first_block']);
             page::fParse('right_block', $TEMPLATE['right_block']);
             page::fParse('last_block', $TEMPLATE['last_block']);
         } else {
             if ($current_num == $count_page && isset($TEMPLATE['right_block'])) {
                 page::fParse('left_block', $TEMPLATE['left_block']);
                 page::fParse('first_block', $TEMPLATE['first_block']);
                 page::fParse('right_block', $TEMPLATE['noact_right_block']);
                 page::fParse('last_block', $TEMPLATE['noact_last_block']);
             } else {
                 page::fParse('left_block', $TEMPLATE['left_block']);
                 page::fParse('first_block', $TEMPLATE['first_block']);
                 page::fParse('right_block', $TEMPLATE['right_block']);
                 page::fParse('last_block', $TEMPLATE['last_block']);
             }
         }
         // Вывод списка страниц
         $pages = '';
         for ($i = $niz; $i < $verx + 1; $i++) {
             page::assign('page_num', $i);
             $tmpl = $i == $current_num ? 'pages_a' : 'pages_na';
             $pages .= page::parse($TEMPLATE[$tmpl]);
         }
         page::assign('pages', $pages);
         $navbar = page::parse($TEMPLATE['navigation']);
     } else {
         $navbar = '';
     }
     if (!empty($navbar)) {
         $counts = array(1 => 1, 5 => 5, 10 => 10, 20 => 20, 30 => 30, 50 => 50, 100 => 100);
         ui::SelectBox('max_count', $counts, $max_count, 50);
         page::assign('navbar', $navbar);
         page::assign('count_page', $count_page);
         page::fParse('navbar', $TEMPLATE['navibar']);
     } else {
         page::assign('navbar', '');
     }
     // Устанавливает лимит для выборки объектов
     if ($this->isSelection && $start > -1 && $max_count > 0) {
         $this->select->limit($start, $max_count);
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:72,代码来源:uiTable.php

示例6: 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'] ? '&nbsp;' : '';
                                 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 . ']';
             }
         }
//.........这里部分代码省略.........
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:101,代码来源:ormMultiForm.php

示例7: upd

 public function upd()
 {
     // Указываем для какого объекта строить форму
     if (system::action() == "upd") {
         // Если это редактирование
         $obj = ormObjects::get(system::url(2));
         // Заголовок страницы
         ui::setNaviBar(lang::get('TEXT_EDIT') . $obj->getClass()->getPadej(1));
         ui::setHeader($obj->login);
         $class_list = '';
         $group_id = system::issetUrl(3) ? system::url(3) : $obj->getParentId();
         $right = 'user_proc_upd';
     } else {
         if (system::action() == "add") {
             $class_name = system::issetUrl(3) ? system::url(3) : 'user';
             // Если это добавление нового объекта
             $group_id = system::url(2);
             $right = 'user_proc_add';
             $obj = new ormObject();
             $obj->setParent($group_id);
             $obj->setClass($class_name);
             $obj->active = 1;
             // Формируем список классов для быстрого изменения класса объекта
             $types = ormClasses::get('user')->getAllInheritors();
             $class_list = '';
             while (list($id, $name) = each($types)) {
                 if ($bc = ormClasses::get($id)) {
                     $url = system::au() . '/users/user_add/' . $group_id . '/' . $bc->getSName();
                     $class_list .= '<a href="' . $url . '" style="line-height:17px;">' . $bc->getName() . '</a><br />';
                 }
             }
             // Заголовок страницы
             if ($group = ormObjects::get($group_id)) {
                 ui::setNaviBar($group->name, '/users/userlist/' . $group_id);
                 ui::setHeader(lang::get('TEXT_ADD') . $obj->getClass()->getPadej(1));
             }
         }
     }
     // Если произошли ошибки, перенаправляем на главную страницу модуля
     if (!$obj->isInheritor('user')) {
         system::redirect('/users/userlist');
     }
     // Устанавливаем кнопки для формы
     if (empty($group_id)) {
         ui::setCancelButton('/users/grouplist');
     } else {
         ui::setCancelButton('/users/userlist/' . $group_id);
     }
     ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
     ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
     // Создаем форму и выводим ее на страницу
     $form = new ormEditForm($obj, $right);
     $form->setORMList($class_list);
     // Изменяем вид поля "Модуль по умолчанию"
     $modules = user::getModulesForObject($obj);
     $form->replaceField('def_modul', ui::SelectBox('def_modul', $modules, $obj->def_modul, 400));
     // Добавляем вкладку "Права доступа"
     $tab_content = '<div style="margin-left:20px;width: 950px;">' . lang::get('USERS_TEXT_RIGHT_HINT') . rights::getListForModuls($obj->id, 1) . '</div>';
     $form->attachJavaScript('/css_mpanel/users_upd.js');
     $form->newTabs(lang::get('USERS_TABS_RIGHT'), $tab_content);
     return $form->getHTML();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:62,代码来源:__user.php

示例8: 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'] ? '&nbsp;' : '';
                                    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']));
                                        }
                                    }
                                }
//.........这里部分代码省略.........
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:101,代码来源:ormEditForm.php

示例9: getLangList

 function getLangList($val, $obj)
 {
     return ui::SelectBox('objdomains[' . $obj['id'] . '][d_def_lang]', languages::getAll(), $val, 130);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:4,代码来源:__change.php

示例10: upd

 public function upd()
 {
     if (file_exists(MODUL_DIR . '/constructor/template/field.tpl')) {
         include MODUL_DIR . '/constructor/template/field.tpl';
     }
     if (system::action() == "upd") {
         // форма обновления информации
         $obj = new ormField(system::url(2));
         if ($obj->id() == '') {
             system::stop();
         }
         page::assign('obj.fname', $obj->getName());
         page::assign('obj.fsname', $obj->getSName());
         page::assign('obj.hint', $obj->getHint());
         page::assign('obj.max_size', $obj->getMaxSize());
         page::assign('obj.id', $obj->id());
         $view = $obj->getView();
         $inherit = $obj->getInherit();
         $search = $obj->getSearch();
         $filter = $obj->getFilter();
         $required = $obj->getRequired();
         $system = $obj->getSystem();
         $type = $obj->getType();
         $list_id = $obj->getListId();
         $uniqum = $obj->getUniqum();
         $quick_add = $obj->getQuickAdd();
         $relation = $obj->getRelType();
         $spec = $obj->getSpec();
         $fr = $obj->getSName() == 'name' ? '_name' : '';
         page::assign('right', 'field_proc_upd');
     } else {
         if (system::action() == "add") {
             // форма добавления информации
             if (system::issetUrl(2)) {
                 // Проверяем существует ли родитель?
                 $group = new ormFieldsGroup(system::url(2));
                 if ($group->id() == '') {
                     system::stop();
                 }
             }
             $view = $inherit = 1;
             $search = $filter = $required = $system = $type = $list_id = $uniqum = $spec = $quick_add = $relation = 0;
             $fr = '';
             page::assign('obj.id', system::url(2));
             page::assign('right', 'field_proc_add');
         }
     }
     page::assignArray(lang::get('CONSTR_FORM_FIELD3'));
     page::assignSavingPost();
     ui::CheckBox('view', 1, $view, lang::get('CONSTR_FORM_FIELD3', 6));
     ui::CheckBox('inherit', 1, $inherit, lang::get('CONSTR_FORM_FIELD3', 7));
     ui::CheckBox('search', 1, $search, lang::get('CONSTR_FORM_FIELD3', 8));
     ui::CheckBox('filter', 1, $filter, lang::get('CONSTR_FORM_FIELD3', 9));
     ui::CheckBox('required', 1, $required, lang::get('CONSTR_FORM_FIELD3', 10));
     ui::CheckBox('system', 1, $system, lang::get('CONSTR_FORM_FIELD3', 11));
     ui::CheckBox('uniqum', 1, $uniqum, lang::get('CONSTR_FORM_FIELD3', 13));
     ui::CheckBox('quick_add', 1, $quick_add, lang::get('CONSTR_FORM_FIELD3', 14));
     ui::CheckBox('spec', 1, $spec, lang::get('CONSTR_FORM_FIELD3', 16));
     ui::SelectBox('reltype', lang::get('CONSTR_RELTYPE'), $relation, 300);
     ui::SelectBox('type', lang::get('CONSTR_TYPE_LIST' . $fr), $type, 300);
     $list = ormClasses::getHandbooks();
     ui::SelectBox('list_id', $list, $list_id, 300, '&nbsp;');
     page::assign('sh', !empty($list_id) ? '' : 'style="display:none;"');
     page::assign('sh2', $type > 69 && $type < 86 ? '' : 'style="display:none;"');
     page::assign('sh3', $type == 90 || $type == 95 || $type == 100 ? '' : 'style="display:none;"');
     page::assign('sh4', $type == 55 || $type == 60 ? '' : 'style="display:none;"');
     echo page::parse($TEMPLATE['frame' . $fr], 1);
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:69,代码来源:__field.php

示例11: addlist

 public function addlist()
 {
     // Устанавливаем кнопки для формы
     ui::setCancelButton('/subscription/user/' . system::url(2));
     ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
     if (file_exists(MODUL_DIR . '/subscription/template/add_userlist.tpl')) {
         include MODUL_DIR . '/subscription/template/add_userlist.tpl';
     }
     // Добавляем поле "Подписан на рассылку"
     $html = ui::SelectBox('subscribes', ormObjects::getObjectsByClass('subscription'), system::url(2), 400, '', '', 'selectbox_multi_big');
     page::assignArray(lang::get('SUBSCRIBE_TEXT'));
     page::assign('parent_id', system::url(2));
     return page::parse($TEMPLATE['frame']);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:14,代码来源:__user.php

示例12: 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, '&nbsp;');
         ui::SelectBox('template_list1', templates::getByDestination(0, true), isset($class) ? $class->getDefTemplate(0) : 0, 400, '&nbsp;');
         ui::SelectBox('template_list2', templates::getByDestination(1, true), isset($class) ? $class->getDefTemplate(1) : 0, 400, '&nbsp;');
         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);
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:70,代码来源:__class.php

示例13: getTemplateBox

 private function getTemplateBox($field_name, $templs, $value, $fla = 0)
 {
     $empty = $field_name == 'template2_id' ? lang::get('STRUCTURE_NO_CHANGE') : '';
     return ui::SelectBox($field_name, $templs, $value, 400, $empty, '', 'selectbox_template') . '
              <div id="' . $field_name . '_edit_block" class="input_min_2" style="display:none;">
                 <input value="" id="' . $field_name . '_new_val" name="' . $field_name . '_new_val" class="" />
                 <input value="" id="' . $field_name . '_new_val2" name="' . $field_name . '_new_val2" class="" />
              </div>
              <span class="add_value" onclick="return AddNewTemplate(this, ' . $fla . ');"></span>
              <small>' . ui::CheckBox($field_name . '_all', 1, 0, 'Применить для всех подразделов', 0, 0, 0) . '</small>';
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:11,代码来源:__page.php

示例14: getHTML

 public function getHTML($templ_name = 'filters')
 {
     if ($this->getCount() > 0 && file_exists(MODUL_DIR . '/mpanel/template/' . $templ_name . '.tpl')) {
         include MODUL_DIR . '/mpanel/template/' . $templ_name . '.tpl';
         $items = '';
         $num = 0;
         // Строим список фильтров
         reset($this->filters);
         while (list($key, $field) = each($this->filters)) {
             $num++;
             if (isset($this->new_filters[$num])) {
                 if ($this->new_filters[$num][2]) {
                     page::assign('field.name', $this->new_filters[$num][0]);
                     page::assign('field.content', $this->new_filters[$num][1]);
                     $items .= page::parse($TEMPLATE['field_spec']);
                 } else {
                     $items .= $this->new_filters[$num][1];
                 }
             }
             if (!isset($_SESSION['filters_' . $this->prefix][$field['f_sname']])) {
                 $_SESSION['filters_' . $this->prefix][$field['f_sname']] = '';
             }
             if (isset($this->show_filters[$field['f_sname']]) && !empty($this->show_filters[$field['f_sname']][0])) {
                 $field['f_name'] = $this->show_filters[$field['f_sname']][0];
             }
             page::assign('field.name', $field['f_name']);
             if ($field['f_type'] == 50 || $field['f_type'] > 69 && $field['f_type'] < 96) {
                 // Выпадающий список
                 $data = array();
                 if ($field['f_type'] == 50) {
                     $data = lang::get('FILTER_BOOL');
                 } else {
                     if ($field['f_type'] > 69 && $field['f_type'] < 86) {
                         $data = lang::get('FILTER_ISSET');
                     } else {
                         if ($field['f_type'] == 90 || $field['f_type'] == 95) {
                             $data = ormObjects::getObjectsByClass($field['f_list_id']);
                         }
                     }
                 }
                 $element = ui::SelectBox($field['f_sname'], $data, $_SESSION['filters_' . $this->prefix][$field['f_sname']], 172, '&nbsp;', '', 'selectbox_mini');
                 page::assign('element', $element);
                 $items .= page::parse($TEMPLATE['field_select']);
             } else {
                 if (isset($this->show_filters[$field['f_sname']]) && $this->show_filters[$field['f_sname']][1] || ($field['f_type'] == 25 || $field['f_type'] == 30 || $field['f_type'] == 32) && (!isset($this->show_filters[$field['f_sname']]) || $this->show_filters[$field['f_sname']][1] !== false)) {
                     // Выбор промежутка для чисел или дат
                     if (!isset($_SESSION['filters_' . $this->prefix][$field['f_sname'] . '_2'])) {
                         $_SESSION['filters_' . $this->prefix][$field['f_sname'] . '_2'] = '';
                     }
                     page::assign('field.sname', $field['f_sname']);
                     page::assign('field.value', $_SESSION['filters_' . $this->prefix][$field['f_sname']]);
                     page::assign('field.value2', $_SESSION['filters_' . $this->prefix][$field['f_sname'] . '_2']);
                     $items .= page::parse($TEMPLATE['field_period']);
                 } else {
                     // Обычный фильтр - текстовое поле
                     page::assign('field.sname', $field['f_sname']);
                     page::assign('field.value', $_SESSION['filters_' . $this->prefix][$field['f_sname']]);
                     $items .= page::parse($TEMPLATE['field']);
                 }
             }
         }
         $all_count = $num + count($this->new_filters);
         while ($num < $all_count) {
             $num++;
             if (isset($this->new_filters[$num])) {
                 if ($this->new_filters[$num][2]) {
                     page::assign('field.name', $this->new_filters[$num][0]);
                     page::assign('field.content', $this->new_filters[$num][1]);
                     $items .= page::parse($TEMPLATE['field_spec']);
                 } else {
                     $items .= $this->new_filters[$num][1];
                 }
             }
         }
         page::assign('fields', $items);
         return page::parse($TEMPLATE['frame']);
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:78,代码来源:ormFilterForm.php

示例15: getLangsAndDomains

 private function getLangsAndDomains($TEMPLATE)
 {
     $sub_menu = '';
     $langs = languages::getAll();
     $domains = domains::getAll();
     page::assign('ldObjectLinks', '');
     if (count($langs) > 1 || count($domains) > 1) {
         $isMultiDom = count($domains) > 1 ? true : false;
         $sub_items = $curLD = '';
         $mas = array();
         $num = 0;
         while (list($num2, $domain) = each($domains)) {
             reset($langs);
             while (list($num1, $lang) = each($langs)) {
                 if (user::issetRight($lang['l_id'] . ' ' . $domain['d_id'], 'structure')) {
                     if ($isMultiDom) {
                         $lanver = $domain['d_name'];
                         if ($lang['l_id'] != $domain['d_def_lang']) {
                             $lanver .= '/' . $lang['l_prefix'];
                         }
                     } else {
                         $lanver = $lang['l_name'];
                     }
                     $link = ADMIN_URL;
                     if ($domain['d_id'] != domains::curSiteDomain()->id()) {
                         $link .= '/' . str_replace('.', '_', $domain['d_name']);
                     }
                     if ($lang['l_id'] != $domain['d_def_lang']) {
                         $link = '/' . $lang['l_prefix'] . $link;
                     }
                     if (domains::curId() == $domain['d_id'] && languages::curId() == $lang['l_id']) {
                         $curLD = $link;
                     }
                     page::assign('name', $lanver);
                     page::assign('url', $link);
                     $sub_items .= page::parse($TEMPLATE['langver']);
                     $mas[] = array('id' => $link, 'name' => $lanver);
                     $num++;
                 }
             }
         }
         if (!empty($sub_items) && $num > 1) {
             if ($isMultiDom) {
                 $lanver = domains::curDomain()->getName() . languages::pre();
             } else {
                 $lanver = languages::curLang()->getName();
             }
             page::assign('eshe', $lanver);
             page::assign('sub_items', $sub_items);
             $sub_menu = page::parse($TEMPLATE['sub_menu']);
             ui::SelectBox('ldObjectLinks', $mas, $curLD, 474, '', 'onSelectldObjectLinks()');
         }
     }
     return $sub_menu;
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:55,代码来源:controller.php


注:本文中的ui::SelectBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。