Permalink
Browse files

-

  • Loading branch information...
project29k committed Jun 20, 2012
1 parent a82a3b3 commit 1226a5f958ec6fcb38e94d4e3526c0af47373d8d
@@ -96,7 +96,7 @@
|
*/
$autoload['language'] = array('axipi_core');
$autoload['language'] = array();
/*
@@ -23,7 +23,7 @@ public function index() {
$columns[] = 'cmp.cmp_iselement';
$columns[] = 'cmp.cmp_isrelation';
$columns[] = 'count_items';
$col = build_columns('components', $columns, 'cmp.cmp_id', 'DESC');
$col = build_columns('components', $columns, 'cmp.cmp_code', 'ASC');
$results = $this->components_model->get_all_components($flt);
$build_pagination = $this->axipi_library->build_pagination(ci_url().$this->itm->itm_code, 'components', $results->count, 50);
@@ -26,7 +26,7 @@ public function index() {
$columns[] = 'itm.itm_code';
$columns[] = 'itm.itm_title';
$columns[] = 'cmp.cmp_code';
$col = build_columns('groups_items', $columns, 'itm.itm_id', 'DESC');
$col = build_columns('groups_items', $columns, 'itm.itm_code', 'ASC');
$results = $this->items_model->get_all_items($flt);
$build_pagination = $this->axipi_library->build_pagination(ci_url().$this->itm->itm_code, 'groups_items', $results->count, 30);
@@ -34,10 +34,10 @@ public function index() {
$columns[] = 'lng.lng_code';
$columns[] = 'itm.itm_ispublished';
$columns[] = 'itm.itm_access';
$col = build_columns('items', $columns, 'itm.itm_id', 'DESC');
$col = build_columns('items', $columns, 'itm.itm_code', 'ASC');
$results = $this->items_model->get_all_items($flt);
$build_pagination = $this->axipi_library->build_pagination(ci_url().$this->itm->itm_code, 'items', $results->count, 20);
$build_pagination = $this->axipi_library->build_pagination(ci_url().$this->itm->itm_code, 'items', $results->count, 50);
$data = array();
$data['columns'] = $col;
@@ -18,7 +18,7 @@ public function index() {
$columns[] = 'lay.lay_id';
$columns[] = 'lay.lay_code';
$columns[] = 'lay.lay_type';
$columns[] = 'count_sections';
$columns[] = 'count_zones';
$col = build_columns('layouts', $columns, 'lay.lay_id', 'DESC');
$results = $this->layouts_model->get_all_layouts($flt);
@@ -78,8 +78,9 @@ function build_columns($reference, $columns, $default_order, $default_direction)
} elseif($CI->session->userdata($reference.'_col') && preg_match('/^[a-zA-Z0-9._]{1,}[ ](ASC|DESC)$/', $CI->session->userdata($reference.'_col'))) {
list($defined_order, $defined_direction) = explode(' ', $CI->session->userdata($reference.'_col'));
}
if(!in_array($defined_order, $columns)) {
$defined_order = '';
if(!in_array($defined_order, $columns) || !in_array($defined_direction, array('ASC', 'DESC'))) {
$defined_order = $default_order;
$defined_direction = $default_direction;
$CI->session->set_userdata($reference.'_col', $default_order.' '.$default_direction);
}
$col = array();
@@ -11,7 +11,7 @@ public function post_controller_constructor() {
$query = $this->CI->db->query('SELECT * FROM '.$this->CI->db->dbprefix('lng').' AS lng WHERE lng_id = ?', array($this->CI->itm->lng_id));
$this->CI->lng = $query->row();
$this->CI->config->set_item('language', $this->CI->lng->lng_code);
$this->CI->load->language('axipi_core');
$query = $this->CI->db->query('SELECT * FROM '.$this->CI->db->dbprefix('sct').' AS sct LEFT JOIN '.$this->CI->db->dbprefix('sct_trl').' AS sct_trl ON sct_trl.sct_id = sct.sct_id WHERE sct.sct_id = ? AND sct_trl.lng_id = ?', array($this->CI->itm->sct_id, $this->CI->itm->lng_id));
$this->CI->sct = $query->row();
@@ -20,7 +20,7 @@
$lang['count_items'] = '%1$s éléments';
$lang['countries'] = 'Countries';
$lang['country'] = 'Country';
$lang['create'] = 'Create';
$lang['create'] = 'Créer';
$lang['created_lock'] = 'Already created';
$lang['created'] = 'Created';
$lang['date'] = 'Date';
@@ -147,7 +147,7 @@
$lang['thumbs_files'] = 'Mode vignettes';
$lang['title_copy'] = 'Copy of %1$s';
$lang['tree_root'] = 'Root';
$lang['update'] = 'Update';
$lang['update'] = 'Modifier';
$lang['updated_lock'] = 'Already updated';
$lang['updated'] = 'Updated';
$lang['upload'] = 'Upload';
@@ -94,7 +94,7 @@
$lang['itm_rel_parent'] = 'Parent';
$lang['itm_rel_title'] = 'Title';
$lang['itm_summary'] = 'Summary';
$lang['itm_title'] = 'Item title';
$lang['itm_title'] = 'Titre item';
$lang['itm_titlehead'] = 'Titre en-tête';
$lang['itm_titleheadfull'] = 'Titre en-tête complet';
$lang['itm_version'] = 'Version';
@@ -9,7 +9,7 @@ function get_all_layouts($flt) {
return $query->row();
}
function get_pagination_layouts($flt, $num, $offset, $column) {
$query = $this->db->query('SELECT lay.lay_id, lay.lay_code, lay.lay_type, lay.lay_islocked, lay.lay_ispublished, COUNT(DISTINCT(sct.sct_id)) AS count_sections FROM '.$this->db->dbprefix('lay').' AS lay LEFT JOIN '.$this->db->dbprefix('sct').' AS sct ON sct.lay_id = lay.lay_id WHERE '.implode(' AND ', $flt).' GROUP BY lay.lay_id ORDER BY '.$this->session->userdata($column.'_col').' LIMIT '.$offset.', '.$num);
$query = $this->db->query('SELECT lay.lay_id, lay.lay_code, lay.lay_type, lay.lay_islocked, lay.lay_ispublished, COUNT(DISTINCT(zon.zon_id)) AS count_zones FROM '.$this->db->dbprefix('lay').' AS lay LEFT JOIN '.$this->db->dbprefix('zon').' AS zon ON zon.lay_id = lay.lay_id WHERE '.implode(' AND ', $flt).' GROUP BY lay.lay_id ORDER BY '.$this->session->userdata($column.'_col').' LIMIT '.$offset.', '.$num);
return $query->result();
}
function get_layout($lay_id) {
@@ -35,7 +35,7 @@
<?php display_column(ci_url().$this->itm->itm_code, 'layouts', $columns[0], $this->lang->line('lay_id')); ?>
<?php display_column(ci_url().$this->itm->itm_code, 'layouts', $columns[1], $this->lang->line('lay_code')); ?>
<?php display_column(ci_url().$this->itm->itm_code, 'layouts', $columns[2], $this->lang->line('lay_type')); ?>
<?php display_column(ci_url().$this->itm->itm_code, 'layouts', $columns[3], $this->lang->line('sections')); ?>
<?php display_column(ci_url().$this->itm->itm_code, 'layouts', $columns[3], $this->lang->line('zones')); ?>
<th>&nbsp;</th>
</tr>
</thead>
@@ -46,10 +46,10 @@
<td><a href="<?php echo ci_url(); ?><?php echo $this->itm->itm_code; ?>/_read/<?php echo $result->lay_id;?>"><?php echo $result->lay_id;?></a></td>
<td><?php echo $result->lay_code; ?></td>
<td><?php echo $result->lay_type; ?></td>
<td><?php echo $result->count_sections; ?></td>
<td><?php echo $result->count_zones; ?></td>
<th>
<a href="<?php echo ci_url(); ?><?php echo $this->itm->itm_code; ?>/_update/<?php echo $result->lay_id;?>"><?php echo $this->lang->line('update'); ?></a>
<?php if($result->count_sections == 0 && $result->lay_islocked == 0) { ?><a href="<?php echo ci_url(); ?><?php echo $this->itm->itm_code; ?>/_delete/<?php echo $result->lay_id;?>"><?php echo $this->lang->line('delete'); ?></a><?php } ?>
<?php if($result->lay_islocked == 0) { ?><a href="<?php echo ci_url(); ?><?php echo $this->itm->itm_code; ?>/_delete/<?php echo $result->lay_id;?>"><?php echo $this->lang->line('delete'); ?></a><?php } ?>
</th>
</tr>
<?php } ?>
@@ -34,8 +34,7 @@ INSERT INTO `cmp` (`cmp_id`, `lay_id`, `cmp_code`, `cmp_ispage`, `cmp_isexcludep
(1078, NULL, 'axipi_core/medias', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1084, NULL, 'axipi_core/lostpassword', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1085, NULL, 'axipi_core/goodies', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1131, NULL, 'axipi_dynamic/watchdog', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1132, NULL, 'axipi_dynamic/connections_users', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1131, NULL, 'axipi_dynamic/watchdog', 1, 0, 0, 0, 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
--
@@ -76,8 +75,7 @@ INSERT INTO `grp_itm` (`grp_id`, `itm_id`, `grp_itm_createdby`, `grp_itm_datecre
(1000, 1070, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1000, 1071, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1000, 1072, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1000, 1080, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1000, 1081, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1000, 1080, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
--
-- Dumping data for table `grp_per`
@@ -91,10 +89,7 @@ INSERT INTO `grp_itm` (`grp_id`, `itm_id`, `grp_itm_createdby`, `grp_itm_datecre
INSERT INTO `grp_trl` (`grp_id`, `lng_id`, `grp_trl_title`, `grp_trl_createdby`, `grp_trl_datecreated`, `grp_trl_modifiedby`, `grp_trl_datemodified`) VALUES
(1000, 1000, 'axipi', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1001, 1000, 'Guest', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1002, 1000, 'Connected', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1002, 1001, 'Connecté', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1000, 1001, 'axipi', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1001, 1001, 'Invité', NULL, '2012-01-01 00:00:00', NULL, NULL);
(1002, 1000, 'Connected', NULL, '2012-01-01 00:00:00', NULL, NULL);
--
-- Dumping data for table `grp_usr`
@@ -148,8 +143,7 @@ INSERT INTO `itm` (`itm_id`, `cmp_id`, `lay_id`, `lng_id`, `sct_id`, `itm_code`,
(1073, 1020, NULL, 1000, 1000, 'error404', NULL, NULL, 'Error 404', NULL, 0, NULL, NULL, NULL, NULL, 1, 'all', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1074, 1019, NULL, 1000, 1000, 'error403', NULL, NULL, 'Error 403', NULL, 0, NULL, NULL, NULL, NULL, 1, 'all', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1076, 1084, NULL, 1000, 1000, 'axipi/lostpassword', NULL, NULL, 'Forgot password', NULL, 0, NULL, NULL, NULL, NULL, 1, 'guest', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1080, 1131, NULL, 1000, 1000, 'axipi/dynamic/watchdog', NULL, 1065, 'Watchdog', NULL, 0, NULL, NULL, NULL, NULL, 1, 'groups', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1081, 1132, NULL, 1000, 1000, 'axipi/dynamic/users/connections', NULL, 1015, 'Connections', NULL, 0, NULL, NULL, NULL, NULL, 1, 'groups', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1080, 1131, NULL, 1000, 1000, 'axipi/dynamic/watchdog', NULL, 1065, 'Watchdog', NULL, 0, NULL, NULL, NULL, NULL, 1, 'groups', 0, '2012-01-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
--
-- Dumping data for table `itm_rel`
@@ -183,9 +177,7 @@ INSERT INTO `itm_rel` (`itm_id`, `rel_id`, `itm_rel_parent`, `itm_rel_title`, `i
(1072, 1028, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1),
(1076, 1005, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1),
(1002, 1009, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1),
(1080, 1009, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1),
(1081, 1009, 1015, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1);
(1080, 1009, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1);
--
-- Dumping data for table `itm_zon`
@@ -204,16 +196,14 @@ INSERT INTO `itm_zon` (`itm_id`, `zon_id`, `itm_zon_ordering`, `itm_zon_createdb
--
INSERT INTO `lay` (`lay_id`, `lay_code`, `lay_type`, `lay_createdby`, `lay_datecreated`, `lay_modifiedby`, `lay_datemodified`, `lay_ispublished`, `lay_islocked`) VALUES
(1000, 'axipi', 'text/html', NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1001, 'site', 'text/html', NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1000, 'axipi', 'text/html', NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1);
--
-- Dumping data for table `lng`
--
INSERT INTO `lng` (`lng_id`, `lay_id`, `lng_code`, `lng_title`, `lng_defaultitem`, `lng_createdby`, `lng_datecreated`, `lng_modifiedby`, `lng_datemodified`, `lng_ispublished`, `lng_islocked`) VALUES
(1000, NULL, 'en', 'English', 1000, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1001, NULL, 'fr', 'Français', 0, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1000, NULL, 'en', 'English', 1000, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1);
--
-- Dumping data for table `per`
@@ -230,17 +220,14 @@ INSERT INTO `lng` (`lng_id`, `lay_id`, `lng_code`, `lng_title`, `lng_defaultitem
--
INSERT INTO `sct` (`sct_id`, `lay_id`, `sct_code`, `sct_virtualcode`, `sct_createdby`, `sct_datecreated`, `sct_modifiedby`, `sct_datemodified`, `sct_ispublished`, `sct_islocked`) VALUES
(1000, 1000, 'axipi', NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1001, 1001, 'site', NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1000, 1000, 'axipi', NULL, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1);
--
-- Dumping data for table `sct_trl`
--
INSERT INTO `sct_trl` (`lng_id`, `sct_id`, `sct_trl_title`, `sct_trl_description`, `sct_trl_keywords`, `sct_trl_createdby`, `sct_trl_datecreated`, `sct_trl_modifiedby`, `sct_trl_datemodified`) VALUES
(1000, 1000, 'axipi', NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL),
(1000, 1001, 'Site', '', '', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1001, 1000, 'axipi', NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL);
(1000, 1000, 'axipi', NULL, NULL, NULL, '2012-01-01 00:00:00', NULL, NULL);
--
-- Dumping data for table `trl_zon`
@@ -258,9 +245,7 @@ INSERT INTO `trl_zon` (`zon_id`, `lng_id`, `trl_zon_title`, `trl_zon_createdby`,
(1010, 1000, 'Page sidebar', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1011, 1000, 'Content footer', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1012, 1000, 'Content header', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1013, 1000, 'Content sidebar', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1001, 1001, 'Entête page', NULL, '2012-01-01 00:00:00', NULL, NULL),
(1000, 1001, 'Page sidebar', NULL, '2012-01-01 00:00:00', NULL, NULL);
(1013, 1000, 'Content sidebar', NULL, '2012-01-01 00:00:00', NULL, NULL);
--
-- Dumping data for table `usr`
@@ -284,10 +269,4 @@ INSERT INTO `zon` (`zon_id`, `lay_id`, `zon_code`, `zon_ordering`, `zon_createdb
(1002, 1000, 'contentheader', 4, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1003, 1000, 'contentfooter', 6, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1006, 1000, 'pagefooter', 3, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1007, 1000, 'contentsidebar', 5, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1),
(1008, 1001, 'pageheader', 1, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1009, 1001, 'pagefooter', 3, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1010, 1001, 'pagesidebar', 2, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1011, 1001, 'contentfooter', 6, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1012, 1001, 'contentheader', 4, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0),
(1013, 1001, 'contentsidebar', 5, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 0);
(1007, 1000, 'contentsidebar', 5, NULL, '2012-01-01 00:00:00', NULL, NULL, 1, 1);
@@ -332,11 +332,12 @@ function &get_instance()
$page = $CFG->item('default_itm_code');
}
$query = $db->query('SELECT itm.*, cmp.cmp_code FROM '.$db->dbprefix('itm').' AS itm LEFT JOIN '.$db->dbprefix('cmp').' AS cmp ON cmp.cmp_id = itm.cmp_id WHERE itm_code = ?', array($page));
$query = $db->query('SELECT itm.*, cmp.cmp_code, lng.lng_code FROM '.$db->dbprefix('itm').' AS itm LEFT JOIN '.$db->dbprefix('cmp').' AS cmp ON cmp.cmp_id = itm.cmp_id LEFT JOIN '.$db->dbprefix('lng').' AS lng ON lng.lng_id = itm.lng_id WHERE itm_code = ?', array($page));
if($query->num_rows() == 0) {
$query = $db->query('SELECT *, cmp.cmp_code FROM '.$db->dbprefix('itm').' AS itm LEFT JOIN '.$db->dbprefix('cmp').' AS cmp ON cmp.cmp_id = itm.cmp_id WHERE cmp_code = ?', array($CFG->item('404_cmp_code')));
$query = $db->query('SELECT *, cmp.cmp_code, lng.lng_code FROM '.$db->dbprefix('itm').' AS itm LEFT JOIN '.$db->dbprefix('cmp').' AS cmp ON cmp.cmp_id = itm.cmp_id LEFT JOIN '.$db->dbprefix('lng').' AS lng ON lng.lng_id = itm.lng_id WHERE cmp_code = ?', array($CFG->item('404_cmp_code')));
}
$itm = $query->row();
$CFG->set_item('language', $itm->lng_code);
list($directory, $class) = explode('/', $itm->cmp_code);
if(file_exists(APPPATH.'controllers/'.$itm->cmp_code.EXT)) {

0 comments on commit 1226a5f

Please sign in to comment.