Files
zurawik.pl/Admin/controller/SharedController.php
2026-05-15 18:33:51 +02:00

192 lines
5.3 KiB
PHP

<?php
/**
* $Id: SharedController.php 969 2008-07-29 13:55:14Z pawy $
* Kontroller wspolny
*
*/
class SharedController extends MainController implements ControllerInterface {
/**
* domyslna metoda
*
*/
public function IndexAction($param) {
}
public function infoFrame($param) {
$this->smarty->assign('info',$param['info']);
$this->smarty->assign('type',$param['type']);
}
public function Pagination($param) {
if(isset($param['strona']) && $param['strona'] > 0 ){
$page = $param['strona'];
$URLparam = $this->GetUrlParam($param);
}
else{
$page = 1;
$URLtemp = $this->GetUrlParam($param);
if (!isset($URLtemp[1])) {
$URLtemp[1] = '';
}
$URLparam = array($URLtemp[0], $URLtemp[1], 1, 'strona');
$URLparam = array_merge($URLparam, array_slice($URLtemp, 2));
}
$this->smarty->assign('CurrentPage', $page);
$URLParam = array("", "");
$URLParam[0] = $URLparam[3];
$URLParam[1] = $URLparam[1] . ',' . $URLparam[0];
for ( $i = 4, $size = sizeof($URLparam) ; $i < $size ; $i++)
{
$URLParam[0] = $URLparam[$i] . ',' . $URLParam[0];
}
$this->smarty->assign("URLParam", $URLParam);
$this->smarty->assign('pagination', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Admin($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function DefaultPanel($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Login($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Page($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Mailing($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function News($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Offer($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Structure($param) {
$lang = SessionProxy::GetValue('lang');
$location = SessionProxy::GetValue('location');
//Utils::ArrayDisplay($param);
$arrayObjStructureMain = StructureDAL::GetTree(array('lang' => $lang, 'type' => 1, 'location' => $location ),array());
$arrayObjStructureBottom = StructureDAL::GetTree(array('lang' => $lang, 'type' => 2, 'location' => $location),array());
$arrayObjStructureOther = StructureDAL::GetTree(array('lang' => $lang, 'type' => 3, 'location' => $location),array());
//$arrayRouter = RouterParamDAL::GetArrayRouter();
//Utils::ArrayDisplay($arrayObjStructureMain);
if (isset($param['id'])) {
$id = $param['id'];
} elseif (isset($param['idElement'])) {
$id = $param['idElement'];
} else {
$id = '';
}
$this->smarty->assign('idStucture', $id);
$this->smarty->assign( 'arrayObjStructure' ,$arrayObjStructureMain);
$this->smarty->assign( 'arrayObjStructureBottom' ,$arrayObjStructureBottom);
$this->smarty->assign( 'arrayObjStructureOther' ,$arrayObjStructureOther);
//Utils::ArrayDisplay($this->smarty->fetch($this->templatePath.$this->partialTemplate));
$this->partialTemplate = 'StructureModern.tpl';
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function Preferences($param) {
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function StructureAction($param) {
//$this->SetAjaxRender();
$lang = SessionProxy::GetValue('lang');
//Utils::ArrayDisplay($param);
$arrayObjStructure = StructureDAL::GetTree(array('lang' => $lang),array());
//$arrayRouter = RouterParamDAL::GetArrayRouter();
$this->smarty->assign( 'arrayObjStructure' ,$arrayObjStructure);
$this->smarty->assign('leftBox', $this->smarty->fetch($this->templatePath.$this->partialTemplate));
}
public function CustomerLink($param) {
//$this->SetAjaxRender();
$lang = SessionProxy::GetValue('lang');
//Utils::ArrayDisplay($param);
$type = ( isset($param['tagType']) ? $param['tagType'] : " 2 ");
$arrayCustomer = Utils::GetArrayList('mf_tag', 'id_mf_tag', 'tag', $lang, ' AND type = '.$type, 'tag');
//$arrayRouter = RouterParamDAL::GetArrayRouter();
$this->smarty->assign('arrayCustomer' ,$arrayCustomer);
}
/**
* Startuje sesje, weryfikuje autoryzacje admina
*
*/
/**
* Startuje sesje, weryfikuje autoryzacje admina
*
*/
public function Auth($param) {
$this->SetNoRender();
//session_start();
$admin = AuthDAL::GetAdmin();
$this->user = $admin;
//Utils::ArrayDisplay($this);
$this->smarty->assign('admin', $admin);
Registry::Set('admin', $admin);
if(!is_object($admin)) {
//$this->AddRedirectInfo("NIE ZALOGOWANY", null, Router::GenerateUrl('LOGIN', array("Login" => "Index")));
die(header("Location: ". Router::GenerateUrl('LOGIN', array("Login" => "Index")) ));
//$this->SetActionRedirect('AdminLoginRedirectAction');
}
}
/**
* Metoda wspolna
*
*/
public function preDispatch($param) {
$this->Run($param);
}
/**
*
*
*/
public function postDispatch($param) {
}
}
?>