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


PHP Control::getPageId方法代码示例

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


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

示例1: display

    function display()
    {
        global $CFG;
        $tab_id = $CFG->pm_editor ? $CFG->id : Control::getPageId($CFG->url, 1);
        if (!$tab_id > 0) {
            return false;
        }
        $current_tab = DB::getRecord('admin_tabs', $tab_id, 0, 1);
        $pages = self::getPages($tab_id);
        if ($pages) {
            $HTML = '
			<div class="page_map">';
            foreach ($pages as $page) {
                if ($CFG->pm_editor) {
                    $edit = '<a href="#" title="' . $CFG->edit_hover_caption . '" class="edit" class="method_edit_button" onclick="pmPageEdit(' . $page['id'] . ',event);return false;"></a>';
                }
                $order = $page['order'];
                $icon = $page['icon'] ? '<div class="lnk">' . Link::url($page['url'], '<img src="' . $page['icon'] . '" title="' . $page['name'] . '" />', false, false, false, 'content') . '</div>' : '';
                $pages_array[$order][] = '
				<div class="page_map_page o">
					<input type="hidden" id="id" value="' . $page['id'] . '" />
					' . $icon . '
					<div class="lnk">' . Link::url($page['url'], $page['name'], false, false, false, 'content') . '</div>
					' . $edit . '
					<div class="clear"></div>
				</div>';
            }
            $total = max(array_keys($pages_array));
            $total = $total + count($this->areas_s);
            $total = $total + count($this->areas_e);
            for ($i = 0; $i <= $total; $i++) {
                if ($this->areas_s[$i]) {
                    foreach ($this->areas_s[$i] as $area) {
                        $HTML .= $area;
                    }
                }
                if ($pages_array[$i]) {
                    foreach ($pages_array[$i] as $p) {
                        $HTML .= $p;
                    }
                }
                if ($this->areas_e[$i]) {
                    foreach ($this->areas_e[$i] as $area) {
                        $HTML .= $area;
                    }
                }
            }
            $HTML .= '</div>';
        } else {
            $HTML .= '<div class="no_pages">' . $CFG->pagemap_nothing . '</div>';
        }
        echo $HTML;
    }
开发者ID:mbassan,项目名称:backstage2,代码行数:53,代码来源:PageMap.php

示例2: __construct

 function __construct($table, $record_id)
 {
     global $CFG;
     $this->table = $table;
     $this->record_id = $CFG->include_id > 0 ? $CFG->include_id : $record_id;
     $this->row = DB::getRecord($this->table, $this->record_id, 0, 1);
     $this->db_fields = DB::getTableFields($this->table);
     $this->db_subtables = DB::getSubtables($this->table);
     $this->db_subtables = !$this->db_subtables ? array() : $this->db_subtables;
     $this->area_i = 0;
     $this->current_area = 0;
     $page_id = Control::getPageId($CFG->url, $CFG->is_tab);
     $corresponding_form = Control::getControls($page_id, 'form', $CFG->is_tab);
     if ($corresponding_form) {
         $k = key($corresponding_form);
         if ($corresponding_form[$k]['params'] = 'Form') {
             foreach ($corresponding_form[$k]['methods'] as $method) {
                 $args = Control::parseArguments($method['arguments'], 'Form', $method['method']);
                 $name = $args['name'] ? $args['name'] : $args['value'];
                 $this->form_method_args[$name] = $args;
             }
         }
     }
 }
开发者ID:mbassan,项目名称:backstage2,代码行数:24,代码来源:Record.php

