diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:03:07 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:03:07 +0000 |
| commit | 4a699ed3b4121cf7ba5e86e382db58c44285e8de (patch) | |
| tree | 31e17b33a6e17048dd21cdd96128e8f44305361e /admin | |
| download | rss-4a699ed3b4121cf7ba5e86e382db58c44285e8de.tar.gz rss-4a699ed3b4121cf7ba5e86e382db58c44285e8de.tar.bz2 rss-4a699ed3b4121cf7ba5e86e382db58c44285e8de.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_rss_inc.php | 67 | ||||
| -rw-r--r-- | admin/index.php | 152 | ||||
| -rw-r--r-- | admin/schema_inc.php | 55 | ||||
| -rw-r--r-- | admin/upgrade_inc.php | 31 |
4 files changed, 305 insertions, 0 deletions
diff --git a/admin/admin_rss_inc.php b/admin/admin_rss_inc.php new file mode 100644 index 0000000..fc8f4e4 --- /dev/null +++ b/admin/admin_rss_inc.php @@ -0,0 +1,67 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_rss/admin/admin_rss_inc.php,v 1.1 2005/06/19 05:03:07 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. + +foreach( array_keys( $gBitSystem->mPrefs ) as $rss_feed ) { + if( preg_match( "/^rss_/",$rss_feed ) ) { + $rss_name = preg_replace( "/rss_/","",$rss_feed ); + $formRSSFeeds[$rss_feed] = array( + 'label' => $rss_name, + 'note' => '', + ); + } +} +$smarty->assign( "formRSSFeeds",$formRSSFeeds ); + +$formRSSSettings = array( + 'rssfeed_language' => array( + 'label' => 'Language', + ), + 'rssfeed_publisher' => array( + 'label' => 'Publisher', + 'note' => 'RDF 1.0', + ), + 'rssfeed_creator' => array( + 'label' => 'Creator', + 'note' => 'RDF 1.0', + ), + 'rssfeed_editor' => array( + 'label' => 'Editor', + 'note' => 'Email address for person responsible for editorial content. For RDF 2.0', + ), + 'rssfeed_webmaster' => array( + 'label' => 'Webmaster', + 'note' => 'Email address for person responsible for technical issues relating to channel. For RDF 2.0', + ), + 'rssfeed_image_url' => array( + 'label' => 'Enter the full URL to an image that you want to associate with your RSS channels', + ), +); +$smarty->assign( "formRSSSettings",$formRSSSettings ); + +$processForm = set_tab(); + +if( $processForm ) { + + + // save package specific RSS feed settings + foreach( array_keys( $formRSSFeeds ) as $item ) { + simple_set_toggle( $item ); + simple_set_int( 'max_'.$item ); + simple_set_value( 'title_'.$item ); + simple_set_value( 'desc_'.$item ); + } + + // deal with the RSS settings + simple_set_toggle( 'rssfeed_css' ); + foreach( array_keys( $formRSSSettings ) as $item ) { + simple_set_value( $item ); + } + simple_set_value( 'rssfeed_default_version' ); +} + +?> diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..719380e --- /dev/null +++ b/admin/index.php @@ -0,0 +1,152 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_rss/admin/index.php,v 1.1 2005/06/19 05:03:07 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( RSS_PKG_PATH.'rss_lib.php' ); + +if (!isset($rsslib)) { + $rsslib = new RssLib(); +} + +if (!$gBitUser->isAdmin()) { + $smarty->assign('msg', tra("You dont have permission to use this feature")); + + $gBitSystem->display( 'error.tpl' ); + die; +} + +if (!isset($_REQUEST["rss_id"])) { + $_REQUEST["rss_id"] = 0; +} + +$smarty->assign('rss_id', $_REQUEST["rss_id"]); + +$smarty->assign('preview', 'n'); + +if (isset($_REQUEST["view"])) { + $smarty->assign('preview', 'y'); + + $data = $rsslib->get_rss_module_content($_REQUEST["view"]); + $items = $rsslib->parse_rss_data($data, $_REQUEST["rss_id"]); + + $smarty->assign_by_ref('items', $items); +} + +if ($_REQUEST["rss_id"]) { + $info = $rsslib->get_rss_module($_REQUEST["rss_id"]); +} else { + $info = array(); + + // default for new rss feed: + $info["name"] = ''; + $info["description"] = ''; + $info["url"] = ''; + $info["refresh"] = 1; + $info["show_title"] = 'n'; + $info["show_pub_date"] = 'n'; +} + +$smarty->assign('name', $info["name"]); +$smarty->assign('description', $info["description"]); +$smarty->assign('url', $info["url"]); +$smarty->assign('refresh', $info["refresh"]); +$smarty->assign('show_title', $info["show_title"]); +$smarty->assign('show_pub_date', $info["show_pub_date"]); + +if (isset($_REQUEST["remove"])) { + + $rsslib->remove_rss_module($_REQUEST["remove"]); +} + +if (isset($_REQUEST["save"])) { + + + if (isset($_REQUEST['show_title']) == 'on') { + $smarty->assign('show_title', 'y'); + $info["show_title"] = 'y'; + } + else + { + $smarty->assign('show_title', 'n'); + $info["show_title"] = 'n'; + } + if (isset($_REQUEST['show_pub_date']) == 'on') { + $smarty->assign('show_pub_date', 'y'); + $info["show_pub_date"] = 'y'; + } + else + { + $smarty->assign('show_pub_date', 'n'); + $info["show_pub_date"] = 'n'; + } + + $rsslib->replace_rss_module($_REQUEST["rss_id"], $_REQUEST["name"], $_REQUEST["description"], $_REQUEST["url"], $_REQUEST["refresh"], $info["show_title"], $info["show_pub_date"]); + + $smarty->assign('rss_id', 0); + $smarty->assign('name', ''); + $smarty->assign('description', ''); + $smarty->assign('url', ''); + $smarty->assign('refresh', 900); + $smarty->assign('show_title', 'n'); + $smarty->assign('show_pub_date', 'n'); +} + +if ( empty( $_REQUEST["sort_mode"] ) ) { + $sort_mode = 'name_desc'; +} else { + $sort_mode = $_REQUEST["sort_mode"]; +} + +if (!isset($_REQUEST["offset"])) { + $offset = 0; +} else { + $offset = $_REQUEST["offset"]; +} +if (isset($_REQUEST['page'])) { + $page = &$_REQUEST['page']; + $offset = ($page - 1) * $maxRecords; +} +$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 = $rsslib->list_rss_modules($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:rss/admin_rssmodules.tpl'); + +?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php new file mode 100644 index 0000000..c102bca --- /dev/null +++ b/admin/schema_inc.php @@ -0,0 +1,55 @@ +<?php + +$tables = array( + +'tiki_rss_modules' => " + rss_id I4 AUTO PRIMARY, + name C(30) NOTNULL, + description X, + url C(255) NOTNULL, + refresh I4, + last_updated I8, + show_title C(1) DEFAULT 'n', + show_pub_date C(1) DEFAULT 'n', + content X +", + +'tiki_rss_feeds' => " + name C(30) NOTNULL, + rss_ver C(1) NOTNULL DEFAULT '1', + refresh I4 DEFAULT '300', + last_updated I8, + cache B +" + +); + +global $gBitInstaller; + +foreach( array_keys( $tables ) AS $tableName ) { + $gBitInstaller->registerSchemaTable( RSS_PKG_DIR, $tableName, $tables[$tableName] ); +} + +$gBitInstaller->registerPackageInfo( RSS_PKG_NAME, array( + 'description' => "Resource Description Framework (RDF) Site Summary (RSS) is a lightweight multipurpose extensible metadata description and syndication format. It allows users to read healines from your site with a dedicated RSS reader.", + 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', + 'version' => '0.1', + 'state' => 'alpha', + 'dependencies' => '', +) ); + +// ### Default MenuOptions +$gBitInstaller->registerMenuOptions( RSS_PKG_NAME, array( + array(42,'o','RSS modules','tiki-admin_rssmodules.php',1100,'','bit_p_admin','') +) ); + +// ### Default Preferences +$gBitInstaller->registerPreferences( RSS_PKG_NAME, array( + array( RSS_PKG_NAME, 'rssfeed_css','y'), + array( RSS_PKG_NAME, 'rssfeed_default_version','2'), + array( RSS_PKG_NAME, 'rssfeed_language','en-us'), + array( RSS_PKG_NAME, 'rss_wiki','y'), + array( RSS_PKG_NAME, 'rss_blogs','y'), +) ); + +?> diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php new file mode 100644 index 0000000..8ad44b4 --- /dev/null +++ b/admin/upgrade_inc.php @@ -0,0 +1,31 @@ +<?php + +global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; + +$upgrades = array( + +'BONNIE' => array( + 'CLYDE' => array( +// STEP 1 +array( 'DATADICT' => array( +array( 'RENAMECOLUMN' => array( + 'tiki_rss_modules' => array( '`rssId`' => '`rss_id` I4 AUTO', + '`lastUpdated`' => '`last_updated` I8', + '`showPubDate`' => '`show_pub_date` I8', + '`showTitle`' => '`show_title` C(1)' ), + 'tiki_rss_feeds' => array( '`rssVer`' => '`rss_ver` C(1)', + '`lastUpdated`' => '`last_updated` I8'), +)), +)) + + ) +) + +); + +if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) { + $gBitSystem->registerUpgrade( RSS_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] ); +} + + +?> |
