Added Admin_Only decorator and greyed out read-only text-areas

This commit is contained in:
Albert Santoni 2015-04-14 14:35:37 -04:00
parent a48ae75907
commit 3695049a6c
2 changed files with 15 additions and 1 deletions

View file

@ -12,4 +12,18 @@ class Airtime_Decorator_SuperAdmin_Only extends Zend_Form_Decorator_Abstract
return "";
}
}
}
/** Hide a Zend_Form_Element unless you're logged in as an Admin or SuperAdmin. */
class Airtime_Decorator_Admin_Only extends Zend_Form_Decorator_Abstract
{
public function render($content)
{
$currentUser = Application_Model_User::getCurrentUser();
if ($currentUser->isSuperAdmin() || $currentUser->isAdmin()) {
return $content;
} else {
return "";
}
}
}