public static function remove($args) { if( !(isset($args[0])) ) return false; $items = ModelHandler::get("Posts",$args); foreach ($items as $item) { ModelHandler::remove($item); } return true; }
public static function getForm( $args ) { if( count($args) != 1 ) return false; if( $args[0] == null ){ $item = ModelHandler::getEmptyItem("Users"); //l($item); }else{ $item = ModelHandler::get("Users", $args); $item = $item[0]; } $form = ViewHandler::wrap("Form", $item); return $form; }
public static function entry($args) { if( count($args) > 1 ) echo 404; else{ $post = ModelHandler::get("Posts", array($args[0])); $post = $post[0]; $content = ViewHandler::wrap("post", $post); $tpl = new TPL(); $tpl->assign("content",$content); $tpl->draw("main"); } }
public static function remove(Item $item) { return ModelHandler::remove($item[0]); }
public static function getCurrentUser() { if(Authorization::isAuthorized()) return ModelHandler::get('Users', array($_COOKIE['user_id'])); else return false; }