Example #1
0
 /**
  * Output a lock icon which also serves as a link to unlock a page (if the user has permission
  * to do this)
  *
  * @param  Array       menu item array for this lock
  * @param  DbUserModel user that is currently logged in
  * @return string
  */
 public function lockIcon($menu, DbUserModel $user)
 {
     if ($menu['locked']) {
         $user = new DbUserModel(array('dbUserID' => $menu['locked'], 'depth' => 'dbUser'));
         $title = "Currently locked by '{$this->h($user->dbUserFullName)}'.";
         if ($user->hasAccess('edit', $menu['page']) || $user->hasAccess('approve', $menu['page'])) {
             $title .= ' Click to unlock.';
             $html = $this->view->linkTo('#', $this->view->imageTag('icons/ffffff/lock_small.png', array('id' => $this->view->url(array('action' => 'unlock', 'id' => $menu['page']->pageID)), 'class' => 'inline lock tooltip', 'tooltip' => $title)));
         } else {
             $html = $this->view->imageTag('icons/ffffff/lock_small.png', array('class' => 'inline', 'title' => $title));
         }
     } else {
         $html = '';
     }
     return $html;
 }
Example #2
0
 /**
  * Outputs an option button for the "more options" panel
  *
  * @param  string name of the javascript event handler
  * @param  string image filename
  * @param  string description (when hovered over)
  * @param  string (optional) class to apply to the button
  * @return string
  */
 public function optionButton($handler, $image, $description, $class = 'inline')
 {
     $image = 'icons/ffffff/' . $image;
     return $this->view->linkTo("#{$handler}", $this->view->imageTag($image, array('class' => $class, 'title' => $description)));
 }