From: <gem...@li...> - 2012-11-29 13:13:40
|
Revision: 1047 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1047&view=rev Author: matijsdejong Date: 2012-11-29 13:13:28 +0000 (Thu, 29 Nov 2012) Log Message: ----------- Renewed fix for #564 using formatFunction instead Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2012-11-29 11:06:23 UTC (rev 1046) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2012-11-29 13:13:28 UTC (rev 1047) @@ -50,13 +50,6 @@ public $filterStandard = array('grc_success' => 1); - /** - * Variable for correctly displaying e-mail addresses - * - * @var MUtil_Lazy_LazyAbstract - */ - protected $grs_email; - public $showSnippets = array( 'RespondentDetailsSnippet', 'AddTracksSnippet', @@ -79,9 +72,8 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { - $this->grs_email = $bridge->getLazy('grs_email'); $model->setIfExists('gr2o_opened', 'tableDisplay', 'small'); - $model->setIfExists('grs_email', 'itemDisplay', array($this, 'ifmail')); + $model->setIfExists('grs_email', 'formatFunction', 'MUtil_Html_AElement::ifmail'); if ($menuItem = $this->findAllowedMenuItem('show')) { $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); @@ -471,23 +463,6 @@ } /** - * Helper function for preventing the marker value being mixed up in the output - * - * @param MUtil_Lazy_LazyAbstract $value - * @return MUtil_Html_AElement - */ - public function ifmail($value) - { - return MUtil_Lazy::iff($this->grs_email, - new MUtil_Html_AElement( - array('mailto:', $this->grs_email), - $value, - array('onclick' => 'event.cancelBubble=true;') - ) - ); - } - - /** * Overrule default index for the case that the current * organization cannot have users. */ Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-11-29 11:06:23 UTC (rev 1046) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-11-29 13:13:28 UTC (rev 1047) @@ -977,7 +977,13 @@ */ public function remove($name, $key = null) { - if (isset($this->_model[$name][$key])) unset($this->_model[$name][$key]); + if (null === $key) { + if (isset($this->_model[$name])) { + unset($this->_model[$name]); + } + } elseif (isset($this->_model[$name][$key])) { + unset($this->_model[$name][$key]); + } return $this; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |