[icinga-checkins] icinga.org: icinga-web/master: * Removed deprecated libraries

git at icinga.org git at icinga.org
Wed Jan 26 17:53:21 CET 2011


Module: icinga-web
Branch: master
Commit: 291c291ce1fff1d1fee40d68a128a4b66de65547
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=291c291ce1fff1d1fee40d68a128a4b66de65547

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Jan 26 14:32:57 2011 +0100

* Removed deprecated libraries

---

 app/config/icinga.xml.in                           |    6 -
 app/modules/AppKit/config/autoload.xml             |    2 -
 .../lib/doctrine/AppKitDoctrinePager.class.php     |   99 --------------------
 .../doctrine/AppKitDoctrinePagerLayout.class.php   |   67 -------------
 .../views/Admin/Users/IndexSuccessView.class.php   |   16 +---
 5 files changed, 1 insertions(+), 189 deletions(-)

diff --git a/app/config/icinga.xml.in b/app/config/icinga.xml.in
index 1d25cff..a877475 100755
--- a/app/config/icinga.xml.in
+++ b/app/config/icinga.xml.in
@@ -43,12 +43,6 @@
 	-->
 	<setting name="appkit.include_dynamic_javascript"></setting>
 	
-	<!--
-		Doctrine pager configuration
-		* deprecated, test to remove
-	-->
-	<setting name="appkit.pager.default_items">20</setting>
-	
 	<!-- 
 		Version information
 		* names, and revisions
diff --git a/app/modules/AppKit/config/autoload.xml b/app/modules/AppKit/config/autoload.xml
index 9468e97..808191d 100755
--- a/app/modules/AppKit/config/autoload.xml
+++ b/app/modules/AppKit/config/autoload.xml
@@ -37,8 +37,6 @@
 		<autoload name="AppKitSQLConstants">%core.module_dir%/AppKit/lib/database/AppKitSQLConstants.class.php</autoload>
 		<autoload name="AppKitDateTime">%core.module_dir%/AppKit/lib/date/AppKitDateTime.class.php</autoload>
 		<autoload name="AppKitDoctrineException">%core.module_dir%/AppKit/lib/doctrine/AppKitDoctrineException.class.php</autoload>
-		<autoload name="AppKitDoctrinePager">%core.module_dir%/AppKit/lib/doctrine/AppKitDoctrinePager.class.php</autoload>
-		<autoload name="AppKitDoctrinePagerLayout">%core.module_dir%/AppKit/lib/doctrine/AppKitDoctrinePagerLayout.class.php</autoload>
 		<autoload name="AppKitDoctrineRecord">%core.module_dir%/AppKit/lib/doctrine/AppKitDoctrineRecord.class.php</autoload>
 		<autoload name="AppKitDoctrineUtil">%core.module_dir%/AppKit/lib/doctrine/AppKitDoctrineUtil.class.php</autoload>
 		<autoload name="AppKitEvent">%core.module_dir%/AppKit/lib/event/AppKitEvent.class.php</autoload>
