/** * Will trigger the default administration error message; * * This method will take the error message to show and the URL where to go back, and will display the now default error message * indicating the user that he doesn't have the access to do a specific action. We're trying to standardize as much as we can * from the redundant administration code we use in our administration pages; * * @param S $objErrorMessage The error message to show; * @param S $objURLToGoBack The URL to go back afterwards; */ public function setErrorMessage(S $objErrorMessage, S $objURLToGoBack) { // Set the template file ... $tpF = new FilePath($this->getPathToSkin()->toRelativePath() . 'error_cannotDoAction.tp'); TPL::tpSet($objErrorMessage->entityEncode(ENT_QUOTES), new S('actionErrorMessage'), $tpF); TPL::tpSet($objURLToGoBack, new S('objURLToGoBack'), $tpF); TPL::tpExe($tpF); }
/** * Will check that a given category URL exists, before trying to get data for it. This is the good way to program a website * where you leave the full administration force to the un-reliable user ... * * @param S $objCategoryURL The category URL; * @return boolean Will return true if the category exists ... */ public function checkCategoryExistsByURL(S $objCategoryURL) { // Do return ... return $this->getCategoryInfoByURL($objCategoryURL->entityEncode(ENT_QUOTES), self::$objCategoryTableFName) instanceof A ? new B(FALSE) : new B(TRUE); }
/** * Will set the input tooltip; * * This method, will set the input tooltip attribute, that can be used by, for example, our jQuery based tooltip JS, so that * every input can have a hovering info box, that isn't part of the design and that will help the user fill-in the form * without much trouble; * * @param S $objFormAttributeVar * @return unknown */ public static final function setToolTip(S $objFormAttributeVar) { // Do return ... return self::setAttribute(new S('tooltip'), $objFormAttributeVar->entityEncode(ENT_QUOTES)); }