public function add($title, $plugin = 'app', $app_id = null, $app_action = 'index', $icon = null, $post_app_params = null, $location = null, $id_parent, $content = null) { if (is_array($post_app_params)) { $c = count($post_app_params); if ($c != 0) { $app_params = array(); foreach ($post_app_params as $key => $value) { $app_params[] = $key . ':' . $value; } $db_app_params = implode(',', $app_params); } } global $my_user; if ($icon == 'null') { $icon = ''; } $items = array('file_title' => filter::utf($title), 'id_user' => $my_user->get_id_user(), 'id_parent' => filter::num($id_parent), 'plugin_id' => filter::alfas($plugin), 'app_id' => filter::alfas($app_id), 'app_action' => filter::alfas($app_action), 'created_at' => time(), 'modified_at' => time(), 'app_params' => $db_app_params, 'location' => filter::alfa($location), 'icon' => filter::fname($icon), 'content' => $content); global $sql; if (false !== ($record_id = $sql->add($this->db_shortcuts, $items))) { return $record_id; } else { return false; } }