Thread: [Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[139] trunk/0.3/cs_tabs.class.php
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-24 16:56:21
|
Revision: 139 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=139&view=rev Author: crazedsanity Date: 2009-08-24 16:56:14 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Fix cs_tabs so it works in its new location. /cs_tabs.class.php: * MAIN::: -- require the standard cs_webapplibsAbstract class. * __construct(): -- don't call parent classes' __construct() (it is an abstract function and will cause a fatal error). Modified Paths: -------------- trunk/0.3/cs_tabs.class.php Modified: trunk/0.3/cs_tabs.class.php =================================================================== --- trunk/0.3/cs_tabs.class.php 2009-08-24 16:25:59 UTC (rev 138) +++ trunk/0.3/cs_tabs.class.php 2009-08-24 16:56:14 UTC (rev 139) @@ -4,10 +4,10 @@ * */ -require_once(dirname(__FILE__) .'/abstract/cs_content.abstract.class.php'); +require_once(dirname(__FILE__) .'/abstract/cs_webapplibs.abstract.class.php'); -class cs_tabs extends cs_contentAbstract { +class cs_tabs extends cs_webapplibsAbstract { private $tabsArr=array(); private $selectedTab; @@ -25,7 +25,6 @@ * @param $templateVar (str,optional) What template var to find the tab blockrows in. */ public function __construct($templateVar="tabs") { - parent::__construct(false); if(is_object($templateVar)) { //trying to pass cs_genericPage{}... tell 'em we don't like that anymore. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-31 14:52:37
|
Revision: 146 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=146&view=rev Author: crazedsanity Date: 2009-08-31 14:52:28 +0000 (Mon, 31 Aug 2009) Log Message: ----------- Fix visibility of $gfObj to match parent class. Modified Paths: -------------- trunk/0.3/cs_tabs.class.php Modified: trunk/0.3/cs_tabs.class.php =================================================================== --- trunk/0.3/cs_tabs.class.php 2009-08-28 20:30:54 UTC (rev 145) +++ trunk/0.3/cs_tabs.class.php 2009-08-31 14:52:28 UTC (rev 146) @@ -10,7 +10,7 @@ private $selectedTab; private $templateVar; - private $gfObj; + protected $gfObj; /** This is the default suffix to use when none is given during the add_tab() call. */ private $defaultSuffix='tab'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2010-05-27 14:31:49
|
Revision: 161 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=161&view=rev Author: crazedsanity Date: 2010-05-27 14:31:40 +0000 (Thu, 27 May 2010) Log Message: ----------- Fix tab selection to be a bit more forgiving. /cs_tabs.class.php: * select_tab(): -- try to matching tabname to the beginning of each tabname or the end of each url if the actual tab name given doesn't exist. -- returns selected tab name. Modified Paths: -------------- trunk/0.3/cs_tabs.class.php Modified: trunk/0.3/cs_tabs.class.php =================================================================== --- trunk/0.3/cs_tabs.class.php 2010-05-13 18:16:07 UTC (rev 160) +++ trunk/0.3/cs_tabs.class.php 2010-05-27 14:31:40 UTC (rev 161) @@ -66,7 +66,22 @@ * @return (void) */ public function select_tab($tabName) { - $this->selectedTab = $tabName; + $selected = $tabName; + + if(!$this->tab_exists($tabName)) { + $fixedTabName = strtolower($tabName); + foreach($this->tabsArr as $name => $info) { + if(preg_match('/^'. $tabName .'/', $name)) { + $selected = $name; + } + elseif(preg_match('/'. $tabName .'$/', $info['url'])) { + $selected = $name; + } + } + } + + $this->selectedTab = $selected; + return($this->selectedTab); }//end select_tab() //--------------------------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2010-05-27 14:49:18
|
Revision: 162 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=162&view=rev Author: crazedsanity Date: 2010-05-27 14:49:12 +0000 (Thu, 27 May 2010) Log Message: ----------- Ability to retrieve internal properties from cs_tabs{}. /cs_tabs.class.php: * __get() [NEW]: -- ability to retrieve any (existing) internal property (easily allows for page titles to be dynamically set to name of selected tab). Modified Paths: -------------- trunk/0.3/cs_tabs.class.php Modified: trunk/0.3/cs_tabs.class.php =================================================================== --- trunk/0.3/cs_tabs.class.php 2010-05-27 14:31:40 UTC (rev 161) +++ trunk/0.3/cs_tabs.class.php 2010-05-27 14:49:12 UTC (rev 162) @@ -184,5 +184,19 @@ }//end rename_tab(); //--------------------------------------------------------------------------------------------- + + + //--------------------------------------------------------------------------------------------- + public function __get($name) { + if(isset($this->$name)) { + $retval = $this->$name; + } + else { + throw new exception(__METHOD__ .": no such var (". $name .")"); + } + return($retval); + }//end __get() + //--------------------------------------------------------------------------------------------- + } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |