OSB enhancements to date
This commit is contained in:
@@ -20,64 +20,8 @@
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @package AgileBill
|
||||
* @subpackage Modules:StaticPages
|
||||
* @deprecated Now using KH
|
||||
*/
|
||||
|
||||
/**
|
||||
* The main AgileBill Static Page Categories Class
|
||||
*
|
||||
* @package AgileBill
|
||||
* @subpackage Modules:StaticPages
|
||||
*/
|
||||
class static_page_category extends OSB_module {
|
||||
/**
|
||||
* Get the page categories
|
||||
*/
|
||||
public function get_page_categories($VAR) {
|
||||
global $C_auth;
|
||||
|
||||
$categories = array();
|
||||
$db = &DB();
|
||||
|
||||
if (isset($VAR['id']) && trim($VAR['id']))
|
||||
$result = $db->Execute(sqlSelect($db,'static_page_category','id,name,group_avail',array('status'=>1,'id'=>$VAR['id']),'sort_order,name'));
|
||||
else
|
||||
$result = $db->Execute(sqlSelect($db,'static_page_category','id,name,group_avail',array('status'=>1),'sort_order,name'));
|
||||
|
||||
if ($result && $result->RecordCount())
|
||||
while (! $result->EOF) {
|
||||
@$arr = unserialize($result->fields['group_avail']);
|
||||
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($C_auth->auth_group_by_id($arr[$i])) {
|
||||
array_push($categories,array('name'=>$result->fields['name'],'id'=>$result->fields['id']));
|
||||
$i=count($arr);
|
||||
}
|
||||
}
|
||||
|
||||
$result->MoveNext();
|
||||
}
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the page categories to a user
|
||||
*/
|
||||
public function menu() {
|
||||
global $smarty;
|
||||
|
||||
$smart = $this->get_page_categories(array());
|
||||
|
||||
if (! count($smart)) {
|
||||
$smarty->assign('static_page_category_display',false);
|
||||
return false;
|
||||
|
||||
} else {
|
||||
$smarty->assign('static_page_category_display',true);
|
||||
$smarty->assign('static_page_category_results',$smart);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
class static_page_category extends OSB_module {}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user