[pLog-svn] r3363 - in plog/trunk/class: action/admin view/admin
mark at devel.lifetype.net
mark at devel.lifetype.net
Mon May 8 06:47:50 GMT 2006
Author: mark
Date: 2006-05-08 06:47:50 +0000 (Mon, 08 May 2006)
New Revision: 3363
Modified:
plog/trunk/class/action/admin/adminupdatelinkaction.class.php
plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
plog/trunk/class/view/admin/admineditlinkview.class.php
plog/trunk/class/view/admin/adminlinkcategorieslistview.class.php
plog/trunk/class/view/admin/adminlinkslistview.class.php
Log:
1. Fixed some error notices
2. The editListView is wrong, just re-implement it.
Modified: plog/trunk/class/action/admin/adminupdatelinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkaction.class.php 2006-05-08 06:15:29 UTC (rev 3362)
+++ plog/trunk/class/action/admin/adminupdatelinkaction.class.php 2006-05-08 06:47:50 UTC (rev 3363)
@@ -75,7 +75,6 @@
$link->setDescription( $this->_linkDescription );
$link->setCategoryId( $this->_linkCategoryId );
$link->setUrl( $this->_linkUrl );
- $link->setProperties( $this->_properties );
$link->setRssFeed( $this->_linkFeed );
$this->notifyEvent( EVENT_PRE_LINK_UPDATE, Array( "link" => &$link ));
// and now update it in the database
Modified: plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php 2006-05-08 06:15:29 UTC (rev 3362)
+++ plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php 2006-05-08 06:47:50 UTC (rev 3363)
@@ -32,7 +32,7 @@
$this->registerFieldValidator( "linkCategoryId", new IntegerValidator());
$errorView = new AdminTemplatedView( $this->_blogInfo, "editlinkcategory" );
$errorView->setErrorMessage( $this->_locale->tr("error_updating_link_category"));
- $this->setValidationErrorView( $view );
+ $this->setValidationErrorView( $errorView );
}
/**
Modified: plog/trunk/class/view/admin/admineditlinkview.class.php
===================================================================
--- plog/trunk/class/view/admin/admineditlinkview.class.php 2006-05-08 06:15:29 UTC (rev 3362)
+++ plog/trunk/class/view/admin/admineditlinkview.class.php 2006-05-08 06:47:50 UTC (rev 3363)
@@ -1,19 +1,36 @@
<?php
- include_once( PLOG_CLASS_PATH."class/view/admin/adminnewlinkview.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
/**
* \ingroup View
* @private
*/
- class AdminEditLinkView extends AdminNewLinkView
+ class AdminEditLinkView extends AdminTemplatedView
{
function AdminEditLinkView( $blogInfo, $params = Array())
{
- $this->_templateName = "editlink";
-
- $this->AdminNewLinkView( $blogInfo, $params );
+ $this->AdminTemplatedView( $blogInfo, "editlink" );
}
+
+ /**
+ * Carries out the specified action
+ */
+ function render()
+ {
+ // get all the link categories but we have to respect the order that the user asked
+ $blogSettings = $this->_blogInfo->getSettings();
+ $order = $blogSettings->getValue( 'link_categories_order', MYLINKS_CATEGORIES_NO_ORDER );
+ $linkCategories = new MyLinksCategories();
+ $blogLinkCategories = $linkCategories->getMyLinksCategories( $this->_blogInfo->getId(), $order );
+ $this->notifyEvent( EVENT_LINK_CATEGORIES_LOADED, Array( "linkcategories" => &$blogLinkCategories ));
+
+ // put the data in the view
+ $this->setValue( "linkcategories", $blogLinkCategories );
+
+ parent::render();
+ }
}
?>
\ No newline at end of file
Modified: plog/trunk/class/view/admin/adminlinkcategorieslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminlinkcategorieslistview.class.php 2006-05-08 06:15:29 UTC (rev 3362)
+++ plog/trunk/class/view/admin/adminlinkcategorieslistview.class.php 2006-05-08 06:47:50 UTC (rev 3363)
@@ -18,36 +18,41 @@
{
$this->AdminTemplatedView( $blogInfo, "editlinkcategories" );
+ // save the parameters and put them in a nicer place after checking them
+ if( !isset( $params["searchTerms"] ) ) $params["searchTerms"] = "";
+ $this->setValue( "searchTerms", $params["searchTerms"] );
+
$this->_page = $this->getCurrentPageFromRequest();
- $this->_searchTerms = $params['searchTerms'];
}
function render()
{
// get all the link categories
+ $searchTerms = $this->getValue( "searchTerms" );
$blogSettings = $this->_blogInfo->getSettings();
$linkCategoriesOrder = $blogSettings->getValue( "link_categories_order", MYLINKS_CATEGORIES_NO_ORDER );
// get the link categories
$linkCategories = new MyLinksCategories();
$blogLinkCategories = $linkCategories->getMyLinksCategories( $this->_blogInfo->getId(),
$linkCategoriesOrder,
- $this->_searchTerms,
+ $searchTerms,
$this->_page,
DEFAULT_ITEMS_PER_PAGE );
// get the total number of link categories
- $numLinkCategories = $linkCategories->getNumMyLinksCategories( $this->_blogInfo->getId(), $this->_searchTerms );
+ $numLinkCategories = $linkCategories->getNumMyLinksCategories( $this->_blogInfo->getId(), $searchTerms );
// throw the event
$this->notifyEvent( EVENT_LINK_CATEGORIES_LOADED, Array( "linkcategories" => &$blogLinkCategories ));
// create the pager
- $pager = new Pager( "?op=editLinkCategories&page=",
+ $pager = new Pager( "?op=editLinkCategories&searchTerms={$searchTerms}&page=",
$this->_page,
$numLinkCategories,
DEFAULT_ITEMS_PER_PAGE );
// create the view and fill the template context
$this->setValue( "linkcategories", $blogLinkCategories );
+ $this->setValue( "searchTerms", $searchTerms );
$this->setValue( "pager", $pager );
// transfer control to the parent class
Modified: plog/trunk/class/view/admin/adminlinkslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminlinkslistview.class.php 2006-05-08 06:15:29 UTC (rev 3362)
+++ plog/trunk/class/view/admin/adminlinkslistview.class.php 2006-05-08 06:47:50 UTC (rev 3363)
@@ -24,8 +24,9 @@
$this->AdminTemplatedView( $blogInfo, "editlinks" );
// save the parameters and put them in a nicer place after checking them
- if( $params["showOrder"] == "" ) $params["showOrder"] = MYLINKS_CATEGORIES_NO_ORDER;
- if( $params["showCategory"] == "" ) $params["showCategory"] = 0;
+ if( !isset( $params["showOrder"] ) ) $params["showOrder"] = MYLINKS_CATEGORIES_NO_ORDER;
+ if( !isset( $params["showCategory"] ) ) $params["showCategory"] = 0;
+ if( !isset( $params["searchTerms"] ) ) $params["searchTerms"] = "";
$this->setValue( "showOrder", $params["showOrder"] );
$this->setValue( "showCategory", $params["showCategory"] );
More information about the pLog-svn
mailing list