[Comoblog-commit] modules/mod_skinselect/admin mod_skinselect.php,NONE,1.1 mod_skinselect_add.php,NO
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-02-24 00:01:35
|
Update of /cvsroot/comoblog/modules/mod_skinselect/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13177/mod_skinselect/admin Added Files: mod_skinselect.php mod_skinselect_add.php mod_skinselect_del.php mod_skinselect_edit.php Log Message: initial commit to make sure i've not missed anything transfering the code from my live site down to my cvs version basic premis is that new skins sit in css/SKINNAME/css.php of mod skin select is set to be shown then the users can change the skin via a drop down, if not then a default can be set in the admin area. these skins are imported after the rest of the css so that the content overrides and extends the existing comoblog css - i think we need to decide if skins will provide a full set of styleing or just override and extend the exising code should skin css be entered via the admin area, or uploaded (like a module) ? id prefere to upload as a module as that allows for custom images etc note need to change things like the topic icons some how --- NEW FILE: mod_skinselect.php --- <?php require_once ('../../../admin/include/admin.inc.php'); require_once ('../include/mod_skinselect.inc.php'); $skinselect_items = mod_skinselect_adminlist (); // template file $tpl = new XTemplate ('templates/mod_skinselect.tpl.htm'); $tpl->assign('MOD_NAME', 'mod_skinselect'); if ($skinselect_items) { for ($c = 0; $c < count($skinselect_items); $c++) { if ($c % 2) $tpl->assign('BGCOLOR', '#ffffff'); else $tpl->assign('BGCOLOR', '#efefef'); $tpl->assign('ITEM', $skinselect_items[$c]); $tpl->parse('main.items.item'); } $tpl->parse('main.items'); } $tpl->parse('main'); $tpl->out('main'); ?> --- NEW FILE: mod_skinselect_add.php --- <?php require_once ('../../../admin/include/admin.inc.php'); require_once ('../include/mod_skinselect.inc.php'); if (strtoupper($_SERVER['REQUEST_METHOD'] == 'POST')) { $errors = array(); foreach($_POST as $k => $v) $_POST[$k] = trim($v); if ($_POST['skinselect_title'] == '') $errors[] = 'You must provide a title for the skin'; if ($_POST['skinselect_nav_text'] == '') $errors[] = 'You must provide Navigation Text for the skin'; if ($_POST['skinselect_nav_link'] == '') $errors[] = 'You must provide Navigation Link Code for the skin'; if (count($errors)) { foreach ($errors as $k => $v) $err_msg .= '- ' . $v . '<br />'; error_page ('Errors:<br />'.$err_msg, 'javascript:history.go(-1);'); } else { $item = mod_skinselect_add($_POST); echo '<html><head></head><body><script language="javascript">opener.location.reload();this.close();</script></body></html>'; exit(); } } $tpl = new XTemplate('templates/mod_skinselect_add.tpl.htm'); $tpl->assign('ACTION', basename($_SERVER['PHP_SELF'])); $tpl->parse('main'); $tpl->out('main'); ?> --- NEW FILE: mod_skinselect_del.php --- <?php require_once ('../../../admin/include/admin.inc.php'); require_once ('../include/mod_skinselect.inc.php'); $item_id = ''; if (isset($_GET['i'])) $item_id = $_GET['i']; mod_skinselect_del ($item_id); Header ('Location: mod_skinselect.php'); exit(); ?> --- NEW FILE: mod_skinselect_edit.php --- <?php require_once ('../../../admin/include/admin.inc.php'); require_once ('../include/mod_skinselect.inc.php'); if (strtoupper($_SERVER['REQUEST_METHOD'] == 'POST')) { $errors = array(); if ($_POST['skinselect_title'] == '') $errors[] = 'You must provide a title for the skin'; if ($_POST['skinselect_nav_text'] == '') $errors[] = 'You must provide Navigation Text for the skin'; if ($_POST['skinselect_nav_link'] == '') $errors[] = 'You must provide Navigation Link Code for the skin'; if (count($errors)) { foreach ($errors as $k => $v) $err_msg .= '- ' . $v . '<br />'; error_page ('Errors:<br />'.$err_msg, 'javascript:history.go(-1);'); } else { $item = mod_skinselect_edit($_POST); echo '<html><head></head><body><script language="javascript">opener.location.reload();this.close();</script></body></html>'; exit(); } } else { $item_id = ''; if (isset($_GET['i'])) $item_id = $_GET['i']; $item = mod_skinselect_details($item_id); $tpl = new XTemplate('templates/mod_skinselect_edit.tpl.htm'); $tpl->assign('ITEM', $item); $tpl->assign('ACTION', basename($_SERVER['PHP_SELF'])); $tpl->parse('main'); $tpl->out('main'); } ?> |