function get_links() { $this->Paging["count"] = FooterLink::get(NULL, true); $footer_links = FooterLink::get(NULL, false, $this->Paging['page'], $this->Paging['show']); return $footer_links; }
//you can see array of tasks in authorize.inc.php $page_task = 'manage_links'; //meta networks require_once "{$path_prefix}/web/includes/authorize.inc.php"; $configure_permission = $task_perm; //set from authorize.inc.php } else { //old method for spawned networks $configure_permission = current_user_can('configure_network'); } $error = FALSE; if (!$configure_permission) { $error = TRUE; $msg[] = "Sorry! you are not authorized to view the content of this page"; } $footer_link = new FooterLink(); filter_all_post($_POST); if (!$error && !empty($_POST) && @$_POST['btn_footer_link']) { // if page is submitted if (!empty($_POST['id'])) { $footer_link->id = $_POST['id']; $msg_id = 11007; } else { $msg_id = 11008; } $mandatory_fields = array('caption' => 'Caption', 'url' => 'URL'); foreach ($mandatory_fields as $key => $value) { if (empty($_POST[$key])) { $error = TRUE; $msg[] = $value . ' can\'t be empty.'; }