$url['id_page'], 'title'=>'', 'content'=>'', 'description'=>'', 'keywords'=>'', 'position'=>0, 'slug'=>'page' ); // Mode if( isset($_POST['button_draft']) ) $safe['mode'] = 'draft'; // Title if(isset($_POST['title'])) $safe['title'] = Validation::sanitize_html($_POST['title']); // Content if(isset($_POST['content'])) $safe['content'] = $_POST['content']; // Content if(isset($_POST['keywords'])) $safe['keywords'] = $_POST['keywords']; // Position if(isset($_POST['position'])) $safe['position'] = $_POST['position']; // Description for SEO if( isset($_POST['description']) ) $safe['description'] = Validation::sanitize_html( $_POST['description'] ); // Slug if(!empty($_POST['slug'])) $safe['slug'] = $_POST['slug']; elseif(!empty($safe['title'])) $safe['slug'] = Text::clean_url($safe['title'], '-', $translit_enable); // Add page $id = $_DB_PAGES->set($safe); if($id!==false) { Session::set_alert($_LANG['PAGE_HAS_BEEN_PUBLISHED_SUCCESSFULLY']); Redirect::controller('admin', 'page', 'list'); } } // ===================================================================== // VARIABLES // ===================================================================== $ctrlv['page'] = $_DB_PAGES->get( array('id'=>$url['id_page']) ); // Page does not exist if($ctrlv['page'] == array() ) Redirect::controller('admin', 'page', 'list'); $count = count($_DB_PAGES->get_all()); $ctrlv['positions_html'] = array_combine(range(1, $count), range(1, $count)); ?>