Files
dlist/templates/simple/render.exec.php
jim 0aefa36e2a added view request variable for GET or POST requests to set view in Simple template...
Icon View values: "icon", "icons", or "1".
Details View values: "detail", "details", or "2".

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@29 a5845835-ea0f-0410-a762-dd0bfe9bfde8
2006-10-13 21:49:30 +00:00

72 lines
1.8 KiB
PHP

<?php die();
/*
Exec: render
Copyright © 2006 Jim Myhrberg.
zynode@gmail.com
----------
This program is free software; you can redistributeit and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA
----------
*/
//_HEAD;
/* --- Configuration ---
Name: render
Priority: 40
Author: Jim Myhrberg
*/
//_SCRIPT;
//==========================
//>STAGE> init
//==========================
//>After> core.define_constants
$config->parse(TPL_PATH.'settings.php', true, 'tpl_');
//==========================
//>STAGE> render
//==========================
//>Section> set_view_mode_from_url
if ( !empty($_REQUEST['view']) ) {
if ( preg_match("/icon|icons|1/i", $_REQUEST['view']) ) {
$_COOKIE['dList_simple_viewMode'] = 'icons';
} elseif ( preg_match("/detail|details|2/i", $_REQUEST['view']) ) {
$_COOKIE['dList_simple_viewMode'] = 'details';
}
}
//>Section> set_view_mode
if ( !empty($_COOKIE['dList_simple_viewMode']) && !empty($config->tpl_modes[$_COOKIE['dList_simple_viewMode']]) ) {
$config->tpl_mode = $config->tpl_modes[$_COOKIE['dList_simple_viewMode']];
} else {
$config->tpl_mode = $config->tpl_modes[$config->tpl_mode];
}
//>Section> include_phtml
include(TPL_PATH.'index.phtml');
//_END;
?>