diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 06:10:37 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 06:10:37 +0000 |
| commit | 7a60287675715612fae9e9fe3e53bb3ea94f70a1 (patch) | |
| tree | 1fd007f0f6356a9c5358ec3c22fab5b665097a09 /admin | |
| download | themes-7a60287675715612fae9e9fe3e53bb3ea94f70a1.tar.gz themes-7a60287675715612fae9e9fe3e53bb3ea94f70a1.tar.bz2 themes-7a60287675715612fae9e9fe3e53bb3ea94f70a1.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_content_templates.php | 203 | ||||
| -rw-r--r-- | admin/admin_themes_manager.php | 62 | ||||
| -rw-r--r-- | admin/index.php | 6 | ||||
| -rw-r--r-- | admin/schema_inc.php | 45 | ||||
| -rw-r--r-- | admin/upgrade_inc.php | 27 |
5 files changed, 343 insertions, 0 deletions
diff --git a/admin/admin_content_templates.php b/admin/admin_content_templates.php new file mode 100644 index 0000000..e5f5071 --- /dev/null +++ b/admin/admin_content_templates.php @@ -0,0 +1,203 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_themes/admin/Attic/admin_content_templates.php,v 1.1 2005/06/19 06:10:37 bitweaver Exp $ + +// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. +// All Rights Reserved. See copyright.txt for details and a complete list of authors. +// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. + +// Initialization +require_once( '../../bit_setup_inc.php' ); + +include_once( THEMES_PKG_PATH.'templates_lib.php' ); + +if (!$gBitUser->hasPermission( 'bit_p_edit_content_templates' )) { + $smarty->assign('msg', tra("You dont have permission to use this feature")); + + $gBitSystem->display( 'error.tpl' ); + die; +} + +if (!isset($_REQUEST["template_id"])) { + $_REQUEST["template_id"] = 0; +} + +$smarty->assign('template_id', $_REQUEST["template_id"]); + +if ($_REQUEST["template_id"]) { + $info = $gBitSystem->get_template($_REQUEST["template_id"]); + + if ($templateslib->template_is_in_section($_REQUEST["template_id"], 'html')) { + $info["section_html"] = 'y'; + } else { + $info["section_html"] = 'n'; + } + + if ($templateslib->template_is_in_section($_REQUEST["template_id"], 'wiki')) { + $info["section_wiki"] = 'y'; + } else { + $info["section_wiki"] = 'n'; + } + + if ($templateslib->template_is_in_section($_REQUEST["template_id"], 'newsletters')) { + $info["section_newsletters"] = 'y'; + } else { + $info["section_newsletters"] = 'n'; + } + + if ($templateslib->template_is_in_section($_REQUEST["template_id"], 'cms')) { + $info["section_cms"] = 'y'; + } else { + $info["section_cms"] = 'n'; + } +} else { + $info = array(); + + $info["name"] = ''; + $info["content"] = ''; + $info["section_cms"] = 'n'; + $info["section_html"] = 'n'; + $info["section_wiki"] = 'n'; + $info["section_newsletters"] = 'n'; +} + +$smarty->assign('info', $info); + +if (isset($_REQUEST["remove"])) { + + $templateslib->remove_template($_REQUEST["remove"]); +} + +if (isset($_REQUEST["removesection"])) { + + $templateslib->remove_template_from_section($_REQUEST["rtemplate_id"], $_REQUEST["removesection"]); +} + +$smarty->assign('preview', 'n'); + +if (isset($_REQUEST["preview"])) { + $smarty->assign('preview', 'y'); + + if (isset($_REQUEST["section_html"]) && $_REQUEST["section_html"] == 'on') { + $info["section_html"] = 'y'; + + $parsed = nl2br($_REQUEST["content"]); + } else { + $info["section_html"] = 'n'; + + $parsed = $gBitSystem->parseData($_REQUEST["content"]); + } + + $smarty->assign('parsed', $parsed); + + if (isset($_REQUEST["section_wiki"]) && $_REQUEST["section_wiki"] == 'on') { + $info["section_wiki"] = 'y'; + } else { + $info["section_wiki"] = 'n'; + } + + if (isset($_REQUEST["section_newsletters"]) && $_REQUEST["section_newsletters"] == 'on') { + $info["section_newsletters"] = 'y'; + } else { + $info["section_newsletters"] = 'n'; + } + + if (isset($_REQUEST["section_cms"]) && $_REQUEST["section_cms"] == 'on') { + $info["section_cms"] = 'y'; + } else { + $info["section_cms"] = 'n'; + } + + $info["content"] = $_REQUEST["content"]; + $info["name"] = $_REQUEST["name"]; + $smarty->assign('info', $info); +} + +if (isset($_REQUEST["save"])) { + + $tid = $templateslib->replace_template($_REQUEST["template_id"], $_REQUEST["name"], $_REQUEST["content"]); + + $smarty->assign("template_id", '0'); + $info["name"] = ''; + $info["content"] = ''; + $info["section_cms"] = 'n'; + $info["section_wiki"] = 'n'; + $info["section_newsletters"] = 'n'; + $info["section_html"] = 'n'; + $smarty->assign('info', $info); + + if (isset($_REQUEST["section_html"]) && $_REQUEST["section_html"] == 'on') { + $templateslib->add_template_to_section($tid, 'html'); + } else { + $templateslib->remove_template_from_section($tid, 'html'); + } + + if (isset($_REQUEST["section_wiki"]) && $_REQUEST["section_wiki"] == 'on') { + $templateslib->add_template_to_section($tid, 'wiki'); + } else { + $templateslib->remove_template_from_section($tid, 'wiki'); + } + + if (isset($_REQUEST["section_newsletters"]) && $_REQUEST["section_newsletters"] == 'on') { + $templateslib->add_template_to_section($tid, 'newsletters'); + } else { + $templateslib->remove_template_from_section($tid, 'newsletters'); + } + + if (isset($_REQUEST["section_cms"]) && $_REQUEST["section_cms"] == 'on') { + $templateslib->add_template_to_section($tid, 'cms'); + } else { + $templateslib->remove_template_from_section($tid, 'cms'); + } +} + +if ( empty( $_REQUEST["sort_mode"] ) ) { + $sort_mode = 'created_desc'; +} else { + $sort_mode = $_REQUEST["sort_mode"]; +} + +if (!isset($_REQUEST["offset"])) { + $offset = 0; +} else { + $offset = $_REQUEST["offset"]; +} + +$smarty->assign_by_ref('offset', $offset); + +if (isset($_REQUEST["find"])) { + $find = $_REQUEST["find"]; +} else { + $find = ''; +} + +$smarty->assign('find', $find); + +$smarty->assign_by_ref('sort_mode', $sort_mode); +$channels = $templateslib->list_all_templates($offset, $maxRecords, $sort_mode, $find); + +$cant_pages = ceil($channels["cant"] / $maxRecords); +$smarty->assign_by_ref('cant_pages', $cant_pages); +$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); + +if ($channels["cant"] > ($offset + $maxRecords)) { + $smarty->assign('next_offset', $offset + $maxRecords); +} else { + $smarty->assign('next_offset', -1); +} + +// If offset is > 0 then prev_offset +if ($offset > 0) { + $smarty->assign('prev_offset', $offset - $maxRecords); +} else { + $smarty->assign('prev_offset', -1); +} + +$smarty->assign_by_ref('channels', $channels["data"]); + + + +// Display the template +$gBitSystem->display( 'bitpackage:themes/admin_content_templates.tpl'); + +?> diff --git a/admin/admin_themes_manager.php b/admin/admin_themes_manager.php new file mode 100644 index 0000000..a6a7e62 --- /dev/null +++ b/admin/admin_themes_manager.php @@ -0,0 +1,62 @@ +<?php +require_once( '../../bit_setup_inc.php' ); +include_once( THEMES_PKG_PATH.'theme_control_lib.php' ); + +$gBitSystem->verifyPermission( 'bit_p_admin' ); + +require_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' ); + +// Handle Update +$processForm = set_tab(); + +if( $processForm ) { + $pref_simple_values = array( + "slide_style", + "biticon_display", + ); + + foreach ($pref_simple_values as $svitem) { + simple_set_value ($svitem); + } + + $pref_toggles = array( + "disable_jstabs", + ); + + foreach ($pref_toggles as $toggle) { + simple_set_toggle ($toggle); + } + + if( $_REQUEST["site_style"] ) { + // Set value(s) with alternate pref name + $gBitSystem->storePreference( 'style', $_REQUEST["site_style"] ); + $gPreviewStyle = $_REQUEST["site_style"]; + $gBitSystem->mStyle = $_REQUEST["site_style"]; + } + + if( isset( $_REQUEST['fRemoveTheme'] ) ) { + $tcontrollib->expunge_dir( THEMES_PKG_PATH.'styles/'.$_REQUEST['fRemoveTheme'] ); + } + + //Clear the template cache in case the theme has changed TODO: Do this ONLY when the theme changes. + //TODO: Fix module render order so that this will correctly render the modules on the 1st try too. +// $smarty->clear_all_cache(); +// $smarty->clear_compiled_tpl(); +} + +// Get list of available styles +$styles = &$tcontrollib->getStyles(); +$smarty->assign_by_ref( "styles", $styles ); +// Get list of available slideshow styles +$smarty->assign_by_ref("slide_styles", $styles); + +// set the options biticon takes +$biticon_display_options = array( + 'icon' => tra( 'icon' ), + 'text' => tra( 'text' ), + 'icon_text' => tra( 'icon and text' ) +); +$smarty->assign( "biticon_display_options", $biticon_display_options ); + +$gBitSystem->display( 'bitpackage:themes/admin_themes_manager.tpl'); +?> diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..3e305fe --- /dev/null +++ b/admin/index.php @@ -0,0 +1,6 @@ +<?php + + // This is not a package. + header ("location: ../index.php"); + +?>
\ No newline at end of file diff --git a/admin/schema_inc.php b/admin/schema_inc.php new file mode 100644 index 0000000..5c6595e --- /dev/null +++ b/admin/schema_inc.php @@ -0,0 +1,45 @@ +<?php + +global $gBitInstaller; + +$tables = array( + +'tiki_theme_control_objects' => " + obj_id C(250) PRIMARY, + type C(250) NOTNULL, + name C(250) NOTNULL, + theme C(250) NOTNULL +", + +'tiki_theme_control_categs' => " + category_id I4 PRIMARY, + theme C(250) NOTNULL +", + +'tiki_theme_control_objects' => " + obj_id C(250) PRIMARY, + type C(250) NOTNULL, + name C(250) NOTNULL, + theme C(250) NOTNULL +", + +); + +global $gBitInstaller; + +foreach( array_keys( $tables ) AS $tableName ) { + $gBitInstaller->registerSchemaTable( THEMES_PKG_DIR, $tableName, $tables[$tableName], TRUE ); +} + + +$gBitInstaller->registerPackageInfo( THEMES_PKG_NAME, array( + 'description' => "The Themes package is an integral part of bitweaver which allows you to control the look and feel of you site.", + 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', + 'version' => '0.1', + 'state' => 'beta', + 'dependencies' => '', +) ); + +$gBitInstaller->registerSchemaTable( THEMES_PKG_DIR, '', '', TRUE ); + +?> diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php new file mode 100644 index 0000000..cffb45c --- /dev/null +++ b/admin/upgrade_inc.php @@ -0,0 +1,27 @@ +<?php + +global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; + +$upgrades = array( + +'BONNIE' => array( + 'CLYDE' => array( +// STEP 1 +array( 'DATADICT' => array( +array( 'RENAMECOLUMN' => array( + 'tiki_theme_control_categs' => array( '`categId`' => '`category_id` I4' ), + 'tiki_theme_control_objects' => array( '`objId`' => '`obj_id` I4' ), + ), +), +)), + + ) +) +); + +if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) { + $gBitSystem->registerUpgrade( THEMES_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] ); +} + + +?> |