示例3: elseif

				<div class="desc" onclick="file_manager.select(this,event);" ondblclick="file_manager.openFolder(' . $row['id'] . ',' . $has_sub . ')">' . $row['name'] . '</div>
				<div class="clear"></div>
			</div>';
        }
    }
} elseif ($action == 'drop') {
    if ($_REQUEST['rows']) {
        foreach ($_REQUEST['rows'] as $id => $row) {
            DB::update($row['table'], array($row['folder_field'] => $row['p_id']), $id);
        }
        Messages::add($CFG->ajax_save_message);
        Messages::display();
    }
} elseif ($action == 'download') {
    if ($_REQUEST['download']) {
        $page_id = Control::getPageId($_REQUEST['current_url'], $_REQUEST['is_tab']);
        $controls = Control::getControls($page_id, 'form', $_REQUEST['is_tab']);
        $key = key($controls);
        $methods = $controls[$key]['methods'];
        if ($methods) {
            foreach ($methods as $method) {
                if ($method['method'] == 'fileInput' || $method['method'] == 'fileMultiple') {
                    $args = Control::parseArguments($method['arguments'], 'Form', $method['method']);
                    $field_names[] = $args['name'];
                    $image_sizes = DB::getImageSizes($args['name']);
                    end($image_sizes);
                    $suffixes[$args['name']] = key($image_sizes);
                }
            }
        }
        $filename = $CFG->dirroot . $CFG->temp_file_location . 'archivos_' . date('Y-m-d') . '.zip';
开发者ID:mbassan,项目名称:backstage2,代码行数:31,代码来源:ajax.file_manager.php

示例4: __construct

    function __construct($url, $action, $is_tab = false, $editor_mode = false)
    {
        global $CFG;
        if ($url && !User::permission(false, false, $url)) {
            return false;
        }
        date_default_timezone_set($CFG->default_timezone);
        String::magicQuotesOff();
        $page_id = is_numeric($url) ? $url : Control::getPageId($url, $is_tab);
        if (!($page_id > 0)) {
            return false;
        }
        $page_info = $is_tab ? DB::getRecord('admin_tabs', $page_id, 0, 1) : DB::getRecord('admin_pages', $page_id, 0, 1);
        if ($page_info['one_record'] == 'Y' && !$editor_mode) {
            $action = 'form';
            $_REQUEST['id'] = 1;
            $CFG->control_one_record = 1;
        }
        $controls = Control::getControls($page_id, $action, $is_tab);
        $CFG->editor_page_id = $page_id;
        $CFG->editor_is_tab = $is_tab;
        $CFG->is_ctrl_panel = $page_info['is_ctrl_panel'];
        if ($controls) {
            foreach ($controls as $c_id => $control) {
                $params = $control['params'];
                $is_static = $params['is_static'] == 'Y';
                $class = $params['class'];
                $CFG->control_pass_id = $params['id'];
                if ($_REQUEST['cal_bypass'] && $class != 'Calendar') {
                    continue;
                }
                if ($editor_mode) {
                    $pm_methods = array();
                    echo '<div class="pm_class_container" id="control_' . $params['id'] . '">
							<div class="control_label">' . $params['class'] . ' ' . $params['id'] . '
								<a href="#" title="' . $CFG->move_hover_caption . '" class="move_handle dont_disable"></a>
								<a class="edit dont_disable" title="' . $CFG->edit_hover_caption . '" onclick="pmControlEdit(\'control_' . $params['id'] . '\');"></a>
								<a class="delete dont_disable" title="' . $CFG->delete_hover_caption . '" onclick="pmControlDelete(\'control_' . $params['id'] . '\');"></a>
							</div>
							<input type="hidden" class="this_class" id="control_' . $params['id'] . '_class" value="' . $params['class'] . '"/>
							<input type="hidden" class="this_page_id" id="control_' . $params['id'] . '_page_id" value="' . $params['page_id'] . '"/>
							<input type="hidden" class="this_action" id="control_' . $params['id'] . '_action" value="' . $params['action'] . '"/>
							<input type="hidden" class="this_id" id="control_' . $params['id'] . '_id" value="' . $params['id'] . '"/>';
                }
                if (!$is_static) {
                    $ref = new ReflectionClass($class);
                    $args = Control::parseArguments($params['arguments'], $class, '__construct');
                    $this->class = $ref->newInstanceArgs($args);
                    if ($class == 'Form') {
                        if (!$CFG->in_include) {
                            $this->class->verify();
                            $this->class->save();
                            $this->class->show_errors();
                            $this->class->show_messages();
                            $this->class->get($page_info['url'] == 'my-account' || $url == 'my-account' ? User::$info['id'] : $_REQUEST['id']);
                        } else {
                            $this->class->get($CFG->include_id);
                        }
                        $this->class->info['p_id'] = $_REQUEST['p_id'];
                        $this->class->info['f_id'] = $_REQUEST['f_id'];
                        if ($page_info['url'] == 'my-account' || $url == 'my-account') {
                            $CFG->o_method_suppress = true;
                            $this->class->passiveField('id', 'ID');
                            $CFG->o_method_suppress = true;
                            $this->class->textInput('user', $CFG->user_username, true, false, false, false, false, false, false, false, 1, $CFG->user_unique_error);
                            $CFG->o_method_suppress = true;
                            $this->class->passwordInput('pass', $CFG->user_password, true);
                            $CFG->o_method_suppress = true;
                            $this->class->passwordInput('pass1', $CFG->user_password, true, false, false, false, false, false, 'pass');
                            $CFG->o_method_suppress = true;
                            $this->class->textInput('first_name', $CFG->user_first_name, true);
                            $CFG->o_method_suppress = true;
                            $this->class->textInput('last_name', $CFG->user_last_name, true);
                            $CFG->o_method_suppress = true;
                            $this->class->textInput('phone', $CFG->user_phone);
                            $CFG->o_method_suppress = true;
                            $this->class->textInput('email', $CFG->user_email);
                            if (User::$info['is_admin'] == 'Y') {
                                $CFG->o_method_suppress = true;
                                $this->class->selectInput('f_id', $CFG->user_group, false, $_REQUEST['f_id'], false, 'admin_groups', array('name'));
                                $CFG->o_method_suppress = true;
                                $this->class->checkBox('is_admin', $CFG->user_is_admin);
                            }
                        }
                    }
                    echo '<input type="hidden" id="control_' . $params['id'] . '_table" value="' . $args['table'] . '"/>';
                }
                if (is_array($control['methods'])) {
                    foreach ($control['methods'] as $method) {
                        if ($method['p_id'] > 0) {
                            continue;
                        }
                        //$method['method'] = ($method['method'] == 'selectInput') ? 'fauxSelect' : $method['method'];
                        $CFG->method_id = $method['id'];
                        $args = Control::parseArguments($method['arguments'], $class, $method['method']);
                        $inputs_array = self::getSubMethods($method['id'], $class);
                        if (is_array($inputs_array)) {
                            $args['inputs_array'] = $inputs_array;
                        }
                        if ($is_static) {
//.........这里部分代码省略.........
开发者ID:mbassan,项目名称:backstage2,代码行数:101,代码来源:Control.php


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