public function __construct() { // Thou shall not pass Check::rights(); }
function transfer($area,$id) { global $add_res; Check::rights(); query::$post = array('id' => $id, 'sure' => 1, 'do' => array('art','transfer'), 'where' => $area); include_once('libs/input/common.php'); $result = input__common::transfer(query::$post, false); if (!empty($result)) { $add_res['meta_error'] = $result; } }
public function pack_join () { Check::rights(); $parent = (int) query::$post['parent']; $child = (int) query::$post['child']; Database::update('art_pack', array('weight' => 0), $parent); $child_arts = Database::get_full_table('art_in_pack', 'pack_id = ?', $child); $parent_order = Database::get_field('art_in_pack', 'max(`order`)', 'pack_id = ?', $parent); foreach ($child_arts as $child_art) { Database::update('art_in_pack', array( 'order' => $child_art['order'] + $parent_order + 1, 'pack_id' => $parent ), 'pack_id = ? and art_id = ?', array($child_art['pack_id'], $child_art['art_id']) ); } Database::delete('art_pack', $child); }