Files
zurawik.pl/Admin/controller/IndexController.php
2026-05-15 20:23:25 +02:00

86 lines
2.4 KiB
PHP

<?php
/**
* Strona glowna
*
*/
class IndexController extends MainController implements ControllerInterface {
/**
* strona glowna
*
*/
public function IndexAction($param) {
$kat = '../temp/compile';
if (is_dir($kat) && ($katalog = opendir($kat))) {
while ($plik = readdir($katalog)) {
if ($plik != '.' AND $plik != '..' && is_file($kat . '/' . $plik)) {
unlink($kat . '/' . $plik);
}
}
closedir($katalog);
}
$this->AddRedirect(URL_MAIN . '/Structure/', 0);
//$this->AddRedirect(URL_MAIN . '/Calc/', 0);
}
public function TestAction($param) {
}
public function ParserXmlAction($param) {
//ini_set($varname, $newvalue)
$xml = simplexml_load_file(PATH_STATIC_CONTENT . "/sklepy_stacjonarne.xml");
Utils::ArrayDisplay($xml);
//$arrayXml = XML2Array::createArray($xml->channel);
$k = 0;
// foreach ($xml->channel->item as $key => $entry) {
// //Utils::ArrayDisplay($entry);
// $htmlString[$k]['content'] = (string) $entry->children('content', true)->encoded;
// $htmlString[$k]['title'] = (string) $entry->title;
// $date = $entry->pubDate;
// $htmlString[$k]['pubDate'] = (string) $entry->children('wp', true)->post_date;
// $htmlString[$k]['autor'] = (string) $entry->children('dc', true)->creator;
//
// $content = (string) $entry->children('content', true)->encoded;
// $arrayContent = explode("<!--more-->", $content);
// Utils::ArrayDisplay($arrayContent);
// $htmlString[$k]['shortnote'] = nl2br($arrayContent[0]);
// if (isset($arrayContent[1])) {
// $htmlString[$k]['content'] = nl2br($arrayContent[1]);
// } else {
// $htmlString[$k]['content'] = "";
// }
//
//
// $k++;
// }
}
/**
* Metoda wspolna
*
*/
public function preDispatch($param) {
$this->smarty->assign('titleAdmin', 'Panel Administracyjny');
// $this->RunShared('Auth');
// $this->RunShared('Auth', array());
// $this->smarty->assign("menuSelected", "");
// $this->smarty->assign('activeTab', 'index');
// $this->AddScript("formAction.js");
// $this->Run($param);
}
/**
*
*
*/
public function postDispatch($param) {
}
}
?>