diff --git a/app/modules/AppKit/lib/doctrine/AppKitDoctrinePager.class.php b/app/modules/AppKit/lib/doctrine/AppKitDoctrinePager.class.php
deleted file mode 100755
index 5b66d31..0000000
--- a/app/modules/AppKit/lib/doctrine/AppKitDoctrinePager.class.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-
-class AppKitDoctrinePager extends Doctrine_Pager {
-	
-	private static $rangeType		= 'Sliding';
-	
-	private static $rangeOptions	= array (
-		'chunk'		=> 8,
-	);
-	
-	private static $url_replaces	= array (
-		'page_offset'	=> '{%page_number}'
-	);
-	
-	/**
-	 * Creates a new pager on the fly
-	 * @param Doctrine_Query $query
-	 * @param integer $page_offset
-	 * @param string $route_name
-	 * @param integer $page_items
-	 * @return AppKitDoctrinePager
-	 * @author Marius Hein
-	 */
-	public static function createNew(Doctrine_query &$query, $page_offset, $route_name, $page_items=null) {
-		
-		if ($page_items === null || is_numeric($page_items) === false) {
-			$page_items = AgaviConfig::get('org.icinga.appkit.pager.default_items');
-		}
-		
-		return new AppKitDoctrinePager($query, $page_offset, $route_name, $page_items);
-	}
-	
-	private $layout	= null;
-	private $range	= null;
-	private $url	= null;
-	private $route	= null;
-	
-	public function __construct(Doctrine_Query &$query, $page_offset, $route, $page_items) {
-		parent::__construct($query, $page_offset, $page_items);
-		
-		$this->route = $route;
-		
-		$this->execute();
-	}
-	
-	private function buildUrl($route_name) {
-		$url = AgaviContext::getInstance('web')->getRouting()->gen($this->route, self::$url_replaces);
-		foreach (self::$url_replaces as $value) {
-			$url = str_replace(urlencode($value), $value, $url);
-		}
-		
-		return $url;
-	}
-	
-	/**
-	 * Init the layout:
-	 * 		- create the class
-	 * 		- added some options
-	 * 		- creates a default range
-	 * @return boolean
-	 * @throws AppKitException
-	 * @author Marius Hein
-	 */
-	private function initLayout() {
-		if ($this->range === null || $this->layout == null) {
-			$this->range = $this->getRange(self::$rangeType, self::$rangeOptions);
-			$this->url = $this->buildUrl($this->route);
-			$this->layout = new AppKitDoctrinePagerLayout($this, $this->range, $this->url);
-			
-			
-			return true;
-		}
-		
-		return false;
-	}
-	
-	/**
-	 * Returns the pagerlayout
-	 * @return AppKitDoctrinePagerLayout
-	 * @author Marius Hein
-	 */
-	public function getLayout() {
-		$this->initLayout();
-		return $this->layout;
-	}
-	
-	/**
-	 * Display the pager
-	 * @return strintg
-	 * @author Marius Hein
-	 * @throws Doctrine_Pager_Exception
-	 */
-	public function displayLayout() {
-		return $this->getLayout()->display();
-	}
-	
-}
-
-?>
\ No newline at end of file
diff --git a/app/modules/AppKit/lib/doctrine/AppKitDoctrinePagerLayout.class.php b/app/modules/AppKit/lib/doctrine/AppKitDoctrinePagerLayout.class.php
deleted file mode 100755
index c9c70b0..0000000
--- a/app/modules/AppKit/lib/doctrine/AppKitDoctrinePagerLayout.class.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-class AppKitDoctrinePagerLayout extends Doctrine_Pager_Layout {
-	
-	public function __construct($pager, $pagerRange, $urlMask) {
-		
-		parent::__construct($pager, $pagerRange, $urlMask);
-		
-		$this->setTemplate('<td class="page_links"><a class="pager_link" href="{%url}">{%page}</a></td>');
-		$this->setSelectedTemplate('<td class="page_links"><a class="pager_link act" href="{%url}">{%page}</a></td>');
-		$this->setSeparatorTemplate('');
-		
-	}
-	
-	public function display($options = array(), $return = false) {
-        $pager = $this->getPager();
-        $str = '';
-
-        if ($pager->getPage() > 1) {
-        
-	        // First page
-	        $this->addMaskReplacement('page', '«', true);
-	        $options['page_number'] = $pager->getFirstPage();
-	        $str .= $this->processPage($options);
-	
-	        // Previous page
-	        $this->addMaskReplacement('page', '‹', true);
-	        $options['page_number'] = $pager->getPreviousPage();
-	        $str .= $this->processPage($options);
-        
-        }
-        
-        // Pages listing
-        $this->removeMaskReplacement('page');
-        $str .= parent::display($options, true);
-
-        if ($pager->getPage() < $pager->getLastPage()) {
-        
-	        // Next page
-	        $this->addMaskReplacement('page', '›', true);
-	        $options['page_number'] = $pager->getNextPage();
-	        $str .= $this->processPage($options);
-	
-	        // Last page
-	        $this->addMaskReplacement('page', '»', true);
-	        $options['page_number'] = $pager->getLastPage();
-	        $str .= $this->processPage($options);
-
-        }
-        
-        // Adding a frame arround
-        if ($str) {
-        	$info = sprintf('<td class="pager_info">(page %d of %d, %d entries found)</td>', $pager->getPage(), $pager->getLastPage(), $pager->getNumResults());
-        	$str = sprintf('<div class="pager_frame"><table class="pager_frame"><tr>%s%s</tr></table></div>', $str, $info);
-        }
-        
-        // Possible wish to return value instead of print it on screen
-        if ($return) {
-            return $str;
-        }
-
-        echo $str;
-    }
-	
-}
-
-?>
\ No newline at end of file
diff --git a/app/modules/AppKit/views/Admin/Users/IndexSuccessView.class.php b/app/modules/AppKit/views/Admin/Users/IndexSuccessView.class.php
index 780aea5..6bc884f 100755
--- a/app/modules/AppKit/views/Admin/Users/IndexSuccessView.class.php
+++ b/app/modules/AppKit/views/Admin/Users/IndexSuccessView.class.php
@@ -5,21 +5,7 @@ class AppKit_Admin_Users_IndexSuccessView extends AppKitBaseView
 	public function executeHtml(AgaviRequestDataHolder $rd)
 	{
 		$this->setupHtml($rd);
-
-		
-		$useradmin = $this->getContext()->getModel('UserAdmin', 'AppKit');
-		
-		$users = $useradmin->getUsersQuery(true);
-		
-		$pager = AppKitDoctrinePager::createNew($users, $rd->getParameter('page_offset', 1), 'appkit.admin.users');
-		
-		$this->setAttribute('user_collection', $users->execute());
-		$this->setAttribute('user_pager', $pager);
-		
-		if ($users->count()<=0) {
-			$this->getMessageQueue()->enqueue(AppKitMessageQueueItem::Error('No users found, this is really bad!'));
-		}
 	}
 }
 
-?>
\ No newline at end of file
+?>





More information about the icinga-checkins mailing list