Exemple #1
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
 }
 /**
  * inicia a controller conforme configurado em navigation e retorna o resultado do metodo chamado
  * @return HttpResultVO
  */
 private function getControllerResult()
 {
     $ignore_name = Config::getAliasFolder();
     if (Config::getLocale()) {
         $ignore_name .= "/" . Config::getLocale();
     }
     //url com trata com regras de rota
     $url = explode("/", Config::rewriteUrl(Navigation::getURI($ignore_name, Navigation::URI_RETURN_TYPE_STRING)));
     //inicia a controller
     $retornoDaController = self::searchController($url, Config::FOLDER_REQUEST_CONTROLER);
     //afiliados ( afiliate) reconhecer aqui a poss�vel origem do internauta atrav�s do restFolder afiliate.N
     $arrayVariable = Navigation::getVariableArraySlug($retornoDaController->arrayRestFolder);
     if (!$retornoDaController->success) {
         //pega o nome da classe para instanciar e executa o init
         $tempExplode = explode("/", Config::URL_DEFAULT_CONTROLLER);
         $className = $tempExplode[count($tempExplode) - 1];
         $className = str_replace(array(".class.php", ".php"), "", $className);
         $retornoDaController->className = $className;
         $retornoDaController->methodName = "init";
         $retornoDaController->urlToInclude = Config::URL_DEFAULT_CONTROLLER;
     }
     $className = $retornoDaController->className;
     $methodName = $retornoDaController->methodName;
     //inclui a controller
     include_once $retornoDaController->urlToInclude;
     //instancia
     $instancia = new $className($retornoDaController->arrayRestFolder);
     //executa o metodo e este deve retornar sempre uma HttpResultVO
     if (!ClassHandler::isMethodPublic($instancia, $methodName)) {
         $methodName = "init";
     }
     $HttpResultVO = $instancia->{$methodName}();
     return $HttpResultVO;
 }
Exemple #3
0
 public function __construct($arrayRestFolder = NULL)
 {
     parent::__construct($arrayRestFolder);
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
     $this->module = DataHandler::getValueByArrayIndex($this->arrayVariable, "module") ? DataHandler::getValueByArrayIndex($this->arrayVariable, "module") : "theme";
     switch ($this->module) {
         case "style":
             $this->DAO = StyleDAO::getInstance();
             break;
         case "technique":
             $this->DAO = TechniqueDAO::getInstance();
             break;
         case "type":
             $this->DAO = TypeDAO::getInstance();
             break;
         case "format":
             $this->DAO = FormatDAO::getInstance();
             break;
         case "composition":
             $this->DAO = CompositionDAO::getInstance();
             break;
         case "theme":
             $this->DAO = ThemeDAO::getInstance();
             break;
         default:
             $this->DAO = ThemeDAO::getInstance();
             break;
     }
 }
 public function __construct($arrayRestFolder)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
         //$this->MenuController = new MenuController($this->arrayVariable);
     }
 }
 public function __construct($arrayRestFolder = NULL)
 {
     Config::getConection();
     $this->DAO = new CategoryDAO();
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
 }
Exemple #6
0
 /**
  * na construct da facil content pode-se configurar como essa content vai se comportar
  * nisso também pode-se iniciar os plugins que serão aceitos e que respeitem o padrão FacilPlugin
  * @param $arrayRestFolder
  * @return unknown_type
  */
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
     }
     $this->moduleName = "content";
     //$this->ContentInfoPostVO = new ContentInfoPostVO($_POST, $_FILE);
 }
Exemple #7
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
     }
     //por padrão ele popula as infos que ele possui com o que veio na restFolder, pode ser resetado utilizando resetInfoPost
     $this->MailInfoPostVO = new MailInfoPostVO($this->arrayVariable);
 }
Exemple #8
0
 public function __construct($arrayRestFolder)
 {
     Config::getConection();
     $this->DAO = CategoryDAO::getInstance();
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
         //$this->MenuController = new MenuController($this->arrayVariable);
     }
 }
Exemple #9
0
 public function __construct($currentQuery = null)
 {
     $this->currentQuery = $currentQuery;
     //Config::getConection();
     $this->arrayRestFolder = Navigation::getURI(Config::getRootPath(), Navigation::URI_RETURN_TYPE_ARRAY);
     $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     if (in_array("promocoes", $this->arrayRestFolder)) {
         $this->arrayVariable["promocoes"] = 1;
     }
 }
Exemple #10
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
         //por padrão ele popula as infos que ele possui com o que veio na restFolder, pode ser resetado utilizando resetInfoPost
         $this->infoPost = new FileInfoPostVO($this->arrayVariable);
     }
     $this->defaultFolderForNewFiles = Config::getFolderView() . "/upload/file/";
     $this->moduleName = "facil_file";
 }
Exemple #11
0
 public function __construct($arrayRestFolder)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
     $this->to = "";
     //Debug::print_r($arrayRestFolder);
     if (count($arrayRestFolder) > 0 && $arrayRestFolder[0] == "to") {
         for ($i = 1; $i < count($arrayRestFolder); $i++) {
             $this->to .= $arrayRestFolder[$i] . "/";
         }
     }
 }
Exemple #12
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
         //por padrão ele popula as infos que ele possui com o que veio na restFolder, pode ser resetado utilizando resetInfoPost
         $this->infoPost = new ImageInfoPostVO($this->arrayVariable);
     }
     $this->defaultFolderForNewImages = Config::getRootApplication() . "/upload/image/";
     $this->defaultImage404 = "img/no_image.jpg";
     $this->moduleName = "facil_image";
     $this->defaultMinWidth = 100;
     $this->defaultMinHeight = 100;
 }
 public function __construct($arrayRestFolder = NULL)
 {
     //verifica se o sujeito está logado e se é admin
     if (!UserClient::isAlive()) {
         Navigation::redirect("admin/login");
     } else {
         if (UserClient::getTypeId() != Config::ADMIN_USER_TYPE_ID && UserClient::getTypeId() != Config::DEVELOPER_USER_TYPE_ID) {
             //o sujeito ou não está logado ou ele não é admin
             Navigation::redirect("admin/login");
         }
     }
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
     }
 }
Exemple #14
0
 public function __construct($arrayRestFolder = NULL)
 {
     if (!UserClient::isAlive()) {
         Navigation::redirect("client/login");
         exit;
     }
     $id_user = UserClient::getId();
     $PartnerDAO = PartnerDAO::getInstance();
     $ReturnPartnerDAO = $PartnerDAO->selectById($id_user);
     if ($ReturnPartnerDAO->success && count($ReturnPartnerDAO->result) > 0) {
         $_SESSION["is_partner"] = 1;
     }
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
     $this->DAO = PurchaseOrderDAO::getInstance();
 }
Exemple #15
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
     }
     parent::__construct($arrayRestFolder);
     //define a dao a ser usada em toda a controler
     $this->ContentSiteDAO = ContentSiteDAO::getInstance();
     //define a vo a ser usada em toda a controler
     $this->ContentSiteVO = $this->ContentSiteDAO->getVO();
     //pega id passado na url
     $this->content_id = DataHandler::getValueByArrayIndex($this->arrayVariable, 'id');
     //popula a a contentvo com os dados conforme o id passado
     if ($this->content_id) {
         $this->ContentSiteVO->setId($this->content_id, TRUE);
     }
 }