site = $interface->getCfg('live_site');
$this->adminsite = $interface->getCfg('admin_site');
$this->cachepath = $interface->getCfg('cachepath');
}
private function display ($service) {
// Change for multiple repositories
// $link = $this->adminsite."/index2.php?option=com_remository&repnum=$this->repnum&act=".$service[1];
$link = $this->adminsite."/index2.php?option=com_remository&act=".$service[1];
echo "\n\t
";
}
public function view ($repositories, $repnum) {
$basic = array (
array(_DOWN_ADMIN_ACT_CONTAINERS, 'containers', 'categories.png'),
array(_DOWN_ADMIN_ACT_FILES, 'files', 'addedit.png'),
array(_DOWN_ADMIN_ACT_GROUPS, 'groups', 'user.png'),
array(_DOWN_ADMIN_ACT_UPLOADS, 'uploads', 'module.png'),
array(_DOWN_ADMIN_ACT_CONFIG, 'config', 'config.png')
);
$handlefiles = array (
array(_DOWN_ADMIN_ACT_UNLINKED, 'unlinked', 'langmanager.png'),
// array(_DOWN_ADMIN_ACT_FTP, 'ftp', 'sections.png'),
array(_DOWN_ADMIN_ACT_ADDSTRUCTURE, 'addstructure', 'sections.png'),
array(_DOWN_ADMIN_ACT_MISSING, 'missing', 'searchtext.png')
);
$housekeeping = array (
array(_DOWN_ADMIN_ACT_COUNTS, 'counts', 'cpanel.png'),
array(_DOWN_ADMIN_ACT_DOWNLOADS, 'downloads', 'cpanel.png'),
array(_DOWN_ADMIN_ACT_PRUNE, 'prune', 'trash.png'),
array(_DOWN_ADMIN_ACT_THUMBS, 'thumbs', 'mediamanager.png'),
array(_DOWN_CLASSIFICATIONS, 'classifications', 'categories.png')
);
$specials = array (
array(_DOWN_ADMIN_ACT_DBCONVERT, 'dbconvert', 'dbrestore.png'),
array(_DOWN_ADMIN_ACT_DBCONVERT2, 'dbconvert2', 'dbrestore.png')
);
$info = array (
array(_DOWN_ADMIN_ACT_STATS, 'stats', 'impressions.png'),
array(_DOWN_ADMIN_ACT_ABOUT, 'about', 'credits.png'),
array(_DOWN_ADMIN_ACT_SUPPORT, 'support', 'support.png')
);
$this->formStart('Control Panel');
echo '';
$repository = remositoryRepository::getInstance();
if (!empty($_SESSION['remositoryResetCounts'])) {
$repository->resetCounts(array());
unset ($_SESSION['remositoryResetCounts']);
}
if ($repository->Use_Database) $status = ""._DOWN_DATABASE."";
else $status = _DOWN_FILE_SYSTEM;
$legend = _DOWN_ADMIN_CPANEL_STORE;
echo "\n$legend $status
";
if (is_writeable($repository->Down_Path)) $status = ""._DOWN_WRITEABLE."";
else $status = ""._DOWN_NOT_WRITEABLE."";
$legend = _DOWN_ADMIN_CPANEL_FILESTORE;
echo "\n$legend $repository->Down_Path $status
";
if (is_writeable($repository->Up_Path)) $status = ""._DOWN_WRITEABLE."";
else $status = ""._DOWN_NOT_WRITEABLE."";
$legend = _DOWN_ADMIN_CPANEL_UPLOADS;
echo "\n$legend $repository->Up_Path $status
";
if (is_writeable($this->cachepath)) $status = ""._DOWN_WRITEABLE."";
else $status = ""._DOWN_NOT_WRITEABLE."";
$legend = _DOWN_ADMIN_CPANEL_CACHEPATH;
echo "\n$legend $this->cachepath $status
";
// Change for multiple repositories
// $this->listRepositories($repositories, $repnum);
echo "\n";
echo "\n\t
"._DOWN_CPANEL_SUB_BASIC."
";
foreach ($basic as $service) $this->display($service);
echo "\n";
echo "\n";
echo "\n";
echo "\n\t
"._DOWN_CPANEL_SUB_FILES."
";
foreach ($handlefiles as $service) $this->display($service);
echo "\n";
echo "\n";
echo "\n";
echo "\n\t
"._DOWN_CPANEL_SUB_HKEEP."
";
foreach ($housekeeping as $service) $this->display($service);
echo "\n";
echo "\n";
echo "\n";
echo "\n\t
"._DOWN_CPANEL_SUB_UTILS."
";
foreach ($specials as $service) $this->display($service);
echo "\n";
echo "\n";
echo "\n";
echo "\n\t
"._DOWN_CPANEL_SUB_INFO."
";
foreach ($info as $service) $this->display($service);
echo "\n";
echo "\n";
}
// Not currently used - may be needed to support multiple repositories
private function listRepositories ($repositories, $repnum) {
$body = '';
foreach ($repositories as $repository) {
$isactive = $repnum == $repository->id ? 'YES' : 'NO';
// Change for multiple repositories
//
$body .= <<
$isactive
|
$repository->name
|
$repository->alias
|
ONE_REPOSITORY;
}
$isactive = _DOWN_IS_ACTIVE;
$name = _DOWN_REPOSITORY_NAME;
$alias = _DOWN_REPOSITORY_ALIAS;
$makenew = _DOWN_NEW_REPOSITORY;
// Change for multiple repositories
//
echo <<
|
$isactive
|
$name
|
$alias
|
$body
|
$makenew
|
REPOSITORY_LIST;
}
}