[pLog-svn] r1307 - in plugins/trunk/linktracker: . class
class/action templates
mark at devel.plogworld.net
mark at devel.plogworld.net
Fri Mar 4 08:55:54 GMT 2005
Author: mark
Date: 2005-03-04 08:55:53 +0000 (Fri, 04 Mar 2005)
New Revision: 1307
Added:
plugins/trunk/linktracker/class/action/
plugins/trunk/linktracker/class/action/linktrackeraction.class.php
Removed:
plugins/trunk/linktracker/action/
Modified:
plugins/trunk/linktracker/templates/linktracker.template
Log:
Move the action back to clss floder. It should be locate there.
Added: plugins/trunk/linktracker/class/action/linktrackeraction.class.php
===================================================================
--- plugins/trunk/linktracker/class/action/linktrackeraction.class.php 2005-03-04 08:44:06 UTC (rev 1306)
+++ plugins/trunk/linktracker/class/action/linktrackeraction.class.php 2005-03-04 08:55:53 UTC (rev 1307)
@@ -0,0 +1,62 @@
+<?php
+
+ /**
+ * @package action
+ */
+
+
+ include_once( PLOG_CLASS_PATH.'class/action/blogaction.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/view/plugintemplatedview.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/view/errorview.class.php' );
+ include_once( PLOG_CLASS_PATH.'plugins/linktracker/class/dao/linktracker.class.php' );
+ include_once( PLOG_CLASS_PATH.'plugins/linktracker/class/dao/linktrackerresult.class.php' );
+
+ define( 'LINKTRACKER_TEMPLATE', 'linktracker' );
+
+ /**
+ * Action that receives the input when the operation called
+ * is "LinkTracker"
+ */
+ class LinkTrackerAction extends BlogAction
+ {
+
+ /**
+ * Constructor
+ */
+ function LinkTrackerAction( $blogInfo, $request )
+ {
+ $this->BlogAction( $blogInfo, $request );
+ }
+
+ /**
+ * Carries out the action
+ */
+ function perform()
+ {
+ $this->_view = new PluginTemplatedView( $this->_blogInfo,
+ 'linktracker',
+ LINKTRACKER_TEMPLATE,
+ SMARTY_VIEW_CACHE_CHECK,
+ Array( 'blogId' => $this->_blogInfo->getId()));
+ if( $this->_view->isCached()) {
+ return true;
+ }
+
+ $l = new LinkTracker();
+ $links = $l->getLinks( $this->_blogInfo->getId());
+
+ // if any error, return the error view
+ if( ($links == '') || (empty($links))) {
+ $this->_view = new ErrorView( $this->_blogInfo );
+ $this->_view->setValue( 'message', 'error_blog_has_no_links' );
+ $this->setCommonData();
+ return false;
+ }
+
+ $this->_view->setValue( 'links', $links );
+ $this->setCommonData();
+
+ return true;
+ }
+ }
+?>
Modified: plugins/trunk/linktracker/templates/linktracker.template
===================================================================
--- plugins/trunk/linktracker/templates/linktracker.template 2005-03-04 08:44:06 UTC (rev 1306)
+++ plugins/trunk/linktracker/templates/linktracker.template 2005-03-04 08:55:53 UTC (rev 1307)
@@ -3,5 +3,4 @@
{foreach from=$links item=link}
<a target="_blank" href="{$link->getUrl()}">{$link->getUrl()}</a><br/>
{/foreach}
-{include file="$blogtemplate/panel.template"}
{include file="$blogtemplate/footer.template"}
More information about the pLog-svn
mailing list