|
From: <txm...@us...> - 2012-07-09 11:54:05
|
Revision: 9812
http://xoops.svn.sourceforge.net/xoops/?rev=9812&view=rev
Author: txmodxoops
Date: 2012-07-09 11:53:56 +0000 (Mon, 09 Jul 2012)
Log Message:
-----------
Added external rss urlUpdated
Added more files
Added plugins folder with files
Modified Paths:
--------------
XoopsModules/feeds/trunk/feeds/admin/about.php
XoopsModules/feeds/trunk/feeds/admin/admin_footer.php
XoopsModules/feeds/trunk/feeds/admin/admin_header.php
XoopsModules/feeds/trunk/feeds/admin/feeds.php
XoopsModules/feeds/trunk/feeds/admin/index.php
XoopsModules/feeds/trunk/feeds/admin/menu.php
XoopsModules/feeds/trunk/feeds/admin/plugins.php
XoopsModules/feeds/trunk/feeds/class/feeds_feeds.php
XoopsModules/feeds/trunk/feeds/class/feeds_plugins.php
XoopsModules/feeds/trunk/feeds/css/style.css
XoopsModules/feeds/trunk/feeds/docs/changelog.txt
XoopsModules/feeds/trunk/feeds/docs/install.txt
XoopsModules/feeds/trunk/feeds/docs/lang_diff.txt
XoopsModules/feeds/trunk/feeds/docs/licence.txt
XoopsModules/feeds/trunk/feeds/docs/readme.txt
XoopsModules/feeds/trunk/feeds/header.php
XoopsModules/feeds/trunk/feeds/images/feeds_slogo.png
XoopsModules/feeds/trunk/feeds/include/config.php
XoopsModules/feeds/trunk/feeds/include/functions.php
XoopsModules/feeds/trunk/feeds/include/install.php
XoopsModules/feeds/trunk/feeds/include/search.inc.php
XoopsModules/feeds/trunk/feeds/index.php
XoopsModules/feeds/trunk/feeds/language/english/admin.php
XoopsModules/feeds/trunk/feeds/language/english/blocks.php
XoopsModules/feeds/trunk/feeds/language/english/help/help.html
XoopsModules/feeds/trunk/feeds/language/english/main.php
XoopsModules/feeds/trunk/feeds/language/english/modinfo.php
XoopsModules/feeds/trunk/feeds/language/italian/admin.php
XoopsModules/feeds/trunk/feeds/language/italian/blocks.php
XoopsModules/feeds/trunk/feeds/language/italian/help/help.html
XoopsModules/feeds/trunk/feeds/language/italian/main.php
XoopsModules/feeds/trunk/feeds/language/italian/modinfo.php
XoopsModules/feeds/trunk/feeds/sql/mysql.sql
XoopsModules/feeds/trunk/feeds/templates/feeds_footer.html
XoopsModules/feeds/trunk/feeds/templates/feeds_header.html
XoopsModules/feeds/trunk/feeds/templates/feeds_index.html
XoopsModules/feeds/trunk/feeds/xoops_version.php
Added Paths:
-----------
XoopsModules/feeds/trunk/feeds/images/rss_rect.png
XoopsModules/feeds/trunk/feeds/images/subscribe_rss.png
XoopsModules/feeds/trunk/feeds/images/txmodxoops_logo.png
XoopsModules/feeds/trunk/feeds/include/notification.inc.php
XoopsModules/feeds/trunk/feeds/plugins/
XoopsModules/feeds/trunk/feeds/plugins/PDdownloads.php
XoopsModules/feeds/trunk/feeds/plugins/PDlinks.php
XoopsModules/feeds/trunk/feeds/plugins/Publisher.php
XoopsModules/feeds/trunk/feeds/plugins/TDMDownloads.php
XoopsModules/feeds/trunk/feeds/plugins/ams.php
XoopsModules/feeds/trunk/feeds/plugins/ams_articles.php
XoopsModules/feeds/trunk/feeds/plugins/index.html
XoopsModules/feeds/trunk/feeds/plugins/mylinks.php
XoopsModules/feeds/trunk/feeds/plugins/mylinks_links.php
XoopsModules/feeds/trunk/feeds/plugins/news.php
XoopsModules/feeds/trunk/feeds/plugins/news_stories.php
XoopsModules/feeds/trunk/feeds/plugins/publisher_items.php
XoopsModules/feeds/trunk/feeds/plugins/smartpartner.php
XoopsModules/feeds/trunk/feeds/plugins/smartsection.php
XoopsModules/feeds/trunk/feeds/plugins/stories.php
XoopsModules/feeds/trunk/feeds/plugins/tdmdownloads_downloads.php
XoopsModules/feeds/trunk/feeds/plugins/tutorials.php
XoopsModules/feeds/trunk/feeds/plugins/xdirectory.php
XoopsModules/feeds/trunk/feeds/plugins/xnews.php
XoopsModules/feeds/trunk/feeds/plugins/xnews_stories.php
Modified: XoopsModules/feeds/trunk/feeds/admin/about.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/about.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/about.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,34 +1,31 @@
<?php
/**
* ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * - Original Copyright (TDM)
+ * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
+ * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org)
* ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
+ * FEEDS - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * TXMod Xoops (http://www.txmodxoops.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
*
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
+ * ------------------------------------------------------------------------
*
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
+ * @copyright TXMod Xoops (http://www.txmodxoops.org)
+ * @license GPL see LICENSE
+ * @package feeds
+ * @author TXMod Xoops (in...@tx...)
+ *
+ * Version : 1.01 Sat 2012/02/25 20:23:53 : Timgno Exp $
* ****************************************************************************
*/
-
include "admin_header.php";
-xoops_cp_header();
-$aboutAdmin = new ModuleAdmin();
-echo $aboutAdmin->addNavigation("about.php");
-echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false);
+echo $adminMenu->addNavigation("about.php");
+echo $adminMenu->renderabout('AZDZXXD6HNFWA', false);
include "admin_footer.php";
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/admin/admin_footer.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/admin_footer.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/admin_footer.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,35 +1,32 @@
<?php
/**
* ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * - Original Copyright (TDM)
+ * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
+ * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org)
* ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
+ * FEEDS - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * TXMod Xoops (http://www.txmodxoops.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
*
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
+ * ------------------------------------------------------------------------
*
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
+ * @copyright TXMod Xoops (http://www.txmodxoops.org)
+ * @license GPL see LICENSE
+ * @package feeds
+ * @author TXMod Xoops (in...@tx...)
+ *
+ * Version : 1.01 Sun 2012/02/26 0:02:53 : Timgno Exp $
* ****************************************************************************
- */
-
-global $pathImageAdmin;
+ */
echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
- <img src='".$pathImageAdmin."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
-echo "<div class='center small italic pad5'>
- <strong>" . $xoopsModule->getVar('name') . "</strong> "._AM_FEEDS_MAINTAINEDBY."
- <a href='http://www.txmodxoops.org/modules/newbb' title='Visit TXMod Xoops Community' class='tooltip' rel='external'>TXMod Xoops Community</a></div>";
-xoops_cp_footer();
+ <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
+echo "<div class='center small italic pad5'>"._AM_MODULEADMIN_ADMIN_FOOTER."
+ <a href='http://www.txmodxoops.org/modules/newbb/' title='Visit TXMod Xoops Community' class='tooltip' rel='external'>TXMod Xoops Community</a></div>";
+xoops_cp_footer();
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/admin/admin_header.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/admin_header.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/admin_header.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,87 +1,61 @@
<?php
/**
* ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * - Original Copyright (TDM)
+ * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
+ * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org)
* ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
+ * FEEDS - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * TXMod Xoops (http://www.txmodxoops.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
*
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
+ * ------------------------------------------------------------------------
*
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
+ * @copyright TXMod Xoops (http://www.txmodxoops.org)
+ * @license GPL see LICENSE
+ * @package feeds
+ * @author TXMod Xoops (in...@tx...)
+ *
+ * Version : 1.01 Sun 2012/02/26 0:02:53 : Timgno Exp $
* ****************************************************************************
- */
-
+ */
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
-include_once XOOPS_ROOT_PATH . '/include/cp_functions.php';
+include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
include_once '../include/config.php';
include_once '../include/functions.php';
-$pathDir = $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin');
-$globlang = $GLOBALS['xoopsConfig']['language'];
-
-if ( file_exists($pathDir.'/language/'.$globlang.'/main.php')){
- include_once $pathDir.'/language/'.$globlang.'/main.php';
-} else {
- include_once $pathDir.'/language/english/main.php';
-}
-
-if ( file_exists($pathDir.'/moduleadmin.php')){
- include_once $pathDir.'/moduleadmin.php';
- //return true;
-}else{
- xoops_cp_header();
- echo xoops_error(_AM_FEEDS_NOFRAMEWORKS);
- xoops_cp_footer();
- //return false;
-}
-
$dirname = basename(dirname(dirname( __FILE__ ) ));
-$module_handler =& xoops_gethandler('module');
-$xoopsModule = & $module_handler->getByDirname($dirname);
-$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
-$pathImageIcon = XOOPS_URL .'/'. $moduleInfo->getInfo('icons16');
-$pathImageAdmin = XOOPS_URL .'/'. $moduleInfo->getInfo('icons32');
+$pathIcon16 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons16');
+$pathIcon32 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
$feedsHandler=& xoops_getModuleHandler('feeds_feeds', $dirname);
$pluginsHandler=& xoops_getModuleHandler('feeds_plugins', $dirname);
+
$myts =& MyTextSanitizer::getInstance();
-if ($xoopsUser) {
- $moduleperm_handler =& xoops_gethandler('groupperm');
- if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups())) {
- redirect_header(XOOPS_URL, 1, _NOPERM);
- exit();
- }
-} else {
- redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM);
- exit();
-}
-
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
$xoopsTpl = new XoopsTpl();
}
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
+$xoopsTpl->assign('pathIcon32', $pathIcon32);
+//Load languages
+xoops_loadLanguage('admin', $dirname);
+xoops_loadLanguage('modinfo', $dirname);
-$xoopsTpl->assign('pathImageIcon', $pathImageIcon);
-$xoopsTpl->assign('pathImageAdmin', $pathImageAdmin);
-//xoops_cp_header();
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
-//Load languages
-xoops_loadLanguage('admin', $xoopsModule->getVar("dirname"));
-xoops_loadLanguage('modinfo', $xoopsModule->getVar("dirname"));
-xoops_loadLanguage('main', $xoopsModule->getVar("dirname"));
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/admin/feeds.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/feeds.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/feeds.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -26,24 +26,21 @@
* ****************************************************************************
*/
include "admin_header.php";
-xoops_cp_header();
-global $pathImageIcon;
// We recovered the value of the argument op in the URL$
$op = feeds_CleanVars($_REQUEST, 'op', 'list', 'string');
-$feedsAdmin = new ModuleAdmin();
switch ($op)
{
case "list":
default:
- echo $feedsAdmin->addNavigation('feeds.php');
- $feedsAdmin->addItemButton(_AM_FEEDS_NEWFEEDS, 'feeds.php?op=new_feeds', 'add');
- echo $feedsAdmin->renderButton();
+ echo $adminMenu->addNavigation('feeds.php');
+ $adminMenu->addItemButton(_AM_FEEDS_NEWFEED, 'feeds.php?op=new_feed', 'add');
+ echo $adminMenu->renderButton();
$limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
$plugins_arr = $pluginsHandler->getall();
$numrowsplugins = count($plugins_arr);
// Redirection if there are no plugins
if ($numrowsplugins==0) {
- redirect_header('plugins.php?op=new_plugins', 2, _AM_FEEDS_REDIRECT_NOPLUGINS);
+ redirect_header('plugins.php?op=new_plugin', 2, _AM_FEEDS_REDIRECT_NOPLUGINS);
}
$criteria = new CriteriaCompo();
$criteria->setSort("feed_weight ASC, feed_name");
@@ -87,7 +84,7 @@
echo "<td class='center'>".$feeds_arr[$i]->getVar("feed_version")."</td>";
$key = $feeds_arr[$i]->getVar('feed_pid');
if (array_key_exists($key, $plugins_arr)){
- $plugin_name = $plugins_arr[$key]->getVar('plugin_name');
+ $plugin_name = $plugins_arr[$key]->getVar('plugin_modulename');
}
echo "<td class='center'>".$plugin_name."</td>";
echo "<td class='center'><img src='".XOOPS_UPLOAD_URL."/feeds/images/".$feeds_arr[$i]->getVar("feed_img")."' height='30px' title='feed_img' alt='feed_img'></td>";
@@ -98,13 +95,13 @@
$online = $feeds_arr[$i]->getVar("feed_online");
if( $online == 1 ) {
- echo "<td class='center'><a href='feeds.php?op=update_online_feeds&feed_id=".$i."&feeds_online=0'><img src=".$pathImageIcon."/on.png border='0' alt='"._AM_FEEDS_ON."' title='"._AM_FEEDS_ON."'></a></td>";
+ echo "<td class='center'><a href='feeds.php?op=update_online_feed&feed_id=".$i."&feed_online=0'><img src=".$pathIcon16."/on.png border='0' alt='"._AM_FEEDS_ON."' title='"._AM_FEEDS_ON."'></a></td>";
} else {
- echo "<td class='center'><a href='feeds.php?op=update_online_feeds&feed_id=".$i."&feeds_online=1'><img src=".$pathImageIcon."/off.png border='0' alt='"._AM_FEEDS_OFF."' title='"._AM_FEEDS_OFF."'></a></td>";
+ echo "<td class='center'><a href='feeds.php?op=update_online_feed&feed_id=".$i."&feed_online=1'><img src=".$pathIcon16."/off.png border='0' alt='"._AM_FEEDS_OFF."' title='"._AM_FEEDS_OFF."'></a></td>";
}
echo "<td class='center width5'>
- <a href='feeds.php?op=edit_feeds&feed_id=".$i."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
- <a href='feeds.php?op=delete_feeds&feed_id=".$i."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
+ <a href='feeds.php?op=edit_feed&feed_id=".$i."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='feeds.php?op=delete_feed&feed_id=".$i."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>";
echo "</tr>";
}
@@ -129,17 +126,17 @@
}
break;
- case "new_feeds":
- echo $feedsAdmin->addNavigation("feeds.php");
- $feedsAdmin->addItemButton(_AM_FEEDS_FEEDSLIST, 'feeds.php?op=list', 'list');
- echo $feedsAdmin->renderButton();
+ case "new_feed":
+ echo $adminMenu->addNavigation("feeds.php");
+ $adminMenu->addItemButton(_AM_FEEDS_FEEDSLIST, 'feeds.php?op=list', 'list');
+ echo $adminMenu->renderButton();
$obj =& $feedsHandler->create();
$form = $obj->getForm();
$form->display();
break;
- case "save_feeds":
+ case "save_feed":
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
redirect_header("feeds.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
@@ -156,7 +153,7 @@
include_once XOOPS_ROOT_PATH."/class/uploader.php";
$uploaddir = XOOPS_UPLOAD_PATH."/feeds/images/";
$uploader = new XoopsMediaUploader($uploaddir, $GLOBALS["xoopsModuleConfig"]["mimetypes"],
- $GLOBALS["xoopsModuleConfig"]["maxsize"], null, null);
+ $GLOBALS["xoopsModuleConfig"]["maxsize"], null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$uploader->setPrefix("feed_img_") ;
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
@@ -169,9 +166,10 @@
} else {
$obj->setVar("feed_img", $_POST["feed_img"]);
}
- $verif_feed_online = ($_REQUEST["feed_online"] == 1) ? "1" : "0";
+
//Form feeds Vars
- $obj->setVars(array("feed_submitter"=>$_POST["feed_submitter"],"feed_created"=>feeds_convertDate($_POST["feed_created"]),"feed_published"=>feeds_convertDate($_POST["feed_published"]),"feed_weight"=> $_POST["feed_weight"],"feed_online"=>$verif_feed_online));
+ $obj->setVars(array("feed_rssurl"=>$_POST["feed_rssurl"],"feed_submitter"=>$_POST["feed_submitter"],"feed_created"=>feeds_convertDate($_POST["feed_created"]),"feed_published"=>feeds_convertDate($_POST["feed_published"]),"feed_weight"=> $_POST["feed_weight"],
+ "feed_online"=>($_REQUEST["feed_online"] == 1) ? "1" : "0"));
if ($feedsHandler->insert($obj)) {
redirect_header("feeds.php?op=list", 2, _AM_FEEDS_FORMOK);
@@ -182,17 +180,17 @@
$form->display();
break;
- case "edit_feeds":
- echo $feedsAdmin->addNavigation("feeds.php");
- $feedsAdmin->addItemButton(_AM_FEEDS_NEWFEEDS, 'feeds.php?op=new_feeds', 'add');
- $feedsAdmin->addItemButton(_AM_FEEDS_FEEDSLIST, 'feeds.php?op=list', 'list');
- echo $feedsAdmin->renderButton();
+ case "edit_feed":
+ echo $adminMenu->addNavigation("feeds.php");
+ $adminMenu->addItemButton(_AM_FEEDS_NEWFEED, 'feeds.php?op=new_feed', 'add');
+ $adminMenu->addItemButton(_AM_FEEDS_FEEDSLIST, 'feeds.php?op=list', 'list');
+ echo $adminMenu->renderButton();
$obj = $feedsHandler->get($_REQUEST["feed_id"]);
$form = $obj->getForm();
$form->display();
break;
- case "delete_feeds":
+ case "delete_feed":
$obj =& $feedsHandler->get($_REQUEST["feed_id"]);
if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) {
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
@@ -204,11 +202,11 @@
echo $obj->getHtmlErrors();
}
} else {
- xoops_confirm(array("ok" => 1, "feed_id" => $_REQUEST["feed_id"], "op" => "delete_feeds"), $_SERVER["REQUEST_URI"], sprintf(_AM_FEEDS_FORMSUREDEL, $obj->getVar("feed_name")));
+ xoops_confirm(array("ok" => 1, "feed_id" => $_REQUEST["feed_id"], "op" => "delete_feed"), $_SERVER["REQUEST_URI"], sprintf(_AM_FEEDS_FORMSUREDEL, $obj->getVar("feed_name")));
}
break;
- case "update_online_feeds":
+ case "update_online_feed":
if (isset($_REQUEST["feed_id"])) {
$obj =& $feedsHandler->get($_REQUEST["feed_id"]);
}
Modified: XoopsModules/feeds/trunk/feeds/admin/index.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/index.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/index.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,68 +1,50 @@
<?php
/**
* ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * - Original Copyright (TDM)
+ * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
+ * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org)
* ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
+ * FEEDS - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * TXMod Xoops (http://www.txmodxoops.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
*
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
+ * ------------------------------------------------------------------------
*
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
+ * @copyright TXMod Xoops (http://www.txmodxoops.org)
+ * @license GPL see LICENSE
+ * @package feeds
+ * @author TXMod Xoops (in...@tx...)
+ *
+ * Version : 1.01 Sat 2012/02/25 20:23:53 : Timgno Exp $
* ****************************************************************************
*/
-
include "admin_header.php";
-xoops_cp_header();
- $indexAdmin = new ModuleAdmin();
- //count "total"
- $count_feeds = $feedsHandler->getCount();
+ //count "total" feeds
+ $count_feed = $feedsHandler->getCount();
+ //count "total" plugins
+ $count_plugin = $pluginsHandler->getCount();
//count "online"
$criteria = new CriteriaCompo();
$criteria->add(new Criteria("feed_online", 1));
$feeds_online = $feedsHandler->getCount($criteria);
- $criteria->add(new Criteria("feed_pending", 1));
- $feeds_pending = $feedsHandler->getCount($criteria);
- unset($criteria);
- //count "total"
- $count_plugins = $pluginsHandler->getCount();
- //count "online"
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("plugin_online", 1));
- $plugins_online = $pluginsHandler->getCount($criteria);
- $criteria->add(new Criteria("plugin_pending", 1));
- $plugins_pending = $pluginsHandler->getCount($criteria);
- unset($criteria);
-
- $r = '#FF0000'; // Red
- $g = '#00AA00'; // Green
-
- $indexAdmin->addInfoBox(_AM_FEEDS_FEEDS);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_FEEDS,_AM_FEEDS_THEREARE_FEEDS, $count_feeds, ($count_feeds == 0) ? $r : $g);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_FEEDS,_AM_FEEDS_THEREARE_FEEDS_ONLINE, $feeds_online, ($count_feeds == 0) ? $r : $g);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_FEEDS,_AM_FEEDS_THEREARE_FEEDS_PENDING, $feeds_pending, ($count_feeds == 0) ? $r : $g);
+ $color_feeds = ($count_feed == 0) ? 'red' : 'green';
+ $color_feeds_online = ($feeds_online == 0) ? 'red' : 'green';
+ $color_plugins = ($count_plugin == 0) ? 'red' : 'green';
+
+ $adminMenu->addInfoBox(_AM_FEEDS_STATISTICS);
+ $adminMenu->addInfoBoxLine(_AM_FEEDS_STATISTICS,_AM_FEEDS_THEREARE_FEEDS, $count_feed, $color_feeds);
+ $adminMenu->addInfoBoxLine(_AM_FEEDS_STATISTICS,_AM_FEEDS_THEREARE_FEEDS_ONLINE, $feeds_online, $color_feeds_online);
+ $adminMenu->addInfoBoxLine(_AM_FEEDS_STATISTICS,_AM_FEEDS_THEREARE_PLUGINS, $count_plugin, $color_plugins);
- $indexAdmin->addInfoBox(_AM_FEEDS_PLUGINS);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_PLUGINS,_AM_FEEDS_THEREARE_PLUGINS, $count_plugins, ($count_plugins == 0) ? $r : $g);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_PLUGINS,_AM_FEEDS_THEREARE_PLUGINS_ONLINE, $plugins_online, ($count_plugins == 0) ? $r : $g);
- $indexAdmin->addInfoBoxLine(_AM_FEEDS_PLUGINS,_AM_FEEDS_THEREARE_PLUGINS_PENDING, $plugins_pending, ($count_plugins == 0) ? $r : $g);
+ echo $adminMenu->addNavigation("index.php") ;
+ echo $adminMenu->renderIndex();
- echo $indexAdmin->addNavigation("index.php") ;
- echo $indexAdmin->renderIndex();
-include "admin_footer.php";
-?>
\ No newline at end of file
+include "admin_footer.php";
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/admin/menu.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/menu.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/menu.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,53 +1,46 @@
<?php
/**
* ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * - Original Copyright (TDM)
+ * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
+ * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org)
* ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
+ * FEEDS - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * TXMod Xoops (http://www.txmodxoops.org)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
*
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
+ * ------------------------------------------------------------------------
*
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
+ * @copyright TXMod Xoops (http://www.txmodxoops.org)
+ * @license GPL see LICENSE
+ * @package feeds
+ * @author TXMod Xoops (in...@tx...)
+ *
+ * Version : 1.01 Sat 2012/02/25 20:23:53 : Timgno Exp $
* ****************************************************************************
- */
-
+ */
$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
$module_handler =& xoops_gethandler("module");
$xoopsModule =& XoopsModule::getByDirname($dirname);
$moduleInfo =& $module_handler->get($xoopsModule->getVar("mid"));
-$pathImageAdmin = $moduleInfo->getInfo("icons32");
-
-$adminmenu = array();
-$i = 1;
+$pathImageAdmin = $moduleInfo->getInfo("icons32");
+$adminmenu = array(); $i = 1;
$adminmenu[$i]["title"] = _MI_FEEDS_ADMENU1;
$adminmenu[$i]["link"] = "admin/index.php";
-$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/dashboard.png";
-$i++;
+$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/dashboard.png"; $i++;
$adminmenu[$i]["title"] = _MI_FEEDS_ADMENU2;
$adminmenu[$i]["link"] = "admin/feeds.php";
-$adminmenu[$i]["icon"] = "images/32/addfeed.png";
-$i++;
+$adminmenu[$i]["icon"] = "images/32/addfeed.png"; $i++;
$adminmenu[$i]["title"] = _MI_FEEDS_ADMENU3;
$adminmenu[$i]["link"] = "admin/plugins.php";
-$adminmenu[$i]["icon"] = "images/32/addplugin.png";
-$i++;
+$adminmenu[$i]["icon"] = "images/32/addplugin.png"; $i++;
$adminmenu[$i]["title"] = _MI_FEEDS_ADMENU4;
$adminmenu[$i]["link"] = "admin/about.php";
$adminmenu[$i]["icon"] = "../../".$pathImageAdmin."/about.png";
-unset( $i );
-?>
\ No newline at end of file
+unset( $i );
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/admin/plugins.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/admin/plugins.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/admin/plugins.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -25,26 +25,26 @@
* Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
* ****************************************************************************
*/
-
include "admin_header.php";
-xoops_cp_header();
-global $pathImageIcon;
// We recovered the value of the argument op in the URL$
$op = feeds_CleanVars($_REQUEST, 'op', 'list', 'string');
-
-$pluginsAdmin = new ModuleAdmin();
switch ($op)
{
case "list":
default:
- echo $pluginsAdmin->addNavigation('plugins.php');
- $pluginsAdmin->addItemButton(_AM_FEEDS_NEWPLUGINS, 'plugins.php?op=new_plugins', 'add');
- echo $pluginsAdmin->renderButton();
+ echo $adminMenu->addNavigation('plugins.php');
+ $adminMenu->addItemButton(_AM_FEEDS_NEWPLUGIN, 'plugins.php?op=new_plugin', 'add');
+
$limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
$criteria = new CriteriaCompo();
- $criteria->setSort("plugin_id ASC, plugin_name");
+ $criteria->setSort("plugin_id ASC, plugin_modulename");
$criteria->setOrder("ASC");
$numrows = $pluginsHandler->getCount();
+ if( $numrows != 0 ){
+ $adminMenu->addItemButton(_AM_FEEDS_DELALLPLUGINS, 'plugins.php?op=delete_all_plugins', 'delete');
+ }
+ echo $adminMenu->renderButton();
+
$start = feeds_CleanVars ( $_REQUEST, 'start', 0, 'int' );
$criteria->setStart($start);
$criteria->setLimit($limit);
@@ -63,42 +63,39 @@
echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width2'>"._AM_FEEDS_PLUGIN_ID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_NAME."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CLASSNAME."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_TABLENAME."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_FILENAME."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_DID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_TITLE."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_DESC."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_DATE."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CREATED."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_WEIGHT."</th>
- <th class='center width5'>"._AM_FEEDS_FORMACTION."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_MODULENAME."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_CLASSNAME."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_TABLENAME."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FILENAME."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_CID."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DID."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_TITLE."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DESC."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DATE."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_WEIGHT."</th>
+ <th class='center width5'>"._AM_FEEDS_FORMACTION."</th>
</tr>";
- $class = "odd";
-
+ $class = "odd";
foreach (array_keys($plugins_arr) as $i)
{
echo "<tr class='".$class."'>";
$class = ($class == "even") ? "odd" : "even";
echo "<td class='center'>".$i."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_name")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_modulename")."</td>";
echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_classname")."</td>";
echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_tablename")."</td>";
echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_filename")."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_cid")."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_did")."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_champ_title")."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_champ_desc")."</td>";
- echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_champ_date")."</td>";
- echo "<td class='center'>".formatTimeStamp($plugins_arr[$i]->getVar("plugin_created"),"S")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_field_cid")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_field_did")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_field_title")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_field_desc")."</td>";
+ echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_field_date")."</td>";
echo "<td class='center'>".$plugins_arr[$i]->getVar("plugin_weight")."</td>";
echo "<td class='center width5'>
- <a href='plugins.php?op=edit_plugins&plugin_id=".$i."'><img src=".$pathImageIcon."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
- <a href='plugins.php?op=delete_plugins&plugin_id=".$i."'><img src=".$pathImageIcon."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
+ <a href='plugins.php?op=edit_plugin&plugin_id=".$i."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='plugins.php?op=delete_plugin&plugin_id=".$i."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>";
echo "</tr>";
}
@@ -108,16 +105,15 @@
echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width2'>"._AM_FEEDS_PLUGIN_ID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_NAME."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_MODULENAME."</th>
<th class='center'>"._AM_FEEDS_PLUGIN_CLASSNAME."</th>
<th class='center'>"._AM_FEEDS_PLUGIN_TABLENAME."</th>
<th class='center'>"._AM_FEEDS_PLUGIN_FILENAME."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_DID."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_TITLE."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_DESC."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CHAMP_DATE."</th>
- <th class='center'>"._AM_FEEDS_PLUGIN_CREATED."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_CID."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DID."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_TITLE."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DESC."</th>
+ <th class='center'>"._AM_FEEDS_PLUGIN_FIELD_DATE."</th>
<th class='center'>"._AM_FEEDS_PLUGIN_WEIGHT."</th>
<th class='center width5'>"._AM_FEEDS_FORMACTION."</th>
</tr>";
@@ -126,17 +122,21 @@
break;
- case "new_plugins":
- echo $pluginsAdmin->addNavigation("plugins.php");
- $pluginsAdmin->addItemButton(_AM_FEEDS_PLUGINSLIST, 'plugins.php?op=list', 'list');
- echo $pluginsAdmin->renderButton();
+ case "new_plugin":
+ echo $adminMenu->addNavigation("plugins.php");
+ $adminMenu->addItemButton(_AM_FEEDS_PLUGINSLIST, 'plugins.php?op=list', 'list');
+ $numrows = $pluginsHandler->getCount();
+ if( $numrows != 0 ){
+ $adminMenu->addItemButton(_AM_FEEDS_DELALLPLUGINS, 'plugins.php?op=delete_all_plugins', 'delete');
+ }
+ echo $adminMenu->renderButton();
$obj =& $pluginsHandler->create();
$form = $obj->getForm();
$form->display();
break;
- case "save_plugins":
+ case "save_plugin":
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
redirect_header("plugins.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
@@ -147,28 +147,31 @@
}
//Form plugins
- $obj->setVars(array("plugin_name"=>$_POST["plugin_name"], "plugin_classname"=>$_POST["plugin_classname"], "plugin_tablename"=>$_POST["plugin_tablename"], "plugin_filename"=>$_POST["plugin_filename"], "plugin_cid"=>$_POST["plugin_cid"], "plugin_did"=>$_POST["plugin_did"], "plugin_champ_title"=>$_POST["plugin_champ_title"], "plugin_champ_desc"=>$_POST["plugin_champ_desc"],"plugin_champ_date"=>$_POST["plugin_champ_date"], "plugin_created"=>feeds_convertDate($_POST["plugin_created"]), "plugin_weight"=>$_POST["plugin_weight"]));
+ $obj->setVars(array("plugin_modulename"=>$_POST["plugin_modulename"], "plugin_classname"=>$_POST["plugin_classname"], "plugin_tablename"=>$_POST["plugin_tablename"], "plugin_filename"=>$_POST["plugin_filename"], "plugin_field_cid"=>$_POST["plugin_field_cid"], "plugin_field_did"=>$_POST["plugin_field_did"], "plugin_field_title"=>$_POST["plugin_field_title"], "plugin_field_desc"=>$_POST["plugin_field_desc"],"plugin_field_date"=>$_POST["plugin_field_date"], "plugin_weight"=>$_POST["plugin_weight"]));
- if ($pluginsHandler->insert($obj)) {
- redirect_header("plugins.php?op=list", 2, _AM_FEEDS_FORMOK);
+ if ($pluginsHandler->insert($obj)) {
+ // Create Plugin File
+ $obj->create_PluginFile();
+ redirect_header("plugins.php?op=list", 2, _AM_FEEDS_FORMOK);
}
echo $obj->getHtmlErrors();
$form =& $obj->getForm();
$form->display();
- break;
+ break;
- case "edit_plugins":
- echo $pluginsAdmin->addNavigation("plugins.php");
- $pluginsAdmin->addItemButton(_AM_FEEDS_NEWPLUGINS, 'plugins.php?op=new_plugins', 'add');
- $pluginsAdmin->addItemButton(_AM_FEEDS_PLUGINSLIST, 'plugins.php?op=list', 'list');
- echo $pluginsAdmin->renderButton();
+ case "edit_plugin":
+ echo $adminMenu->addNavigation("plugins.php");
+ $adminMenu->addItemButton(_AM_FEEDS_NEWPLUGIN, 'plugins.php?op=new_plugin', 'add');
+ $adminMenu->addItemButton(_AM_FEEDS_PLUGINSLIST, 'plugins.php?op=list', 'list');
+ $adminMenu->addItemButton(_AM_FEEDS_DELALLPLUGINS, 'plugins.php?op=delete_all_plugins', 'delete');
+ echo $adminMenu->renderButton();
$obj = $pluginsHandler->get($_REQUEST["plugin_id"]);
$form = $obj->getForm();
$form->display();
break;
- case "delete_plugins":
+ case "delete_plugin":
$obj =& $pluginsHandler->get($_REQUEST["plugin_id"]);
if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) {
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
@@ -180,20 +183,25 @@
echo $obj->getHtmlErrors();
}
} else {
- xoops_confirm(array("ok" => 1, "plugin_id" => $_REQUEST["plugin_id"], "op" => "delete_plugins"), $_SERVER["REQUEST_URI"], sprintf(_AM_FEEDS_FORMSUREDEL, $obj->getVar("plugin_name")));
+ xoops_confirm(array("ok" => 1, "plugin_id" => $_REQUEST["plugin_id"], "op" => "delete_plugin"), $_SERVER["REQUEST_URI"], sprintf(_AM_FEEDS_FORMSUREDEL, $obj->getVar("plugin_modulename")));
}
- break;
+ break;
- case "update_online_plugins":
- if (isset($_REQUEST["plugin_id"])) {
- $obj =& $pluginsHandler->get($_REQUEST["plugin_id"]);
- }
- $obj->setVar("plugin_online", $_REQUEST["plugin_online"]);
- if ($pluginsHandler->insert($obj)) {
- redirect_header("plugins.php", 3, _AM_FEEDS_FORMOK);
+ case "delete_all_plugins":
+ $obj =& $pluginsHandler->get();
+ if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) {
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("plugins.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+ if ($pluginsHandler->deleteAll($obj)) {
+ redirect_header("plugins.php", 3, _AM_FEEDS_FORMDELALLOK);
+ } else {
+ echo $obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array("ok" => 1, "op" => "delete_all_plugins"), $_SERVER["REQUEST_URI"], _AM_FEEDS_FORMSUREDELALL);
}
- echo $obj->getHtmlErrors();
- break;
+ break;
}
include "admin_footer.php";
?>
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/class/feeds_feeds.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/class/feeds_feeds.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/class/feeds_feeds.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -24,8 +24,7 @@
*
* Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
* ****************************************************************************
- */
-
+ */
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
@@ -36,16 +35,17 @@
function __construct()
{
$this->XoopsObject();
- $this->initVar("feed_id", XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar("feed_pid", XOBJ_DTYPE_INT, null, false, 5);
+ $this->initVar("feed_id", XOBJ_DTYPE_INT, 0, false, 8);
+ $this->initVar("feed_pid", XOBJ_DTYPE_INT, 0, false, 8);
$this->initVar("feed_name", XOBJ_DTYPE_TXTBOX, null, false, 255);
$this->initVar("feed_version", XOBJ_DTYPE_TXTBOX, null, false, 5);
$this->initVar("feed_desc", XOBJ_DTYPE_TXTAREA, null, false);
- $this->initVar("feed_img", XOBJ_DTYPE_TXTBOX, null, false, 222);
+ $this->initVar("feed_img", XOBJ_DTYPE_TXTBOX, null, false, 100);
+ $this->initVar("feed_rssurl", XOBJ_DTYPE_TXTBOX, null, false, 255);
$this->initVar("feed_submitter", XOBJ_DTYPE_INT, null, false, 10);
$this->initVar("feed_created", XOBJ_DTYPE_INT, null, false, 10);
$this->initVar("feed_published", XOBJ_DTYPE_INT, null, false, 10);
- $this->initVar("feed_weight", XOBJ_DTYPE_INT, null, false, 11);
+ $this->initVar("feed_weight", XOBJ_DTYPE_INT, 0, false, 11);
$this->initVar("feed_online", XOBJ_DTYPE_INT, null, false, 1);
}
@@ -62,15 +62,14 @@
$action = $_SERVER["REQUEST_URI"];
}
- $title = $this->isNew() ? sprintf(_AM_FEEDS_FEEDS_ADD) : sprintf(_AM_FEEDS_FEEDS_EDIT);
+ $title = $this->isNew() ? sprintf(_AM_FEEDS_FEED_ADD) : sprintf(_AM_FEEDS_FEED_EDIT);
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
-
$form = new XoopsThemeForm($title, "form", $action, "post", true);
$form->setExtra('enctype="multipart/form-data"');
$form->addElement(new XoopsFormText(_AM_FEEDS_FEED_NAME, "feed_name", 50, 255, $this->getVar("feed_name")), true);
- $form->addElement(new XoopsFormText(_AM_FEEDS_FEED_VERSION, "feed_version", 50, 255, $this->getVar("feed_version")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_FEED_VERSION, "feed_version", 8, 25, $this->getVar("feed_version")), true);
if (!$this->isNew()) {
$feedpid = $this->getVar('plugin_id');
@@ -79,20 +78,24 @@
}
$plugins_handler = xoops_getmodulehandler('feeds_plugins');
$plugins_select = new XoopsFormSelect(_AM_FEEDS_FEED_PNAME, 'feed_pid', $feedpid);
- $plugins_select->addOption(0, _AM_FEEDS_PLUGIN_DEFAULT);
- foreach($plugins_handler->getObjects(null, true) as $pid => $plugins)
- $plugins_select->addOption($pid, $plugins->getVar('plugin_name'));
- $form->addElement($plugins_select);
+ $plugins_select->addOption(null, _AM_FEEDS_PLUGIN_DEFAULT);
+ foreach($plugins_handler->getObjects(null, true) as $pid => $plugins) {
+ /*if($pid == 0) {
+ redirect_header("feeds.php", 3, "Pleace: specify a plugin first.");
+ }*/
+ $plugins_select->addOption($pid, $plugins->getVar('plugin_modulename'));
+ }
+ $form->addElement($plugins_select, true);
$editor_configs=array();
$editor_configs["name"] ="feed_desc";
$editor_configs["value"] = $this->getVar("feed_desc", "e");
- $editor_configs["rows"] = 10;
+ $editor_configs["rows"] = 8;
$editor_configs["cols"] = 80;
$editor_configs["width"] = "100%";
- $editor_configs["height"] = "400px";
- $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["editor"];
- $form->addElement( new XoopsFormEditor(_AM_FEEDS_FEED_DESC, "feed_desc", $editor_configs), true );
+ $editor_configs["height"] = "200px";
+ $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["feeds_editor"];
+ $form->addElement( new XoopsFormEditor(_AM_FEEDS_FEED_DESC, "feed_desc", $editor_configs), false );
$feed_img = $this->getVar("feed_img") ? $this->getVar("feed_img") : 'blank.gif';
$uploadirectory = '/uploads/feeds/images';
@@ -107,21 +110,30 @@
$imgtray->addElement($imageselect, false);
$imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory."/".$feed_img."' name='image1' id='image1' alt='' />" ) );
$fileseltray = new XoopsFormElementTray('','<br />');
- $fileseltray->addElement(new XoopsFormFile(_AM_FEEDS_FORMUPLOAD , "feed_img", $GLOBALS['xoopsModuleConfig']['maxsize']),false);
+ $fileseltray->addElement(new XoopsFormFile(_AM_FEEDS_FORMUPLOAD , "feed_img", $GLOBALS['xoopsModuleConfig']['maxsize']), false);
$fileseltray->addElement(new XoopsFormLabel(''), false);
$imgtray->addElement($fileseltray);
- $form->addElement($imgtray);
+ $form->addElement($imgtray);
+ // feed_rssurl
+ $feed_rssurl = new XoopsFormText(_AM_FEEDS_FEED_RSSURL, "feed_rssurl", 50, 255, $this->getVar("feed_rssurl"));
+ $feed_rssurl->setDescription(_AM_FEEDS_FEED_RSSURL_DESC);
+ $form->addElement($feed_rssurl, false);
$form->addElement(new XoopsFormSelectUser(_AM_FEEDS_FEED_SUBMITTER, "feed_submitter", false, $this->getVar("feed_submitter"), 1, false), true);
- $form->addElement(new XoopsFormTextDateSelect(_AM_FEEDS_FEED_CREATED, "feed_created", "", $this->getVar("feed_created")));
- $form->addElement(new XoopsFormTextDateSelect(_AM_FEEDS_FEED_PUBLISHED, "feed_published", "", $this->getVar("feed_published")));
- $form->addElement(new XoopsFormText(_AM_FEEDS_FEED_WEIGHT, "feed_weight", 10, 25, $this->getVar("feed_weight")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_FEED_WEIGHT, "feed_weight", 8, 25, $this->getVar("feed_weight")), true);
+
+ $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
+ $feed_created = new XoopsFormDateTime(_AM_FEEDS_FEED_CREATED, "feed_created", $this->getVar("feed_created"));
+ $options_tray->addElement($feed_created);
+ $feed_published = new XoopsFormDateTime(_AM_FEEDS_FEED_PUBLISHED, "feed_published", $this->getVar("feed_published"));
+ $options_tray->addElement($feed_published);
$feed_online = $this->isNew() ? 0 : $this->getVar("feed_online");
$check_feed_online = new XoopsFormCheckBox(_AM_FEEDS_FEED_ONLINE, "feed_online", $feed_online);
$check_feed_online->addOption(1, " ");
- $form->addElement($check_feed_online);
+ $options_tray->addElement($check_feed_online);
+ $form->addElement($options_tray);
- $form->addElement(new XoopsFormHidden("op", "save_feeds"));
+ $form->addElement(new XoopsFormHidden("op", "save_feed"));
$form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
return $form;
}
Modified: XoopsModules/feeds/trunk/feeds/class/feeds_plugins.php
===================================================================
--- XoopsModules/feeds/trunk/feeds/class/feeds_plugins.php 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/class/feeds_plugins.php 2012-07-09 11:53:56 UTC (rev 9812)
@@ -32,27 +32,37 @@
class feeds_plugins extends XoopsObject
{
+ var $plugins; // Holds plugins
+ var $plugin_name; // Name of the plugin wich contains all content_plugin
+
//Constructor
function __construct()
{
$this->XoopsObject();
- $this->initVar("plugin_id", XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar("plugin_name", XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar("plugin_id", XOBJ_DTYPE_INT, 0, false, 8);
+ $this->initVar("plugin_modulename", XOBJ_DTYPE_TXTBOX, null, false, 255);
$this->initVar("plugin_classname", XOBJ_DTYPE_TXTBOX, null, false, 255);
$this->initVar("plugin_tablename", XOBJ_DTYPE_TXTBOX, null, false, 255);
$this->initVar("plugin_filename", XOBJ_DTYPE_TXTBOX, null, false, 150);
- $this->initVar("plugin_cid", XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar("plugin_did", XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar("plugin_champ_title", XOBJ_DTYPE_TXTBOX, null, false, 150);
- $this->initVar("plugin_champ_desc", XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar("plugin_champ_date", XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar("plugin_created", XOBJ_DTYPE_INT, null, false, 10);
- $this->initVar("plugin_weight", XOBJ_DTYPE_INT, null, false, 11);
+ $this->initVar("plugin_field_cid", XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar("plugin_field_did", XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar("plugin_field_title", XOBJ_DTYPE_TXTBOX, null, false, 150);
+ $this->initVar("plugin_field_desc", XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar("plugin_field_date", XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar("plugin_weight", XOBJ_DTYPE_INT, 0, false, 11);
}
function feeds_plugins()
{
$this->__construct();
+ $folder_name = FEEDS_URL."/plugins/";
+ if(!is_dir($folder_name)) {
+ mkdir($folder_name, 0755);
+ chmod($folder_name, 0755);
+ } else {
+ chmod($folder_name, 0755);
+ }
+ $this->plugin_name = FEEDS_URL."/plugins/".$this->getVar("plugin_modulename").".php";
}
function getForm($action = false)
@@ -63,35 +73,108 @@
$action = $_SERVER["REQUEST_URI"];
}
- $title = $this->isNew() ? sprintf(_AM_FEEDS_PLUGINS_ADD) : sprintf(_AM_FEEDS_PLUGINS_EDIT);
+ $title = $this->isNew() ? sprintf(_AM_FEEDS_PLUGIN_ADD) : sprintf(_AM_FEEDS_PLUGIN_EDIT);
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
$form = new XoopsThemeForm($title, "form", $action, "post", true);
$form->setExtra('enctype="multipart/form-data"');
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_NAME, "plugin_name", 50, 255, $this->getVar("plugin_name")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_MODULENAME, "plugin_modulename", 50, 255, $this->getVar("plugin_modulename")), true);
$form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_CLASSNAME, "plugin_classname", 50, 255, $this->getVar("plugin_classname")), true);
$form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_TABLENAME, "plugin_tablename", 50, 255, $this->getVar("plugin_tablename")), true);
$form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FILENAME, "plugin_filename", 50, 150, $this->getVar("plugin_filename")), true);
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_CID, "plugin_cid", 20, 55, $this->getVar("plugin_cid")), true);
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_DID, "plugin_did", 20, 55, $this->getVar("plugin_did")), false);
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_CHAMP_TITLE, "plugin_champ_title", 50, 150, $this->getVar("plugin_champ_title")), true);
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_CHAMP_DESC, "plugin_champ_desc", 50, 255, $this->getVar("plugin_champ_desc")), true);
- $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_CHAMP_DATE, "plugin_champ_date", 50, 255, $this->getVar("plugin_champ_date")), true);
- $form->addElement(new XoopsFormTextDateSelect(_AM_FEEDS_PLUGIN_CREATED, "plugin_created", "", $this->getVar("plugin_created")));
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FIELD_CID, "plugin_field_cid", 20, 55, $this->getVar("plugin_field_cid")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FIELD_DID, "plugin_field_did", 20, 55, $this->getVar("plugin_field_did")), false);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FIELD_TITLE, "plugin_field_title", 50, 150, $this->getVar("plugin_field_title")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FIELD_DESC, "plugin_field_desc", 50, 255, $this->getVar("plugin_field_desc")), true);
+ $form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_FIELD_DATE, "plugin_field_date", 50, 255, $this->getVar("plugin_field_date")), true);
$form->addElement(new XoopsFormText(_AM_FEEDS_PLUGIN_WEIGHT, "plugin_weight", 10, 25, $this->getVar("plugin_weight")), true);
- $form->addElement(new XoopsFormHidden("op", "save_plugins"));
+ $form->addElement(new XoopsFormHidden("op", "save_plugin"));
$form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
return $form;
}
+
+ /**
+ * Create plugin file
+ */
+ function create_PluginFile()
+ {
+ if(file_exists($this->plugin_name)) {
+ unlink($this->plugin_name);
+ }
+
+ $modName = $this->getVar("plugin_modulename");
+ $className = $this->getVar("plugin_classname");
+ $tablename = $this->getVar("plugin_tablename");
+ $filename = $this->getVar("plugin_filename");
+ $field_cid = $this->getVar("plugin_field_cid");
+ $field_did = $this->getVar("plugin_field_did");
+ $field_date = $this->getVar("plugin_field_date");
+ $prefix = substr($tablename, strpos($tablename, '_'));
+
+ $content_plugin = "<?php\n";
+ $content_plugin .= '/*
+ * Plugin $'.$prefix.' of module '.$modName.'
+ * Table name '.$tablename.' and Class name '.$className.'
+ */
+
+if (file_exists($fileinc = $GLOBALS[\'xoops\']->path(\'modules/'.$modName.'/class/'.$className.'.php\'))) {
+ include $fileinc;
+ $'.$prefix.'Handler =& xoops_getModuleHandler(\''.$tablename.'\', \''.$modName.'\');
+ $criteria = new CriteriaCompo();
+ $criteria->setSort(\''.$field_date.'\');
+ $criteria->setOrder(\'DESC\');
+ $'.$prefix.'Array = $'.$prefix.'Handler->getAll($criteria);
}
+if (!empty($'.$prefix.'Array) && is_array($'.$prefix.'Array)) {
+ $myts =& MyTextSanitizer::getInstance();
+ foreach ($'.$prefix.'Array as $'.$prefix.') {
+ //description
+ $'.$prefix.'desc = $'.$prefix.'->getVar(\''.$this->getVar("plugin_field_desc").'\');
+ if (strpos($'.$prefix.'desc,\'[pagebreak]\')==false){
+ $'.$prefix.'desc_short = substr($'.$prefix.'desc, 0, 400);
+ }else{
+ $'.$prefix.'desc_short = substr($'.$prefix.'desc, 0, strpos($'.$prefix.'desc,\'[pagebreak]\'));
+ }
+ $tpl->append(\'items\', array(
+ \'title\' => XoopsLocal::convert_encoding($myts->htmlspecialchars($'.$prefix.'->getVar(\''.$this->getVar("plugin_field_title").'\'), ENT_QUOTES)),';
+ if($field_did == null){
+ $text = '\'link\' => XOOPS_URL . \'/modules/'.$modName.'/'.$filename.'.php?'.$field_cid.'=\'.$'.$prefix.'->getVar(\''.$field_cid.'\').\'\',
+ \'guid\' => XOOPS_URL . \'/modules/'.$modName.'/'.$filename.'.php?'.$field_cid.'=\'.$'.$prefix.'->getVar(\''.$field_cid.'\').\'\',';
+ } else {
+ $text = '\'link\' => XOOPS_URL . \'/modules/'.$modName.'/'.$filename.'.php?'.$field_cid.'=\'.$'.$prefix.'->getVar(\''.$field_cid.'\').\'&'.$field_did.'=\'.$'.$prefix.'->getVar(\''.$field_did.'\').\'\',
+ \'guid\' => XOOPS_URL . \'/modules/'.$modName.'/'.$filename.'.php?'.$field_cid.'=\'.$'.$prefix.'->getVar(\''.$field_cid.'\').\'&'.$field_did.'=\'.$'.$prefix.'->getVar(\''.$field_did.'\').\'\',';
+ }
+ $text = '\'pubdate\' => formatTimestamp($'.$prefix.'->getVar(\''.$field_date.'\'), \'rss\'),
+ \'description\' => XoopsLocal::convert_encoding($myts->htmlspecialchars($'.$prefix.'desc_short, ENT_QUOTES))));
+ }
+}';
+ $content_plugin .= "?>\n";
+ //
+ $plugin_filename = new XoopsFileHandler($this->plugin_name, true);
+ if( $plugin_filename->write($content_plugin) )
+ $plugin_filename->close();
+ }
+}
class feedsfeeds_pluginsHandler extends XoopsPersistableObjectHandler
{
function __construct(&$db)
{
parent::__construct($db, "feeds_plugins", "feeds_plugins", "plugin_id", "plugin_name");
}
+
+ function deleteAll($criteria = null)
+ {
+ $sql = 'DELETE FROM '.$this->db->prefix('feeds_plugins');
+ if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+ $sql .= ' '.$criteria->renderWhere();
+ }
+ if (!$result = $this->db->queryF($sql)) {
+ return false;
+ }
+ return true;
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/feeds/trunk/feeds/css/style.css
===================================================================
--- XoopsModules/feeds/trunk/feeds/css/style.css 2012-07-09 11:46:30 UTC (rev 9811)
+++ XoopsModules/feeds/trunk/feeds/css/style.css 2012-07-09 11:53:56 UTC (rev 9812)
@@ -1,36 +1,76 @@
-@charset "UTF-8";
-/**
- * ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
- * ****************************************************************************
- * FEEDS - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * TXMod Xoops ( http://www.txmodxoops.org )
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting
- * source code which is considered copyrighted (c) material of the
- * original comment or credit authors.
- *
- * 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.
- * ---------------------------------------------------------------------------
- * @copyright TXMod Xoops ( http://www.txmodxoops.org )
- * @license GNU GPL see License
- * @package feeds
- * @author TXMod Xoops ( su...@tx... )
- *
- * Version : 1.01 Sat 2012/04/14 20:38:47 : timgno Exp $
- * ****************************************************************************
+/*
+ * Module Feeds
+ * Created Tru 28/02/2012
+ * Copyright TXMod Xoops <in...@tx...>
+ * $Id Timgno
*/
-
+table {
+ border: 1px solid #ccc;
+ width: 100%;
+}
-.box-header {
- margin: 2px;
- padding: 5px;
- background-color: #ccc;
- width:...
[truncated message content] |