function main() {
$this->controllers_config = $GLOBALS['CONFIG_CONTROLLER'];
$this->xajax = new xajax();
$this->xajax->configure('javascript URI', '../files/js/xajax/');
$this->xajax->configure('wrapperPrefix', $this->config_module['ajax_prefix']);
$this->xajax->configure('debug', $GLOBALS['DEBUG']['ajax']);
$GLOBALS['TBE_TEMPLATE']->setBaseURL($GLOBALS['FE_CONFIG']['baseURL'].PATH_adminDir);
$GLOBALS['TBE_TEMPLATE']->setDocType('xhtml_trans');
$GLOBALS['TBE_TEMPLATE']->addJSInclude('../files/js/jquery/jquery.js', 'jquery');
$GLOBALS['TBE_TEMPLATE']->addJSInclude('../files/js/common.js', 'common');
$GLOBALS['TBE_TEMPLATE']->addJSCode('
<script language="javascript" type="text/javascript">
if ('.(cmf_div::_GP('reload_tree') ? 'true' : 'false').')
top.reload_nav_frame();
</script>
');
$this->content = $GLOBALS['TBE_TEMPLATE']->startPage('Backend');
$set_array = array(
'mod_title' => $this->getLL('ext.title'),
'mod_table' => $this->getLL('mod.table'),
'_save' => $this->getLL('_save'),
'_saveandclosedok' => $this->getLL('_saveandclosedok'),
'_delete' => $this->getLL('_delete'),
'_you_shure' => $this->getLL('_you_shure'),
'_set' => $this->getLL('_set'),
'_search_by_id' => $this->getLL('_search_by_id'),
'_filter' => $this->getLL('_filter'),
'_title_operation' => $this->getLL('_title_operation'),
'_title' => $this->getLL('_title'),
'_new' => $this->getLL('_new'),
'_url' => $this->getLL('_url'),
'_active_version' => $this->getLL('_active_version'),
'page_id' => (intval($this->page_id) ? $this->page_id : $this->getLL('_new')),
'filter_page_id' => (intval($this->page_id) ? $this->page_id : 0),
'path_to_script' => $this->path_to_script,
);
$total = $this->model_page->getTotalPage(true);
$set_array['total'] = $total;
if ($total > $this->page_per_list) {
$this->block('block_pager', array('pager'=> cmf_div::getPager(
$total,
intval(cmf_div::_GP('p')),
$this->path_to_script.'?page_id='.$this->page_id.'&',
$this->getLL('_page_prev'),
$this->getLL('_page_next'),
$this->page_per_list)));
}
if (isset($this->page_data['id'])&&$GLOBALS['BE_USER']->checkTableFieldAccess(model_page::getTable('pages'), 'deleted')) {
$this->block(
'field_delete',
array(
'_you_shure' => $this->getLL('_you_shure'),
'_deleted' => $this->getLL('_deleted'),
'path_to_script' => $this->path_to_script,
'page_id' => $this->page_data['id'],
)
);
}
if ($GLOBALS['BE_USER']->checkTableFieldAccess(model_page::getTable('pages'), 'disabled')) {
$this->block(
'field_disable',
array(
'_disabled' => $this->getLL('_disabled'),
'disabled' => (isset($this->page_data['disabled'])&&$this->page_data['disabled'] ? 'CHECKED' :''),
)
);
$this->xajax->register(XAJAX_FUNCTION, 'hideUnhide', array('URI' => '"'.$this->action_server['path'].$this->config_module['actionPath'].$this->config_module['ajax_script_be'].'"'));
}
if ($GLOBALS['BE_USER']->checkTableFieldAccess(model_page::getTable('pages'), 'title')) {
$this->block(
'field_title',
array(
'_title' => $this->getLL('_title'),
'title' => (isset($this->page_data['title'][$this->page_language])?$this->page_data['title'][$this->page_language]: (isset($this->page_data['title'][$GLOBALS['FE_CONFIG']['default_language']]) ? $this->page_data['title'][$GLOBALS['FE_CONFIG']['default_language']] : '' )),
)
);
}
$this->getContentByType(isset($this->page_data['type']) ? $this->page_data['type'] : 1);
$set_array['xajax_js'] = $this->xajax->getJavascript();
$this->set($set_array);
$a = intval(cmf_div::_GP('p'));
if ($a-1 <= 0)
$a = 0;
else
$a--;
$page_res = $this->model_page->getResPages('id, title, url_full, disabled, url_test, type, url_path', '', $a*$this->page_per_list.','.$this->page_per_list, true, 'tstamp DESC');
while($row = $GLOBALS['DB_SELECT']->sql_fetch_assoc($page_res)) {
model_page::unserialize($row);
$this->block(
'rows_list',
array(
'title_1' => htmlspecialchars(mb_substr((isset($row['title'][$this->page_language])?$row['title'][$this->page_language]: (isset($row['title'][$GLOBALS['FE_CONFIG']['default_language']]) ? $row['title'][$GLOBALS['FE_CONFIG']['default_language']] : '') ), 0, 28)),
'_edit' => $this->getLL('_edit'),
'path_to_script'=> $this->path_to_script.'?page_id='.$row['id'],
'row_id' => $row['id'],
'title_2' => $row['url_full'],
'xajax_prefix' => $this->config_module['ajax_prefix'],
'_edit_record' => $this->getLL('_edit_record'),
'_disabled' => ($row['disabled'] ? $this->getLL('_showed') : $this->getLL('_disabled')),
'_you_shure' => $this->getLL('_you_shure'),
'_deleted' => $this->getLL('_deleted'),
'img_zoom' => (in_array($row['type'], array(1,3)) ? 'gfx/zoom.gif' : 'clear.gif'),
'path_to_zoom' => ($row['type']==1 ? $GLOBALS['FE_CONFIG']['baseURL'].$row['url_test'] : ($row['type']==3 ? $row['url_path'] : '')),
'_zoom_record' => $this->getLL('_zoom_record'),
'status' => ($row['disabled'] ? '' : 'un'),
'disabled' => ($row['disabled'] ? '' : 'on'),
));
}
$this->content .= $this->parse();
$this->content .= $GLOBALS['TBE_TEMPLATE']->endPage();
}