public function admin_add_type() { if (!Visitor::current()->group->can("add_type")) { show_403(__("Access Denied"), __("You do not have sufficient privileges to add types.", "extend")); } Type::add($_POST['name'], $_POST['description'], $_POST['color']); Flash::notice(__("Type added.", "extend"), "/admin/?action=manage_types"); }
public static function call() { $task = $_POST['task']; if ($task == 'getContent' && isset($_POST['title'])) { include_once 'Content.php'; Content::getFromTitle(); } else { if ($task == 'getContent') { include_once 'Content.php'; Content::get(); } else { if ($task == 'addContent') { include_once 'Content.php'; Content::add(); } else { if ($task == 'editContent') { include_once 'Content.php'; Content::edit(); } else { if ($task == 'deleteContent') { include_once 'Content.php'; Content::remove(); } else { if ($task == 'getType') { include_once 'Type.php'; Type::get(); } else { if ($task == 'addType') { include_once 'Type.php'; Type::add(); } else { if ($task == 'editType') { include_once 'Type.php'; Type::edit(); } else { if ($task == 'deleteType') { include_once 'Type.php'; Type::remove(); } else { if ($task == 'getContentOnUser') { include_once 'ContentOnUser.php'; ContentOnUser::get(); } else { if ($task == 'addContentToUser') { include_once 'ContentOnUser.php'; ContentOnUser::add(); } else { if ($task == 'editContentOnUser') { include_once 'ContentOnUser.php'; ContentOnUser::edit(); } else { if ($task == 'removeContentFromUser') { include_once 'ContentOnUser.php'; ContentOnUser::remove(); } else { if ($task == 'useContentOnUser') { include_once 'ContentOnUser.php'; ContentOnUser::useContentOnUser(); } else { if ($task == 'getUser') { include_once 'User.php'; User::get(); } else { echo "Task not recognized.<br>"; } } } } } } } } } } } } } } } }
public function actionAdd() { $model = new Type(); $status = $model->add($_GET); echo $status; }