smarty->assign('arrayBanner', $arrayBanner); //Utils::ArrayDisplay($arrayBanner); $this -> AddScript('AC_RunActiveContent.js'); $this->AddScript('swfobject.js'); } /** * Dodawanie/edycja klient/banera * */ public function EditAction($param) { $logger = LoggerManager::getLogger(__CLASS__); //$this->AddScript('CopyFiles.js'); $this->AddScript('prototype.js'); $this->AddScript('validateFormCustomer.js'); $this->AddScript('CheckUnique.js'); if(isset($param['id'])) { $id=$param['id']; } else{ $id = null; } if(isset($_POST['saveCustomer'])) { //Utils::ArrayDisplay($_POST); $id = $_POST['id']; $name = $_POST['name']; $url = $_POST['url']; $sort = $_POST['sort']; $content = $_POST['content']; if(!strstr($url, "http://")) { $url = "http://".$url; } if (isset($_FILES['baner']) && $_FILES['baner']['error'] != 4) { //echo "sss ".isset($_FILES['photo']['name']); $fileName = $_FILES['baner']['name']; $ext = explode(".",$fileName); $fileName = Utils::ClearString($fileName); if (is_file(PATH_CUSTOMER.$id."/".$_POST['banerSaved'])) { unlink(PATH_CUSTOMER.$id."/".$_POST['banerSaved']); } } else if (isset($_POST['banerSaved'])) { $fileName = $_POST['banerSaved']; } if ($_POST['id']) { } //$idCustomer = $_POST['idCustomer']; $objCustomer = new Customer($id, $name, $fileName, $content, $url, $sort, $published); $id = CustomerDAL::Save($objCustomer); if (!is_dir(PATH_CUSTOMER.$id)) { mkdir(PATH_CUSTOMER.$id, 0777); } CustomerDAL::SaveCustomerFile($_FILES, 'baner', $fileName, PATH_CUSTOMER.$id); die(Header('Location: customer'.APPLICATION_FILE_TYPE)); } //AKCJE DOMY�LNE $objCustomer = CustomerDAL::GetCustomerById($id); //Utils::ArrayDisplay($objQuery); $this->smarty->assign('objCustomer', $objCustomer); $this->smarty->assign('id', $id); //Utils::ArrayDisplay($objCustomer); $this->smarty->register_modifier("sslash", "stripslashes"); } /** * Sprawdzanie unikalno�ci nazwy klient * * @param array $param */ public function AjaxCheckUniqueAction($param) { header('Content-Type: text/html; charset=iso-8859-2'); if ($_POST['value']) { $value = $_POST['value']; } else { $value = ""; } if ($_POST['column']) { $column = $_POST['column']; } else { $column = ""; } $unigue = Utils::CheckUnique('customer', $column, $value); if (!$unigue) { $this->smarty->assign("uniqueInfo", "1"); } $this->smarty->assign("column", $column); $template = 'clean.tpl'; Registry::Remove('smartyTemplate'); Registry::Set('smartyTemplate', $template); } /** * usuwanie banera * */ public function DeleteAction($param) { $logger = LoggerManager::getLogger(__CLASS__); $idCustomer = SessionProxy::GetValue(EnumSessionValue::IDCUSTOMER); if(isset($param['id'])) { $id=$param['id']; } else{ $id = null; } if($id) { CustomerDAL::Delete($id); // $filePath = PATH_BILLBOARD.$idCustomer."/".$id.".swf"; // if (is_file($filePath)) { // @unlink($filePath); // } die(Header('Location: customer'.APPLICATION_FILE_TYPE)); if (Pat) { } } //AKCJE DOMY�LNE //Utils::ArrayDisplay($objQuery); } public function RedirectAction($param) { if(isset($param) && is_array($param) && !empty($param) && isset($param['id']) && !empty($param['id'])) { $customer = CustomerDAL::GetCustomerById($param['id']); Utils::Redirect($customer -> GetRedirectUrl()); } exit; } /** * Metoda wspolna * */ public function preDispatch($param) { $this->AddScript("prototype.js"); $this->AddScript("scriptaculous.js"); $this->AddScript("GetContent.js"); $this->AddScript("tree.js"); $this->AddScript('dropDown.js'); $this->AddScript('structure.js'); $this->AddScript('Dosia.js'); $this->AddScript('Link.js'); $this->AddScript('drag-drop-folder-tree.js'); $this->AddScript('Validator.js'); $this->AddScript('calendar.js'); //Utils::ArrayDisplay($param); $this->Run($param); $this->RunShared('Structure', $param); $this->smarty->assign('titleAdmin', 'Struktura strony'); $arrayModuleName = MfModuleDAL::GetArrayModuleName(); $this->smarty->assign( 'arrayModuleName' ,$arrayModuleName); $this->smarty->assign('showIcon', true); $this->RunShared('Auth', $param); //Utils::ArrayDisplay(Utils::ArrayDisplay(SessionProxy::GetValue(EnumSessionValue::USER_OBJECT))); // if($this->IsUser()==false) { // $this->AddRedirect(URL_MAIN.'/Login.frmx', 0); // } } public function postDispatch($param) { } } ?>