コード例 #1
0
 /**
  * 
  * updateContentName
  * 
  * @param String $ErrorString
  * @param String $StatusString
  */
 public function updateContentName($ErrorString = "", $StatusString = "")
 {
     if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     $ErrorString = "";
     $StatusString = "";
     $ContentFinder = new ContentFinder();
     $Controler_Main = Controler_Main::getInstance();
     if (strlen($Request->getAsString("tb_ContentName")) < 3) {
         $ErrorString .= ":T_Menue_ERROR1:";
     }
     if (strlen($Request->getAsString("tb_ContentName"))) {
         $Content = $ContentFinder->findByNameAndMenueID($Request->getAsString("tb_ContentName"), $Request->getAsString("MenueID"));
         if ($Content->getId() != 0) {
             $ErrorString .= ":T_Meneu_ERROR2:";
         }
     }
     if (strlen($ErrorString) != 0) {
         $this->showEditMenue($ErrorString, $StatusString);
         return false;
     }
     $ContentManager = new ContentManager();
     $ContentID = $Request->getAsString("ContentID");
     $ContentName = $Request->getAsString("tb_ContentName");
     if ($ContentManager->updateById($ContentID, $ContentName)) {
         $this->showEditMenue("", ":T_MENUE_CONTENT_UPDATE_NAME_STATUS:");
     } else {
         $this->showEditMenue(":T_MENUE_CONTENT_UPDATE_NAME_ERROR:");
     }
 }