/**
  * Renders the icon to edit a records tags
  * @param class_model|interface_model $objListEntry
  * @return string
  */
 protected function renderTagAction(class_model $objListEntry)
 {
     if ($objListEntry->getIntRecordDeleted() == 1) {
         return "";
     }
     if ($objListEntry->rightView()) {
         //the tag list is more complex and wrapped by a js-logic to load the tags by ajax afterwards
         // @codingStandardsIgnoreStart
         $strOnClick = "KAJONA.admin.folderview.dialog.setContentIFrame('" . class_link::getLinkAdminHref("tags", "genericTagForm", "&systemid=" . $objListEntry->getSystemid()) . "'); KAJONA.admin.folderview.dialog.setTitle('" . uniStrReplace(array("\r", "\n"), "", strip_tags(nl2br($objListEntry->getStrDisplayName()))) . "'); KAJONA.admin.folderview.dialog.init(); return false;";
         $strLink = "<a href=\"#\" onclick=\"" . $strOnClick . "\" title=\"" . $this->getLang("commons_edit_tags") . "\" rel=\"tagtooltip\" data-systemid=\"" . $objListEntry->getSystemid() . "\">" . class_adminskin_helper::getAdminImage("icon_tag", $this->getLang("commons_edit_tags"), true) . "</a>";
         // @codingStandardsIgnoreEnd
         return $this->objToolkit->listButton($strLink);
     }
     return "";
 }
 /**
  * @return bool
  */
 public function rightView()
 {
     return parent::rightView() && $this->getStrUser() == $this->objSession->getUserID();
 }
Exemple #3
0
 /**
  * Validates a set of permissions for a single object.
  * The string of permissions is a comma-separated list, whereas the entries may be one of
  * view, edit, delete, right, right1, right2, right3, right4, right5
  * If at least a single permission is given, true is returned, otherwise false.
  *
  * @param string $strPermissions
  * @param class_model $objObject
  *
  * @return bool
  * @throws class_exception
  * @since 4.0
  */
 public function validatePermissionString($strPermissions, class_model $objObject)
 {
     if (!$objObject instanceof class_model) {
         throw new class_exception("automated permission-check only for instances of class_model", class_exception::$level_ERROR);
     }
     if (trim($strPermissions) == "") {
         return false;
     }
     $arrPermissions = explode(",", $strPermissions);
     foreach ($arrPermissions as $strOnePermissions) {
         $strOnePermissions = trim($strOnePermissions);
         switch (trim($strOnePermissions)) {
             case self::$STR_RIGHT_VIEW:
                 if ($objObject->rightView()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_EDIT:
                 if ($objObject->rightEdit()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_DELETE:
                 if ($objObject->rightDelete()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT:
                 if ($objObject->rightRight()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT1:
                 if ($objObject->rightRight1()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT2:
                 if ($objObject->rightRight2()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT3:
                 if ($objObject->rightRight3()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT4:
                 if ($objObject->rightRight4()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_RIGHT5:
                 if ($objObject->rightRight5()) {
                     return true;
                 }
                 break;
             case self::$STR_RIGHT_CHANGELOG:
                 if ($objObject->rightChangelog()) {
                     return true;
                 }
                 break;
             default:
                 break;
         }
     }
     return false;
 }
 /**
  * @param class_model $objListEntry
  * @param bool $bitDialog
  *
  * @return string
  */
 protected function renderEditAction(class_model $objListEntry, $bitDialog = false)
 {
     if ($objListEntry->rightView()) {
         return $this->objToolkit->listButton(class_link::getLinkAdmin($objListEntry->getArrModule("modul"), "edit", "&systemid=" . $objListEntry->getSystemid(), $this->getLang("action_edit"), $this->getLang("action_edit"), "icon_lens"));
     }
     return "";
 }
 /**
  * @param class_model|interface_admin_listable|interface_model $objOneIterable
  * @param string $strListIdentifier
  *
  * @return string
  */
 public function getActionIcons($objOneIterable, $strListIdentifier = "")
 {
     if ($strListIdentifier == self::INT_LISTTYPE_FOLDERVIEW) {
         $strTargetfield = $this->getParam("form_element");
         if ($objOneIterable instanceof class_module_mediamanager_file && $objOneIterable->rightView()) {
             if ($objOneIterable->getIntType() == class_module_mediamanager_file::$INT_TYPE_FOLDER) {
                 return $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "folderContentFolderviewMode", "&form_element=" . $strTargetfield . "&systemid=" . $objOneIterable->getSystemid(), "", $this->getLang("action_open_folder"), "icon_folderActionOpen"));
             } else {
                 if ($objOneIterable->getIntType() == class_module_mediamanager_file::$INT_TYPE_FILE) {
                     return $this->objToolkit->listButton("<a href=\"#\" title=\"" . $this->getLang("commons_accept") . "\" rel=\"tooltip\" onclick=\"KAJONA.admin.folderview.selectCallback([['" . $strTargetfield . "', '" . $objOneIterable->getStrFilename() . "']]);\">" . class_adminskin_helper::getAdminImage("icon_accept") . "</a>");
                 }
             }
         }
         return "";
     }
     return parent::getActionIcons($objOneIterable, $strListIdentifier);
 }
 /**
  * @param class_model|class_module_pages_page $objListEntry
  *
  * @return array
  */
 protected function renderAdditionalActions(class_model $objListEntry)
 {
     $bitPeMode = $this->getParam("pe") != "";
     if ($objListEntry instanceof class_module_pages_page) {
         $arrReturn = array();
         if ($objListEntry->getIntType() == class_module_pages_page::$INT_TYPE_ALIAS) {
             $objTargetPage = class_module_pages_page::getPageByName($objListEntry->getStrAlias());
             if (!$bitPeMode && $objTargetPage != null && $objTargetPage->rightEdit()) {
                 $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objTargetPage->getStrSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("seite_inhalte_alias"), "icon_page_alias"));
             }
             $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("page_sublist"), "icon_folderActionOpen"));
         } else {
             if ($objListEntry->rightView()) {
                 if (!$bitPeMode && $objListEntry->rightEdit()) {
                     $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages_content", "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("seite_inhalte"), "icon_page"));
                 }
                 $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin($this->getArrModule("modul"), "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), "", $this->getLang("page_sublist"), "icon_folderActionOpen"));
             }
         }
         return $arrReturn;
     } else {
         if ($objListEntry instanceof class_module_pages_folder) {
             $arrReturn[] = $this->objToolkit->listButton(class_link::getLinkAdmin("pages", "list", "&systemid=" . $objListEntry->getSystemid() . "&pe=" . $this->getParam("pe"), $this->getLang("pages_ordner_oeffnen"), $this->getLang("pages_ordner_oeffnen"), "icon_folderActionOpen"));
             return $arrReturn;
         } else {
             return parent::renderAdditionalActions($objListEntry);
         }
     }
 }