File: //opt/cpanel/ea-php54/root/usr/share/pear/RVSeagullMod/modules/tryout/classes/PdfCatalogMgr.php
<?php
class PdfCatalogMgr extends SGL_Manager
{
function PdfCatalogMgr()
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
parent::SGL_Manager();
$this->pageTitle = 'PDF Catagory';
$this->template = 'PdfCatalog.html';
$this->_aActionsMapping = array(
'view' => array('view')
);
}
function validate($req, &$input)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$this->validated = true;
$input->error = array();
$input->pageTitle = $this->pageTitle;
$input->masterTemplate = $this->masterTemplate;
$input->template = $this->template;
$input->action = ($req->get('action'))? $req->get('action'): 'view';
}
function display(&$output)
{
}
function _cmd_view(&$input, &$output)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$path = "http://rvsitebuilder.com/pdfCatalog/filemtime.ini.txt";
$output->pdfFile_arr = $this->loadFilePdfCatalog($path);
}
function loadFilePdfCatalog($path)
{
//"http://rvsitebuilder.com/pdfCatalog/filemtime.ini";
$data = file($path);
foreach ($data as $key => $value) {
if(preg_match("/(.*?)+=/i", $value, $aMatch)){
$aPdfFile = explode('=', $value);
$file = str_replace(".md5", "", $aPdfFile[0]);
$key = str_replace(".", "_", $file);
$pdfFile_arr[$key]['file'] = $file;
$date = str_replace("\"", "", $aPdfFile[1]);
$dateStr = strtotime($date);
$pdfFile_arr[$key]['date'] = @strftime("%d-%m-%Y", $dateStr);
}
}
return $pdfFile_arr;
}
}
?>