--- /dev/null
+<?php
+
+/**
+ Plugin Name: Advanced Access Manager
+ Description: Manage User and Role Access to WordPress Backend and Frontend.
+ Version: 2.8.3
+ Author: Vasyl Martyniuk <support@wpaam.com>
+ Author URI: http://www.wpaam.com
+
+ ===========================================================================
+ LICENSE: This file is subject to the terms and conditions defined in *
+ file 'license.txt', which is part of this source code package. *
+ ===========================================================================
+ *
+ */
+require(dirname(__FILE__) . '/config.php');
+
+/**
+ * Main Plugin Class
+ *
+ * Responsible for initialization and handling user requests to Advanced Access
+ * Manager
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam {
+
+ /**
+ * Single instance of itself
+ *
+ * @var aam
+ *
+ * @access private
+ */
+ private static $_aam = null;
+
+ /**
+ * User Subject
+ *
+ * @var aam_Control_Subject_User
+ *
+ * @access private
+ */
+ private $_user = null;
+
+ /**
+ * Initialize the AAM Object
+ *
+ * @return void
+ *
+ * @access protected
+ */
+ protected function __construct() {
+ //use some internal hooks to extend functionality
+ add_filter('aam_access_objects', array($this, 'internalHooks'), 1, 2);
+
+ //initialize the user subject
+ $this->initializeUser();
+
+ if (is_admin()) {
+ //check if system requires update
+ $this->checkUpdate();
+
+ //print required JS & CSS
+ add_action('admin_print_scripts', array($this, 'printScripts'));
+ add_action('admin_print_styles', array($this, 'printStyles'));
+
+ //add help menu
+ add_filter('contextual_help', array($this, 'contextualHelp'), 10, 3);
+
+ //manager Admin Menu
+ if (aam_Core_API::isNetworkPanel()) {
+ add_action('network_admin_menu', array($this, 'adminMenu'), 999);
+ } else {
+ add_action('admin_menu', array($this, 'adminMenu'), 999);
+ }
+ add_filter('parent_file', array($this, 'filterMenu'), 999, 1);
+ //manager AAM Features Content rendering
+ add_action('admin_action_features', array($this, 'features'));
+ //manager AAM Ajax Requests
+ add_action('wp_ajax_aam', array($this, 'ajax'));
+ //manager WordPress metaboxes
+ add_action("in_admin_header", array($this, 'metaboxes'), 999);
+ //manager user search and authentication control
+ add_filter('user_search_columns', array($this, 'searchColumns'));
+ //terms & post restriction handlers
+ add_filter('get_terms', array($this, 'getBackendTerms'), 10, 3);
+ //post restrictions
+ add_action('post_updated', array($this, 'postUpdate'), 10, 3);
+ add_filter('page_row_actions', array($this, 'postRowActions'), 10, 2);
+ add_filter('post_row_actions', array($this, 'postRowActions'), 10, 2);
+ add_filter('tag_row_actions', array($this, 'tagRowActions'), 10, 2);
+ add_action('admin_action_edit', array($this, 'adminActionEdit'), 10);
+ //control permalink editing
+ add_filter(
+ 'get_sample_permalink_html', array($this, 'permalinkHTML'), 10, 4
+ );
+ //wp die hook
+ add_filter('wp_die_handler', array($this, 'wpDie'), 10);
+ //***For UI purposes***
+ add_action('parse_tax_query', array($this, 'parseTaxQuery'), 10, 1);
+ add_filter('editable_roles', array($this, 'editableRoles'), 999);
+ //control Admin area
+ add_action('admin_init', array($this, 'adminInit'));
+ } else {
+ //make sure that subject is initiated during the login
+ add_action('wp_login', array($this, 'login'), 0, 2);
+ //control WordPress frontend
+ add_action('wp', array($this, 'wp'), 999);
+ //filter navigation pages & taxonomies
+ add_filter('get_pages', array($this, 'getPages'));
+ add_filter('wp_get_nav_menu_items', array($this, 'getNavigationMenu'));
+ //widget filters
+ add_filter('sidebars_widgets', array($this, 'widgetFilter'), 999);
+ //get control over commenting stuff
+ add_filter('comments_open', array($this, 'commentOpen'), 10, 2);
+ //user login control
+ add_filter('wp_authenticate_user', array($this, 'authenticate'), 1, 2);
+ //terms & post restriction handlers
+ add_filter('get_terms', array($this, 'getFrontendTerms'), 10, 3);
+ }
+
+ //load extensions only when admin
+ $this->loadExtensions();
+
+ //add shutdown action
+ add_action('shutdown', array($this, 'shutdown'), 1);
+ }
+
+ /**
+ * Control Admin Area access
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function adminInit() {
+ global $plugin_page;
+
+ //compile menu
+ if (empty($plugin_page)){
+ $menu = basename(aam_Core_Request::server('SCRIPT_NAME'));
+ if ($query = trim(aam_Core_Request::server('QUERY_STRING'))) {
+ $menu .= '?' . $query;
+ }
+ } else {
+ $menu = $plugin_page;
+ }
+
+ $has = $this->getUser()->getObject(aam_Control_Object_Menu::UID)->has($menu);
+ if ($has === true){
+ $this->reject();
+ } elseif(is_null($has)
+ && aam_Core_ConfigPress::getParam('aam.menu.undefined') == 'deny'){
+ $this->reject();
+ }
+ }
+
+ /**
+ * Check if system requires update
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function checkUpdate() {
+ if (aam_Core_API::getBlogOption('aam_updated', '', 1) != AAM_VERSION) {
+ $update = new aam_Core_Update($this);
+ $update->run();
+ }
+ }
+
+ /**
+ * Control Frontend commenting freature
+ *
+ * @param boolean $open
+ * @param int $post_id
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function commentOpen($open, $post_id) {
+ $control = $this->getUser()->getObject(
+ aam_Control_Object_Post::UID, $post_id
+ );
+ if ($control->has('frontend', aam_Control_Object_Post::ACTION_COMMENT)) {
+ $open = false;
+ }
+
+ return $open;
+ }
+
+ /**
+ * Control edit permalink feature
+ *
+ * @param string $html
+ * @param int $id
+ * @param type $new_title
+ * @param type $new_slug
+ *
+ * @return string
+ */
+ public function permalinkHTML($html, $id, $new_title, $new_slug) {
+ if (aam_Core_ConfigPress::getParam('aam.control_permalink') === 'true') {
+ if ($this->getUser()->hasCapability('manage_permalink') === false) {
+ $html = '';
+ }
+ }
+
+ return $html;
+ }
+
+ /**
+ * Get Post ID
+ *
+ * Replication of the same mechanism that is in wp-admin/post.php
+ *
+ * @return WP_Post|null
+ *
+ * @access public
+ */
+ public function getPost() {
+ if (get_post()) {
+ $post = get_post();
+ } elseif ($post_id = aam_Core_Request::get('post')) {
+ $post = get_post($post_id);
+ } elseif ($post_id = aam_Core_Request::get('post_ID')) {
+ $post = get_post($post_id);
+ } else {
+ $post = null;
+ }
+
+ return $post;
+ }
+
+ /**
+ * Filter backend term list
+ *
+ * @param array $terms
+ * @param array $taxonomies
+ * @param array $args
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function getBackendTerms($terms, $taxonomies, $args) {
+ return $this->getTerms('backend', $terms);
+ }
+
+ /**
+ * Filter frontend term list
+ *
+ * @param array $terms
+ * @param array $taxonomies
+ * @param array $args
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function getFrontendTerms($terms, $taxonomies, $args) {
+ return $this->getTerms('frontend', $terms);
+ }
+
+ /**
+ * Filter terms based on area
+ *
+ * @param string $area
+ * @param array $terms
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function getTerms($area, $terms) {
+ if (is_array($terms)) {
+ foreach ($terms as $i => $term) {
+ if (is_object($term)) {
+ $object = $this->getUser()->getObject(
+ aam_Control_Object_Term::UID, $term->term_id
+ );
+ if ($object->has($area, aam_Control_Object_Term::ACTION_LIST)) {
+ unset($terms[$i]);
+ }
+ }
+ }
+ }
+
+ return $terms;
+ }
+
+ /**
+ * Filter Pages that should be excluded in frontend
+ *
+ * @param array $pages
+ *
+ * @return array
+ *
+ * @access public
+ * @todo Cache this process
+ */
+ public function getPages($pages) {
+ if (is_array($pages)) {
+ foreach ($pages as $i => $page) {
+ $object = $this->getUser()->getObject(
+ aam_Control_Object_Post::UID, $page->ID
+ );
+ if ($object->has('frontend', aam_Control_Object_Post::ACTION_EXCLUDE)) {
+ unset($pages[$i]);
+ }
+ }
+ }
+
+ return $pages;
+ }
+
+ /**
+ * Contextual Help Menu
+ *
+ * @param type $contextual_help
+ * @param type $screen_id
+ * @param type $screen
+ *
+ * @return
+ */
+ public function contextualHelp($contextual_help, $screen_id, $screen){
+ if ($this->isAAMScreen()){
+ $help = new aam_View_Help();
+ $help->content($screen);
+ }
+
+ return $contextual_help;
+ }
+
+ /**
+ * Filter Navigation menu
+ *
+ * @param array $pages
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function getNavigationMenu($pages) {
+ if (is_array($pages)) {
+ foreach ($pages as $i => $page) {
+ if ($page->type === 'taxonomy') {
+ $object = $this->getUser()->getObject(
+ aam_Control_Object_Term::UID, $page->object_id
+ );
+ $exclude = aam_Control_Object_Term::ACTION_EXCLUDE;
+ } else {
+ $object = $this->getUser()->getObject(
+ aam_Control_Object_Post::UID, $page->object_id
+ );
+ $exclude = aam_Control_Object_Post::ACTION_EXCLUDE;
+ }
+
+ if ($object->has('frontend', $exclude)) {
+ unset($pages[$i]);
+ }
+ }
+ }
+
+ return $pages;
+ }
+
+ /**
+ * Filter Frontend widgets
+ *
+ * @param array $widgets
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function widgetFilter($widgets) {
+ return $this->getUser()->getObject(
+ aam_Control_Object_Metabox::UID)->filterFrontend($widgets);
+ }
+
+ /**
+ * Control Edit Post/Term
+ *
+ * Make sure that current user does not have access to edit Post or Term
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function adminActionEdit() {
+ $user = $this->getUser();
+ if (aam_Core_Request::request('taxonomy')) {
+ $control = $user->getObject(
+ aam_Control_Object_Term::UID, aam_Core_Request::request('tag_ID')
+ );
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_EDIT)) {
+ $this->reject();
+ }
+ } elseif ($post = $this->getPost()) {
+ $control = $user->getObject(aam_Control_Object_Post::UID, $post->ID);
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_EDIT)) {
+ $this->reject();
+ }
+ }
+ }
+
+ /**
+ * Reject the request
+ *
+ * Redirect or die the execution based on ConfigPress settings
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function reject() {
+ if (is_admin()) {
+ $redirect = aam_Core_ConfigPress::getParam(
+ 'backend.access.deny.redirect'
+ );
+ $message = aam_Core_ConfigPress::getParam(
+ 'backend.access.deny.message', __('Access Denied', 'aam')
+ );
+ } else {
+ $redirect = aam_Core_ConfigPress::getParam(
+ 'frontend.access.deny.redirect'
+ );
+ $message = aam_Core_ConfigPress::getParam(
+ 'frontend.access.deny.message',
+ __('Access Denied', 'aam')
+ );
+ }
+
+ if (filter_var($redirect, FILTER_VALIDATE_URL)) {
+ wp_redirect($redirect);
+ exit;
+ } elseif (is_int($redirect)) {
+ wp_redirect(get_post_permalink($redirect));
+ exit;
+ } else {
+ wp_die($message);
+ }
+ }
+
+ /**
+ * Take control over wp_die function
+ *
+ * @param callback $function
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function wpDie($function) {
+ $redirect = aam_Core_ConfigPress::getParam('backend.access.deny.redirect');
+ $message = aam_Core_ConfigPress::getParam(
+ 'backend.access.deny.message', __('Access Denied', 'aam')
+ );
+
+ if (filter_var($redirect, FILTER_VALIDATE_URL)) {
+ wp_redirect($redirect);
+ exit;
+ } elseif (is_int($redirect)) {
+ wp_redirect(get_post_permalink($redirect));
+ exit;
+ } else {
+ call_user_func($function, $message, '', array());
+ }
+ }
+
+ /**
+ * Term Quick Menu Actions Filtering
+ *
+ * @param array $actions
+ * @param object $term
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function tagRowActions($actions, $term) {
+ $control = $this->getUser()->getObject(
+ aam_Control_Object_Term::UID, $term->term_id
+ );
+ //filter edit menu
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_EDIT)) {
+ if (isset($actions['edit'])) {
+ unset($actions['edit']);
+ }
+ if (isset($actions['inline hide-if-no-js'])) {
+ unset($actions['inline hide-if-no-js']);
+ }
+ }
+
+ //filter delete menu
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_DELETE)) {
+ if (isset($actions['delete'])) {
+ unset($actions['delete']);
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * Post Quick Menu Actions Filtering
+ *
+ * @param array $actions
+ * @param WP_Post $post
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function postRowActions($actions, $post) {
+ $control = $this->getUser()->getObject(
+ aam_Control_Object_Post::UID, $post->ID
+ );
+ //filter edit menu
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_EDIT)) {
+ if (isset($actions['edit'])) {
+ unset($actions['edit']);
+ }
+ if (isset($actions['inline hide-if-no-js'])) {
+ unset($actions['inline hide-if-no-js']);
+ }
+ }
+ //filter trash menu
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_TRASH)) {
+ if (isset($actions['trash'])) {
+ unset($actions['trash']);
+ }
+ }
+
+ //filter delete menu
+ if ($control->has('backend', aam_Control_Object_Post::ACTION_DELETE)) {
+ if (isset($actions['delete'])) {
+ unset($actions['delete']);
+ }
+ }
+
+ return $actions;
+ }
+
+ /**
+ * Main Frontend access control hook
+ *
+ * @return void
+ *
+ * @access public
+ * @global WP_Query $wp_query
+ * @global WP_Post $post
+ */
+ public function wp() {
+ global $wp_query, $post;
+
+ $user = $this->getUser();
+ if (is_category()) {
+ $category = $wp_query->get_queried_object();
+ if ($user->getObject(aam_Control_Object_Term::UID, $category->term_id
+ )->has('frontend', aam_Control_Object_Term::ACTION_BROWSE)) {
+ $this->reject();
+ }
+ } elseif (!$wp_query->is_home() && ($post instanceof WP_Post)) {
+ if ($user->getObject(aam_Control_Object_Post::UID, $post->ID
+ )->has('frontend', aam_Control_Object_Post::ACTION_READ)) {
+ $this->reject();
+ }
+ }
+ }
+
+ /**
+ * Register Internal miscellenious functionality
+ *
+ * @param array $objects
+ * @param aam_Control_Subject $subject
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function internalHooks($objects, $subject) {
+ $objects[aam_Control_Object_Event::UID] = new aam_Control_Object_Event(
+ $subject
+ );
+
+ return $objects;
+ }
+
+ /**
+ * Event Handler
+ *
+ * @param int $post_ID
+ * @param WP_Post $post_after
+ * @param WP_Post $post_before
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function postUpdate($post_ID, $post_after, $post_before = null) {
+ $events = $this->getUser()->getObject(
+ aam_Control_Object_Event::UID)->getOption();
+
+ foreach ($events as $event) {
+ if ($post_after->post_type == $event['post_type']) {
+ if ($event['event'] == 'status_change') {
+ if ($event['event_specifier'] == $post_after->post_status) {
+ $this->triggerAction(
+ $event, $post_ID, $post_after, $post_before
+ );
+ }
+ } elseif ($post_before && $event['event'] == 'content_change') {
+ if ($post_before->post_content != $post_after->post_content) {
+ $this->triggerAction(
+ $event, $post_ID, $post_after, $post_before
+ );
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Trigger Action based on settings
+ *
+ * @param array $event
+ * @param int $post_ID
+ * @param WP_Post $post_after
+ * @param WP_Post $post_before
+ *
+ * @global wpdb $wpdb
+ * @global array $wp_post_types
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function triggerAction($event, $post_ID, $post_after, $post_before) {
+ global $wpdb, $wp_post_types;
+
+ if ($event['action'] == 'notify') {
+ $subject = $wp_post_types[$event['post_type']]->labels->name . ' ';
+ $subject .= $post_ID . ' has been changed by ' . get_current_user();
+ $subject = apply_filters('aam_notification_subject', $subject);
+
+ $message = apply_filters(
+ 'aam_notification_message', get_edit_post_link($post_ID)
+ );
+
+ wp_mail($event['action_specifier'], $subject, $message);
+ } else if ($event['action'] == 'change_status') {
+ $wpdb->update(
+ $wpdb->posts,
+ array('post_status' => $event['action_specifier']),
+ array('ID' => $post_ID)
+ );
+ } else if ($event['action'] == 'custom') {
+ if (is_callable($event['callback'])) {
+ call_user_func(
+ $event['callback'], $post_ID, $post_after, $post_before
+ );
+ }
+ }
+ }
+
+ /**
+ * Add extra column to search in for User search
+ *
+ * @param array $columns
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function searchColumns($columns) {
+ $columns[] = 'display_name';
+
+ return $columns;
+ }
+
+ /**
+ * Control User Block flag
+ *
+ * @param WP_Error $user
+ *
+ * @return WP_Error|WP_User
+ *
+ * @access public
+ */
+ public function authenticate($user) {
+ if ($user->user_status == 1) {
+ $user = new WP_Error();
+ $user->add(
+ 'authentication_failed', '<strong>ERROR</strong>: User is blocked'
+ );
+ }
+
+ return $user;
+ }
+
+ /**
+ * Make sure that AAM UI Page is used
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function isAAMScreen() {
+ return (aam_Core_Request::get('page') == 'aam' ? true : false);
+ }
+
+ /**
+ * Make sure that AAM Extension UI Page is used
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function isAAMExtensionScreen() {
+ return (aam_Core_Request::get('page') == 'aam-ext' ? true : false);
+ }
+
+ /**
+ * Make sure that AAM ConfigPress UI Page is used
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function isAAMConfigPressScreen() {
+ return (aam_Core_Request::get('page') == 'aam-configpress' ? true : false);
+ }
+
+ /**
+ * Print necessary styles
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function printStyles() {
+ if ($this->isAAMScreen()) {
+ wp_enqueue_style('dashboard');
+ wp_enqueue_style('global');
+ wp_enqueue_style('wp-admin');
+ wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
+ wp_enqueue_style('aam-common-style', AAM_MEDIA_URL . 'css/common.css');
+ wp_enqueue_style(
+ 'aam-style',
+ AAM_MEDIA_URL . 'css/aam.css',
+ array('aam-common-style')
+ );
+ wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
+ wp_enqueue_style('wp-pointer');
+ wp_enqueue_style(
+ 'aam-treeview', AAM_MEDIA_URL . 'css/jquery.treeview.css'
+ );
+ } elseif ($this->isAAMExtensionScreen()) {
+ wp_enqueue_style('dashboard');
+ wp_enqueue_style('global');
+ wp_enqueue_style('wp-admin');
+ wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');
+ wp_enqueue_style('aam-common-style', AAM_MEDIA_URL . 'css/common.css');
+ wp_enqueue_style(
+ 'aam-style',
+ AAM_MEDIA_URL . 'css/extension.css',
+ array('aam-common-style')
+ );
+ wp_enqueue_style('aam-datatables', AAM_MEDIA_URL . 'css/jquery.dt.css');
+ } elseif ($this->isAAMConfigPressScreen()) {
+ wp_enqueue_style('aam-common-style', AAM_MEDIA_URL . 'css/common.css');
+ wp_enqueue_style(
+ 'aam-style',
+ AAM_MEDIA_URL . 'css/configpress.css',
+ array('aam-common-style')
+ );
+ wp_enqueue_style('aam-codemirror', AAM_MEDIA_URL . 'css/codemirror.css');
+ }
+
+ }
+
+ /**
+ * Print necessary scripts
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function printScripts() {
+ if ($this->isAAMScreen()) {
+ wp_enqueue_script('postbox');
+ wp_enqueue_script('dashboard');
+ wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/aam.js');
+ wp_enqueue_script('aam-datatables', AAM_MEDIA_URL . 'js/jquery.dt.js');
+ wp_enqueue_script(
+ 'aam-treeview', AAM_MEDIA_URL . 'js/jquery.treeview.js'
+ );
+ wp_enqueue_script('jquery-ui-core');
+ wp_enqueue_script('jquery-effects-core');
+ wp_enqueue_script('jquery-ui-widget');
+ wp_enqueue_script('jquery-ui-tabs');
+ wp_enqueue_script('jquery-ui-accordion');
+ wp_enqueue_script('jquery-ui-progressbar');
+ wp_enqueue_script('jquery-ui-dialog');
+ wp_enqueue_script('jquery-ui-button');
+ wp_enqueue_script('jquery-ui-sortable');
+ wp_enqueue_script('jquery-ui-menu');
+ wp_enqueue_script('jquery-effects-highlight');
+ wp_enqueue_script('wp-pointer');
+
+ $localization = array(
+ 'nonce' => wp_create_nonce('aam_ajax'),
+ 'siteURI' => admin_url('index.php'),
+ 'ajaxurl' => admin_url('admin-ajax.php'),
+ 'addUserURI' => admin_url('user-new.php'),
+ 'editUserURI' => admin_url('user-edit.php'),
+ 'defaultSegment' => array(
+ 'role' => $this->getDefaultEditableRole(),
+ 'blog' => get_current_blog_id(),
+ 'user' => 0
+ ),
+ 'contextualMenu' => get_user_meta(
+ get_current_user_id(), 'aam_contextual_menu', true
+ ),
+ 'labels' => aam_View_Manager::uiLabels()
+ );
+ wp_localize_script('aam-admin', 'aamLocal', $localization);
+ } elseif ($this->isAAMExtensionScreen()) {
+ wp_enqueue_script('postbox');
+ wp_enqueue_script('dashboard');
+ wp_enqueue_script('jquery-ui-core');
+ wp_enqueue_script('jquery-effects-core');
+ wp_enqueue_script('jquery-ui-widget');
+ wp_enqueue_script('jquery-ui-dialog');
+ wp_enqueue_script('jquery-ui-button');
+ wp_enqueue_script('jquery-effects-highlight');
+ wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/extension.js');
+ wp_enqueue_script('aam-datatables', AAM_MEDIA_URL . 'js/jquery.dt.js');
+
+ $localization = array(
+ 'nonce' => wp_create_nonce('aam_ajax'),
+ 'ajaxurl' => admin_url('admin-ajax.php'),
+ 'labels' => aam_View_Manager::uiLabels()
+ );
+ wp_localize_script('aam-admin', 'aamLocal', $localization);
+ } elseif ($this->isAAMConfigPressScreen()) {
+ wp_enqueue_script('jquery-ui-core');
+ wp_enqueue_script('jquery-effects-core');
+ wp_enqueue_script('jquery-effects-highlight');
+ wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/configpress.js');
+ wp_enqueue_script('aam-codemirror', AAM_MEDIA_URL . 'js/codemirror.js');
+ wp_enqueue_script('aam-cmini', AAM_MEDIA_URL . 'js/properties.js');
+
+ $localization = array(
+ 'nonce' => wp_create_nonce('aam_ajax'),
+ 'ajaxurl' => admin_url('admin-ajax.php'),
+ );
+ wp_localize_script('aam-admin', 'aamLocal', $localization);
+ }
+ }
+
+ /**
+ * Get first editable role
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function getDefaultEditableRole(){
+ $role_keys = array_keys(get_editable_roles());
+
+ return array_shift($role_keys);
+ }
+
+ /**
+ * Render list of AAM Features
+ *
+ * Must be separate from Ajax call because WordPress ajax does not load a lot of
+ * UI stuff
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function features() {
+ check_ajax_referer('aam_ajax');
+ try{
+ $model = new aam_View_Manager;
+ $model->retrieveFeatures();
+ } catch (Exception $e){
+ echo $e->getMessage();
+ }
+ die();
+ }
+
+ /**
+ * Handle Ajax calls to AAM
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function ajax() {
+ check_ajax_referer('aam_ajax');
+
+ //clean buffer to make sure that nothing messing around with system
+ while (@ob_end_clean());
+
+ //process ajax request
+ try{
+ $model = new aam_View_Manager();
+ echo $model->processAjax();
+ } catch (Exception $e){
+ echo '-1';
+ }
+ die();
+ }
+
+ /**
+ * Hanlde Metabox initialization process
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function metaboxes() {
+ global $post;
+
+ //make sure that nobody is playing with screen options
+ if ($post instanceof WP_Post) {
+ $screen = $post->post_type;
+ } elseif ($screen_object = get_current_screen()) {
+ $screen = $screen_object->id;
+ } else {
+ $screen = '';
+ }
+
+ if (aam_Core_Request::get('aam_meta_init')) {
+ try {
+ $model = new aam_View_Metabox;
+ $model->run($screen);
+ } catch (Exception $e){}
+ } else {
+ $this->getUser()->getObject(aam_Control_Object_Metabox::UID)
+ ->filterBackend($screen);
+ }
+ }
+
+ /**
+ * Register Admin Menu
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function adminMenu() {
+ //register the menu
+ add_menu_page(
+ __('AAM', 'aam'),
+ __('AAM', 'aam'),
+ aam_Core_ConfigPress::getParam(
+ 'aam.page.access_control.capability', 'administrator'
+ ),
+ 'aam',
+ array($this, 'content'),
+ AAM_BASE_URL . 'active-menu.png'
+ );
+ //register submenus
+ add_submenu_page(
+ 'aam',
+ __('Access Control', 'aam'),
+ __('Access Control', 'aam'),
+ aam_Core_ConfigPress::getParam(
+ 'aam.page.access_control.capability', 'administrator'
+ ),
+ 'aam',
+ array($this, 'content')
+ );
+ add_submenu_page(
+ 'aam',
+ __('ConfigPress', 'aam'),
+ __('ConfigPress', 'aam'),
+ aam_Core_ConfigPress::getParam(
+ 'aam.page.configpress.capability', 'administrator'
+ ),
+ 'aam-configpress',
+ array($this, 'configPressContent')
+ );
+ add_submenu_page(
+ 'aam',
+ __('Extensions', 'aam'),
+ __('Extensions', 'aam'),
+ aam_Core_ConfigPress::getParam(
+ 'aam.page.extensions.capability', 'administrator'
+ ),
+ 'aam-ext',
+ array($this, 'extensionContent')
+ );
+
+ }
+
+ /**
+ * Filter the Admin Menu
+ *
+ * @param string $parent_file
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function filterMenu($parent_file){
+ //filter admin menu
+ $this->getUser()->getObject(aam_Control_Object_Menu::UID)->filter();
+
+ return $parent_file;
+ }
+
+ /**
+ * Take control over Tax Query parser
+ *
+ * By default WordPress consider non-empty term & category pair as search by
+ * slug. This is weird assumption and there is no other way to force core to
+ * search posts within custom taxonomy rather than take control over it with
+ * action parse_tax_query.
+ *
+ * @param WP_Query $query
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function parseTaxQuery($query) {
+ if (!empty($query->query['term']) && !empty($query->query['taxonomy'])) {
+ foreach ($query->tax_query->queries as $id => $dump) {
+ $query->tax_query->queries[$id]['field'] = 'term_id';
+ }
+ }
+ }
+
+ /**
+ * Filter list of editable roles
+ *
+ * Does not allow for current user manager roles that have same or higher Level
+ *
+ * @param array $roles
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function editableRoles($roles){
+ $filtered = array();
+ $level = aam_Core_API::getUserLevel();
+
+
+ //check if super admin is specified
+ if (aam_Core_API::isSuperAdmin() === false){
+ foreach ($roles as $role => $info) {
+ if (empty($info['capabilities']["level_{$level}"])
+ || !$info['capabilities']["level_{$level}"]) {
+ $filtered[$role] = $info;
+ }
+ }
+ } else {
+ $filtered = $roles;
+ }
+
+ return $filtered;
+ }
+
+ /**
+ * Render Main Content page
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function content() {
+ try {
+ $manager = new aam_View_Manager();
+ echo $manager->run();
+ } catch (Exception $e) {
+ echo $e->getMessage();
+ }
+ }
+
+ /**
+ * Render ConfigPress Page
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function configPressContent() {
+ $manager = new aam_View_ConfigPress();
+ echo $manager->run();
+ }
+
+ /**
+ * Extension content page
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function extensionContent() {
+ $manager = new aam_View_Extension();
+ echo $manager->run();
+ }
+
+ /**
+ * Initialize the AAM plugin
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
+ public static function initialize() {
+ if (is_null(self::$_aam)) {
+ self::$_aam = new self;
+ }
+ }
+
+ /**
+ * Initialize the current user
+ *
+ * Whether it is logged in user or visitor
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function initializeUser() {
+ if ($user_id = get_current_user_id()) {
+ $this->setUser(new aam_Control_Subject_User($user_id));
+ } else {
+ $this->setUser(new aam_Control_Subject_Visitor(''));
+ }
+ }
+
+ /**
+ * User Login Hook
+ *
+ * This hook track the user's successfull login and update current subject
+ *
+ * @param string $username User Login name
+ * @param Wp_User $user Current user object
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function login($username, $user) {
+ $this->setUser(new aam_Control_Subject_User($user->ID));
+ }
+
+ /**
+ * Uninstall hook
+ *
+ * Remove all leftovers from AAM execution
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public static function uninstall() {
+ global $wp_filesystem;
+
+ //remove the content directory
+ if (!defined(AAM_CONTENT_DIR_FAILURE) && WP_Filesystem()) {
+ $wp_filesystem->rmdir(AAM_TEMP_DIR, true);
+ }
+ }
+
+ /**
+ * Get Current User Subject
+ *
+ * @return aam_Control_Subject_User
+ *
+ * @access public
+ */
+ public function getUser() {
+ return $this->_user;
+ }
+
+ /**
+ * Set Current User Subject
+ *
+ * @param aam_Control_Subject $user
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function setUser(aam_Control_Subject $user) {
+ $this->_user = $user;
+ }
+
+ /**
+ * Execute before shutdown actions
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function shutdown() {
+ $this->getUser()->saveCache();
+ }
+
+ /**
+ * Load Installed extensions
+ *
+ * @return void
+ *
+ * @access protected
+ */
+ protected function loadExtensions() {
+ aam_Core_Repository::getInstance($this)->load();
+ }
+
+}
+
+//the highest priority (higher the core)
+//this is important to have to catch events like register core post types
+add_action('init', 'aam::initialize', -1);
+
+//register_activation_hook(__FILE__, array('aam', 'activate'));
+register_uninstall_hook(__FILE__, array('aam', 'uninstall'));
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * Abstract Object Class
+ *
+ * Object is any part of the WordPress that is controlled by AAM. The example of
+ * object is Post, Page, Metabox, Widget etc.
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+abstract class aam_Control_Object {
+
+ /**
+ * Subject
+ *
+ * @var aam_Control_Subject
+ *
+ * @access private
+ */
+ private $_subject = null;
+
+ /**
+ * Constructor
+ *
+ * @param aam_Control_Subject $subject
+ * @param int $object_id
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function __construct(aam_Control_Subject $subject, $object_id) {
+ $this->setSubject($subject);
+ $this->init($object_id);
+ }
+
+ /**
+ * Sleep method
+ *
+ * Used for caching mechanism
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function __sleep(){
+ return array('_option');
+ }
+
+ /**
+ * Indicate either object can be cached on not
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ abstract public function cacheObject();
+
+ /**
+ * Initialize object
+ *
+ * @param string|int $object_id
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function init($object_id) {
+ $this->setOption(
+ $this->getSubject()->readOption($this->getUID(), $object_id)
+ );
+ }
+
+ /**
+ * Set current subject
+ *
+ * Either it is User or Role
+ *
+ * @param aam_Control_Subject $subject
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function setSubject(aam_Control_Subject $subject) {
+ $this->_subject = $subject;
+ }
+
+ /**
+ * Get Subject
+ *
+ * @return aam_Control_Subject
+ *
+ * @access public
+ */
+ public function getSubject() {
+ return $this->_subject;
+ }
+
+ /**
+ * Get current object UID
+ *
+ * @return string
+ *
+ * @access public
+ */
+ abstract public function getUID();
+
+ /**
+ * Set Object options
+ *
+ * @param mixed $option
+ *
+ * @return void
+ *
+ * @access public
+ */
+ abstract public function setOption($option);
+
+ /**
+ * Get Object options
+ *
+ * @return mixed
+ *
+ * @access public
+ */
+ abstract public function getOption();
+
+ /**
+ * Save Object options
+ *
+ * @param mixed $params
+ *
+ * @return void
+ *
+ * @access public
+ */
+ abstract public function save($params = null);
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Object_Capability extends aam_Control_Object {\r
+\r
+ /**\r
+ *\r
+ */\r
+ const UID = 'capability';\r
+\r
+ /**\r
+ *\r
+ * @var type\r
+ */\r
+ private $_option = array();\r
+\r
+ /**\r
+ *\r
+ * @param type $capabilities\r
+ */\r
+ public function save($capabilities = null) {\r
+ if (is_array($capabilities)) {\r
+ foreach ($capabilities as $capability => $grant) {\r
+ if (intval($grant)) {\r
+ $this->getSubject()->addCapability($capability);\r
+ } else {\r
+ $this->getSubject()->removeCapability($capability);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function cacheObject(){\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object_id\r
+ */\r
+ public function init($object_id) {\r
+ if (empty($this->_option)) {\r
+ $this->setOption($this->getSubject()->getCapabilities());\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $option\r
+ */\r
+ public function setOption($option) {\r
+ $this->_option = (is_array($option) ? $option : array());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getOption() {\r
+ return $this->_option;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $capability\r
+ * @return type\r
+ */\r
+ public function has($capability) {\r
+ return $this->getSubject()->hasCapability($capability);\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Object_Event extends aam_Control_Object {\r
+\r
+ /**\r
+ *\r
+ */\r
+ const UID = 'event';\r
+\r
+ /**\r
+ *\r
+ * @var type\r
+ */\r
+ private $_option = array();\r
+\r
+ /**\r
+ *\r
+ * @param type $events\r
+ */\r
+ public function save($events = null) {\r
+ if (is_array($events)) {\r
+ $this->getSubject()->updateOption($events, self::UID);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function cacheObject(){\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $option\r
+ */\r
+ public function setOption($option) {\r
+ $this->_option = (is_array($option) ? $option : array());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getOption() {\r
+ return $this->_option;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Object_Menu extends aam_Control_Object {\r
+\r
+ /**\r
+ * Object Unique ID\r
+ */\r
+ const UID = 'menu';\r
+\r
+ /**\r
+ * List of options\r
+ *\r
+ * @var array\r
+ *\r
+ * @access private\r
+ */\r
+ private $_option = array();\r
+\r
+ /**\r
+ * Filter Menu List\r
+ *\r
+ * @global array $menu\r
+ * @global array $submenu\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function filter() {\r
+ global $menu;\r
+\r
+ //filter menu & submenu first\r
+ $capability = uniqid('aam_'); //random capability means NO access\r
+ //let's go and iterate menu & submenu\r
+ foreach ($menu as $id => $item) {\r
+ if ($this->has($item[2])) {\r
+ $menu[$id][1] = $capability;\r
+ $denied = true;\r
+ } else {\r
+ $denied = false;\r
+ }\r
+ //filter submenu\r
+ $submenu = $this->filterSubmenu($item[2], $denied);\r
+ //a trick to whether remove the Root Menu or replace link with the first\r
+ //available submenu\r
+ if ($denied && $submenu){\r
+ $menu[$id][2] = $submenu[1];\r
+ $menu[$id][1] = $submenu[0];\r
+ } elseif ($denied){ //ok, no available submenus, remove it completely\r
+ unset($menu[$id]);\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Filter submenu\r
+ *\r
+ * @global array $submenu\r
+ *\r
+ * @param array $menu\r
+ * @param boolean $denied\r
+ *\r
+ * @return string|null\r
+ *\r
+ * @access public\r
+ */\r
+ public function filterSubmenu($menu, $denied) {\r
+ global $submenu;\r
+\r
+ //go to submenu\r
+ $available = null;\r
+ if (isset($submenu[$menu])) {\r
+ foreach ($submenu[$menu] as $sid => $sub_item) {\r
+ if ($this->has($sub_item[2])) {\r
+ //weird WordPress behavior, it gets the first submenu link\r
+ //$submenu[$menu][$sid][1] = $capability;\r
+ unset($submenu[$menu][$sid]);\r
+ } elseif (is_null($available)){ //find first available submenu\r
+ $available = array($sub_item[1], $sub_item[2]);\r
+ }\r
+ }\r
+ }\r
+\r
+ //replace submenu with available new if found\r
+ if ($denied && !is_null($available) && ($available[1] != $menu) ){\r
+ $submenu[$available[1]] = $submenu[$menu];\r
+ unset($submenu[$menu]);\r
+ }\r
+\r
+ return $available;\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function save($menu = null) {\r
+ if (is_array($menu)) {\r
+ $this->getSubject()->updateOption($menu, self::UID);\r
+ //set flag that this subject has custom settings\r
+ $this->getSubject()->setFlag(aam_Control_Subject::FLAG_MODIFIED);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function cacheObject(){\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $option\r
+ */\r
+ public function setOption($option) {\r
+ $this->_option = (is_array($option) ? $option : array());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getOption() {\r
+ return $this->_option;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $menu\r
+ * @return type\r
+ */\r
+ public function has($menu) {\r
+ $response = null;\r
+ //decode URL in case of any special characters like &\r
+ $menu_decoded = htmlspecialchars_decode($menu);\r
+ //check if menu is restricted\r
+ if (isset($this->_option[$menu_decoded])) {\r
+ $response = (intval($this->_option[$menu_decoded]) ? true : false);\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r\r/**\r * ======================================================================\r * LICENSE: This file is subject to the terms and conditions defined in *\r * file 'license.txt', which is part of this source code package. *\r * ======================================================================\r */\r\r/**\r *\r * @package AAM\r * @author Vasyl Martyniuk <support@wpaam.com>\r * @copyright Copyright C 2013 Vasyl Martyniuk\r * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r */\rclass aam_Control_Object_Metabox extends aam_Control_Object {\r\r /**\r *\r */\r const UID = 'metabox';\r\r /**\r *\r * @var type\r */\r private $_option = array();\r\r /**\r *\r * @global type $wp_registered_widgets\r * @param type $sidebar_widgets\r * @return type\r */\r public function filterFrontend($sidebar_widgets) {\r global $wp_registered_widgets;\r\r if (is_array($wp_registered_widgets)) {\r foreach ($wp_registered_widgets as $id => $data) {\r if (is_object($data['callback'][0])) {\r $callback = get_class($data['callback'][0]);\r } elseif (is_string($data['callback'][0])) {\r $callback = $data['callback'][0];\r }\r if ($this->has('widgets', $callback)) {\r unregister_widget($callback);\r //remove it from registered widget global var!!\r //INFORM: Why Unregister Widget does not clear global var?\r unset($wp_registered_widgets[$id]);\r }\r }\r }\r\r return $sidebar_widgets;\r }\r\r /**\r *\r * @global type $wp_meta_boxes\r * @param type $screen\r * @param type $post\r */\r public function filterBackend($screen, $post = null) {\r global $wp_meta_boxes;\r\r if (is_array($wp_meta_boxes)) {\r foreach ($wp_meta_boxes as $screen_id => $zones) {\r if ($screen == $screen_id) {\r foreach ($zones as $zone => $priorities) {\r foreach ($priorities as $priority => $metaboxes) {\r foreach ($metaboxes as $metabox => $data) {\r if ($this->has($screen_id, $metabox)) {\r remove_meta_box($metabox, $screen_id, $zone);\r }\r }\r }\r }\r }\r }\r }\r }\r\r /**\r * @inheritdoc\r */\r public function save($metaboxes = null) {\r if (is_array($metaboxes)) {\r $this->getSubject()->updateOption($metaboxes, self::UID);\r //set flag that this subject has custom settings\r $this->getSubject()->setFlag(aam_Control_Subject::FLAG_MODIFIED);\r }\r }\r\r /**\r * @inheritdoc\r */\r public function cacheObject(){\r return true;\r }\r\r /**\r *\r * @return type\r */\r public function getUID() {\r return self::UID;\r }\r\r /**\r *\r * @param type $option\r */\r public function setOption($option) {\r $this->_option = (is_array($option) ? $option : array());\r }\r\r /**\r *\r * @return type\r */\r public function getOption() {\r return $this->_option;\r }\r\r /**\r *\r * @param type $group\r * @param type $metabox\r * @return type\r */\r public function has($group, $metabox) {\r $response = false;\r if (isset($this->_option[$group][$metabox])) {\r $response = (intval($this->_option[$group][$metabox]) ? true : false);\r }\r\r return $response;\r }\r\r}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Object_Post extends aam_Control_Object {\r
+\r
+ /**\r
+ * Object Identifier\r
+ */\r
+ const UID = 'post';\r
+\r
+ /**\r
+ * Object Action: COMMENT\r
+ *\r
+ * Control access to commenting ability\r
+ */\r
+ const ACTION_COMMENT = 'comment';\r
+\r
+ /**\r
+ * Object Action: READ\r
+ *\r
+ * Either Object can be read by user or not\r
+ */\r
+ const ACTION_READ = 'read';\r
+\r
+ /**\r
+ * Object Action: EXCLUDE\r
+ *\r
+ * If object is a part of frontend menu either exclude it from menu or not\r
+ */\r
+ const ACTION_EXCLUDE = 'exclude';\r
+\r
+ /**\r
+ * Object Action: TRASH\r
+ *\r
+ * Manage access to object trash ability\r
+ */\r
+ const ACTION_TRASH = 'trash';\r
+\r
+ /**\r
+ *\r
+ */\r
+ const ACTION_DELETE = 'delete';\r
+\r
+ /**\r
+ *\r
+ */\r
+ const ACTION_EDIT = 'edit';\r
+\r
+ /**\r
+ *\r
+ * @var type\r
+ */\r
+ private $_post;\r
+\r
+ /**\r
+ *\r
+ * @var type\r
+ */\r
+ private $_option = array();\r
+\r
+ /**\r
+ * Indicator that settings where inherited\r
+ *\r
+ * @var boolean\r
+ *\r
+ * @access private\r
+ */\r
+ private $_inherited = false;\r
+\r
+ /**\r
+ * Init Post Object\r
+ *\r
+ * @param WP_Post|Int $object\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function init($object) {\r
+ //make sure that we are dealing with WP_Post object\r
+ if ($object instanceof WP_Post){\r
+ $this->setPost($object);\r
+ } elseif (intval($object)) {\r
+ $this->setPost(get_post($object));\r
+ }\r
+\r
+ if ($this->getPost()){\r
+ $this->read();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Read the Post AAM Metadata\r
+ *\r
+ * Get all settings related to specified post\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function read() {\r
+ $option = get_post_meta($this->getPost()->ID, $this->getOptionName(), true);\r
+ //try to inherit it from parent category\r
+ if (empty($option)\r
+ && (aam_Core_ConfigPress::getParam('aam.post.inherit', 'true') == 'true')) {\r
+ $terms = $this->retrievePostTerms();\r
+ //use only first term for inheritance\r
+ $term_id = array_shift($terms);\r
+ //try to get any parent access\r
+ $option = $this->inheritAccess($term_id);\r
+ }\r
+ //even if parent category is empty, try to read the parent subject\r
+ if (empty($option)){\r
+ $option = $this->getSubject()->readParentSubject(\r
+ self::UID, $this->getPost()->ID\r
+ );\r
+ }\r
+\r
+ $this->setOption(\r
+ apply_filters('aam_post_access_option', $option, $this)\r
+ );\r
+ }\r
+\r
+ /**\r
+ * Generate option name\r
+ * \r
+ * @return string\r
+ * \r
+ * @access protected\r
+ */\r
+ protected function getOptionName() {\r
+ $subject = $this->getSubject();\r
+ //prepare option name\r
+ $meta_key = 'aam_' . self::UID . '_access_' . $subject->getUID();\r
+ $meta_key .= ($subject->getId() ? $subject->getId() : '');\r
+\r
+ return $meta_key;\r
+ }\r
+\r
+ /**\r
+ * Inherit access from parent term\r
+ * \r
+ * Go throught the hierarchical branch of terms and retrieve access from the \r
+ * first parent term that has access defined.\r
+ * \r
+ * @param int $term_id\r
+ * \r
+ * @return array\r
+ * \r
+ * @access private\r
+ */\r
+ private function inheritAccess($term_id) {\r
+ $term = new aam_Control_Object_Term($this->getSubject(), $term_id);\r
+ $access = $term->getOption();\r
+ if (isset($access['post']) && $access['post']) {\r
+ $result = array('post' => $access['post']);\r
+ $this->setInherited(true);\r
+ } elseif (is_object($term->getTerm()) && $term->getTerm()->parent) {\r
+ $result = $this->inheritAccess($term->getTerm()->parent);\r
+ } else {\r
+ $result = array();\r
+ }\r
+\r
+ return $result;\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function __sleep(){\r
+ return array('_post', '_option', '_inherited');\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function cacheObject(){\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function save($params = null) {\r
+ if (is_array($params)) {\r
+ $this->setInherited(false);\r
+ update_post_meta($this->getPost()->ID, $this->getOptionName(), $params);\r
+ //set flag that this subject has custom settings\r
+ $this->getSubject()->setFlag(aam_Control_Subject::FLAG_MODIFIED);\r
+ }\r
+ //fire internal hook\r
+ do_action_ref_array('aam_object_saved', $this, $params);\r
+ }\r
+\r
+ /**\r
+ * Get Object Unique ID\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function delete() {\r
+ return delete_post_meta($this->getPost()->ID, $this->getOptionName());\r
+ }\r
+\r
+ /**\r
+ * Retrieve list of all hierarchical terms the object belongs to\r
+ *\r
+ * @return array\r
+ *\r
+ * @access private\r
+ */\r
+ private function retrievePostTerms() {\r
+ $taxonomies = get_object_taxonomies($this->getPost());\r
+ if (is_array($taxonomies) && count($taxonomies)) {\r
+ //filter taxonomies to hierarchical only\r
+ $filtered = array();\r
+ foreach ($taxonomies as $taxonomy) {\r
+ if (is_taxonomy_hierarchical($taxonomy)) {\r
+ $filtered[] = $taxonomy;\r
+ }\r
+ }\r
+ $terms = wp_get_object_terms(\r
+ $this->getPost()->ID, $filtered, array('fields' => 'ids')\r
+ );\r
+ } else {\r
+ $terms = array();\r
+ }\r
+\r
+ return $terms;\r
+ }\r
+\r
+ /**\r
+ * Set Post. Cover all unexpectd wierd issues with WP Core\r
+ *\r
+ * @param WP_Post $post\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setPost($post) {\r
+ if ($post instanceof WP_Post){\r
+ $this->_post = $post;\r
+ } else {\r
+ $this->_post = (object) array('ID' => 0);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Get Post\r
+ *\r
+ * @return WP_Post|stdClass\r
+ *\r
+ * @access public\r
+ */\r
+ public function getPost() {\r
+ return $this->_post;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $option\r
+ */\r
+ public function setOption($option) {\r
+ $this->_option = (is_array($option) ? $option : array());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getOption() {\r
+ return $this->_option;\r
+ }\r
+\r
+ /**\r
+ * Set inherited flag\r
+ *\r
+ * If post does not have access specified, it'll try to inherit it from the\r
+ * parent category and if parent category has access defined it'll inherit all\r
+ * settings and set _inherited flag to true.\r
+ *\r
+ * @param boolean $flag\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setInherited($flag){\r
+ $this->_inherited = $flag;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getInherited(){\r
+ return $this->_inherited;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $area\r
+ * @param type $action\r
+ * @return type\r
+ */\r
+ public function has($area, $action) {\r
+ $response = false;\r
+ if (isset($this->_option['post'][$area][$action])) {\r
+ $response = (intval($this->_option['post'][$area][$action]) ? true : false);\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_Control_Object_Term extends aam_Control_Object {
+
+ /**
+ *
+ */
+ const UID = 'term';
+
+ /**
+ *
+ */
+ const ACTION_BROWSE = 'browse';
+
+ /**
+ *
+ */
+ const ACTION_EXCLUDE = 'exclude';
+
+ /**
+ *
+ */
+ const ACTION_EDIT = 'edit';
+
+ /**
+ *
+ */
+ const ACTION_LIST = 'list';
+
+ /**
+ *
+ * @var type
+ */
+ private $_term = null;
+
+ /**
+ *
+ * @var type
+ */
+ private $_option = array();
+
+ /**
+ * @inheritdoc
+ */
+ public function __sleep(){
+ return array('_term', '_option');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function save($params = null) {
+ if (is_array($params)) {
+ $this->getSubject()->updateOption(
+ $params, self::UID, $this->getTerm()->term_id
+ );
+ //set flag that this subject has custom settings
+ $this->getSubject()->setFlag(aam_Control_Subject::FLAG_MODIFIED);
+ }
+ }
+
+ /**
+ * Get Object Unique ID
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function getUID() {
+ return self::UID;
+ }
+
+ /**
+ *
+ * @param type $object_id
+ */
+ public function init($object_id) {
+ if ($object_id) {
+ //initialize term first
+ $term = get_term($object_id, $this->getTaxonomy($object_id));
+ if ($term && !is_wp_error($term)) {
+ $this->setTerm($term);
+ $access = $this->getSubject()->readOption(
+ self::UID, $this->getTerm()->term_id
+ );
+ $inherit = aam_Core_ConfigPress::getParam(
+ 'aam.term.inherit', 'true'
+ );
+ if (empty($access) && ($inherit == 'true')) {
+ //try to get any parent restriction
+ $access = $this->inheritAccess($this->getTerm()->parent);
+ }
+
+ //even if parent category is empty, try to read the parent subject
+ if (empty($access)){
+ $access = $this->getSubject()->readParentSubject(
+ self::UID, $this->getTerm()->term_id
+ );
+ }
+
+ $this->setOption(
+ apply_filters('aam_term_access_option', $access, $this)
+ );
+ }
+ }
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function delete() {
+ return $this->getSubject()->deleteOption(
+ self::UID, $this->getTerm()->term_id
+ );
+ }
+
+ /**
+ *
+ * @param type $term_id
+ * @return array
+ */
+ private function inheritAccess($term_id) {
+ $term = new aam_Control_Object_Term($this->getSubject(), $term_id);
+ if ($term->getTerm()) {
+ $access = $term->getOption();
+ if (empty($access) && $term->getTerm()->parent) {
+ $this->inheritAccess($term->getTerm()->parent);
+ } elseif (!empty($access)) {
+ $access['inherited'] = true;
+ }
+ } else {
+ $access = array();
+ }
+
+ return $access;
+ }
+
+ /**
+ *
+ * @global type $wpdb
+ * @param type $object_id
+ * @return type
+ */
+ private function getTaxonomy($object_id) {
+ global $wpdb;
+
+ $query = "SELECT taxonomy FROM {$wpdb->term_taxonomy} ";
+ $query .= "WHERE term_id = {$object_id}";
+
+ return $wpdb->get_var($query);
+ }
+
+ /**
+ *
+ * @param type $term
+ */
+ public function setTerm($term) {
+ $this->_term = $term;
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function getTerm() {
+ return $this->_term;
+ }
+
+ /**
+ *
+ * @param type $option
+ */
+ public function setOption($option) {
+ $this->_option = (is_array($option) ? $option : array());
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function getOption() {
+ return $this->_option;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function cacheObject(){
+ return true;
+ }
+
+ /**
+ *
+ * @param type $area
+ * @param type $action
+ * @return type
+ */
+ public function has($area, $action) {
+ $response = false;
+ if (isset($this->_option['term'][$area][$action])) {
+ $response = (intval($this->_option['term'][$area][$action]) ? true : false);
+ }
+
+ return $response;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Abstract Subject Controller\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+abstract class aam_Control_Subject {\r
+\r
+ /**\r
+ * Flag that idicates that subject has been modified\r
+ */\r
+ const FLAG_MODIFIED = 'modified_flag';\r
+ \r
+ /**\r
+ * Subject ID\r
+ *\r
+ * Whether it is User ID or Role ID\r
+ *\r
+ * @var string|int\r
+ *\r
+ * @access private\r
+ */\r
+ private $_id;\r
+\r
+ /**\r
+ * WordPres Subject\r
+ *\r
+ * It can be WP_User or WP_Role, based on what class has been used\r
+ *\r
+ * @var WP_Role|WP_User\r
+ *\r
+ * @access private\r
+ */\r
+ private $_subject;\r
+\r
+ /**\r
+ * List of Objects to be access controled for current subject\r
+ *\r
+ * All access control objects like Admin Menu, Metaboxes, Posts etc\r
+ *\r
+ * @var array\r
+ *\r
+ * @access private\r
+ */\r
+ private $_objects = array();\r
+\r
+ /**\r
+ * Update Cache flag\r
+ *\r
+ * If there is any new object instantiated, update cache too\r
+ *\r
+ * @var boolean\r
+ *\r
+ * @access private\r
+ */\r
+ private $_updateCache = false;\r
+\r
+ /**\r
+ * Constructor\r
+ *\r
+ * @param string|int $id\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct($id) {\r
+ //set subject\r
+ $this->setId($id);\r
+ //retrieve and set subject itself\r
+ $this->setSubject($this->retrieveSubject());\r
+ //retrieve cache if there is any\r
+ $this->initCache();\r
+ }\r
+\r
+ /**\r
+ * Initialize cache\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function initCache(){\r
+ if (aam_Core_ConfigPress::getParam('aam.caching', 'false') === "true"){\r
+ $this->setObjects($this->readCache());\r
+ foreach($this->_objects as $objects){\r
+ foreach($objects as $object){\r
+ if (!($object instanceof __PHP_Incomplete_Class)) {\r
+ $object->setSubject($this);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Desctruct the subject\r
+ *\r
+ * Execute extra actions during application shutdown\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function saveCache(){\r
+ $caching = aam_Core_ConfigPress::getParam('aam.caching', 'false');\r
+ if (($this->_updateCache === true) && ($caching === "true")){\r
+ $this->updateCache();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Trigger Subject native methods\r
+ *\r
+ * @param string $name\r
+ * @param array $arguments\r
+ *\r
+ * @return mixed\r
+ *\r
+ * @access public\r
+ */\r
+ public function __call($name, $arguments) {\r
+ $subject = $this->getSubject();\r
+ //make sure that method is callable\r
+ if (method_exists($subject, $name)) {\r
+ $response = call_user_func_array(array($subject, $name), $arguments);\r
+ } else {\r
+ $response = null;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get Subject's native properties\r
+ *\r
+ * @param string $name\r
+ *\r
+ * @return mixed\r
+ *\r
+ * @access public\r
+ */\r
+ public function __get($name) {\r
+ $subject = $this->getSubject();\r
+ //TODO - In multisite Wp_User roles are not initialized if admin not a part\r
+ //of the site\r
+ return @$subject->$name;\r
+ }\r
+\r
+ /**\r
+ * Set Subject's native properties\r
+ *\r
+ * @param string $name\r
+ *\r
+ * @return mixed\r
+ *\r
+ * @access public\r
+ */\r
+ public function __set($name, $value) {\r
+ $subject = $this->getSubject();\r
+ $subject->$name = $value;\r
+ }\r
+\r
+ /**\r
+ * Set Subject ID\r
+ *\r
+ * @param string|int\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setId($id) {\r
+ $this->_id = $id;\r
+ }\r
+\r
+ /**\r
+ * Get Subject ID\r
+ *\r
+ * @return string|int\r
+ *\r
+ * @access public\r
+ */\r
+ public function getId() {\r
+ return $this->_id;\r
+ }\r
+\r
+ /**\r
+ * Get Subject\r
+ *\r
+ * @return WP_Role|WP_User\r
+ *\r
+ * @access public\r
+ */\r
+ public function getSubject() {\r
+ return $this->_subject;\r
+ }\r
+\r
+ /**\r
+ * Set Subject\r
+ *\r
+ * @param WP_Role|WP_User $subject\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setSubject($subject) {\r
+ $this->_subject = $subject;\r
+ }\r
+\r
+ /**\r
+ * Set Objects\r
+ *\r
+ * If there is any cache, set the complete set of objects\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setObjects($objects) {\r
+ $this->_objects = $objects;\r
+ }\r
+\r
+ /**\r
+ * Get Access Objects\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function getObjects() {\r
+ return $this->_objects;\r
+ }\r
+\r
+ /**\r
+ * Get Individual Object\r
+ *\r
+ * @param string $object\r
+ * @param mixed $object_id\r
+ *\r
+ * @return aam_Control_Object\r
+ *\r
+ * @access public\r
+ */\r
+ public function getObject($object, $object_id = 0) {\r
+ //make sure that object group is defined\r
+ if (!isset($this->_objects[$object])){\r
+ $this->_objects[$object] = array();\r
+ }\r
+ //check if there is an object with specified ID\r
+ if (!isset($this->_objects[$object][$object_id])) {\r
+ $class_name = 'aam_Control_Object_' . ucfirst($object);\r
+ if (class_exists($class_name)) {\r
+ $this->_objects[$object][$object_id] = new $class_name(\r
+ $this, $object_id, $this\r
+ );\r
+ } else {\r
+ $this->_objects[$object][$object_id] = apply_filters(\r
+ 'aam_object', null, $object, $object_id, $this\r
+ );\r
+ }\r
+\r
+ //set update cache flag to true if object can be cached\r
+ if ($this->_objects[$object][$object_id]->cacheObject() === true){\r
+ $this->_updateCache = true;\r
+ }\r
+ }\r
+\r
+ return $this->_objects[$object][$object_id];\r
+ }\r
+\r
+ /**\r
+ * Set Individual Access Object\r
+ *\r
+ * @param aam_Control_Object $object\r
+ * @param string $uid\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setObject(aam_Control_Object $object, $uid) {\r
+ $this->_objects[$uid] = $object;\r
+ }\r
+ \r
+ /**\r
+ * Release the object\r
+ * \r
+ * @param string $uid\r
+ * @param string|int $object_id\r
+ * \r
+ * @return void\r
+ * \r
+ * @access public\r
+ */\r
+ public function releaseObject($uid, $object_id = 0){\r
+ if (isset($this->_objects[$uid][$object_id])){\r
+ unset($this->_objects[$uid][$object_id]);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Get Subject Type\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function getType() {\r
+ return get_class($this->getSubject());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $capability\r
+ * @return type\r
+ */\r
+ public function hasCapability($capability) {\r
+ return $this->getSubject()->has_cap($capability);\r
+ }\r
+ \r
+ /**\r
+ * Save Access Parameters\r
+ *\r
+ * @param array $params\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function save(array $params) {\r
+ foreach ($params as $object_type => $dump) {\r
+ if ($object = $this->getObject($object_type)) {\r
+ $object->save($dump);\r
+ }\r
+ }\r
+\r
+ //clear cache\r
+ $this->clearCache();\r
+ }\r
+\r
+ /**\r
+ * Retrieve list of subject's capabilities\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function getCapabilities();\r
+\r
+ /**\r
+ * Read Cache\r
+ *\r
+ * Cache all settings to speed-up the AAM execution\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function readCache();\r
+\r
+ /**\r
+ * Update Cache\r
+ *\r
+ * If there is any change to cache, update it and save to database\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function updateCache();\r
+\r
+ /**\r
+ * Clear the Subject Cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function clearCache();\r
+\r
+ /**\r
+ * Clear all options\r
+ *\r
+ * Remove all options related to current user from database and any other\r
+ * custom storage\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function clearAllOptions();\r
+\r
+ /**\r
+ * Check if subject has specified flag\r
+ *\r
+ * @param string flag\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ abstract public function hasFlag($flag);\r
+\r
+ /**\r
+ * Set Subject Flag\r
+ *\r
+ * @param string $flag\r
+ * @param boolean $value\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ abstract public function setFlag($flag, $value = true);\r
+\r
+ /**\r
+ * Retrieve subject based on used class\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ abstract protected function retrieveSubject();\r
+ \r
+ /**\r
+ * Read object from parent subject\r
+ * \r
+ * @param string $object\r
+ * @param mixed $object_id\r
+ * \r
+ * @return mixed\r
+ * \r
+ * @access public\r
+ */\r
+ public function readParentSubject($object, $object_id){\r
+ if ($subject = $this->getParentSubject()){\r
+ $option = $subject->getObject($object, $object_id)->getOption();\r
+ } else {\r
+ $option = null;\r
+ }\r
+ \r
+ return $option;\r
+ }\r
+ \r
+ /**\r
+ * Retrive parent subject\r
+ * \r
+ * If there is no parent subject, return null\r
+ * \r
+ * @return aam_Control_Subject|null\r
+ * \r
+ * @access public\r
+ */\r
+ abstract public function getParentSubject();\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Subject_Role extends aam_Control_Subject {\r
+\r
+ /**\r
+ * Subject UID: ROLE\r
+ */\r
+ const UID = 'role';\r
+\r
+ /**\r
+ * Retrieve Role based on ID\r
+ *\r
+ * @return WP_Role|null\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function retrieveSubject() {\r
+ $roles = new WP_Roles;\r
+ $role = $roles->get_role($this->getId());\r
+\r
+ if (!is_null($role) && isset($role->capabilities)){\r
+ //add role capability as role id, weird WordPress behavior\r
+ //example is administrator capability\r
+ $role->capabilities[$this->getId()] = true;\r
+ }\r
+\r
+ return $role;\r
+ }\r
+\r
+ /**\r
+ * Delete User Role and all User's in role if requested\r
+ *\r
+ * @param boolean $delete_users\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function delete($delete_users = false) {\r
+ $role = new WP_Roles;\r
+\r
+ if ($this->getId() !== 'administrator') {\r
+ if ($delete_users) {\r
+ if (current_user_can('delete_users')) {\r
+ //delete users first\r
+ $users = new WP_User_Query(array(\r
+ 'number' => '',\r
+ 'blog_id' => get_current_blog_id(),\r
+ 'role' => $this->getId()\r
+ ));\r
+ foreach ($users->get_results() as $user) {\r
+ //user can not delete himself\r
+ if (($user instanceof WP_User)\r
+ && ($user->ID != get_current_user_id())) {\r
+ wp_delete_user($user->ID);\r
+ }\r
+ }\r
+ $role->remove_role($this->getId());\r
+ $status = true;\r
+ } else {\r
+ $status = false;\r
+ }\r
+ } else {\r
+ $role->remove_role($this->getId());\r
+ $status = true;\r
+ }\r
+ } else {\r
+ $status = false;\r
+ }\r
+\r
+ return $status;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $name\r
+ * @return boolean\r
+ */\r
+ public function update($name) {\r
+ $role = new WP_Roles;\r
+ if ($name) {\r
+ $role->roles[$this->getId()]['name'] = $name;\r
+ $status = aam_Core_API::updateBlogOption($role->role_key, $role->roles);\r
+ } else {\r
+ $status = false;\r
+ }\r
+\r
+ return $status;\r
+ }\r
+\r
+ /**\r
+ * Remove Capability\r
+ *\r
+ * @param string $capability\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function removeCapability($capability) {\r
+ return $this->getSubject()->remove_cap($capability);\r
+ }\r
+\r
+ /**\r
+ * Check if Subject has capability\r
+ *\r
+ * Keep compatible with WordPress core\r
+ *\r
+ * @param string $capability\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function addCapability($capability) {\r
+ return $this->getSubject()->add_cap($capability, 1);\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getCapabilities() {\r
+ return $this->getSubject()->capabilities;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $value\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function updateOption($value, $object, $object_id = 0) {\r
+ return aam_Core_API::updateBlogOption(\r
+ $this->getOptionName($object, $object_id), $value\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @param type $default\r
+ * @return type\r
+ */\r
+ public function readOption($object, $object_id = 0, $default = null) {\r
+ return aam_Core_API::getBlogOption(\r
+ $this->getOptionName($object, $object_id), $default\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function deleteOption($object, $object_id = 0) {\r
+ return aam_Core_API::deleteBlogOption(\r
+ $this->getOptionName($object, $object_id)\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return string\r
+ */\r
+ protected function getOptionName($object, $object_id) {\r
+ $name = "aam_{$object}" . ($object_id ? "_{$object_id}_" : '_');\r
+ $name .= self::UID . '_' . $this->getId();\r
+\r
+ return $name;\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function hasFlag($flag){\r
+ $option = 'aam_' . self::UID . '_' . $this->getId() . "_{$flag}";\r
+ return aam_Core_API::getBlogOption($option);\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function setFlag($flag, $value = true) {\r
+ $option = 'aam_' . self::UID . '_' . $this->getId() . "_{$flag}";\r
+ if ($value === true){\r
+ aam_Core_API::updateBlogOption($option, $value);\r
+ } else {\r
+ aam_Core_API::deleteBlogOption($option);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function clearAllOptions(){\r
+ global $wpdb;\r
+\r
+ //prepare option mask\r
+ $mask = 'aam_%_' . $this->getId();\r
+ \r
+ //clear all settings in options table\r
+ $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '{$mask}'");\r
+\r
+ //clear all settings in postmeta table\r
+ $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '{$mask}'");\r
+\r
+ $this->clearCache(); //delete cache\r
+ //clear modifield flag\r
+ $this->setFlag(aam_Control_Subject::FLAG_MODIFIED, false);\r
+\r
+ do_action('aam_clear_all_options', $this);\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ * Get Role Cache\r
+ *\r
+ * AAM does not store individual Role cache that is why this function returns\r
+ * always empty array\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function readCache(){\r
+ return array();\r
+ }\r
+\r
+ /**\r
+ * Update Role Cache\r
+ *\r
+ * This function does nothing because AAM does not store Role's cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function updateCache(){\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ * Clear Role Cache\r
+ *\r
+ * This function does nothing because AAM does not store Role's cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function clearCache(){\r
+ return true;\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function getParentSubject(){\r
+ return null;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * User's Subject\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Subject_User extends aam_Control_Subject {\r
+\r
+ /**\r
+ * Subject UID: USER\r
+ */\r
+ const UID = 'user';\r
+\r
+ /**\r
+ * AAM Capability Key\r
+ *\r
+ * WordPress does not allow to have different set of capabilities for one user\r
+ * between sites. aam_capability key stores the set of capabilities stored after\r
+ * individual user edit and merge them with system capabilities.\r
+ * The merging process overwrites allcaps.\r
+ *\r
+ * @var array\r
+ *\r
+ * @access private\r
+ */\r
+ private $_cap_key = '';\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function __construct($id) {\r
+ parent::__construct($id);\r
+\r
+ //overwrite default set of capabilities if AAM capset is defined\r
+ if ($this->isDefaultCapSet() === false){\r
+ //make sure that aam_capability is actually array\r
+ if (is_array($this->getSubject()->aam_caps)){\r
+ $allcaps = array_merge(\r
+ $this->getSubject()->allcaps, $this->getSubject()->aam_caps\r
+ );\r
+ $this->getSubject()->allcaps = $allcaps;\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Delete User\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function delete() {\r
+ $response = false;\r
+ if (current_user_can('delete_users')\r
+ && ($this->getId() !== get_current_user_id())) {\r
+ $response = wp_delete_user($this->getId());\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Block User\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ * @global wpdb $wpdb\r
+ */\r
+ public function block() {\r
+ global $wpdb;\r
+\r
+ $response = false;\r
+ if (current_user_can('edit_users')\r
+ && ($this->getId() != get_current_user_id())) {\r
+ $status = ($this->getSubject()->user_status == 0 ? 1 : 0);\r
+ if ($wpdb->update(\r
+ $wpdb->users,\r
+ array('user_status' => $status),\r
+ array('ID' => $this->getId())\r
+ )) {\r
+ $this->getSubject()->user_status = $status;\r
+ clean_user_cache($this->getSubject());\r
+ $response = true;\r
+ }\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Retrieve User based on ID\r
+ *\r
+ * @return WP_Role|null\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function retrieveSubject() {\r
+ global $current_user;\r
+\r
+ if (($current_user instanceof WP_User)\r
+ && ($current_user->ID == $this->getId())) {\r
+ $subject = $current_user;\r
+ } else {\r
+ $subject = new WP_User($this->getId());\r
+ }\r
+\r
+ //retrieve aam capabilities if are not retrieved yet\r
+ $this->_cap_key = 'aam_capability';\r
+ $subject->aam_caps = get_user_option($this->_cap_key, $this->getId());\r
+\r
+ return $subject;\r
+ }\r
+\r
+ /**\r
+ * Check if user has default capability set\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function isDefaultCapSet(){\r
+ return empty($this->getSubject()->aam_caps);\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return array\r
+ */\r
+ public function getCapabilities() {\r
+ return $this->getSubject()->allcaps;\r
+ }\r
+\r
+ /**\r
+ * Check if user has specified capability\r
+ *\r
+ * @param string $capability\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function hasCapability($capability) {\r
+ return user_can($this->getSubject(), $capability);\r
+ }\r
+\r
+ /**\r
+ * Check if Subject has capability\r
+ *\r
+ * Keep compatible with WordPress core\r
+ *\r
+ * @param string $capability\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function addCapability($capability) {\r
+ return $this->updateCapability($capability, true);\r
+ }\r
+\r
+ /**\r
+ * Remove Capability\r
+ *\r
+ * @param string $capability\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function removeCapability($capability) {\r
+ return $this->updateCapability($capability, false);\r
+ }\r
+\r
+ /**\r
+ * Reset User Capability\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function resetCapability(){\r
+ return delete_user_option($this->getId(), $this->_cap_key);\r
+ }\r
+\r
+ /**\r
+ * Update User's Capability Set\r
+ *\r
+ * @param string $capability\r
+ * @param boolean $grand\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function updateCapability($capability, $grand){\r
+ //make sure that we have right array\r
+ if (is_array($this->getSubject()->aam_caps)){\r
+ $aam_caps = $this->getSubject()->aam_caps;\r
+ } else {\r
+ $aam_caps = array();\r
+ }\r
+\r
+ //add capability\r
+ $aam_caps[$capability] = $grand;\r
+ //update user data. TODO - Keep eyes on this part\r
+ $this->getSubject()->data->aam_caps = $aam_caps;\r
+ //save and return the result of operation\r
+ return update_user_option($this->getId(), $this->_cap_key, $aam_caps);\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $value\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function updateOption($value, $object, $object_id = 0) {\r
+ return update_user_option(\r
+ $this->getId(), $this->getOptionName($object, $object_id), $value\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @param bool $inherit\r
+ *\r
+ * @return mixed\r
+ */\r
+ public function readOption($object, $object_id = 0, $inherit = true) {\r
+ $option = get_user_option(\r
+ $this->getOptionName($object, $object_id), $this->getId()\r
+ );\r
+ if (empty($option) && $inherit) {\r
+ $option = $this->readParentSubject($object, $object_id);\r
+ }\r
+\r
+ return $option;\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function getParentSubject() {\r
+ //try to get this option from the User's Role\r
+ $roles = $this->getSubject()->roles;\r
+ //first user role is counted only. AAM does not support multi-roles\r
+ $subject_role = array_shift($roles);\r
+ \r
+ if ($subject_role){\r
+ //in case of multisite & current user does not belong to the site\r
+ $role = new aam_Control_Subject_Role($subject_role);\r
+ } else {\r
+ $role = null;\r
+ }\r
+ \r
+ return $role;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function deleteOption($object, $object_id = 0) {\r
+ return delete_user_option(\r
+ $this->getId(), $this->getOptionName($object, $object_id)\r
+ );\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function hasFlag($flag){\r
+ return get_user_option("aam_{$flag}", $this->getId());\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function setFlag($flag, $value = true) {\r
+ if ($value === true){\r
+ update_user_option($this->getId(), "aam_{$flag}", $value);\r
+ } else {\r
+ delete_user_option($this->getId(), "aam_{$flag}");\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function clearAllOptions()\r
+ {\r
+ global $wpdb;\r
+\r
+ //clear all settings in usermeta table\r
+ $prefix = $wpdb->get_blog_prefix();\r
+ $query = "DELETE FROM {$wpdb->usermeta} WHERE ";\r
+ $query .= "meta_key LIKE '{$prefix}aam_%' AND user_id = " . $this->getId();\r
+ $wpdb->query($query);\r
+\r
+ //clear all settings in postmeta table\r
+ $mask = 'aam_%_' . $this->getId();\r
+ $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '{$mask}'");\r
+\r
+ $this->clearCache(); //delete cache\r
+ $this->resetCapability(); //reset default capabilities\r
+ $this->setFlag(aam_Control_Subject::FLAG_MODIFIED, false); //clear flag\r
+\r
+ do_action('aam_clear_all_options', $this);\r
+ }\r
+\r
+ /**\r
+ * Prepare option's name\r
+ *\r
+ * Compile option's name based on object name and object ID. As example if\r
+ * object name is "post" and object ID is "5", the compiled option's name is\r
+ * aam_post_5.\r
+ *\r
+ * @param string $object\r
+ * @param string|int $object_id\r
+ *\r
+ * @return string\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function getOptionName($object, $object_id) {\r
+ return "aam_{$object}" . ($object_id ? "_{$object_id}" : '');\r
+ }\r
+\r
+ /**\r
+ * Get Subject UID\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ * Get User's Cache\r
+ *\r
+ * Read User's option aam_cache and return it\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function readCache(){\r
+ $cache = get_user_option('aam_cache', $this->getId());\r
+\r
+ return (is_array($cache) ? $cache : array());\r
+ }\r
+\r
+ /**\r
+ * Insert or Update User's Cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function updateCache(){\r
+ return update_user_option($this->getId(), 'aam_cache', $this->getObjects());\r
+ }\r
+\r
+ /**\r
+ * Delete User's Cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function clearCache(){\r
+ return delete_user_option($this->getId(), 'aam_cache');\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Subject_Visitor extends aam_Control_Subject\r
+{\r
+\r
+ /**\r
+ * Subject UID: VISITOR\r
+ */\r
+ const UID = 'visitor';\r
+\r
+ /**\r
+ * Constructor\r
+ *\r
+ * @param string|int $id\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct($id) {\r
+ //run parent constructor\r
+ parent::__construct('');\r
+ }\r
+\r
+ /**\r
+ * Retrieve Visitor Subject\r
+ *\r
+ * @return stdClass\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function retrieveSubject(){\r
+ return new stdClass();\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getCapabilities(){\r
+ return array();\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $value\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function updateOption($value, $object, $object_id = 0){\r
+ return aam_Core_API::updateBlogOption(\r
+ $this->getOptionName($object, $object_id), $value\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function readOption($object, $object_id = 0){\r
+ return aam_Core_API::getBlogOption(\r
+ $this->getOptionName($object, $object_id)\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ public function deleteOption($object, $object_id = 0){\r
+ return aam_Core_API::deleteBlogOption(\r
+ $this->getOptionName($object, $object_id)\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $object\r
+ * @param type $object_id\r
+ * @return type\r
+ */\r
+ protected function getOptionName($object, $object_id){\r
+ return 'aam_' . self::UID . "_{$object}" . ($object_id ? "_{$object_id}" : '');\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function hasFlag($flag) {\r
+ $option = 'aam_' . self::UID . "_{$flag}";\r
+ return aam_Core_API::getBlogOption($option);\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function setFlag($flag, $value = true) {\r
+ $option = 'aam_' . self::UID . "_{$flag}";\r
+ if ($value === true){\r
+ aam_Core_API::updateBlogOption($option, $value);\r
+ } else {\r
+ aam_Core_API::deleteBlogOption($option);\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID(){\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ * Get Visitor's Cache\r
+ *\r
+ * Read Visitor's option aam_visitor_cache and return it\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function readCache(){\r
+ $cache = aam_Core_API::getBlogOption('aam_visitor_cache', array());\r
+\r
+ return (is_array($cache) ? $cache : array());\r
+ }\r
+\r
+ /**\r
+ * Insert or Update Visitor's Cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function updateCache(){\r
+ return aam_Core_API::updateBlogOption(\r
+ 'aam_visitor_cache', $this->getObjects()\r
+ );\r
+ }\r
+\r
+ /**\r
+ * Delete Visitor's Cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function clearCache(){\r
+ return aam_Core_API::deleteBlogOption('aam_visitor_cache');\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function clearAllOptions(){\r
+ global $wpdb;\r
+\r
+ $mask = 'aam_%_' . self::UID;\r
+ //clear postmeta data\r
+ $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '{$mask}'");\r
+ \r
+ //clear all settings in options table\r
+ //TODO - convert mask to the standart aam_%_[subject]\r
+ $mask = 'aam_' . self::UID . '_%'; \r
+ $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '{$mask}'");\r
+\r
+ $this->clearCache(); //delete cache\r
+ //clear modifield flag\r
+ $this->setFlag(aam_Control_Subject::FLAG_MODIFIED, false);\r
+\r
+ do_action('aam_clear_all_options', $this);\r
+ }\r
+ \r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function getParentSubject(){\r
+ return null;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+final class aam_Core_API {
+
+ /**
+ * Get current blog's option
+ *
+ * @param string $option
+ * @param mixed $default
+ * @param int $blog_id;
+ *
+ * @return mixed
+ *
+ * @access public
+ * @static
+ */
+ public static function getBlogOption($option, $default = FALSE, $blog_id = null) {
+ if (is_multisite()) {
+ $blog = (is_null($blog_id) ? get_current_blog_id() : $blog_id);
+ $response = get_blog_option($blog, $option, $default);
+ } else {
+ $response = get_option($option, $default);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Update Blog Option
+ *
+ * @param string $option
+ * @param mixed $data
+ * @param int $blog_id
+ *
+ * @return bool
+ *
+ * @access public
+ * @static
+ */
+ public static function updateBlogOption($option, $data, $blog_id = null) {
+ if (is_multisite()) {
+ $blog = (is_null($blog_id) ? get_current_blog_id() : $blog_id);
+ $response = update_blog_option($blog, $option, $data);
+ } else {
+ $response = update_option($option, $data);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Delete Blog Option
+ *
+ * @param string $option
+ * @param int $blog_id
+ *
+ * @return bool
+ *
+ * @access public
+ * @static
+ */
+ public static function deleteBlogOption($option, $blog_id = null) {
+ if (is_multisite()) {
+ $blog = (is_null($blog_id) ? get_current_blog_id() : $blog_id);
+ $response = delete_blog_option($blog, $option);
+ } else {
+ $response = delete_option($option);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Initiate HTTP request
+ *
+ * @param string $url Requested URL
+ * @param bool $send_cookies Wheather send cookies or not
+ * @param bool $return_content Return content or not
+ * @return bool Always return TRUE
+ */
+ public static function cURL($url, $send_cookies = TRUE, $return_content = FALSE) {
+ $header = array(
+ 'User-Agent' => aam_Core_Request::server('HTTP_USER_AGENT')
+ );
+
+ $cookies = array();
+ if (is_array($_COOKIE) && $send_cookies) {
+ foreach ($_COOKIE as $key => $value) {
+ //SKIP PHPSESSID - some servers does not like it for security reason
+ if ($key !== 'PHPSESSID') {
+ $cookies[] = new WP_Http_Cookie(array(
+ 'name' => $key,
+ 'value' => $value
+ ));
+ }
+ }
+ }
+
+ $res = wp_remote_request($url, array(
+ 'headers' => $header,
+ 'cookies' => $cookies,
+ 'timeout' => 5)
+ );
+
+ if (is_wp_error($res)) {
+ $result = array(
+ 'status' => 'error',
+ 'url' => $url
+ );
+ } else {
+ $result = array('status' => 'success');
+ if ($return_content) {
+ $result['content'] = $res['body'];
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Check whether it is Multisite Network panel
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public static function isNetworkPanel() {
+ return (is_multisite() && is_network_admin() ? TRUE : FALSE);
+ }
+
+ /**
+ * Check if SSL is used
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function isSSL() {
+ if (force_ssl_admin()) {
+ $response = true;
+ } elseif (aam_Core_Request::server('HTTPS')) {
+ $response = true;
+ } elseif (aam_Core_Request::server('REQUEST_SCHEME') == 'https') {
+ $response = true;
+ } else {
+ $response = false;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Get User Capability Level
+ *
+ * Iterate throught User Capabilities and find out the higher User Level
+ *
+ * @param WP_User $user
+ *
+ * @return int
+ *
+ * @access public
+ * @static
+ */
+ public static function getUserLevel(WP_User $user = null){
+ if (is_null($user) ){
+ $user = wp_get_current_user();
+ }
+
+ $caps = $user->allcaps;
+ //get users highest level
+ $level = 0;
+ do {
+ $level++;
+ } while (isset($caps["level_{$level}"]) && $caps["level_{$level}"]);
+
+ return $level - 1;
+ }
+
+ /**
+ * Check if current user is super admin
+ *
+ * Super admin is someone who is allowed to manage all roles and users. This
+ * user is defined in ConfigPress parameter aam.super_admin
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function isSuperAdmin(){
+ if (is_multisite()){
+ $response = is_super_admin();
+ } else {
+ $super_admin = aam_Core_ConfigPress::getParam('aam.super_admin', 0);
+ $response = ($super_admin == get_current_user_id() ? true : false);
+ }
+
+ return $response;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * ConfigPress handler\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+final class aam_Core_ConfigPress {\r
+\r
+ /**\r
+ * Parsed ConfigPress from the file\r
+ * \r
+ * @var Zend_Config_Ini\r
+ * \r
+ * @access private\r
+ * @static \r
+ */\r
+ private static $_config = null;\r
+\r
+ /**\r
+ * Read ConfigPress File content\r
+ * \r
+ * @return string\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function read() {\r
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');\r
+ if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {\r
+ $content = file_get_contents(AAM_TEMP_DIR . $filename);\r
+ } else {\r
+ $content = '';\r
+ }\r
+\r
+ return $content;\r
+ }\r
+\r
+ /**\r
+ * Write ConfigPres to file\r
+ * \r
+ * @param string $content\r
+ * \r
+ * @return boolean\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function write($content) {\r
+ if (is_writable(AAM_TEMP_DIR)) {\r
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');\r
+ //file already was created and name is valid\r
+ if (preg_match('/^[a-z0-9]{40}$/i', $filename) === 0) {\r
+ $filename = sha1(uniqid('aam'));\r
+ aam_Core_API::updateBlogOption('aam_configpress', $filename);\r
+ }\r
+ $response = file_put_contents(\r
+ AAM_TEMP_DIR . $filename, stripcslashes($content)\r
+ );\r
+ } else {\r
+ $response = false;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get ConfigPress parameter\r
+ * \r
+ * @param string $param\r
+ * @param mixed $default\r
+ * \r
+ * @return mixed\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function getParam($param, $default = null) {\r
+ //initialize the ConfigPress if empty\r
+ if (is_null(self::$_config)) {\r
+ $filename = aam_Core_API::getBlogOption('aam_configpress', '');\r
+ if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {\r
+ //parse the file content & create Config INI Object\r
+ self::parseConfig(AAM_TEMP_DIR . $filename);\r
+ }\r
+ }\r
+\r
+ //find the parameter\r
+ $tree = self::$_config;\r
+ foreach (explode('.', $param) as $section) {\r
+ if (isset($tree->{$section})) {\r
+ $tree = $tree->{$section};\r
+ } else {\r
+ $tree = $default;\r
+ break;\r
+ }\r
+ }\r
+\r
+ return self::parseParam($tree, $default);\r
+ }\r
+\r
+ /**\r
+ * Parse found parameter\r
+ * \r
+ * @param mixed $param\r
+ * @param mixed $default\r
+ * \r
+ * @return mixed\r
+ * \r
+ * @access protected\r
+ * @static\r
+ */\r
+ protected static function parseParam($param, $default) {\r
+ if (is_object($param) && isset($param->userFunc)) {\r
+ $func = trim($param->userFunc);\r
+ if (is_string($func) && is_callable($func)) {\r
+ $response = call_user_func($func);\r
+ } else {\r
+ $response = $default;\r
+ }\r
+ } else {\r
+ $response = $param;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Parse ConfigPress file and create an object\r
+ * \r
+ * @param string $filename\r
+ * \r
+ * @return void\r
+ * \r
+ * @access protected\r
+ * @static\r
+ */\r
+ protected static function parseConfig($filename) {\r
+ //include third party library\r
+ if (!class_exists('Zend_Config')) {\r
+ require_once(AAM_LIBRARY_DIR . 'Zend/Exception.php');\r
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Exception.php');\r
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config.php');\r
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Ini.php');\r
+ }\r
+ //parse ini file\r
+ try {\r
+ self::$_config = new Zend_Config_Ini($filename);\r
+ } catch (Zend_Config_Exception $e) {\r
+ //do nothing\r
+ }\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * AAM Core Consol Panel\r
+ * \r
+ * Track and display list of all warnings that has been detected during AAM \r
+ * execution. The consol is used only when AAM interface was triggered in Admin side.\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Core_Console {\r
+\r
+ /**\r
+ * List of Runtime errors related to AAM\r
+ * \r
+ * @var array\r
+ * \r
+ * @access private \r
+ * @static \r
+ */\r
+ private static $_warnings = array();\r
+\r
+ /**\r
+ * Add new warning\r
+ * \r
+ * @param string $message\r
+ * \r
+ * @return void\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function add($message) {\r
+ self::$_warnings[] = $message;\r
+ }\r
+\r
+ /**\r
+ * Check if there is any warning during execution\r
+ * \r
+ * @return boolean\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function hasIssues() {\r
+ return (count(self::$_warnings) ? true : false);\r
+ }\r
+\r
+ /**\r
+ * Get list of all warnings\r
+ * \r
+ * @return array\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function getWarnings() {\r
+ return self::$_warnings;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * AAM Core Extension
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2014 Vasyl Martyniuk
+ */
+class AAM_Core_Extension {
+
+ /**
+ * Parent AAM object
+ *
+ * @var aam
+ *
+ * @access public
+ */
+ private $_parent = null;
+
+ /**
+ * Constructor
+ *
+ * @param aam $parent
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function __construct(aam $parent) {
+ $this->setParent($parent);
+ }
+
+ /**
+ * Activate hook
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function activate(){
+ return true;
+ }
+
+ /**
+ * Set Parent Object
+ *
+ * This is reference to main AAM class
+ *
+ * @param aam $parent
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function setParent(aam $parent) {
+ $this->_parent = $parent;
+ }
+
+ /**
+ * Get Parent Object
+ *
+ * @return aam
+ *
+ * @access public
+ */
+ public function getParent() {
+ return $this->_parent;
+ }
+
+ /**
+ * Get current User
+ *
+ * @return aam_Control_Subject_User
+ *
+ * @access public
+ */
+ public function getUser() {
+ return $this->getParent()->getUser();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Extension Repository\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2014 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Core_Repository {\r
+\r
+ /**\r
+ * Single instance of itself\r
+ * \r
+ * @var aam_Core_Repository\r
+ * \r
+ * @access private\r
+ * @static \r
+ */\r
+ private static $_instance = null;\r
+ \r
+ /**\r
+ * Extension repository\r
+ * \r
+ * @var array\r
+ * \r
+ * @access private \r
+ */\r
+ private $_repository = array();\r
+\r
+ /**\r
+ * Basedir to Extentions repository\r
+ *\r
+ * @var string\r
+ *\r
+ * @access private\r
+ */\r
+ private $_basedir = '';\r
+\r
+ /**\r
+ * Extension list cache\r
+ * \r
+ * @var array\r
+ * \r
+ * @access private\r
+ */\r
+ private $_cache = array();\r
+ \r
+ /**\r
+ * Repository Errors\r
+ * \r
+ * @var array\r
+ * \r
+ * @access private \r
+ */\r
+ private $_errors = array();\r
+\r
+ /**\r
+ * Main AAM class\r
+ *\r
+ * @var aam\r
+ *\r
+ * @access private\r
+ */\r
+ private $_parent;\r
+\r
+ /**\r
+ * Consturctor\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function __construct(aam $parent = null) {\r
+ $this->setParent($parent);\r
+ $this->_basedir = AAM_BASE_DIR . 'extension';\r
+ //retrieve list of extensions from the database\r
+ $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);\r
+ if (is_array($repository)){\r
+ $this->_repository = $repository;\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Get single instance of itself\r
+ * \r
+ * @param aam $parent\r
+ * \r
+ * @return aam_Core_Repository\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function getInstance(aam $parent = null){\r
+ if (is_null(self::$_instance)){\r
+ self::$_instance = new self($parent);\r
+ }\r
+ \r
+ return self::$_instance;\r
+ }\r
+\r
+ /**\r
+ * Load active extensions\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function load() {\r
+ //iterate through each active extension and load it\r
+ foreach (scandir($this->_basedir) as $module) {\r
+ if (!in_array($module, array('.', '..'))) {\r
+ $status = aam_Core_ConfigPress::getParam(\r
+ "aam.extension.{$module}.status"\r
+ );\r
+ if (strtolower($status) !== 'off'){\r
+ $this->bootstrapExtension($module);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Check if extensions exists\r
+ *\r
+ * @param string $extension\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function hasExtension($extension){\r
+ return file_exists(\r
+ $this->_basedir . '/' . $this->prepareExtFName($extension)\r
+ );\r
+ }\r
+ \r
+ /**\r
+ * Check if license exists\r
+ * \r
+ * @param string $extension\r
+ * \r
+ * @return boolean\r
+ * \r
+ * @access public\r
+ */\r
+ public function hasLicense($extension) {\r
+ return (isset($this->_repository[$extension]) ? true : false);\r
+ }\r
+ \r
+ /**\r
+ * Get Extension info\r
+ * \r
+ * @param string $ext\r
+ * \r
+ * @return stdClass\r
+ * \r
+ * @access public\r
+ */\r
+ public function getLicense($ext){\r
+ return ($this->hasLicense($ext) ? $this->_repository[$ext]->license : '');\r
+ }\r
+\r
+ /**\r
+ * Download extension from the external server\r
+ * \r
+ * @return void\r
+ * \r
+ * @access public\r
+ */\r
+ public function download() {\r
+ $this->initFilesystem();\r
+ $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);\r
+\r
+ if (is_array($repository)) {\r
+ //get the list of extensions\r
+ foreach ($repository as $data) {\r
+ $this->retrieve($data->license);\r
+ }\r
+ aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Add new extension to repository\r
+ *\r
+ * @param string $extension\r
+ * @param string $license\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function add($extension, $license){\r
+ $this->initFilesystem();\r
+ $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);\r
+\r
+ if ($this->retrieve($license)){\r
+ $repository[$extension] = (object) array(\r
+ 'license' => $license\r
+ );\r
+ aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);\r
+ $response = true;\r
+ } else {\r
+ $response = false;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Remove Extension from the repository\r
+ *\r
+ * @param string $extension\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function remove($extension){\r
+ global $wp_filesystem;\r
+\r
+ $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);\r
+\r
+ //if extension has been downloaded as part of dev license, it'll be\r
+ //not present in the repository list\r
+ if (isset($repository[$extension])){\r
+ unset($repository[$extension]);\r
+ aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);\r
+ }\r
+ \r
+ if ($this->hasExtension($extension)){\r
+ $this->initFilesystem();\r
+ $wp_filesystem->rmdir(\r
+ $this->_basedir . '/' . $this->prepareExtFName($extension), true\r
+ );\r
+ }\r
+\r
+ return true;\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @param type $extension\r
+ * @return type\r
+ */\r
+ protected function prepareExtFName($extension) {\r
+ return str_replace(' ', '_', $extension);\r
+ }\r
+\r
+ /**\r
+ * Initialize WordPress filesystem\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function initFilesystem(){\r
+ require_once ABSPATH . 'wp-admin/includes/file.php';\r
+\r
+ //initialize Filesystem\r
+ WP_Filesystem();\r
+ }\r
+\r
+ /**\r
+ * Retrieve extension based on license key\r
+ *\r
+ * @global WP_Filesystem $wp_filesystem\r
+ * @param string $license\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function retrieve($license) {\r
+ global $wp_filesystem;\r
+ \r
+ $url = WPAAM_REST_API . '?method=exchange&license=' . $license;\r
+ $res = wp_remote_request($url, array('timeout' => 10));\r
+ $response = false;\r
+ if (!is_wp_error($res)) {\r
+ //write zip archive to the filesystem first\r
+ $zip = AAM_TEMP_DIR . '/' . uniqid();\r
+ $content = base64_decode($res['body']);\r
+ if ($content && $wp_filesystem->put_contents($zip, $content)) {\r
+ $response = $this->insert($zip);\r
+ $wp_filesystem->delete($zip);\r
+ } elseif (empty($content)){\r
+ $this->addError(__('Invalid License Key', 'aam'));\r
+ } else {\r
+ $this->addError(\r
+ __('Failed to write file to wp-content/aam folder', 'aam')\r
+ );\r
+ }\r
+ } else {\r
+ $this->addError(__('Failed to reach the WPAAM Server', 'aam'));\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $zip\r
+ * @return boolean\r
+ */\r
+ protected function insert($zip) {\r
+ $response = true;\r
+ if (is_wp_error(unzip_file($zip, $this->_basedir))) {\r
+ $response = false;\r
+ $this->addError(\r
+ __('Failed to insert extension to extension folder', 'aam')\r
+ );\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Bootstrap the Extension\r
+ *\r
+ * In case of any errors, the output can be found in console\r
+ *\r
+ * @param string $extension\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function bootstrapExtension($extension) {\r
+ $bootstrap = $this->_basedir . "/{$extension}/index.php";\r
+ if (file_exists($bootstrap) && !isset($this->_cache[$extension])) {\r
+ //bootstrap the extension\r
+ $this->_cache[$extension] = require_once($bootstrap);\r
+ $this->_cache[$extension]->activate();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Set Parent class\r
+ *\r
+ * @param aam $parent\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function setParent($parent){\r
+ $this->_parent = $parent;\r
+ }\r
+\r
+ /**\r
+ * Get Parent class\r
+ *\r
+ * @return aam\r
+ *\r
+ * @access public\r
+ */\r
+ public function getParent(){\r
+ return $this->_parent;\r
+ }\r
+ \r
+ /**\r
+ * Add error\r
+ * \r
+ * @param string $message\r
+ * \r
+ * @access public\r
+ */\r
+ public function addError($message){\r
+ $this->_errors[] = $message;\r
+ }\r
+ \r
+ /**\r
+ * Get all errors\r
+ * \r
+ * @return array\r
+ * \r
+ * @access public\r
+ */\r
+ public function getErrors(){\r
+ return $this->_errors;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_Core_Request {
+
+ /**
+ * Get parameter from global _GET array
+ *
+ * @param string $param GET Parameter
+ * @param mixed $default Default value
+ *
+ * @return mixed
+ *
+ * @access public
+ */
+ public static function get($param = null, $default = null) {
+ return self::readArray($_GET, $param, $default);
+ }
+
+ /**
+ * Get parameter from global _POST array
+ *
+ * @param string $param POST Parameter
+ * @param mixed $default Default value
+ *
+ * @return mixed
+ *
+ * @access public
+ */
+ public static function post($param = null, $default = null) {
+ return self::readArray($_POST, $param, $default);
+ }
+
+ /**
+ * Get parameter from global _REQUEST array
+ *
+ * @param string $param REQUEST Parameter
+ * @param mixed $default Default value
+ *
+ * @return mixed
+ *
+ * @access public
+ * @static
+ */
+ public static function request($param = null, $default = null) {
+ return self::readArray($_REQUEST, $param, $default);
+ }
+
+ /**
+ * Get parameter from global _SERVER array
+ *
+ * @param string $param SERVER Parameter
+ * @param mixed $default Default value
+ *
+ * @return mixed
+ *
+ * @access public
+ * @static
+ */
+ public static function server($param = null, $default = null) {
+ return self::readArray($_SERVER, $param, $default);
+ }
+
+ /**
+ * Check array for specified parameter and return the it's value or
+ * default one
+ *
+ * @param array &$array Global array _GET, _POST etc
+ * @param string $param Array Parameter
+ * @param mixed $default Default value
+ *
+ * @return mixed
+ *
+ * @access protected
+ * @static
+ */
+ protected static function readArray(&$array, $param, $default) {
+ $value = $default;
+ if (is_null($param)) {
+ $value = $array;
+ } else {
+ $chunks = explode('.', $param);
+ $value = $array;
+ foreach ($chunks as $chunk) {
+ if (isset($value[$chunk])) {
+ $value = $value[$chunk];
+ } else {
+ $value = $default;
+ break;
+ }
+ }
+ }
+
+ return $value;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Core Plugin Settings\r
+ * \r
+ * Collection of core and default settings that are used across the plugin\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+final class aam_Core_Settings {\r
+\r
+ /**\r
+ * Collection of settings\r
+ * \r
+ * @var array\r
+ * \r
+ * @access private\r
+ * @static \r
+ */\r
+ private static $_collection = array();\r
+\r
+ /**\r
+ * Get Setting\r
+ * \r
+ * @param string $setting\r
+ * @param mixed $default\r
+ * \r
+ * @return mixed\r
+ * \r
+ * @access public\r
+ * @static\r
+ */\r
+ public static function get($setting, $default = null) {\r
+ if (empty(self::$_collection)) {\r
+ self::init();\r
+ }\r
+\r
+ if (isset(self::$_collection[$setting])) {\r
+ $response = self::$_collection[$setting];\r
+ } else {\r
+ $response = $default;\r
+ }\r
+\r
+ return apply_filters('aam_core_setting', $response, $setting);\r
+ }\r
+\r
+ /**\r
+ * Initialize all core & default settings\r
+ * \r
+ * @return void\r
+ * \r
+ * @access protected\r
+ * @static\r
+ */\r
+ protected static function init() {\r
+ //initialize default posts & terms restrictions\r
+ self::$_collection['term_frontend_restrictions'] = array(\r
+ aam_Control_Object_Term::ACTION_BROWSE,\r
+ aam_Control_Object_Term::ACTION_EXCLUDE,\r
+ aam_Control_Object_Term::ACTION_LIST\r
+ );\r
+ self::$_collection['term_backend_restrictions'] = array(\r
+ aam_Control_Object_Term::ACTION_BROWSE,\r
+ aam_Control_Object_Term::ACTION_EDIT,\r
+ aam_Control_Object_Term::ACTION_LIST\r
+ );\r
+ self::$_collection['post_frontend_restrictions'] = array(\r
+ aam_Control_Object_Post::ACTION_READ,\r
+ aam_Control_Object_Post::ACTION_EXCLUDE,\r
+ aam_Control_Object_Post::ACTION_COMMENT\r
+ );\r
+ self::$_collection['post_backend_restrictions'] = array(\r
+ aam_Control_Object_Post::ACTION_TRASH,\r
+ aam_Control_Object_Post::ACTION_DELETE,\r
+ aam_Control_Object_Post::ACTION_EDIT\r
+ );\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * AAM Plugin Update Hook\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+final class aam_Core_Update {\r
+\r
+ /**\r
+ * Reference to AAM\r
+ * \r
+ * @var aam\r
+ * \r
+ * @access private\r
+ */\r
+ \r
+ private $_parent = null;\r
+ /**\r
+ * List of stages\r
+ *\r
+ * @var array\r
+ *\r
+ * @access private\r
+ */\r
+ private $_stages = array();\r
+\r
+ /**\r
+ * Constructoor\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct($parent) {\r
+ $this->_parent = $parent;\r
+ //register update stages\r
+ $this->_stages = apply_filters('aam_update_stages', array(\r
+ array($this, 'downloadRepository'),\r
+ array($this, 'flashCache'),\r
+ array($this, 'updateFlag')\r
+ ));\r
+ }\r
+\r
+ /**\r
+ * Run the update if necessary\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function run() {\r
+ foreach ($this->_stages as $stage) {\r
+ //break the change if any stage failed\r
+ if (call_user_func($stage) === false) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Download the Extension Repository\r
+ *\r
+ * This forces the system to retrieve the new set of extensions based on\r
+ * license key\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function downloadRepository() {\r
+ $response = true;\r
+ if ($extensions = aam_Core_API::getBlogOption('aam_extensions')) {\r
+ if (is_array($extensions)){\r
+ $repo = aam_Core_Repository::getInstance($this->_parent);\r
+ $repo->download();\r
+ }\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Flash all cache\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function flashCache(){\r
+ global $wpdb;\r
+\r
+ //clear visitor's cache first\r
+ if (is_multisite()) {\r
+ //get all sites first and iterate through each\r
+ $query = 'SELECT blog_id FROM ' . $wpdb->blogs;\r
+ $blog_list = $wpdb->get_results($query);\r
+ if (is_array($blog_list)) {\r
+ $query = 'DELETE FROM %s WHERE `option_name` = "aam_%s_cache"';\r
+ foreach ($blog_list as $blog) {\r
+ $wpdb->query(\r
+ sprintf(\r
+ $query,\r
+ $wpdb->get_blog_prefix($blog->blog_id) . 'options',\r
+ aam_Control_Subject_Visitor::UID\r
+ )\r
+ );\r
+ }\r
+ }\r
+ } else {\r
+ $query = 'DELETE FROM ' . $wpdb->options . ' ';\r
+ $query .= 'WHERE `option_name` = "aam_' . aam_Control_Subject_Visitor::UID . '_cache"';\r
+ $wpdb->query($query);\r
+ }\r
+\r
+ //clear users cache\r
+ $query = 'DELETE FROM ' . $wpdb->usermeta . ' ';\r
+ $query .= 'WHERE `meta_key` = "aam_cache"';\r
+ $wpdb->query($query);\r
+\r
+ return true;\r
+ }\r
+\r
+ /**\r
+ * Change the Update flag\r
+ *\r
+ * This will stop to run the update again\r
+ *\r
+ * @return boolean\r
+ *\r
+ * @access public\r
+ */\r
+ public function updateFlag() {\r
+ return aam_Core_API::updateBlogOption('aam_updated', AAM_VERSION, 1);\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * Abstract class for all View Models
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+abstract class aam_View_Abstract {
+
+ /**
+ * Current Subject
+ *
+ * @var aam_Control_Subject
+ *
+ * @access private
+ */
+ static private $_subject = null;
+
+ /**
+ * Construct the Object
+ *
+ * Instantiate the subject one type that is going to be shared with all view
+ * models.
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function __construct() {
+ if (is_null(self::$_subject)) {
+ $subject_class = 'aam_Control_Subject_' . ucfirst(
+ trim(aam_Core_Request::request('subject'), '')
+ );
+ if (class_exists($subject_class)){
+ $this->setSubject(new $subject_class(
+ aam_Core_Request::request('subject_id')
+ ));
+ //check if view for current subject can be managed
+ $this->isManagable();
+ }
+ }
+
+ //control default option list
+ add_filter('aam_default_option_list', array($this, 'defaultOption'));
+ }
+
+ /**
+ * Check if view can be managed
+ *
+ * @return void
+ *
+ * @access public
+ * @throw Exception You are not allowed to manage current view
+ */
+ public function isManagable(){
+ if ($this->getSubject()->getUID() == aam_Control_Subject_Role::UID){
+ $caps = $this->getSubject()->capabilities;
+ } elseif ($this->getSubject()->getUID == aam_Control_Subject_User::UID){
+ //AAM does not support multi-roles. Get only one first role
+ $roles = $this->getSubject()->roles;
+ $caps = get_role(array_shift($roles))->capabilities;
+ } else {
+ $caps = apply_filters('aam_managable_capabilities', null, $this);
+ }
+
+ if ($caps && !aam_Core_API::isSuperAdmin()){
+ //get user's highest level
+ $level = aam_Core_API::getUserLevel();
+ if (!empty($caps['level_' . $level]) && $caps['level_' . $level]){
+ Throw new Exception(
+ __('You are not allowed to manager current view', 'aam')
+ );
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Control default set of options
+ *
+ * This is very important function. It control the default option for each
+ * feature. It covers the scenario when the set of UI options is represented by
+ * checkboxes.
+ *
+ * @param array $options
+ *
+ * @return array
+ *
+ * @access public
+ */
+ public function defaultOption($options){
+ return $options;
+ }
+
+ /**
+ * Get Subject
+ *
+ * @return aam_Control_Subject
+ *
+ * @access public
+ */
+ public function getSubject() {
+ return self::$_subject;
+ }
+
+ /**
+ * Set Subject
+ *
+ * @param aam_Control_Subject $subject
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function setSubject(aam_Control_Subject $subject) {
+ self::$_subject = $subject;
+ }
+
+ /**
+ * Load View template
+ *
+ * @param string $tmpl_path
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function loadTemplate($tmpl_path) {
+ ob_start();
+ require_once($tmpl_path);
+ $content = ob_get_contents();
+ ob_end_clean();
+
+ return $content;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Capability extends aam_View_Abstract {
+
+ /**
+ *
+ * @var type
+ */
+ private $_groups = array(
+ 'system' => array(
+ 'level_0', 'level_1', 'level_2', 'level_3', 'level_4', 'level_5',
+ 'level_6', 'level_7', 'level_8', 'level_9', 'level_10'
+ ),
+ 'post' => array(
+ 'delete_others_pages', 'delete_others_posts', 'delete_pages',
+ 'delete_posts', 'delete_private_pages', 'delete_private_posts',
+ 'delete_published_pages', 'delete_published_posts', 'edit_others_pages',
+ 'edit_others_posts', 'edit_pages', 'edit_private_posts',
+ 'edit_private_pages', 'edit_posts', 'edit_published_pages',
+ 'edit_published_posts', 'publish_pages', 'publish_posts', 'read',
+ 'read_private_pages', 'read_private_posts', 'edit_permalink'
+ ),
+ 'backend' => array(
+ 'aam_manage', 'activate_plugins', 'add_users', 'create_users',
+ 'delete_users', 'delete_themes', 'edit_dashboard', 'edit_files',
+ 'edit_plugins', 'edit_theme_options', 'edit_themes', 'edit_users',
+ 'export', 'import', 'install_plugins', 'install_themes', 'list_users',
+ 'manage_options', 'manage_links', 'manage_categories', 'promote_users',
+ 'unfiltered_html', 'unfiltered_upload', 'update_themes', 'update_plugins',
+ 'update_core', 'upload_files', 'delete_plugins', 'remove_users',
+ 'switch_themes'
+ )
+ );
+
+ /**
+ *
+ * @return type
+ */
+ public function retrieveList() {
+ $response = array(
+ 'aaData' => array(),
+ 'aaDefault' => 1 //Default set of Capabilities indicator
+ );
+
+ $subject = $this->getSubject();
+ $roles = new WP_Roles();
+ if ($subject->getUID() === aam_Control_Subject_Role::UID) {
+ //prepare list of all capabilities
+ $caps = array();
+ foreach ($roles->role_objects as $role) {
+ $caps = array_merge($caps, $role->capabilities);
+ }
+ //init all caps
+ foreach ($caps as $capability => $grant) {
+ $response['aaData'][] = array(
+ $capability,
+ ($subject->hasCapability($capability) ? 1 : 0),
+ $this->getGroup($capability),
+ $this->getHumanText($capability),
+ ''
+ );
+ }
+ } else {
+ $role_list = $subject->roles;
+ $role = $roles->get_role(array_shift($role_list));
+ foreach ($role->capabilities as $capability => $grant) {
+ $response['aaData'][] = array(
+ $capability,
+ ($subject->hasCapability($capability) ? 1 : 0),
+ $this->getGroup($capability),
+ $this->getHumanText($capability),
+ ''
+ );
+ $response['aaDefault'] = ($subject->isDefaultCapSet() ? 1 : 0);
+ }
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function getGroupList(){
+ return apply_filters('aam_capability_groups', array(
+ __('System', 'aam'),
+ __('Post & Page', 'aam'),
+ __('Backend Interface', 'aam'),
+ __('Miscellaneous', 'aam')
+ ));
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function retrieveRoleCapabilities() {
+ return json_encode(array(
+ 'status' => 'success',
+ 'capabilities' => $this->getSubject()->getCapabilities()
+ ));
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function addCapability() {
+ $roles = new WP_Roles();
+ $capability = trim(aam_Core_Request::post('capability'));
+ $unfiltered = intval(aam_Core_Request::post('unfiltered'));
+
+ if ($capability) {
+ if ($unfiltered){
+ $normalized = $capability;
+ } else {
+ $normalized = str_replace(' ', '_', strtolower($capability));
+ }
+ //add the capability to administrator's role as default behavior
+ $roles->add_cap('administrator', $normalized);
+ $response = array('status' => 'success', 'capability' => $normalized);
+ } else {
+ $response = array('status' => 'failure');
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function deleteCapability() {
+ $roles = new WP_Roles();
+ $capability = trim(aam_Core_Request::post('capability'));
+
+ if ($capability) {
+ foreach ($roles->role_objects as $role) {
+ $role->remove_cap($capability);
+ }
+ $response = array('status' => 'success');
+ } else {
+ $response = array('status' => 'failure');
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Restore default user capabilities
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function restoreCapability(){
+ $subject = $this->getSubject();
+ $response = array('status' => 'failure');
+ if (($subject->getUID() == aam_Control_Subject_User::UID)
+ && $subject->resetCapability()){
+ $response['status'] = 'success';
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @param type $text
+ * @return type
+ */
+ protected function getHumanText($text) {
+ $parts = preg_split('/_/', $text);
+ if (is_array($parts)) {
+ foreach ($parts as &$part) {
+ $part = ucfirst($part);
+ }
+ }
+
+ return implode(' ', $parts);
+ }
+
+ /**
+ *
+ * @param type $capability
+ * @return type
+ */
+ protected function getGroup($capability) {
+ if (in_array($capability, $this->_groups['system'])) {
+ $response = __('System', 'aam');
+ } elseif (in_array($capability, $this->_groups['post'])) {
+ $response = __('Post & Page', 'aam');
+ } elseif (in_array($capability, $this->_groups['backend'])) {
+ $response = __('Backend Interface', 'aam');
+ } else {
+ $response = __('Miscellaneous', 'aam');
+ }
+
+ return apply_filters('aam_capability_group', $response, $capability);
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/capability.phtml');
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * View collection
+ *
+ * Collection of features and subjects
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Collection {
+
+ /**
+ * Collection of subjects
+ *
+ * @var array
+ *
+ * @access private
+ * @static
+ */
+ static private $_subjects = array();
+
+ /**
+ * Collection of features
+ *
+ * @var array
+ *
+ * @access private
+ * @static
+ */
+ static private $_features = array();
+
+ /**
+ * Register Subject
+ *
+ * @param stdClass $subject
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function registerSubject(stdClass $subject) {
+ self::$_subjects[] = $subject;
+
+ return true;
+ }
+
+ /**
+ * Register UI Feature
+ *
+ * @param stdClass $feature
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function registerFeature(stdClass $feature) {
+ $response = false;
+
+ if (empty($feature->capability)){
+ $cap = aam_Core_ConfigPress::getParam(
+ 'aam.default_feature_capability', 'administrator'
+ );
+ } else {
+ $cap = $feature->capability;
+ }
+
+ if (self::accessGranted($feature->uid, $cap)) {
+ self::$_features[] = $feature;
+ $response = true;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Check if feature registered
+ *
+ * If feature is restricted for current user or it does not exist, this function
+ * will return false result
+ *
+ * @param string $search
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function hasFeature($search){
+ $found = false;
+ foreach(self::$_features as $feature){
+ if ($feature->uid == $search){
+ $found = true;
+ break;
+ }
+ }
+
+ return $found;
+ }
+
+ /**
+ * Check if subject is registered
+ *
+ * @param string $search
+ *
+ * @return boolean
+ *
+ * @access public
+ * @static
+ */
+ public static function hasSubject($search){
+ $found = false;
+ foreach(self::$_subjects as $subject){
+ if ($subject->uid == $search){
+ $found = true;
+ break;
+ }
+ }
+
+ return $found;
+ }
+
+ /**
+ * Get initiated feature
+ *
+ * Find the feature in the collection of registered features and initiate it if
+ * was not initiated already
+ *
+ * @param string $search
+ * @return boolean
+ */
+ public static function getFeature($search){
+ $response = null;
+ foreach(self::$_features as $feature){
+ if ($feature->uid == $search){
+ $response = self::initController($feature);
+ break;
+ }
+ }
+
+ return $response;
+ }
+
+ /**
+ * Get initiated subject
+ *
+ * Find the subject in the collection of registered subjects and initiate it if
+ * was not initiated already
+ *
+ * @param string $search
+ * @return boolean
+ */
+ public static function getSubject($search){
+ $response = null;
+ foreach(self::$_subjects as $subject){
+ if ($subject->uid == $search){
+ $response = self::initController($subject);
+ break;
+ }
+ }
+
+ return $response;
+ }
+
+ /**
+ * Initiate the Controller
+ *
+ * @param stdClass $feature
+ *
+ * @return stdClass
+ *
+ * @access public
+ * @static
+ */
+ public static function initController(stdClass $feature){
+ if (is_string($feature->controller)){
+ $feature->controller = new $feature->controller;
+ }
+
+ return $feature;
+ }
+
+ /**
+ * Retrieve subjects
+ *
+ * @return array
+ *
+ * @access public
+ * @static
+ */
+ public static function retrieveSubjects() {
+ $subjects = self::$_subjects; //keep originally copy
+ usort($subjects, 'aam_View_Collection::positionOrder');
+
+ //initiate controller
+ foreach($subjects as $subject){
+ self::initController($subject);
+ }
+
+ return $subjects;
+ }
+
+ /**
+ * Retrieve list of features
+ *
+ * Retrieve sorted list of featured based on current subject
+ *
+ * @param aam_Control_Subject $subject
+ *
+ * @return array
+ *
+ * @access public
+ * @static
+ */
+ public static function retriveFeatures(aam_Control_Subject $subject) {
+ $response = array();
+
+ foreach (self::$_features as $feature) {
+ if (in_array($subject->getUID(), $feature->subjects)) {
+ $response[] = self::initController($feature);
+ }
+ }
+ usort($response, 'aam_View_Collection::positionOrder');
+
+ return $response;
+ }
+
+ /**
+ * Check if current user can use feature
+ *
+ * Make sure that current user has enough capabilities to use feature
+ *
+ * @param string $feature
+ * @param string $cap
+ *
+ * @return boolean
+ *
+ * @access protected
+ * @static
+ */
+ protected static function accessGranted($feature, $cap = 'administrator') {
+ $capability = aam_Core_ConfigPress::getParam(
+ "aam.feature.{$feature}.capability", $cap
+ );
+
+ return current_user_can($capability);
+ }
+
+ /**
+ * Order list of features or subjectes
+ *
+ * Reorganize the list based on "position" attribute
+ *
+ * @param array $features
+ *
+ * @return array
+ *
+ * @access public
+ * @static
+ */
+ public static function positionOrder($feature_a, $feature_b){
+ $pos_a = (empty($feature_a->position) ? 9999 : $feature_a->position);
+ $pos_b = (empty($feature_b->position) ? 9999 : $feature_b->position);
+
+ if ($pos_a == $pos_b){
+ $response = 0;
+ } else {
+ $response = ($pos_a < $pos_b ? -1 : 1);
+ }
+
+ return $response;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_View_ConfigPress extends aam_View_Abstract {\r
+\r
+ /**\r
+ * Run the Manager\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function run() {\r
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/configpress.phtml');\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Event extends aam_View_Abstract {
+
+ /**
+ *
+ * @return type
+ */
+ public function retrieveEventList() {
+ $response = array('aaData' => array());
+ $events = $this->getSubject()->getObject(aam_Control_Object_Event::UID);
+ foreach ($events->getOption() as $event) {
+ $response['aaData'][] = array(
+ $event['event'],
+ $event['event_specifier'],
+ $event['post_type'],
+ $event['action'],
+ $event['action_specifier'],
+ ''
+ );
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @global type $wp_post_statuses
+ * @return type
+ */
+ public function getPostStatuses() {
+ global $wp_post_statuses;
+
+ return $wp_post_statuses;
+ }
+
+ /**
+ *
+ * @global type $wp_post_types
+ * @return type
+ */
+ public function getPostTypes() {
+ global $wp_post_types;
+
+ return $wp_post_types;
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/event.phtml');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function defaultOption($options) {
+ //make sure that some parts are always in place
+ if (!isset($options[aam_Control_Object_Event::UID])) {
+ $options[aam_Control_Object_Event::UID] = array();
+ }
+
+ return $options;
+ }
+
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Extension UI controller\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_View_Extension extends aam_View_Abstract {\r
+\r
+ /**\r
+ * Extensions Repository\r
+ *\r
+ * @var aam_Core_Repository\r
+ *\r
+ * @access private\r
+ */\r
+ private $_repository;\r
+ \r
+ /**\r
+ * Constructor\r
+ *\r
+ * The filter "aam_cpanel" can be used to control the Control Panel items.\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct() {\r
+ parent::__construct();\r
+ $this->_repository = aam_Core_Repository::getInstance();\r
+ }\r
+\r
+ /**\r
+ * Install extension\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function install(){\r
+ $license = aam_Core_Request::post('license');\r
+ $ext = aam_Core_Request::post('extension');\r
+\r
+ if ($license && $this->getRepository()->add($ext, $license)){\r
+ $response = array('status' => 'success');\r
+ } else {\r
+ $response = array(\r
+ 'status' => 'failure',\r
+ 'reasons' => $this->getRepository()->getErrors()\r
+ );\r
+ }\r
+\r
+ return json_encode($response);\r
+ }\r
+\r
+ /**\r
+ * Remove extension\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function remove(){\r
+ $license = aam_Core_Request::post('license');\r
+ $ext = aam_Core_Request::post('extension');\r
+\r
+ if ($this->getRepository()->remove($ext, $license)){\r
+ $response = array('status' => 'success');\r
+ } else {\r
+ $response = array(\r
+ 'status' => 'failure',\r
+ 'reasons' => $this->getRepository()->getErrors()\r
+ );\r
+ }\r
+\r
+ return json_encode($response);\r
+ }\r
+\r
+ /**\r
+ * Run the Manager\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function run() {\r
+ //check if plugins/advanced-access-manager/extension is writable\r
+ if (!is_writable(AAM_BASE_DIR . 'extension')){\r
+ aam_Core_Console::add(__(\r
+ 'Folder advanced-access-manager/extension is not writable', 'aam'\r
+ ));\r
+ }\r
+ \r
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/extension.phtml');\r
+ }\r
+ \r
+ /**\r
+ * \r
+ * @return aam_Core_Respository\r
+ */\r
+ public function getRepository(){\r
+ return $this->_repository;\r
+ }\r
+ \r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Help extends aam_View_Abstract {
+
+ /**
+ * Get View content
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function content($screen) {
+ $basedir = dirname(__FILE__) . '/tmpl/';
+ $screen->add_help_tab(array(
+ 'id' => 'faq',
+ 'title' => 'FAQ',
+ 'content' => $this->loadTemplate($basedir . 'help_faq.phtml')
+ ));
+ //add overview tab
+ $screen->add_help_tab(array(
+ 'id' => 'overview',
+ 'title' => 'Overview',
+ 'content' => $this->loadTemplate($basedir . 'help_overview.phtml')
+ ));
+ $screen->add_help_tab(array(
+ 'id' => 'extensions',
+ 'title' => 'Extensions',
+ 'content' => $this->loadTemplate($basedir . 'help_extensions.phtml')
+ ));
+ $screen->add_help_tab(array(
+ 'id' => 'developers',
+ 'title' => 'Developers',
+ 'content' => $this->loadTemplate($basedir . 'help_developers.phtml')
+ ));
+ }
+
+}
--- /dev/null
+<?php\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Main UI Controller\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_View_Manager extends aam_View_Abstract {\r
+\r
+ /**\r
+ * Admin Menu Feature\r
+ */\r
+ const FEATURE_ADMIN_MENU = 'admin_menu';\r
+\r
+ /**\r
+ * Metaboxes & Widgetst Feature\r
+ */\r
+ const FEATURE_METABOX = 'metabox';\r
+\r
+ /**\r
+ * Capability Feature\r
+ */\r
+ const FEATURE_CAPABILITY = 'capability';\r
+\r
+ /**\r
+ * Post Access Feature\r
+ */\r
+ const FEATURE_POST_ACCESS = 'post_access';\r
+\r
+ /**\r
+ * Event Manager Feature\r
+ */\r
+ const FEATURE_EVENT_MANAGER = 'event_manager';\r
+\r
+ /**\r
+ * Default ajax response\r
+ */\r
+ const DEFAULT_AJAX_RESPONSE = -1;\r
+ \r
+ /**\r
+ * Constructor\r
+ *\r
+ * The filter "aam_cpanel" can be used to control the Control Panel items.\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct() {\r
+ parent::__construct();\r
+\r
+ $this->registerDefaultSubjects();\r
+ $this->registerDefaultFeatures();\r
+ }\r
+\r
+ /**\r
+ * Registet default list of subjects\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function registerDefaultSubjects() {\r
+ aam_View_Collection::registerSubject((object)array(\r
+ 'position' => 5,\r
+ 'segment' => aam_Control_Subject_Role::UID,\r
+ 'label' => __('Roles', 'aam'),\r
+ 'title' => __('Role Manager', 'aam'),\r
+ 'class' => 'manager-item manager-item-role',\r
+ 'uid' => 'role',\r
+ 'controller' => 'aam_View_Role'\r
+ ));\r
+\r
+ aam_View_Collection::registerSubject((object)array(\r
+ 'position' => 10,\r
+ 'segment' => aam_Control_Subject_User::UID,\r
+ 'label' => __('Users', 'aam'),\r
+ 'title' => __('User Manager', 'aam'),\r
+ 'class' => 'manager-item manager-item-user',\r
+ 'uid' => 'user',\r
+ 'controller' => 'aam_View_User'\r
+ ));\r
+\r
+ aam_View_Collection::registerSubject((object)array(\r
+ 'position' => 15,\r
+ 'segment' => aam_Control_Subject_Visitor::UID,\r
+ 'label' => __('Visitor', 'aam'),\r
+ 'title' => __('Visitor Manager', 'aam'),\r
+ 'class' => 'manager-item manager-item-visitor',\r
+ 'uid' => 'visitor',\r
+ 'controller' => 'aam_View_Visitor'\r
+ ));\r
+ }\r
+\r
+ /**\r
+ * Prepare default list of features\r
+ *\r
+ * Check if current user has proper capability to use the feature\r
+ *\r
+ * @return array\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function registerDefaultFeatures() {\r
+ $features = array();\r
+\r
+ //Main Menu Tab\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => self::FEATURE_ADMIN_MENU,\r
+ 'position' => 5,\r
+ 'title' => __('Admin Menu', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID\r
+ ),\r
+ 'controller' => 'aam_View_Menu'\r
+ ));\r
+\r
+\r
+ //Metaboxes & Widgets Tab\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => self::FEATURE_METABOX,\r
+ 'position' => 10,\r
+ 'title' => __('Metabox & Widget', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID,\r
+ aam_Control_Subject_User::UID,\r
+ aam_Control_Subject_Visitor::UID\r
+ ),\r
+ 'controller' => 'aam_View_Metabox'\r
+ ));\r
+\r
+ //Capability Tab\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => self::FEATURE_CAPABILITY,\r
+ 'position' => 15,\r
+ 'title' => __('Capability', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID\r
+ ),\r
+ 'controller' => 'aam_View_Capability'\r
+ ));\r
+\r
+ //Posts & Pages Tab\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => self::FEATURE_POST_ACCESS,\r
+ 'position' => 20,\r
+ 'title' => __('Posts & Pages', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID,\r
+ aam_Control_Subject_User::UID,\r
+ aam_Control_Subject_Visitor::UID\r
+ ),\r
+ 'controller' => 'aam_View_Post'\r
+ ));\r
+\r
+ //Event Manager Tab\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => self::FEATURE_EVENT_MANAGER,\r
+ 'position' => 25,\r
+ 'title' => __('Event Manager', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID\r
+ ),\r
+ 'controller' =>'aam_View_Event'\r
+ ));\r
+\r
+ return $features;\r
+ }\r
+\r
+ /**\r
+ * Run the Manager\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function run() {\r
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/manager.phtml');\r
+ }\r
+\r
+ /**\r
+ * Process the ajax call\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function processAjax(){ \r
+ $sub_method = aam_Core_Request::request('sub_action');\r
+\r
+ if (method_exists($this, $sub_method)) {\r
+ $response = call_user_func(array($this, $sub_method));\r
+ } else {\r
+ $response = apply_filters(\r
+ 'aam_ajax_call', self::DEFAULT_AJAX_RESPONSE, $this->getSubject()\r
+ );\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Render the Main Control Area\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function retrieveFeatures() {\r
+ $features = aam_View_Collection::retriveFeatures($this->getSubject());\r
+ if (count($features)){\r
+ ?>\r
+ <div class="feature-list">\r
+ <?php\r
+ foreach ($features as $feature) {\r
+ echo '<div class="feature-item" feature="' . $feature->uid . '">';\r
+ echo '<span>' . $feature->title . '</span></div>';\r
+ }\r
+ ?>\r
+ </div>\r
+ <div class="feature-content">\r
+ <?php\r
+ foreach ($features as $feature) {\r
+ echo $feature->controller->content($this->getSubject());\r
+ }\r
+ ?>\r
+ </div>\r
+ <br class="clear" />\r
+ <?php\r
+ } else {\r
+ echo '<p class="feature-list-empty">';\r
+ echo __('You are not allowed to manage any AAM Features.', 'aam');\r
+ echo '</p>';\r
+ }\r
+ do_action('aam_post_features_render');\r
+ }\r
+\r
+ /**\r
+ * Load List of Metaboxes\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function loadMetaboxes(){\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_METABOX)){\r
+ $metabox = new aam_View_Metabox;\r
+ $response = $metabox->retrieveList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Initialize list of metaboxes from individual link\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function initLink(){\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_METABOX)){\r
+ $metabox = new aam_View_Metabox;\r
+ $response = $metabox->initLink();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Retrieve Available for Editing Role List\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function roleList(){\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_Role::UID)){\r
+ $role = new aam_View_Role;\r
+ $response = $role->retrieveList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Retrieve Pure Role List\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function plainRoleList(){\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_Role::UID)){\r
+ $role = new aam_View_Role;\r
+ $response = $role->retrievePureList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Add New Role\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function addRole()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_Role::UID)) {\r
+ $role = new aam_View_Role;\r
+ $response = $role->add();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Edit Existing Role\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function editRole()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_Role::UID)) {\r
+ $role = new aam_View_Role;\r
+ $response = $role->edit();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Delete Existing Role\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function deleteRole()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_Role::UID)) {\r
+ $role = new aam_View_Role;\r
+ $response = $role->delete();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Retrieve Available User List\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function userList()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_User::UID)) {\r
+ $user = new aam_View_User;\r
+ $response = $user->retrieveList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Block Selected User\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function blockUser()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_User::UID)) {\r
+ $user = new aam_View_User;\r
+ $response = $user->block();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Delete Selected User\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function deleteList()\r
+ {\r
+ if (aam_View_Collection::hasSubject(aam_Control_Subject_User::UID)) {\r
+ $user = new aam_View_User;\r
+ $response = $user->delete();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Load list of capabilities\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function loadCapabilities()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_CAPABILITY)){\r
+ $capability = new aam_View_Capability;\r
+ $response = $capability->retrieveList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get list of Capabilities by selected Role\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function roleCapabilities()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_CAPABILITY)){\r
+ $capability = new aam_View_Capability;\r
+ $response = $capability->retrieveRoleCapabilities();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Add New Capability\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function addCapability()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_CAPABILITY)){\r
+ $capability = new aam_View_Capability;\r
+ $response = $capability->addCapability();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Delete Capability\r
+ *\r
+ * @return string\r
+ *\r
+ * @access protected\r
+ */\r
+ public function deleteCapability()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_CAPABILITY)){\r
+ $capability = new aam_View_Capability;\r
+ $response = $capability->deleteCapability();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Restore Capabilities\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function restoreCapabilities()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_CAPABILITY)){\r
+ $capability = new aam_View_Capability;\r
+ $response = $capability->restoreCapability();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get the List of Posts\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function postList()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->retrievePostList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get Post Tree\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function postTree()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->getPostTree();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Save Access settings for Post or Term\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function saveAccess()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->saveAccess();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get Access settings for Post or Term\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function getAccess()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->getAccess();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Restore default access level for Post or Term\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function clearAccess()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->clearAccess();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Delete Post\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function deletePost()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->deletePost();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Prepare and generate the post breadcrumb\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function postBreadcrumb()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_POST_ACCESS)){\r
+ $post = new aam_View_Post;\r
+ $response = $post->getPostBreadcrumb();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Get Event List\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function eventList()\r
+ {\r
+ if (aam_View_Collection::hasFeature(self::FEATURE_EVENT_MANAGER)){\r
+ $event = new aam_View_Event;\r
+ $response = $event->retrieveEventList();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Save AAM options\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function save() {\r
+ $this->getSubject()->save(\r
+ apply_filters(\r
+ 'aam_default_option_list', aam_Core_Request::post('aam')\r
+ ));\r
+ return json_encode(array('status' => 'success'));\r
+ }\r
+\r
+ /**\r
+ * Roleback changes\r
+ *\r
+ * Restore default settings for current Subject\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function roleback() {\r
+ //clear all settings\r
+ $this->getSubject()->clearAllOptions();\r
+ //clear cache\r
+ $this->getSubject()->clearCache();\r
+\r
+ return json_encode(array('status' => 'success'));\r
+ }\r
+\r
+ /**\r
+ * Check if current subject can perform roleback\r
+ *\r
+ * This function checks if there is any saved set of settings and return\r
+ * true if roleback feature can be performed\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function hasRoleback() {\r
+ return json_encode(\r
+ array(\r
+ 'status' => intval(\r
+ $this->getSubject()->hasFlag(\r
+ aam_Control_Subject::FLAG_MODIFIED\r
+ )\r
+ )\r
+ ));\r
+ }\r
+\r
+ /**\r
+ * Install license\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function installLicense()\r
+ {\r
+ if (current_user_can(aam_Core_ConfigPress::getParam(\r
+ 'aam.menu.extensions.capability', 'administrator'\r
+ ))){\r
+ $model = new aam_View_Extension();\r
+ $response = $model->install();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Remove license\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function removeLicense()\r
+ {\r
+ if (current_user_can(aam_Core_ConfigPress::getParam(\r
+ 'aam.menu.extensions.capability', 'administrator'\r
+ ))){\r
+ $model = new aam_View_Extension();\r
+ $response = $model->remove();\r
+ } else {\r
+ $response = self::DEFAULT_AJAX_RESPONSE;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Save ConfigPress\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function saveConfigPress()\r
+ {\r
+ if (current_user_can(aam_Core_ConfigPress::getParam(\r
+ 'aam.menu.configpress.capability', 'administrator'\r
+ ))){\r
+ $result = aam_Core_ConfigPress::write(aam_Core_Request::post('config'));\r
+ } else {\r
+ $result = false;\r
+ }\r
+\r
+ return json_encode(array(\r
+ 'status' => ($result === false ? 'failure' : 'success')\r
+ ));\r
+ }\r
+ \r
+ /**\r
+ * Discard Help Pointer\r
+ * \r
+ * @return string\r
+ * \r
+ * @access public\r
+ */\r
+ public function discardHelp(){\r
+ return update_user_meta(get_current_user_id(), 'aam_contextual_menu', 1);\r
+ }\r
+\r
+ /**\r
+ * UI Javascript labels\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ * @static\r
+ * @todo Move to other file\r
+ */\r
+ public static function uiLabels() {\r
+ return apply_filters('aam_localization_labels', array(\r
+ 'Rollback Settings' => __('Rollback Settings', 'aam'),\r
+ 'Cancel' => __('Cancel', 'aam'),\r
+ 'Send E-mail' => __('Send E-mail', 'aam'),\r
+ 'Add New Role' => __('Add New Role', 'aam'),\r
+ 'Manage' => __('Manage', 'aam'),\r
+ 'Edit' => __('Edit', 'aam'),\r
+ 'Delete' => __('Delete', 'aam'),\r
+ 'Filtered' => __('Filtered', 'aam'),\r
+ 'Clear' => __('Clear', 'aam'),\r
+ 'Add New Role' => __('Add New Role', 'aam'),\r
+ 'Save Changes' => __('Save Changes', 'aam'),\r
+ 'Delete Role with Users Message' => __('System detected %d user(s) with this role. All Users with Role <b>%s</b> will be deleted automatically!', 'aam'),\r
+ 'Delete Role Message' => __('Are you sure that you want to delete role <b>%s</b>?', 'aam'),\r
+ 'Delete Role' => __('Delete Role', 'aam'),\r
+ 'Add User' => __('Add User', 'aam'),\r
+ 'Filter Users' => __('Filter Users', 'aam'),\r
+ 'Refresh List' => __('Refresh List', 'aam'),\r
+ 'Block' => __('Block', 'aam'),\r
+ 'Delete User Message' => __('Are you sure you want to delete user <b>%s</b>?', 'aam'),\r
+ 'Filter Capabilities by Category' => __('Filter Capabilities by Category', 'aam'),\r
+ 'Inherit Capabilities' => __('Inherit Capabilities', 'aam'),\r
+ 'Add New Capability' => __('Add New Capability', 'aam'),\r
+ 'Delete Capability Message' => __('Are you sure that you want to delete capability <b>%s</b>?', 'aam'),\r
+ 'Delete Capability' => __('Delete Capability', 'aam'),\r
+ 'Select Role' => __('Select Role', 'aam'),\r
+ 'Add Capability' => __('Add Capability', 'aam'),\r
+ 'Add Event' => __('Add Event', 'aam'),\r
+ 'Edit Event' => __('Edit Event', 'aam'),\r
+ 'Delete Event' => __('Delete Event', 'aam'),\r
+ 'Save Event' => __('Save Event', 'aam'),\r
+ 'Delete Event' => __('Delete Event', 'aam'),\r
+ 'Filter Posts by Post Type' => __('Filter Posts by Post Type', 'aam'),\r
+ 'Refresh List' => __('Refresh List', 'aam'),\r
+ 'Restore Default' => __('Restore Default', 'aam'),\r
+ 'Apply' => __('Apply', 'aam'),\r
+ 'Edit Term' => __('Edit Term', 'aam'),\r
+ 'Manager Access' => __('Manager Access', 'aam'),\r
+ 'Unlock Default Accesss Control' => __('Unlock Default Accesss Control', 'aam'),\r
+ 'Close' => __('Close', 'aam'),\r
+ 'Edit Role' => __('Edit Role', 'aam'),\r
+ 'Restore Default Capabilities' => __('Restore Default Capabilities', 'aam'),\r
+ 'Delete Post Message' => __('Are you sure you want to delete <b>%s</b>?', 'aam'),\r
+ 'Trash Post Message' => __('Are you sure you want to move <b>%s</b> to trash?', 'aam'),\r
+ 'Delete Post' => __('Delete Post', 'aam'),\r
+ 'Delete Permanently' => __('Delete Permanently', 'aam'),\r
+ 'Trash Post' => __('Trash Post', 'aam'),\r
+ 'Restore Default Access' => __('Restore Default Access', 'aam'),\r
+ 'Duplicate' => __('Duplicate', 'aam'),\r
+ 'Actions Locked' => __('Actions Locked', 'aam'),\r
+ 'AAM Documentation' => __('<h3>AAM Documentation</h3><div class="inner">Find more information about Advanced Access Manager here.</div>', 'aam'),\r
+ ));\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_View_Menu extends aam_View_Abstract {\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function content() {\r
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/menu.phtml');\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function defaultOption($options) {\r
+ //make sure that some parts are always in place\r
+ if (!isset($options[aam_Control_Object_Menu::UID])) {\r
+ $options[aam_Control_Object_Menu::UID] = array();\r
+ }\r
+\r
+ return $options;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @global type $menu\r
+ * @global type $submenu\r
+ * @return type\r
+ */\r
+ public function getMenu() {\r
+ global $menu;\r
+\r
+ $response = array();\r
+\r
+ //let's create menu list with submenus\r
+ foreach ($menu as $menu_item) {\r
+ if (!preg_match('/^separator/', $menu_item[2])) {\r
+ $submenu = $this->getSubmenu($menu_item[2]);\r
+ $remove = !$this->getSubject()->hasCapability($menu_item[1]);\r
+ if (($remove === false) || (count($submenu) !== 0)) {\r
+ $item = array(\r
+ 'name' => $this->removeHTML($menu_item[0]),\r
+ 'id' => $menu_item[2],\r
+ 'submenu' => $submenu\r
+ );\r
+ $response[] = $item;\r
+ }\r
+ }\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Prepare filtered submenu\r
+ * \r
+ * @global array $submenu\r
+ * @param string $menu\r
+ * \r
+ * @return array\r
+ * \r
+ * @access public\r
+ */\r
+ public function getSubmenu($menu) {\r
+ global $submenu;\r
+\r
+ $filtered_submenu = array();\r
+ if (isset($submenu[$menu])) {\r
+ foreach ($submenu[$menu] as $submenu_item) {\r
+ if ($this->getSubject()->hasCapability($submenu_item[1]) !== false) {\r
+ //prepare title\r
+ $submenu_title = $this->removeHTML($submenu_item[0]);\r
+ $filtered_submenu[] = array(\r
+ 'name' => $submenu_title,\r
+ 'short' => $this->prepareTitle($submenu_title),\r
+ 'id' => $submenu_item[2]\r
+ );\r
+ }\r
+ }\r
+ }\r
+\r
+ return $filtered_submenu;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $title\r
+ * @return string\r
+ */\r
+ protected function prepareTitle($title) {\r
+ if (function_exists('mb_strlen')) {\r
+ if ((mb_strlen($title) > 18)) {\r
+ $title = mb_substr($title, 0, 15) . '..';\r
+ }\r
+ } elseif (strlen($title) > 18) {\r
+ $title = substr($title, 0, 15) . '..';\r
+ }\r
+\r
+ return $title;\r
+ }\r
+\r
+ /**\r
+ * Check if the entire branch is restricted\r
+ * \r
+ * @param array $menu\r
+ * \r
+ * @return boolean\r
+ * \r
+ * @access public\r
+ */\r
+ public function hasRestrictedAll($menu) {\r
+ $menuControl = $this->getSubject()->getObject(aam_Control_Object_Menu::UID);\r
+ $response = $menuControl->has($menu['id']);\r
+\r
+ foreach ($menu['submenu'] as $submenu) {\r
+ if ($menuControl->has($submenu['id']) === false) {\r
+ $response = false;\r
+ break;\r
+ }\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $text\r
+ * @return type\r
+ */\r
+ public function removeHTML($text) {\r
+ // Return clean content\r
+ return strip_tags($text);\r
+ }\r
+\r
+}\r
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * Metaboxes & Widgets Tab Controller
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Metabox extends aam_View_Abstract {
+
+ /**
+ * Metabox Group - WIDGETS
+ *
+ * Is used to retrieve the list of all wigets on the frontend
+ */
+ const GROUP_WIDGETS = 'widgets';
+
+ /**
+ *
+ * @var type
+ */
+ private $_cache = array();
+
+ /**
+ *
+ * @global type $wp_meta_boxes
+ * @param type $post_type
+ */
+ public function run($post_type) {
+ $this->_cache = aam_Core_API::getBlogOption(
+ 'aam_metabox_cache', array()
+ );
+
+ if ($post_type === 'dashboard') {
+ $this->collectWidgets();
+ } else {
+ $this->collectMetaboxes($post_type);
+ }
+ aam_Core_API::updateBlogOption('aam_metabox_cache', $this->_cache);
+ }
+
+ /**
+ *
+ * @global type $wp_registered_widgets
+ */
+ protected function collectWidgets() {
+ global $wp_registered_widgets;
+
+ if (!isset($this->_cache['widgets'])) {
+ $this->_cache['widgets'] = array();
+ }
+
+ //get frontend widgets
+ if (is_array($wp_registered_widgets)) {
+ foreach ($wp_registered_widgets as $id => $data) {
+ if (is_object($data['callback'][0])) {
+ $callback = get_class($data['callback'][0]);
+ } elseif (is_string($data['callback'][0])) {
+ $callback = $data['callback'][0];
+ } else {
+ $callback = null;
+ }
+
+ if (!is_null($callback)) { //exclude any junk
+ $this->_cache['widgets'][$callback] = array(
+ 'title' => $this->removeHTML($data['name']),
+ 'id' => $callback
+ );
+ }
+ }
+ }
+
+ //now collect Admin Dashboard Widgets
+ $this->collectMetaboxes('dashboard');
+ }
+
+ /**
+ *
+ * @global type $wp_meta_boxes
+ * @param type $post_type
+ */
+ protected function collectMetaboxes($post_type) {
+ global $wp_meta_boxes;
+
+ if (!isset($this->_cache[$post_type])) {
+ $this->_cache[$post_type] = array();
+ }
+
+ if (isset($wp_meta_boxes[$post_type]) && is_array($wp_meta_boxes[$post_type])) {
+ foreach ($wp_meta_boxes[$post_type] as $levels) {
+ if (is_array($levels)) {
+ foreach ($levels as $boxes) {
+ if (is_array($boxes)) {
+ foreach ($boxes as $data) {
+ if (trim($data['id'])) { //exclude any junk
+ $this->_cache[$post_type][$data['id']] = array(
+ 'id' => $data['id'],
+ 'title' => $this->removeHTML($data['title'])
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function initLink() {
+ $link = filter_var(aam_Core_Request::post('link'), FILTER_VALIDATE_URL);
+ if ($link) {
+ $url = add_query_arg('aam_meta_init', 1, $link);
+ aam_Core_API::cURL($url);
+ $response = array('status' => 'success');
+ } else {
+ $response = array('status' => 'failure');
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @global type $wp_post_types
+ * @return type
+ */
+ public function retrieveList() {
+ global $wp_post_types;
+
+ if (aam_Core_Request::post('refresh') == 1) {
+ aam_Core_API::deleteBlogOption('aam_metabox_cache');
+ $type_list = array_keys($wp_post_types);
+ array_unshift($type_list, self::GROUP_WIDGETS);
+
+ foreach ($type_list as $type) {
+ if ($type == self::GROUP_WIDGETS) {
+ $url = add_query_arg(
+ 'aam_meta_init',
+ 1,
+ admin_url('index.php')
+ );
+ } else {
+ $url = add_query_arg(
+ 'aam_meta_init',
+ 1,
+ admin_url('post-new.php?post_type=' . $type)
+ );
+ }
+ //grab metaboxes
+ aam_Core_API::cURL($url);
+ }
+ }
+
+ return $this->buildMetaboxList();
+ }
+
+ /**
+ *
+ * @global type $wp_post_types
+ * @return type
+ */
+ protected function buildMetaboxList() {
+ global $wp_post_types;
+
+ $cache = aam_Core_API::getBlogOption('aam_metabox_cache', array());
+ if ($this->getSubject()->getUID() == aam_Control_Subject_Visitor::UID) {
+ $list = array(
+ 'widgets' => (isset($cache['widgets']) ? $cache['widgets'] : array())
+ );
+ } else {
+ $list = $cache;
+ }
+ $content = '<div id="metabox_list">';
+ foreach ($list as $screen => $metaboxes) {
+ $content .= '<div class="group">';
+ switch ($screen) {
+ case 'dashboard':
+ $content .= '<h4>' . __('Dashboard Widgets', 'aam') . '</h4>';
+ break;
+
+ case 'widgets':
+ $content .= '<h4>' . __('Frontend Widgets', 'aam') . '</h4>';
+ break;
+
+ default:
+ $content .= '<h4>' . $wp_post_types[$screen]->labels->name;
+ $content .= '</h4>';
+ break;
+ }
+ $content .= '<div>';
+ $content .= '<div class="metabox-group">';
+ $i = 1;
+ $metaboxControl = $this->getSubject()->getObject(
+ aam_Control_Object_Metabox::UID
+ );
+ foreach ($metaboxes as $metabox) {
+ if ($i++ == 1) {
+ $content .= '<div class=metabox-row>';
+ }
+ //prepare title
+ $title = $this->prepareTitle($metabox['title']);
+
+ //prepare selected
+ if ($metaboxControl->has($screen, $metabox['id'])) {
+ $checked = 'checked="checked"';
+ } else {
+ $checked = '';
+ }
+
+ $metabox_id = "metabox_{$screen}_{$metabox['id']}";
+
+ $content .= '<div class="metabox-item">';
+ $content .= sprintf(
+ '<label for="%s" aam-tooltip="%s">%s</label>',
+ $metabox_id,
+ esc_js($metabox['title']),
+ $title
+ );
+ $content .= sprintf(
+ '<input type="checkbox" id="%s" name="aam[%s][%s][%s]" %s />',
+ $metabox_id,
+ aam_Control_Object_Metabox::UID,
+ $screen,
+ $metabox['id'],
+ $checked
+ );
+ $content .= '<label for="' . $metabox_id . '"><span></span></label>';
+ $content .= '</div>';
+ if ($i > 3) {
+ $content .= '</div>';
+ $i = 1;
+ }
+ }
+ if ($i != 1) {
+ $content .= '</div>';
+ }
+ $content .= '</div></div></div>';
+ }
+ $content .= '</div>';
+
+ return $content;
+ }
+
+ /**
+ *
+ * @param type $title
+ * @return string
+ */
+ protected function prepareTitle($title) {
+ if (function_exists('mb_strlen')) {
+ if ((mb_strlen($title) > 18)) {
+ $title = mb_substr($title, 0, 15) . '..';
+ }
+ } elseif (strlen($title) > 18) {
+ $title = substr($title, 0, 15) . '..';
+ }
+
+ return $title;
+ }
+
+ /**
+ *
+ * @param type $text
+ * @return type
+ */
+ public function removeHTML($text) {
+ return strip_tags($text);
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/metabox.phtml');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function defaultOption($options) {
+ //make sure that some parts are always in place
+ if (!isset($options[aam_Control_Object_Metabox::UID])) {
+ $options[aam_Control_Object_Metabox::UID] = array();
+ }
+
+ return $options;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Post extends aam_View_Abstract {
+
+ /**
+ * Type of browsing object
+ *
+ * It can be either post or term
+ *
+ * @var string
+ *
+ * @access private
+ */
+ private $_post_type = 'post';
+
+ /**
+ * Term ID
+ *
+ * @var int
+ *
+ * @access private
+ */
+ private $_term = 0;
+
+ /**
+ * Constructor
+ *
+ * @return void
+ *
+ * @access public
+ */
+ public function __construct() {
+ parent::__construct();
+ $this->_post_type = aam_Core_Request::request('post_type');
+ $this->_term = intval(aam_Core_Request::request('term'));
+ }
+
+ /**
+ *
+ * @global type $wp_post_statuses
+ * @global type $wp_post_types
+ * @return type
+ */
+ public function retrievePostList() {
+ global $wp_post_statuses, $wp_post_types, $wp_taxonomies;
+
+ $term = trim(aam_Core_Request::request('term'));
+
+ //default behavior
+ if (empty($term)) {
+ $post_type = 'post';
+ //root for each Post Type
+ } elseif (isset($wp_post_types[$term])) {
+ $post_type = $term;
+ $term = '';
+ } else {
+ $taxonomy = $this->getTaxonomy($term);
+ if (isset($wp_taxonomies[$taxonomy])) {
+ //take in consideration only first object type
+ $post_type = $wp_taxonomies[$taxonomy]->object_type[0];
+ } else {
+ $post_type = 'post';
+ }
+ }
+
+ $args = array(
+ 'numberposts' => aam_Core_Request::request('iDisplayLength'),
+ 'offset' => aam_Core_Request::request('iDisplayStart'),
+ 'fields' => 'ids',
+ 'term' => $term,
+ 'taxonomy' => (!empty($taxonomy) ? $taxonomy : ''),
+ 'post_type' => $post_type,
+ 's' => aam_Core_Request::request('sSearch'),
+ 'post_status' => array()
+ );
+
+ $argsAll = array(
+ 'numberposts' => '999999',
+ 'fields' => 'ids',
+ //'category' => $term,
+ 'term' => $term,
+ 'taxonomy' => (!empty($taxonomy) ? $taxonomy : ''),
+ 'post_type' => $post_type,
+ 's' => aam_Core_Request::request('sSearch'),
+ 'post_status' => array()
+ );
+
+ if ($post_type != 'attachment') { //attachment has only inherit status
+ foreach ($wp_post_statuses as $status => $data) {
+ if ($data->show_in_admin_status_list) {
+ $args['post_status'][] = $status;
+ $argsAll['post_status'][] = $status;
+ }
+ }
+ }
+
+ $total = 0;
+ foreach (wp_count_posts($post_type) as $status => $number) {
+ if ($wp_post_statuses[$status]->show_in_admin_status_list) {
+ $total += $number;
+ }
+ }
+
+ //get displayed total
+ $displayTotal = count(get_posts($argsAll));
+
+ $response = array(
+ 'iTotalRecords' => $total,
+ 'iTotalDisplayRecords' => $displayTotal,
+ 'sEcho' => aam_Core_Request::request('sEcho'),
+ 'aaData' => array(),
+ );
+
+ foreach (get_posts($args) as $post_id) {
+ $post = $this->getSubject()->getObject(
+ aam_Control_Object_Post::UID, $post_id
+ );
+ $response['aaData'][] = array(
+ $post->getPost()->ID,
+ $post->getPost()->post_status,
+ get_edit_post_link($post->getPost()->ID),
+ $post->getPost()->post_title,
+ $wp_post_statuses[$post->getPost()->post_status]->label,
+ '',
+ ($post->getOption() && !$post->getInherited() ? 1 : 0)
+ );
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Get Taxonomy by Term ID
+ *
+ * @global type $wpdb
+ * @param type $object_id
+ * @return type
+ */
+ private function getTaxonomy($object_id) {
+ global $wpdb;
+
+ $query = "SELECT taxonomy FROM {$wpdb->term_taxonomy} ";
+ $query .= "WHERE term_id = {$object_id}";
+
+ return $wpdb->get_var($query);
+ }
+
+ /**
+ *
+ * @global type $wp_post_types
+ * @return type
+ */
+ public function getPostTree() {
+ global $wp_post_types;
+
+ $type = aam_Core_Request::request('root');
+ $tree = array();
+
+ if ($type == "source") {
+ if (is_array($wp_post_types)) {
+ foreach ($wp_post_types as $post_type => $data) {
+ //show only list of post type which have User Interface
+ if ($data->show_ui) {
+ $tree[] = (object) array(
+ 'text' => $data->label,
+ 'expanded' => FALSE,
+ 'hasChildren' => TRUE,
+ 'id' => $post_type,
+ 'classes' => 'important',
+ );
+ }
+ }
+ }
+ } else {
+ if (preg_match('/^[\d]+$/', $type)) {
+ $taxonomy = $this->getTaxonomyByTerm($type);
+ $tree = $this->buildBranch(NULL, $taxonomy, $type);
+ } else {
+ $tree = $this->buildBranch($type);
+ }
+ }
+
+ if (!count($tree)) {
+ $tree[] = (object) array(
+ 'text' => '<i>' . __('[empty]', 'aam') . '</i>',
+ 'hasChildren' => FALSE,
+ 'classes' => 'post-ontree',
+ 'id' => 'empty-' . uniqid()
+ );
+ }
+
+ return json_encode($tree);
+ }
+
+ /**
+ * Delete Post
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function deletePost() {
+ $post_id = aam_Core_Request::post('post');
+
+ if (aam_Core_Request::post('force')) {
+ $result = wp_delete_post($post_id, true);
+ } else {
+ $result = wp_trash_post($post_id);
+ }
+
+ return json_encode(array('status' => ($result ? 'success' : 'failure')));
+ }
+
+ /**
+ *
+ * @global type $wpdb
+ * @param type $term_id
+ * @return boolean
+ */
+ protected function getTaxonomyByTerm($term_id) {
+ global $wpdb;
+
+ if ($term_id) {
+ $query = "SELECT taxonomy FROM {$wpdb->term_taxonomy} ";
+ $query .= "WHERE term_id = {$term_id}";
+ $result = $wpdb->get_var($query);
+ } else {
+ $result = FALSE;
+ }
+
+ return $result;
+ }
+
+ /**
+ *
+ * @param type $post_type
+ * @param type $taxonomy
+ * @param type $parent
+ * @return type
+ */
+ private function buildBranch($post_type, $taxonomy = FALSE, $parent = 0) {
+ $tree = array();
+ if (!$parent && !$taxonomy) { //root of a branch
+ $tree = $this->buildCategories($post_type);
+ } elseif ($taxonomy) { //build sub categories
+ $tree = $this->buildCategories('', $taxonomy, $parent);
+ }
+
+ return $tree;
+ }
+
+ /**
+ *
+ * @param type $post_type
+ * @param type $taxonomy
+ * @param type $parent
+ * @return type
+ */
+ private function buildCategories($post_type, $taxonomy = FALSE, $parent = 0) {
+
+ $tree = array();
+
+ if ($parent) {
+ //$taxonomy = $this->get_taxonomy_get_term($parent);
+ //firstly render the list of sub categories
+ $cat_list = get_terms(
+ $taxonomy, array(
+ 'get' => 'all',
+ 'parent' => $parent,
+ 'hide_empty' => FALSE
+ )
+ );
+ if (is_array($cat_list)) {
+ foreach ($cat_list as $category) {
+ $tree[] = $this->buildCategory($category);
+ }
+ }
+ } else {
+ $taxonomies = get_object_taxonomies($post_type);
+ foreach ($taxonomies as $taxonomy) {
+ if (is_taxonomy_hierarchical($taxonomy)) {
+ $term_list = get_terms($taxonomy, array(
+ 'parent' => $parent,
+ 'hide_empty' => FALSE
+ ));
+ if (is_array($term_list)) {
+ foreach ($term_list as $term) {
+ $tree[] = $this->buildCategory($term);
+ }
+ }
+ }
+ }
+ }
+
+ return $tree;
+ }
+
+ /**
+ *
+ * @param type $category
+ * @return type
+ */
+ private function buildCategory($category) {
+ $branch = (object) array(
+ 'text' => $category->name,
+ 'expanded' => FALSE,
+ 'classes' => 'important folder',
+ );
+ if ($this->hasCategoryChilds($category)) {
+ $branch->hasChildren = TRUE;
+ } else {
+ $branch->hasChildren = FALSE;
+ }
+ $branch->id = $category->term_id;
+
+ return $branch;
+ }
+
+ /**
+ * Check if category has children
+ *
+ * @param int category ID
+ * @return bool TRUE if has
+ */
+ protected function hasCategoryChilds($cat) {
+ global $wpdb;
+
+ //get number of categories
+ $query = "SELECT COUNT(*) FROM {$wpdb->term_taxonomy} ";
+ $query .= "WHERE parent={$cat->term_id}";
+ $counter = $wpdb->get_var($query);
+
+ return ($counter ? TRUE : FALSE);
+ }
+
+ /**
+ *
+ * @global type $wp_post_types
+ * @global type $wp_taxonomies
+ * @return type
+ */
+ public function getPostBreadcrumb() {
+ global $wp_post_types, $wp_taxonomies;
+
+ $id = aam_Core_Request::post('id');
+ $response = array();
+ if (preg_match('/^[\d]+$/', $id)) {
+ $taxonomy = $this->getTaxonomyByTerm($id);
+ //get post type
+ if (isset($wp_taxonomies[$taxonomy])) {
+ $post_type = $wp_taxonomies[$taxonomy]->object_type[0];
+ if (isset($wp_post_types[$post_type])) {
+ $response['post_type'] = $post_type;
+ $response['term'] = $id;
+ $response['link'] = get_edit_term_link($id, $taxonomy);
+ $term = get_term($id, $taxonomy);
+ $tree = $this->renderBreadcrumbTree($term, array());
+ $tree[] = array($post_type, $wp_post_types[$post_type]->label);
+ $response['breadcrumb'] = array_reverse($tree);
+ }
+ }
+ } else {
+ if (isset($wp_post_types[$id])) {
+ $response = array(
+ 'post_type' => $id,
+ 'term' => 0,
+ 'breadcrumb' => array(
+ array($id, $wp_post_types[$id]->label),
+ array('#', __('All', 'aam'))
+ )
+ );
+ } else {
+ $response = array(
+ 'term' => '',
+ 'breadcrumb' => array(
+ array('post', $wp_post_types['post']->label),
+ array('#', __('All', 'aam'))
+ )
+ );
+ }
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @param type $term
+ * @param type $tree
+ * @return type
+ */
+ protected function renderBreadcrumbTree($term, $tree) {
+ $tree[] = array($term->term_id, $term->name);
+ if ($term->parent) {
+ $tree = $this->renderBreadcrumbTree(
+ get_term($term->parent, $term->taxonomy), $tree
+ );
+ }
+
+ return $tree;
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/post.phtml');
+ }
+
+ /**
+ * Save Post or Term access
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function saveAccess() {
+ $object_id = aam_Core_Request::post('id');
+
+ $limit_counter = apply_filters(
+ 'wpaccess_restrict_limit',
+ aam_Core_API::getBlogOption('aam_access_limit', 0)
+ );
+
+ if ($limit_counter == -1 || $limit_counter <= 10) {
+ $access = aam_Core_Request::post('access');
+ if (aam_Core_Request::post('type') == 'term') {
+ $object = $this->getSubject()->getObject(
+ aam_Control_Object_Term::UID, $object_id
+ );
+ if ($limit_counter !== -1 && isset($access['post'])) {
+ unset($access['post']);
+ }
+ } else {
+ $object = $this->getSubject()->getObject(
+ aam_Control_Object_Post::UID, $object_id
+ );
+ }
+ $object->save($access);
+ aam_Core_API::updateBlogOption('aam_access_limit', $limit_counter + 1);
+
+ //clear cache
+ $this->getSubject()->clearCache();
+
+ $response = array('status' => 'success');
+ } else {
+ $response = array(
+ 'status' => 'failure',
+ 'reason' => 'limitation',
+ 'extension' => 'AAM Unlimited Basic'
+ );
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Get Post or Term access
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function getAccess() {
+ return json_encode(array(
+ 'html' => $this->loadTemplate(
+ dirname(__FILE__) . '/tmpl/control_area.phtml'
+ ),
+ 'counter' => apply_filters(
+ 'wpaccess_restrict_limit',
+ aam_Core_API::getBlogOption('aam_access_limit', 0)
+ )
+ ));
+ }
+
+ /**
+ * Restore default access level for object
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function clearAccess() {
+ $type = aam_Core_Request::post('type');
+ $object_id = aam_Core_Request::post('id');
+
+ if ($type === aam_Control_Object_Term::UID) {
+ $object = $this->getSubject()->getObject(
+ aam_Control_Object_Term::UID, $object_id
+ );
+ } else {
+ $object = $this->getSubject()->getObject(
+ aam_Control_Object_Post::UID, $object_id
+ );
+ }
+
+ return json_encode(array(
+ 'status' => ($object->delete() ? 'success' : 'failure')
+ ));
+ }
+
+ /**
+ * Get Object Title
+ *
+ * @param string $type
+ * @param string $name
+ *
+ * @return string
+ *
+ * @access public
+ * @global array $wp_post_types
+ * @global array $wp_taxonomies
+ */
+ public function getObjectTitle($type, $name) {
+ global $wp_post_types, $wp_taxonomies;
+
+ if ($type == aam_Control_Object_Term::UID) {
+ if (!empty($wp_taxonomies[$name]->labels->name)) {
+ $title = $wp_taxonomies[$name]->labels->name;
+ } else {
+ $title = 'term';
+ }
+ } else {
+ if (!empty($wp_post_types[$name]->labels->name)) {
+ $title = $wp_post_types[$name]->labels->name;
+ } else {
+ $title = 'post';
+ }
+ }
+
+ return $title;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Role extends aam_View_Abstract {
+
+ /**
+ * Generate UI Content
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/role.phtml');
+ }
+
+ /**
+ * Get Role List
+ *
+ * @return string JSON Encoded role list
+ *
+ * @access public
+ */
+ public function retrieveList() {
+ //retrieve list of users
+ $count = count_users();
+ $user_count = $count['avail_roles'];
+
+ //filter by name
+ $search = strtolower(trim(aam_Core_Request::request('sSearch')));
+ $filtered = array();
+ $roles = get_editable_roles();
+ foreach ($roles as $id => $role) {
+ if (!$search || preg_match('/^' . $search . '/i', $role['name'])) {
+ $filtered[$id] = $role;
+ }
+ }
+
+ $response = array(
+ 'iTotalRecords' => count($roles),
+ 'iTotalDisplayRecords' => count($filtered),
+ 'sEcho' => aam_Core_Request::request('sEcho'),
+ 'aaData' => array(),
+ );
+ foreach ($filtered as $role => $data) {
+ $users = (isset($user_count[$role]) ? $user_count[$role] : 0);
+ $response['aaData'][] = array(
+ $role,
+ $users,
+ translate_user_role($data['name']),
+ ''
+ );
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Retrieve Pure Role List
+ *
+ * @return string
+ */
+ public function retrievePureList(){
+ return json_encode(get_editable_roles());
+ }
+
+ /**
+ * Add New Role
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function add() {
+ $name = trim(aam_Core_Request::post('name'));
+ $roles = new WP_Roles;
+ if (aam_Core_ConfigPress::getParam('aam.native_role_id') === 'true'){
+ $role_id = strtolower($name);
+ } else {
+ $role_id = 'aamrole_' . uniqid();
+ }
+ //if inherited role is set get capabilities from it
+ $parent = trim(aam_Core_Request::post('inherit'));
+ if ($parent && $roles->get_role($parent)){
+ $caps = $roles->get_role($parent)->capabilities;
+ } else {
+ $caps = array();
+ }
+
+ if ($roles->add_role($role_id, $name, $caps)) {
+ $response = array(
+ 'status' => 'success',
+ 'role' => $role_id
+ );
+ } else {
+ $response = array('status' => 'failure');
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function edit() {
+ $result = $this->getSubject()->update(trim(aam_Core_Request::post('name')));
+ return json_encode(
+ array('status' => ($result ? 'success' : 'failure'))
+ );
+ }
+
+ /**
+ *
+ * @return type
+ */
+ public function delete() {
+ if ($this->getSubject()->delete(aam_Core_Request::post('delete_users'))) {
+ $status = 'success';
+ } else {
+ $status = 'failure';
+ }
+
+ return json_encode(array('status' => $status));
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="capability_content">\r
+ <table id="capability_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Capability ID</th>\r
+ <th>Checked</th>\r
+ <th width="35%"><?php echo __('Category', 'aam'); ?></th>\r
+ <th width="50%"><?php echo __('Capability', 'aam'); ?></th>\r
+ <th><?php echo __('Control', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+\r
+ <div id="filter_capability_dialog" class="aam-dialog" title="<?php echo __('Filter Capability List', 'aam'); ?>">\r
+ <table id="capability_group_list">\r
+ <thead>\r
+ <tr>\r
+ <th><?php echo __('Group Name', 'aam'); ?></th>\r
+ <th><?php echo __('Select', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ <?php foreach ($this->getGroupList() as $group) { ?>\r
+ <tr>\r
+ <td><?php echo $group; ?></td>\r
+ <td>\r
+ <div class="aam-list-row-actions">\r
+ <a href="#" class="aam-icon aam-icon-small aam-icon-select"><span></span></a>\r
+ </div>\r
+ </td>\r
+ </tr>\r
+ <?php } ?>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="copy_role_dialog" class="aam-dialog" title="<?php echo __('Inherit Capabilities', 'aam'); ?>">\r
+ <table id="copy_role_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Role ID</th>\r
+ <th>User Count</th>\r
+ <th width="80%"><?php echo __('Role Name', 'aam'); ?></th>\r
+ <th><?php echo __('Action', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+ <div class="aam-metabox-loader"></div>\r
+ </div>\r
+\r
+ <div id="capability_form_dialog" class="aam-dialog" title="<?php echo __('Add New Capability', 'aam'); ?>">\r
+ <table class="dataTable">\r
+ <tbody>\r
+ <tr>\r
+ <th class="aam-align-right"><?php echo __('Capability Name', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td><input type="text" id="capability_name" class="aam-input" /></td>\r
+ </tr>\r
+ <tr>\r
+ <th class="aam-align-right"><?php echo __('Keep Unfiltered', 'aam'); ?>:</th>\r
+ <td>\r
+ <input type="checkbox" id="capability_unfiltered" />\r
+ <label for="capability_unfiltered"><span></span></label>\r
+ </td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ <div class="aam-metabox-loader"></div>\r
+ </div>\r
+\r
+ <div id="delete_capability" class="aam-dialog" title="<?php echo __('Delete Capability', 'aam'); ?>">\r
+ <p class="dialog-content"></p>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+?>
+<div class="wrap" id="aam">
+ <div class="postbox-container" style="width:70%;" id="configpress_area">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span>
+ <?php echo __('AAM ConfigPress', 'aam'); ?>
+ </span>
+ </h3>
+ <div class="inside">
+ <textarea id="configpress" style="width:100%; height: 400px;"><?php echo aam_Core_ConfigPress::read(); ?></textarea>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="postbox-container" style="width:70%; display: none;" id="configpress_info">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span>
+ <?php echo __('AAM ConfigPress Information', 'aam'); ?>
+ </span>
+ </h3>
+ <div class="inside">
+ <p>
+ Below is the list of all possible ConfigPress settings with explanation:
+ <pre style="background:#fff;color:#000">
+<span style="color:#05a;font-weight: bold;">[aam]</span>
+<span style="color:#00b418">#Define default access to admin menu items if it was not configured.</span>
+<span style="color:#00b418">#By default it is set to</span> <span style="color:#d80800">"allow"</span>.
+<span style="color:#0100b6;font-weight:700;">menu.undefined</span> = <span style="color:#d80800">"deny"</span>
+<span style="color:#00b418">#Change the default access capability to AAM->Access Control screen.</span>
+<span style="color:#00b418">#By default capability is <b>administrator</b>.</span>
+<span style="color:#0100b6;font-weight:700;">page.access_control.capability</span> = <span style="color:#d80800">"aam_manager"</span>
+<span style="color:#00b418">#Change the default access capability to AAM->ConfigPress screen.</span>
+<span style="color:#00b418">#By default capability is <b>administrator</b>.</span>
+<span style="color:#0100b6;font-weight:700;">page.configpress.capability</span> = <span style="color:#d80800">"configpress_guru"</span>
+<span style="color:#00b418">#Change the default access capability to AAM->Extensions screen.</span>
+<span style="color:#00b418">#By default capability is <b>administrator</b>.</span>
+<span style="color:#0100b6;font-weight:700;">page.extensions.capability</span> = <span style="color:#d80800">"aam_extensions_manager"</span>
+<span style="color:#00b418">#If there is no access defined for specific post or page, by default AAM tries to inherit</span>
+<span style="color:#00b418">#settings from parent category. Below setting can change this behavior.</span>
+<span style="color:#0100b6;font-weight:700;">post.inherit</span> = <span style="color:#d80800">"false"</span>
+<span style="color:#00b418">#If there is no access defined for specific category, by default AAM tries to inherit</span>
+<span style="color:#00b418">#settings from parent category. Below setting can change this behavior.</span>
+<span style="color:#0100b6;font-weight:700;">term.inherit</span> = <span style="color:#d80800">"false"</span>
+<span style="color:#00b418">#To speed up the AAM execution, the result can be cached.</span>
+<span style="color:#00b418">#The cache is automatically flush during plugin update or when you hit Save button.</span>
+<span style="color:#0100b6;font-weight:700;">caching</span> = <span style="color:#d80800">"true"</span>
+<span style="color:#00b418">#Unlock restricted features in AAM for one administrator. By default you are not</span>
+<span style="color:#00b418">#allowed to manager other administrators.</span>
+<span style="color:#0100b6;font-weight:700;">super_admin</span> = <span style="color:#d80800">"true"</span>
+<span style="color:#00b418">#Keep the native name for newly created roles. Each WordPress role like</span>
+<span style="color:#00b418">#Editor or Contributor has internal ID (usually lowercase equivalent) and title.</span>
+<span style="color:#00b418">#Each time you create new role with AAM, the ID is changed to something like aam_78koi9831933i.</span>
+<span style="color:#00b418">#Setting below suppresses this behavior and keep the name in lowercase format.</span>
+<span style="color:#0100b6;font-weight:700;">native_role_id</span> = <span style="color:#d80800">"true"</span>
+<span style="color:#00b418">#Control access to Edit Permalink feature (Permalink block under the post or page title).</span>
+<span style="color:#00b418">#If this feature is activated, make sure that you created the custom capability "Manage Permalink"</span>
+<span style="color:#00b418">#By default this feature is deactivated.</span>
+<span style="color:#0100b6;font-weight:700;">control_permalink</span> = <span style="color:#d80800">"false"</span>
+
+<span style="color:#05a;font-weight: bold;">[backend]</span>
+<span style="color:#00b418">#Defines redirect behavior when access is denied to any backend resource like menu</span>
+<span style="color:#00b418">#or post. It can be whether valid URL or post/page ID number.</span>
+<span style="color:#00b418">#By default it will show <b>Access Denied</b> message.</span>
+<span style="color:#0100b6;font-weight:700;">access.deny.redirect</span> = <span style="color:#d80800">"http://someurlhere.in"</span>
+<span style="color:#00b418">#Redefine default <b>Access Denied</b> message.</span>
+<span style="color:#0100b6;font-weight:700;">access.deny.message</span> = <span style="color:#d80800">"Oops. This is restricted area"</span>
+
+<span style="color:#05a;font-weight: bold;">[frontend]</span>
+<span style="color:#00b418">#Defines redirect behavior when access is denied to any frontend resource like page</span>
+<span style="color:#00b418">#or post. It can be whether valid URL or post/page ID number.</span>
+<span style="color:#00b418">#By default it will show <b>Access Denied</b> message.</span>
+<span style="color:#0100b6;font-weight:700;">access.deny.redirect</span> = <span style="color:#d80800">"http://someurlhere.in"</span>
+<span style="color:#00b418">#Redefine default <b>Access Denied</b> message.</span>
+<span style="color:#0100b6;font-weight:700;">access.deny.message</span> = <span style="color:#d80800">"Oops. This is restricted area"</span>
+ </pre>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <?php if (aam_Core_Console::hasIssues()) { ?>
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
+ <?php } ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox" id="control_panel">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Control Panel', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <div class="large-icons-row">
+ <a href="#" class="aam-icon aam-icon-large aam-icon-large-save" id="save_config" >
+ <span></span><?php echo __('Save', 'aam'); ?>
+ </a>
+ <a href="#" class="aam-icon aam-icon-large aam-icon-large-info" id="info_screen" >
+ <span></span><?php echo __('Info', 'aam'); ?>
+ </a>
+ <a href="#" class="aam-icon aam-icon-large aam-icon-large-editor" style="display: none;" id="configpress_screen" >
+ <span></span><?php echo __('Editor', 'aam'); ?>
+ </a>
+ </div>
+ <div class="medium-icons-row">
+ <a href="https://twitter.com/wpaam" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-twitter" aam-tooltip="<?php echo __('Follow @wpaam', 'aam'); ?>">
+ <span></span><?php echo __('Follow', 'aam'); ?>
+ </a>
+ <a href="http://wpaam.com/support" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-help" aam-tooltip="<?php echo __('Help Forum', 'aam'); ?>">
+ <span></span><?php echo __('Help', 'aam'); ?>
+ </a>
+ <a href="mailto:support@wpaam.com" class="aam-icon aam-icon-medium aam-icon-medium-message" id="aam_message" aam-tooltip="<?php echo __('E-mail Us', 'aam'); ?>">
+ <span></span><?php echo __('E-mail Us', 'aam'); ?>
+ </a>
+ <a href="http://wordpress.org/support/view/plugin-reviews/advanced-access-manager" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-star" aam-tooltip="<?php echo __('Rate AAM', 'aam'); ?>">
+ <span></span><?php echo __('Rate Us', 'aam'); ?>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+global $wp_taxonomies;\r
+\r
+if (aam_Core_Request::post('type') === aam_Control_Object_Term::UID) {\r
+ $object = $this->getSubject()->getObject(\r
+ aam_Control_Object_Term::UID, aam_Core_Request::post('id')\r
+ );\r
+ if (isset($wp_taxonomies[$object->getTerm()->taxonomy])){\r
+ //take in consideration only first object type\r
+ $post_type = $wp_taxonomies[$object->getTerm()->taxonomy]->object_type[0];\r
+ } else {\r
+ $post_type = 'post';\r
+ }\r
+} else {\r
+ $object = $this->getSubject()->getObject(\r
+ aam_Control_Object_Post::UID, aam_Core_Request::post('id')\r
+ );\r
+ $post_type = $object->getPost()->post_type;\r
+}\r
+\r
+if ($post_type == 'attachment'){\r
+?>\r
+ <div class="attachment-access-block">\r
+ Get better access control over your media files with \r
+ <b><a href="http://wpaam.com/aam-extensions/aam-media-manager/" target="_blank">AAM Media Manager</a></b>\r
+ extension.\r
+ </div>\r
+<?php \r
+}\r
+if ($object->getUID() == aam_Control_Object_Term::UID) { ?>\r
+ <div id="term_access">\r
+ <table class="dataTable" id="term_access_frontend">\r
+ <thead>\r
+ <tr>\r
+ <th colspan="2" class="term-access-title">\r
+ <?php echo $this->getObjectTitle('term', $object->getTerm()->taxonomy) . ' ' . __('Access', 'aam'); ?>\r
+ </th>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Capability', 'aam'); ?></th>\r
+ <th><?php echo __('Restrict', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ <?php\r
+ $term_fcaps = aam_Core_ConfigPress::getParam(\r
+ 'aam.term.' . $object->getTerm()->taxonomy . '.caps.frontend',\r
+ apply_filters(\r
+ 'aam_term_access_list',\r
+ aam_Core_Settings::get('term_frontend_restrictions'),\r
+ 'frontend',\r
+ $object,\r
+ $post_type\r
+ )\r
+ );\r
+ foreach ($term_fcaps as $i => $action) {\r
+ ?>\r
+ <tr class="<?php echo ($i % 2 ? 'event' : 'odd'); ?>">\r
+ <td>\r
+ <div class="post-access">\r
+ <?php echo __($action, 'aam'); ?>\r
+ </div>\r
+ </td>\r
+ <td>\r
+ <div class="aam-list-row-actions">\r
+ <div class="post-action">\r
+ <input type="checkbox" id="term_frontend_<?php echo $action; ?>" name="access[term][frontend][<?php echo $action; ?>]" <?php echo ($object->has('frontend', $action) ? 'checked="checked"' : ''); ?> />\r
+ <label for="term_frontend_<?php echo $action; ?>">\r
+ <span></span>\r
+ </label>\r
+ </div>\r
+ </div>\r
+ </td>\r
+ </tr>\r
+ <?php } ?>\r
+ </tbody>\r
+ </table>\r
+\r
+ <table class="dataTable" id="term_access_backend">\r
+ <thead>\r
+ <tr>\r
+ <th colspan="2" class="term-access-title">\r
+ <?php echo $this->getObjectTitle('term', $object->getTerm()->taxonomy) . ' ' . __('Access', 'aam'); ?>\r
+ </th>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Capability', 'aam'); ?></th>\r
+ <th><?php echo __('Restrict', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ <?php\r
+ $term_bcaps = aam_Core_ConfigPress::getParam(\r
+ 'aam.term.' . $object->getTerm()->taxonomy . '.caps.backend',\r
+ apply_filters(\r
+ 'aam_term_access_list',\r
+ aam_Core_Settings::get('term_backend_restrictions'),\r
+ 'backend',\r
+ $object,\r
+ $post_type\r
+ )\r
+ );\r
+ foreach ($term_bcaps as $i => $action) {\r
+ ?>\r
+ <tr class="<?php echo ($i % 2 ? 'event' : 'odd'); ?>">\r
+ <td>\r
+ <div class="post-access">\r
+ <?php echo __($action, 'aam'); ?>\r
+ </div>\r
+ </td>\r
+ <td>\r
+ <div class="aam-list-row-actions">\r
+ <div class="post-action">\r
+ <input type="checkbox" id="term_backend_<?php echo $action ?>" name="access[term][backend][<?php echo $action; ?>]" <?php echo ($object->has('backend', $action) ? 'checked="checked"' : ''); ?> />\r
+ <label for="term_backend_<?php echo $action ?>">\r
+ <span></span>\r
+ </label>\r
+ </div>\r
+ </div>\r
+ </td>\r
+ </tr>\r
+ <?php } ?>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+<?php } ?>\r
+<div id="post_access" class="post-access-list">\r
+ <table class="dataTable" id="post_access_frontend">\r
+ <thead>\r
+ <tr>\r
+ <th colspan="2" class="post-access-title">\r
+ <?php if (($object->getUID() == aam_Control_Object_Term::UID)){\r
+ echo sprintf(__('All %s in Term', 'aam'), $this->getObjectTitle('post', $post_type));\r
+ } else {\r
+ echo $this->getObjectTitle('post', $post_type) . ' ' . __('Access', 'aam');\r
+ }\r
+ ?>\r
+ </th>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Capability', 'aam'); ?></th>\r
+ <th><?php echo __('Restrict', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ <?php\r
+ $post_fcaps = aam_Core_ConfigPress::getParam(\r
+ 'aam.post.' . $post_type . '.caps.frontend',\r
+ apply_filters(\r
+ 'aam_post_access_list',\r
+ aam_Core_Settings::get('post_frontend_restrictions'),\r
+ 'frontend',\r
+ $object,\r
+ $post_type\r
+ )\r
+ );\r
+ foreach ($post_fcaps as $i => $action) {\r
+ ?>\r
+ <tr class="<?php echo ($i % 2 ? 'event' : 'odd'); ?>">\r
+ <td>\r
+ <div class="post-access">\r
+ <?php echo __($action, 'aam'); ?>\r
+ </div>\r
+ </td>\r
+ <td>\r
+ <div class="aam-list-row-actions">\r
+ <div class="post-action post-action-check">\r
+ <input type="checkbox" id="post_frontend_<?php echo $action ?>" name="access[post][frontend][<?php echo $action; ?>]" <?php echo ($object->has('frontend', $action) ? 'checked="checked"' : ''); ?> />\r
+ <label for="post_frontend_<?php echo $action ?>">\r
+ <span></span>\r
+ </label>\r
+ </div>\r
+ </div>\r
+ </td>\r
+ </tr>\r
+ <?php } ?>\r
+ </tbody>\r
+ </table>\r
+ <table class="dataTable" id="post_access_backend">\r
+ <thead>\r
+ <tr>\r
+ <th colspan="2" class="post-access-title">\r
+ <?php if (($object->getUID() == aam_Control_Object_Term::UID)){\r
+ echo sprintf(__('All %s in Term', 'aam'), $this->getObjectTitle('post', $post_type));\r
+ } else {\r
+ echo $this->getObjectTitle('post', $post_type) . ' ' . __('Access', 'aam');\r
+ }\r
+ ?>\r
+ </th>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Capability', 'aam'); ?></th>\r
+ <th><?php echo __('Restrict', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ <?php\r
+ $post_bcaps = aam_Core_ConfigPress::getParam(\r
+ 'aam.post.' . $post_type . '.caps.backend',\r
+ apply_filters(\r
+ 'aam_post_access_list',\r
+ aam_Core_Settings::get('post_backend_restrictions'),\r
+ 'backend',\r
+ $object,\r
+ $post_type\r
+ )\r
+ );\r
+ foreach ($post_bcaps as $i => $action) {\r
+ ?>\r
+ <tr class="<?php echo ($i % 2 ? 'event' : 'odd'); ?>">\r
+ <td>\r
+ <div class="post-access">\r
+ <?php echo __($action, 'aam'); ?>\r
+ </div>\r
+ </td>\r
+ <td>\r
+ <div class="aam-list-row-actions">\r
+ <div class="post-action post-action-check">\r
+ <input type="checkbox" id="post_backend_<?php echo $action ?>" name="access[post][backend][<?php echo $action; ?>]" <?php echo ($object->has('backend', $action) ? 'checked="checked"' : ''); ?> />\r
+ <label for="post_backend_<?php echo $action ?>">\r
+ <span></span>\r
+ </label>\r
+ </div>\r
+ </div>\r
+ </td>\r
+ </tr>\r
+ <?php } ?>\r
+ </tbody>\r
+ </table>\r
+ <div class="post-access-block">\r
+ <a href="#" class="aam-lock-big">\r
+ <span><?php echo __('Get AAM Plus Package', 'aam'); ?></span>\r
+ </a>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="event_manager_content">\r
+ <table id="event_list">\r
+ <thead>\r
+ <tr>\r
+ <th width="30%"><?php echo __('Event', 'aam'); ?></th>\r
+ <th><?php echo __('Event Specifier', 'aam'); ?></th>\r
+ <th width="25%"><?php echo __('Bind Post Type', 'aam'); ?></th>\r
+ <th width="30%"><?php echo __('Action', 'aam'); ?></th>\r
+ <th><?php echo __('Action Specifier', 'aam'); ?></th>\r
+ <th><?php echo __('Control', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+ <div id="manage_event_dialog" class="aam-dialog" title="<?php echo __('Manager Event'); ?>">\r
+ <table class="aam-form-table">\r
+ <tbody>\r
+ <tr>\r
+ <th width="40%"><?php echo __('Event', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <select id="event_event">\r
+ <option value="status_change"><?php echo __('Post Status Change', 'aam'); ?></option>\r
+ <option value="content_change"><?php echo __('Post Content Change', 'aam'); ?></option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr id="status_changed" style="display: none;">\r
+ <th><?php echo __('Status Changed To', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <select id="event_specifier">\r
+ <?php\r
+ foreach ($this->getPostStatuses() as $status => $config) {\r
+ if ($config->show_in_admin_status_list) {\r
+ echo '<option value="' . $status . '">';\r
+ echo $config->label . '</option>';\r
+ }\r
+ }\r
+ ?>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Bind to Post Type', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <select id="event_bind">\r
+ <?php\r
+ foreach ($this->getPostTypes() as $post => $config) {\r
+ echo '<option value="' . $post . '">';\r
+ echo $config->labels->name . '</option>';\r
+ }\r
+ ?>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Action', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <select id="event_action">\r
+ <option value="notify"><?php echo __('Email Notification', 'aam'); ?></option>\r
+ <option value="change_status"><?php echo __('Change Status', 'aam'); ?></option>\r
+ <option value="callback"><?php echo __('Callback', 'aam'); ?></option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr id="event_specifier_notify_holder" class="event-specifier">\r
+ <th><?php echo __('Email Address', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <input type="text" id="event_specifier_notify" />\r
+ </td>\r
+ </tr>\r
+ <tr id="event_specifier_change_status_holder" class="event-specifier">\r
+ <th><?php echo __('Change Status To', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <select id="event_specifier_change_status">\r
+ <?php\r
+ foreach ($this->getPostStatuses() as $status => $config) {\r
+ if ($config->show_in_admin_status_list) {\r
+ echo '<option value="' . $status . '">';\r
+ echo $config->label . '</option>';\r
+ }\r
+ }\r
+ ?>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr id="event_specifier_callback_holder" class="event-specifier">\r
+ <th><?php echo __('Callback Function', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td>\r
+ <input type="text" id="event_specifier_callback" />\r
+ </td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="delete_event" class="aam-dialog" title="<?php echo __('Delete Event', 'aam'); ?>">\r
+ <p class="dialog-content"><?php echo __('Are you sure you want to delete selected Event?', 'aam'); ?></p>\r
+ </div>\r
+\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+?>
+<div class="wrap" id="aam">
+ <div class="postbox-container" style="width:70%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span>
+ <?php echo __('Extension List', 'aam'); ?>
+ </span>
+ </h3>
+ <div class="inside">
+ <table id="extension_list">
+ <thead>
+ <tr>
+ <th width="25%"><?php echo __('Name', 'aam'); ?></th>
+ <th width="50%"><?php echo __('Description', 'aam'); ?></th>
+ <th width="10%"><?php echo __('Price', 'aam'); ?></th>
+ <th><?php echo __('Actions', 'aam'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <span class="extension-name">AAM Plus Package</span>
+ </td>
+ <td class="extension-description">
+ This Extension extends default AAM basic features and unlock some limitations.
+ Add custom taxonomy <b>Page Category</b> to ground pages into categories;
+ Unlock the limitation for Post Access control;
+ Add additional Capability Group <b>Comments</b> with the set of capabilities to control default comment
+ actions like <b>Reply</b>, <b>Mark Spam</b>, <b>Trash</b>, <b>Delete</b> etc;
+ Add possibility to setup default post or page access.
+ For more details, please visit our forum.
+ </td>
+ <td class="extension-price payed">$30.00</td>
+ <td>
+ <div class="extension-actions">
+ <a href="http://wpaam.com/aam-extensions/aam-plus-package/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
+ <?php if ($this->getRepository()->hasExtension('AAM Plus Package')) { ?>
+ <a href="#" extension="AAM Plus Package" license="<?php echo $this->getRepository()->getLicense('AAM Plus Package'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Plus Package" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UEM8U65HFEG4Q" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
+ <?php } ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="extension-name">AAM Activities</span>
+ </td>
+ <td class="extension-description">
+ Extend the list of activities that AAM can track. By default AAM logs only user <i>login</i> and <i>logout</i>.
+ By purchasing this extension you can also track activities like post trash, delete, update etc.
+ As well as we can implement any additional activity on demand. Check <a href="http://wpaam.com/aam-extensions/aam-activities/" traget="_blank">our website</a> for more details.
+ </td>
+ <td class="extension-price payed">$20.00</td>
+ <td>
+ <div class="extension-actions">
+ <a href="http://wpaam.com/aam-extensions/aam-activities/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
+ <?php if ($this->getRepository()->hasExtension('AAM Activities')) { ?>
+ <a href="#" extension="AAM Activities" license="<?php echo $this->getRepository()->getLicense('AAM Activities'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Activities" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HME9DTSFSJH4W" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
+ <?php } ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="extension-name">AAM Media Manager</span>
+ </td>
+ <td class="extension-description">
+ It is the first official prototype that allows you to group your media files in Categories.
+ Visit our <a href="http://wpaam.com/aam-extensions/aam-media-manager/" target="_blank">website</a>
+ to find out more about current functionality and future development plans.
+ </td>
+ <td class="extension-price payed">$10.00</td>
+ <td>
+ <div class="extension-actions">
+ <a href="http://wpaam.com/aam-extensions/aam-media-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
+ <?php if ($this->getRepository()->hasExtension('AAM Media Manager')) { ?>
+ <a href="#" extension="AAM Media Manager" license="<?php echo $this->getRepository()->getLicense('AAM Media Manager'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Media Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WJ48A7Z6EFZJ4" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
+ <?php } ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="extension-name">AAM Content Filter</span>
+ </td>
+ <td class="extension-description">
+ The first version of AAM Content Filter Extension allows you to filter content for your Posts or Pages or Custom Post Types.
+ The content (or part of the content) can be filtered based on currently logged in user or visitor.
+ Check our <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank">website</a> for more information.
+ </td>
+ <td class="extension-price payed">$15.00</td>
+ <td>
+
+ <div class="extension-actions">
+ <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
+ <?php if ($this->getRepository()->hasExtension('AAM Content Filter')) { ?>
+ <a href="#" extension="AAM Content Filter" license="<?php echo $this->getRepository()->getLicense('AAM Content Filter'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Content Filter" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X7NZ7QF8A9CVS" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
+ <?php } ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="extension-name">AAM Plugin Manager</span>
+ </td>
+ <td class="extension-description">
+ Control access to individual plugins in your list of Plugins. Hide, restrict to activate, deactivate or delete any existing plugin for user or role.
+ Check our <a href="http://wpaam.com/aam-development/aam-plugin-manager/" target="_blank">website</a> for more information.
+ </td>
+ <td class="extension-price payed">$10.00</td>
+ <td>
+ <div class="extension-actions">
+ <a href="http://wpaam.com/aam-development/aam-plugin-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
+ <?php if ($this->getRepository()->hasExtension('AAM Plugin Manager')) { ?>
+ <a href="#" extension="AAM Plugin Manager" license="<?php echo $this->getRepository()->getLicense('AAM Content Filter'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Plugin Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QJ2H2J483VXPL" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
+ <?php } ?>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div id="install_license" class="aam-dialog" title="<?php echo __('Install License', 'aam'); ?>">
+ <p class="dialog-content">
+ <?php echo __('If you already have license key, just enter it below. Othewise click <b>Purchase</b> button to checkout your order.', 'aam'); ?>
+ <input type="text" class="license-input" id="license_key" placeholder="License Key" />
+ </p>
+ <ul class="license-error-list"></ul>
+ </div>
+ <div id="update_license" class="aam-dialog" title="<?php echo __('Update License', 'aam'); ?>">
+ <p class="dialog-content" style="text-align: center;">
+ <?php echo __('Your license key: ', 'aam'); ?><br/>
+ <b><span id="installed_license_key"></span></b>
+ </p>
+ <ul class="license-error-list"></ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <?php if (aam_Core_Console::hasIssues()) { ?>
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
+ <?php } ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Connect with AAM', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <div class="large-icons-row">
+ <a href="https://twitter.com/wpaam" class="aam-icon aam-icon-large aam-icon-large-twitter" aam-tooltip="Follow @wpaam" target="_blank">
+ <span></span><?php echo __('Follow Us', 'aam'); ?>
+ </a>
+ <a href="mailto:support@wpaam.com" class="aam-icon aam-icon-large aam-icon-large-message" aam-tooltip="Send Us Email">
+ <span></span><?php echo __('Send Message', 'aam'); ?>
+ </a>
+ <a href="http://wpaam.com" class="aam-icon aam-icon-large aam-icon-large-link" aam-tooltip="Visit Us" target="_blank">
+ <span></span><?php echo __('Website', 'aam'); ?>
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span style="color:#FF0000;"><?php echo __('Development License', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <p>
+ <?php echo __('Get <b>Development License</b> for $119 and receive access to all extensions that are available today and will be developed within a year.', 'aam'); ?>
+ <a href="http://wpaam.com/aam-development/aam-development-license/" target="_blank"><?php echo __('Read More', 'aam'); ?></a>
+ </p>
+ <div style="text-align: center;">
+ <?php if ($this->getRepository()->hasLicense('AAM Development License')) { ?>
+ <a href="#" extension="AAM Development License" license="<?php echo $this->getRepository()->getLicense('AAM Development License'); ?>" class="button button-primary button-large view-license-btn"><?php echo __('View License', 'aam'); ?></a>
+ <?php } else { ?>
+ <a href="#" extension="AAM Development License" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" class="button button-primary button-large add-license-btn"><?php echo __('Add License', 'aam'); ?></a>
+ <?php } ?>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+<h2>AAM Development Framework</h2>\r
+\r
+<p>\r
+ Are you passionate about WordPress development? We are too! Become a member of \r
+ the AAM community and obtain our \r
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" target="_blank">Exclusive Development License</a> \r
+ where you can profit from your own ideas and have access to all AAM extensions.\r
+</p>\r
+\r
+<p>\r
+ We receive regular requests and suggestions for new extensions and decided we would \r
+ extend the opportunity to create and earn by opening our platform to you. We will \r
+ host your extensions on our server so you may develop custom features for you and \r
+ your customers. If you have a great idea and would like to create an extension for \r
+ sales, we will review, approve and host it on AAM server.\r
+</p>\r
+\r
+<p>\r
+ You can download the sample extension from our official \r
+ <a href="https://github.com/wpaam/AAM-Feature-Example" target="_blank">GitHub Repository</a> \r
+ and customize it to your special need.\r
+</p>\r
+\r
+<p>\r
+ Additionally the \r
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" target="_blank">AAM Development License</a> \r
+ gives you an opportunity to download <b>ALL</b> AAM extensions that are available \r
+ now and all new extensions that will be developed within a year from the time of purchase.\r
+</p>
\ No newline at end of file
--- /dev/null
+<h2>AAM Extensions</h2>\r
+\r
+<p>\r
+ Advanced Access Manager is free platform and you can use most of the features without\r
+ any limitations but in case you are looking for more, this is where AAM extensions\r
+ might be useful for you to check. Complete list of available extensions you can find \r
+ on AAM->Extensions page.\r
+</p>\r
+<p>\r
+ We are using PayPal to process the payment and if it completed successfully, you will\r
+ automatically receive an email with license key that you can use to activate the extension.\r
+</p>\r
+<p>\r
+ In case of any issues with license key, we guaranty to resolve the issue within one business day.\r
+ Otherwise your money back.\r
+</p>
\ No newline at end of file
--- /dev/null
+<h2>Frequently Asked Questions</h2>\r
+\r
+<h4>What is Advanced Access Manager?</h4>\r
+<p>\r
+ Advanced Access Manager (aka AAM) is free WordPress plugin that allows you to \r
+ control access to your website. With AAM you can manager access to your Posts, \r
+ Pages and Categories, filter unnecessary areas in your Backend, manager Users and\r
+ Roles and many more. \r
+</p>\r
+\r
+<h4>What should I know to understand how AAM works?</h4>\r
+<p>\r
+ Best way to learn more about AAM is to check our \r
+ <a href="http://wpaam.com/tutorials/" target="_blank">collection of tutorials</a>.\r
+ From here you'll get the basic understanding about most important aspects of AAM\r
+ functionality. It is also very important to understand how WordPress \r
+ <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles & Capabilities</a> \r
+ are organized.\r
+</p>\r
+\r
+<h4>I'm not able to manage Administrator Role. What am I missing?</h4>\r
+<p>\r
+ In fact that AAM is very powerful tool, many unexperienced users were able to limit \r
+ Administrator rights and loose access to Dashboard. That is why from AAM Release 2.5 \r
+ we introduced <a href="http://wpaam.com/tutorials/aam-super-admin/" target="_blank">AAM Super Admin</a>.\r
+ You can make one user in your system as AAM Super Administrator that is able to manager other\r
+ administrators.<br/>\r
+ <span style="color:#FF0000; font-weight: bold;">Warning!</span> Do not limit capabilities for Administrator\r
+ Role, because even if you are AAM Super Administrator, you still remain WordPress Administrator.\r
+</p>\r
+\r
+<h4>What is ConfigPress?</h4>\r
+<p>\r
+ Think about ConfigPress as a settings page but instead of dozens of checkboxes, drop-downs and input fields \r
+ you use configuration script based on <a href="http://en.wikipedia.org/wiki/INI_file" target="_blank">INI Standard</a>. \r
+ The reason we use this format is that AAM is not only just a plugin but complex and very flexible development \r
+ tool. That is why we came to conclusion to organize all settings in ConfigPress format. \r
+</p>
\ No newline at end of file
--- /dev/null
+<h2>General Overview</h2>\r
+<p>\r
+ Advanced Access Manager (aka AAM) is one of the most popular access control plugins. It is easy-to-use but\r
+ at the same time very powerful tool that gives you a flexible control over your either\r
+ single WordPress site or Multisite Network. With AAM you are allowed to configure access\r
+ to different parts of your website for any <i>role</i> or individual <i>user</i>.\r
+</p>\r
+<p>\r
+ Another great aspect of AAM is that our team constantly working on new features and improving\r
+ existing. We are very dedicated to success of this project and our support is ready to help you\r
+ within 48hours.\r
+</p>\r
+<p>\r
+ Below you can find some of the major feature that are available in current AAM version:\r
+</p>\r
+\r
+<b>Control access to backend menu (including submenu).</b> As example you can restrict \r
+access for <i>role</i> Editor to Menu "Pages" or does not allow any <i>user</i> to \r
+manage Post's Categories.<br/>\r
+<br/>\r
+<b>Filter <i>widgets</i> & <i>metaboxes</i>.</b> Filter the list of metaboxes that any <i>role</i> \r
+or <i>user</i> can see during Post/Page editing. At the same time you can filter the \r
+list of Dashboard and Frontend widgets.<br/>\r
+<br/>\r
+<b>Control access to any <i>post</i>, <i>page</i>, <i>custom post type</i> or <i>category</i>.</b> \r
+You can restrict access to page or post for any <i>user</i> or <i>role</i> as well as\r
+restrict access to entire <i>category</i> and all posts inside it. You can also restrict \r
+commenting for pages or exclude any from the frontend menu. For more restrictions you can \r
+consider to get <a href="http://wpaam.com/aam-extensions/aam-plus-package/" target="_blank">AAM Plus Package</a>.<br/>\r
+<br/>\r
+<b>Filter Post or Page content.</b> You can filter Post's or Page's content for \r
+currently logged in user or visitor. This feature is available with extension \r
+<a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank">AAM Content Manager</a>.<br/>\r
+<br/>\r
+<b>Manage capabilities for any <i>role</i> or <i>user</i>.</b> \r
+AAM, with simple interface, allows you to grand or remove capabilities for any <i>role</i> or <i>user</i>.\r
+You can also create new custom capability or remove existing.<br/>\r
+<br/>\r
+<b>Create custom actions for system events.</b> As example your system can send email \r
+to you if some user published post or page, or modified content. You also can develop \r
+your own custom action for system event.<br/>\r
+<br/>\r
+<b>Track <i>user</i> activities.</b> With AAM you can track user activities within \r
+your website. So you can easily find out when user was logged in or modified any post \r
+or page. To extend the list of tracked activities, consider to get \r
+<a href="http://wpaam.com/aam-extensions/aam-activities/" target="_blank">AAM Activities</a> \r
+extension.\r
+\r
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+?>
+<div class="wrap" id="aam">
+ <form action="" method="post" id="aam_form">
+ <?php do_action('aam_cmanager_hierarchy'); ?>
+ <div class="postbox-container" style="width:70%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <?php if (aam_Core_API::isNetworkPanel()) { ?>
+ <span class="current-site"></span>
+ <?php } ?>
+ <span class="current-subject"></span>
+ </h3>
+ <div class="inside main-inside">
+ <div class="aam-main-loader"></div>
+ <div class="aam-main-content"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <?php if (aam_Core_Console::hasIssues()) { ?>
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
+ <?php } ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder" id="control_panel">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Control Panel', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <div class="large-icons-row" id="cpanel_major">
+ </div>
+ <div class="medium-icons-row" id="cpanel_minor"></div>
+ <div class="aam-metabox-loader"></div>
+ </div>
+ <div id="restore_dialog" class="aam-dialog" title="<?php echo __('Undo Change', 'aam'); ?>">
+ <p class="dialog-content"><?php echo __('Would your like to role back current settings?', 'aam'); ?></p>
+ </div>
+ <div id="message_dialog" class="aam-dialog" title="<?php echo __('E-mail Us', 'aam'); ?>">
+ <p class="dialog-content"><?php echo __('Our E-mail address is <b>support@wpaam.com</b>', 'aam'); ?></p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="metabox-holder" id="control_manager">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Control Manager', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <div id="minor-publishing">
+ <div id="misc-publishing-actions" class="control-manager">
+ <?php
+ $subjects = aam_View_Collection::retrieveSubjects();
+ foreach ($subjects as $subject) {
+ echo '<a href="#" class="', $subject->class, '" ';
+ echo 'aam-tooltip="', $subject->title, '" segment="' . $subject->segment . '">';
+ echo $subject->label, '</a>';
+ }
+ ?>
+ </div>
+ </div>
+ <div class="control-manager-content">
+ <?php
+ foreach ($subjects as $subject) {
+ echo $subject->controller->content();
+ }
+ ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <br class="clear" />
+ </form>
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+$menu = $this->getMenu();\r
+?>\r
+<div class="feature-content-container" id="admin_menu_content">\r
+ <?php if (count($menu)) { ?>\r
+ <div class="menu-top-actions">\r
+ <!--\r
+ <div class="menu-top-action-sort-description">\r
+ <span>Drag & Drop the Menu Item to change the order.</span>\r
+ </div>\r
+ <a href="#" class="menu-top-action-item menu-top-action-sort" tooltip="Sort the Admin Menu"></a>\r
+ -->\r
+ </div>\r
+ <?php } ?>\r
+ <div id="main_menu_list">\r
+ <?php\r
+ if (count($menu)) {\r
+ $menuControl = $this->getSubject()->getObject(aam_Control_Object_Menu::UID);\r
+ foreach ($menu as $i => $menu) {\r
+ $menu_id = $i . uniqid();\r
+ ?>\r
+ <div class="group">\r
+ <h4><?php echo $menu['name']; ?></h4>\r
+ <div>\r
+ <div class="whole-menu">\r
+ <label for="m<?php echo $menu_id; ?>"><?php echo __('Restrict All', 'aam'); ?></label>\r
+ <input type="checkbox" id="m<?php echo $menu_id; ?>" name="aam[<?php echo aam_Control_Object_Menu::UID; ?>][<?php echo $menu['id']; ?>]" <?php echo ($this->hasRestrictedAll($menu) ? 'checked="checked"' : ''); ?> class="whole_menu" />\r
+ <label for="m<?php echo $menu_id; ?>"><span></span></label>\r
+ </div>\r
+ <?php if (isset($menu['submenu'])) { ?>\r
+ <div class="menu-submenu-list" id="submenu_m<?php echo $menu_id; ?>">\r
+ <?php\r
+ $c = 1;\r
+ foreach ($menu['submenu'] as $j => $submenu) {\r
+ if ($c++ === 1) {\r
+ echo '<div class="menu-submenu-row">';\r
+ }\r
+ ?>\r
+ <div class="menu-submenu-item">\r
+ <label for="m<?php echo $menu_id . $j; ?>" aam-tooltip="<?php echo $submenu['name']; ?>" ><?php echo $submenu['short']; ?></label>\r
+ <input type="checkbox" id="m<?php echo $menu_id . $j; ?>" name="aam[<?php echo aam_Control_Object_Menu::UID; ?>][<?php echo $submenu['id']; ?>]" <?php echo ($menuControl->has($submenu['id']) ? 'checked="checked"' : ''); ?> />\r
+ <label for="m<?php echo $menu_id . $j; ?>"><span></span></label>\r
+ </div>\r
+ <?php\r
+ if ($c > 3) {\r
+ $c = 1;\r
+ echo '</div>';\r
+ }\r
+ }\r
+ if ($c !== 1) {\r
+ echo '</div>';\r
+ }\r
+ ?>\r
+ </div>\r
+ <?php } ?>\r
+ </div>\r
+ </div>\r
+ <?php\r
+ }\r
+ } else {\r
+ ?>\r
+ <div class="menu-empty-list">\r
+ <span><?php echo __('There is no single menu item allowed for current Role or User', 'aam'); ?></span>\r
+ </div>\r
+ <?php\r
+ }\r
+ ?>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="metabox_content">\r
+ <div class="metabox-top-actions">\r
+ <div class="metabox-top-action-link">\r
+ <input type="text" class="link-text" id="metabox_link" />\r
+ </div>\r
+ <a href="#" class="aam-icon aam-icon-medium aam-icon-medium-add" id="retrieve_url" aam-tooltip="<?php echo __('Retrieve Metaboxes From Link', 'aam') ;?>"><span></span></a>\r
+ <a href="#" class="aam-icon aam-icon-medium aam-icon-medium-refresh" id="refresh_metaboxes" aam-tooltip="<?php echo __('Refresh the List', 'aam') ;?>"><span></span></a>\r
+ <br class="clear" />\r
+ </div>\r
+ <div class="aam-metabox-loader"></div>\r
+ <div id="metabox_list_container"></div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="post_access_content">\r
+ <table id="post_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Post ID</th>\r
+ <th>Post Status</th>\r
+ <th>Post Link</th>\r
+ <th width="60%"><?php echo __('Name', 'aam'); ?></th>\r
+ <th width="20%"><?php echo __('Status', 'aam'); ?></th>\r
+ <th><?php echo __('Control', 'aam'); ?></th>\r
+ <th>Restriction Status</th>\r
+ </tr>\r
+ </thead>\r
+ <tbody>\r
+ </tbody>\r
+ </table>\r
+ \r
+ <div id="delete_post_dialog" class="aam-dialog" title="<?php echo __('Delete Post', 'aam'); ?>">\r
+ <p class="dialog-content"></p>\r
+ </div>\r
+\r
+ <div id="filter_post_dialog" class="aam-dialog" title="<?php echo __('Filter Posts by Type', 'aam'); ?>">\r
+ <div class="tree-holder postbox">\r
+ <div id="sidetreecontrol">\r
+ <a href="#"><?php echo __('Collapse All', 'aam'); ?></a> | \r
+ <a href="#"><?php echo __('Expand All', 'aam'); ?></a> | \r
+ <span><?php echo __('Refresh', 'aam'); ?></span></div>\r
+ <br class="clear" />\r
+ <ul id="tree" class="filetree"></ul>\r
+ </div>\r
+ <div class="aam-main-loader"></div>\r
+ </div>\r
+\r
+ <div id="access_dialog" class="aam-dialog">\r
+ <div class="aam-lock-message">\r
+ <span><?php echo __('You reached the limit. Get <a href="' . admin_url('admin.php?page=aam-ext') . '" target="_blank">AAM Plus Package</a> to unlock the feature.'); ?></span>\r
+ </div>\r
+ <div class="post-access-inherited"></div>\r
+ <?php if ($this->getSubject()->getUID() != 'visitor') { ?>\r
+ <div class="post-access-area">\r
+ <input type="radio" id="post_area_frontend" value="frontend" checked="checked" name="access_area" /><label for="post_area_frontend"><?php echo __('Frontend', 'aam'); ?></label>\r
+ <input type="radio" id="post_area_backend" value="backend" name="access_area" /><label for="post_area_backend"><?php echo __('Backend', 'aam'); ?></label>\r
+ </div>\r
+ <?php } ?>\r
+ <div id="access_control_area"></div>\r
+ <div class="aam-main-loader"></div>\r
+ </div>\r
+</div>\r
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div id="role_manager_wrap">\r
+ <table id="role_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Role ID</th>\r
+ <th>User Count</th>\r
+ <th width="60%"><?php echo __('Role', 'aam'); ?></th>\r
+ <th><?php echo __('Action', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+\r
+ <div id="manage_role_dialog" class="aam-dialog">\r
+ <table class="dataTable">\r
+ <tbody>\r
+ <tr>\r
+ <th><?php echo __('Role Name', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td><input type="text" id="role_name" class="aam-input" /></td>\r
+ </tr>\r
+ <tr id="parent_cap_role_holder">\r
+ <th><?php echo __('Inherit Caps', 'aam'); ?>:</th>\r
+ <td><select class="aam-input" id="parent_cap_role"></select></td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+ \r
+ <div id="duplicate_role_dialog" class="aam-dialog" title="<?php echo __('Duplicate Role', 'aam'); ?>">\r
+ <table class="dataTable">\r
+ <tbody>\r
+ <tr>\r
+ <th><?php echo __('Duplicate Role', 'aam'); ?>:</th>\r
+ <td><span style="font-weight: bold;" id="duplicate_role_name"></span></td>\r
+ </tr>\r
+ <tr>\r
+ <th><?php echo __('Role Name', 'aam'); ?><span class="aam-asterix">*</span>:</th>\r
+ <td><input type="text" id="duplicate_role_name" class="aam-input" /></td>\r
+ </tr>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="delete_role_dialog" class="aam-dialog" title="<?php echo __('Delete Role', 'aam'); ?>">\r
+ <p class="dialog-content"></p>\r
+ </div>\r
+ <div id="delete_admin_role_dialog" class="aam-dialog" title="<?php echo __('Notice', 'aam'); ?>">\r
+ <p class="dialog-content">\r
+ <?php echo __('You can not delete <b>Administrator</b> Role', 'aam'); ?>\r
+ </p>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div id="user_manager_wrap">\r
+ <table id="user_list">\r
+ <thead>\r
+ <tr>\r
+ <th>User ID</th>\r
+ <th>User Login</th>\r
+ <th width="60%"><?php echo __('Username', 'aam'); ?></th>\r
+ <th><?php echo __('Action', 'aam'); ?></th>\r
+ <th>Status</th>\r
+ <th>Managable</th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+\r
+ <div id="filter_user_dialog" class="aam-dialog" title="<?php echo __('Filter Users by Role', 'aam'); ?>">\r
+ <table id="filter_role_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Role ID</th>\r
+ <th>User Count</th>\r
+ <th width="80%"><?php echo __('Role Name', 'aam'); ?></th>\r
+ <th><?php echo __('Action', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="delete_user_dialog" class="aam-dialog" title="<?php echo __('Delete User', 'aam'); ?>">\r
+ <span class="dialog-content"></span>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div id="visitor_manager_wrap" class="control-manager-visitor">\r
+ <?php echo __('Control Access to your blog for visitor (any user that is not logged in)', 'aam'); ?>.\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_User extends aam_View_Abstract {
+
+ /**
+ * Generate UI content
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function content() {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/user.phtml');
+ }
+
+ /**
+ * Retrieve list of users
+ *
+ * Based on filters, get list of users
+ *
+ * @return string JSON encoded list of users
+ *
+ * @access public
+ */
+ public function retrieveList() {
+ //get total number of users
+ $total = count_users();
+ $result = $this->query();
+ $response = array(
+ 'iTotalRecords' => $total['total_users'],
+ 'iTotalDisplayRecords' => $result->get_total(),
+ 'sEcho' => aam_Core_Request::request('sEcho'),
+ 'aaData' => array(),
+ );
+ foreach ($result->get_results() as $user) {
+ $response['aaData'][] = array(
+ $user->ID,
+ $user->user_login,
+ ($user->display_name ? $user->display_name : $user->user_nicename),
+ '',
+ $user->user_status,
+ ($this->canManage($user) ? 1 : 0)
+ );
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Check if specified user can be managed by current user
+ *
+ * @param WP_User $user
+ *
+ * @return boolean
+ *
+ * @access public
+ */
+ public function canManage(WP_User $user = null){
+ //AAM does not support multi-roles. Get only one first role
+ $roles = $user->roles;
+ $role = get_role(array_shift($roles));
+ //get user's highest level
+ $level = aam_Core_API::getUserLevel();
+
+ if (empty($role->capabilities['level_' . $level])
+ || !$role->capabilities['level_' . $level]
+ || aam_Core_API::isSuperAdmin()){
+ $response = true;
+ } else {
+ $response = false;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Query database for list of users
+ *
+ * Based on filters and settings get the list of users from database
+ *
+ * @return \WP_User_Query
+ *
+ * @access public
+ */
+ public function query() {
+ if ($search = trim(aam_Core_Request::request('sSearch'))) {
+ $search = "{$search}*";
+ }
+ $args = array(
+ 'number' => '',
+ 'blog_id' => get_current_blog_id(),
+ 'role' => aam_Core_Request::request('role'),
+ 'fields' => 'all',
+ 'number' => aam_Core_Request::request('iDisplayLength'),
+ 'offset' => aam_Core_Request::request('iDisplayStart'),
+ 'search' => $search,
+ 'search_columns' => array('user_login', 'user_email', 'display_name'),
+ 'orderby' => 'user_nicename',
+ 'order' => 'ASC'
+ );
+
+ return new WP_User_Query($args);
+ }
+
+ /**
+ * Block user
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function block() {
+ if ($this->isManagable() && $this->getSubject()->block()){
+ $response = array(
+ 'status' => 'success',
+ 'user_status' => $this->getSubject()->user_status
+ );
+ } else{
+ $response = array('status' => 'failure');
+ }
+
+ return json_encode($response);
+ }
+
+ /**
+ * Delete user
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function delete() {
+ if ($this->isManagable($this->getSubject()->getUser())){
+ $response = $this->getSubject()->delete();
+ } else {
+ $response = false;
+ }
+
+ return json_encode(array('status' => $response ? 'success' : 'failure'));
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ *
+ * @package AAM
+ * @author Vasyl Martyniuk <support@wpaam.com>
+ * @copyright Copyright C 2013 Vasyl Martyniuk
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
+ */
+class aam_View_Visitor extends aam_View_Abstract
+{
+
+ /**
+ * Get View content
+ *
+ * @return string
+ *
+ * @access public
+ */
+ public function content()
+ {
+ return $this->loadTemplate(dirname(__FILE__) . '/tmpl/visitor.phtml');
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+//AAM Version for Update purpose
+define('AAM_VERSION', '2.8.1');
+
+define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+
+$base_url = WP_PLUGIN_URL . '/' . basename(AAM_BASE_DIR) . '/';
+if (force_ssl_admin() && (strpos($base_url, 'https') !== 0)) {
+ $base_url = str_replace('http', 'https', $base_url);
+}
+define('AAM_BASE_URL', $base_url);
+
+define('AAM_TEMPLATE_DIR', AAM_BASE_DIR . 'view/html/');
+define('AAM_LIBRARY_DIR', AAM_BASE_DIR . 'library/');
+define('AAM_TEMP_DIR', WP_CONTENT_DIR . '/aam/');
+define('AAM_MEDIA_URL', AAM_BASE_URL . 'media/');
+
+define('AAM_APPL_ENV', (getenv('APPL_ENV') ? getenv('APPL_ENV') : 'production'));
+//Rest API
+if (AAM_APPL_ENV === 'production') {
+ define('WPAAM_REST_API', 'http://rest.wpaam.com');
+} else {
+ define('WPAAM_REST_API', 'http://wpaam.localhost/');
+}
+
+/**
+ * Autoloader for project Advanced Access Manager
+ *
+ * Try to load a class if prefix is mvb_
+ *
+ * @param string $class_name
+ */
+function aam_autoload($class_name) {
+ $chunks = explode('_', strtolower($class_name));
+ $prefix = array_shift($chunks);
+
+ if ($prefix === 'aam') {
+ $base_path = AAM_BASE_DIR . '/application';
+ $path = $base_path . '/' . implode('/', $chunks) . '.php';
+ if (file_exists($path)) {
+ require($path);
+ }
+ }
+}
+
+spl_autoload_register('aam_autoload');
+
+//make sure that we have always content dir
+if (!file_exists(AAM_TEMP_DIR)) {
+ if (@mkdir(AAM_TEMP_DIR)) {
+ //silence the directory
+ file_put_contents(AAM_TEMP_DIR . '/index.php', '');
+ } else {
+ aam_Core_Console::add(__('Failed to create wp-content/aam folder', 'aam'));
+ }
+} elseif(!is_writable(AAM_TEMP_DIR)){
+ aam_Core_Console::add(__('Folder wp-content/aam is not writable', 'aam'));
+}
+
+load_plugin_textdomain('aam', false, basename(AAM_BASE_DIR) . '/lang');
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+.activity-top-actions{
+ float: right;
+ display: inline-table;
+ width: auto;
+ text-align: right;
+}
+
+.activity-top-action{
+ width: 24px;
+ height: 24px;
+ display: table-cell;
+ text-indent: -9999px;
+ padding-right: 10px;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+.activity-top-action-clear{
+ background-image: url('images/trash.png');
+}
+
+.activity-top-action-clear:hover{
+ background-image: url('images/trash-active.png');
+}
+
+.activity-top-action-clear-active{
+ background-image: url('images/trash-active.png');
+}
+
+.activity-top-action-info{
+ background-image: url('images/info.png');
+}
+
+.activity-top-action-info:hover{
+ background-image: url('images/info-active.png');
+}
+
+.activity-top-action-info-active{
+ background-image: url('images/info-active.png');
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * Activity List
+ *
+ * @type object
+ */
+AAM.prototype.blogTables.activityList = null;
+
+/**
+ * Initialize and load activity tab
+ *
+ * @returns void
+ */
+AAM.prototype.loadActivityTab = function() {
+ var _this = this;
+
+ if (this.blogTables.activityList === null) {
+ this.blogTables.activityList = jQuery('#activity_list').dataTable({
+ sDom: "<'top'lf<'activity-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bDestroy: true,
+ bSort: false,
+ sAjaxSource: ajaxurl,
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'activity_list'
+ });
+ aoData.push({
+ name: 'subject',
+ value: _this.getSubject().type
+ });
+ aoData.push({
+ name: 'subject_id',
+ value: _this.getSubject().id
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ },
+ fnInitComplete: function() {
+ var a = jQuery('#activity_list_wrapper .activity-top-actions');
+
+ var clear = jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'activity-top-action activity-top-action-clear',
+ 'aam-tooltip': aamLocal.labels['Clear Logs']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.launch(jQuery(this), 'activity-top-action-clear');
+ _this.launchClearActivityLog();
+ });
+ jQuery(a).append(clear);
+
+ var info = jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'activity-top-action activity-top-action-info',
+ 'aam-tooltip': aamLocal.labels['Get More']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.launch(jQuery(this), 'activity-top-action-info');
+ _this.launchActivityLogInfo();
+ });
+ jQuery(a).append(info);
+
+ _this.doAction('aam_activity_top_actions', {container: a});
+ },
+ fnRowCallback: function(nRow, aData) {
+ jQuery('td:eq(0)', nRow).html(jQuery('<a/>', {
+ href: aamLocal.editUserURI + '?user_id=' + aData[0],
+ target: '_blank'
+ }).html(aData[1]));
+ },
+ aoColumnDefs: [
+ {bVisible: false, aTargets: [0]}
+ ],
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ },
+ sLengthMenu: "_MENU_"
+ }
+ });
+ }
+};
+
+/**
+ * Show Clear Activity Log Confirmation dialog
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchClearActivityLog = function() {
+ var _this = this;
+
+ var buttons = {};
+
+ buttons[aamLocal.labels['Clear Logs']] = function() {
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: _this.compileAjaxPackage('clear_activities', true),
+ complete: function() {
+ jQuery('#clear_activity_dialog').dialog("close");
+ }
+ });
+ };
+
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#clear_activity_dialog').dialog("close");
+ };
+
+ jQuery('#clear_activity_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '20%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.terminate(
+ jQuery('.activity-top-action-clear'),
+ 'activity-top-action-clear'
+ );
+ //refresh the table
+ _this.blogTables.activityList = null;
+ _this.loadActivityTab();
+ }
+ });
+};
+
+/**
+ * Show Activation Log Information Dialog
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchActivityLogInfo = function() {
+ var _this = this;
+
+ var buttons = {};
+
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#info_activity_dialog').dialog("close");
+ };
+
+ jQuery('#info_activity_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.terminate(
+ jQuery('.activity-top-action-info'),
+ 'activity-top-action-info'
+ );
+ }
+ });
+};
+
+jQuery(document).ready(function() {
+ aamInterface.addAction('aam_feature_activation', function(params) {
+ if (params.feature === 'activity_log') {
+ aamInterface.loadActivityTab();
+ }
+ });
+});
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_Control_Object_Activity extends aam_Control_Object {\r
+\r
+ /**\r
+ * Control Object UID\r
+ */\r
+ const UID = 'activity';\r
+\r
+ /**\r
+ * Activity User Login\r
+ */\r
+ const ACTIVITY_LOGIN = 'login';\r
+\r
+ /**\r
+ * Activity User Logout\r
+ */\r
+ const ACTIVITY_LOGOUT = 'logout';\r
+\r
+ /**\r
+ * Set of Activities\r
+ *\r
+ * @var array\r
+ *\r
+ * @access private\r
+ */\r
+ private $_option = array();\r
+\r
+ /**\r
+ * Initialize the Activity list\r
+ *\r
+ * Based on subject type, load the list of activities\r
+ *\r
+ * @param int $object_id\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function init($object_id) {\r
+ if ($this->getSubject()->getUID() == aam_Control_Subject_User::UID) {\r
+ //get single user activity list\r
+ $option = array(\r
+ $this->getSubject()->getId() => $this->getSubject()->readOption(\r
+ self::UID, $object_id, false\r
+ ));\r
+ } else {\r
+ //get all users in Role and combine the activities\r
+ $query = new WP_User_Query(array(\r
+ 'number' => '',\r
+ 'blog_id' => get_current_blog_id(),\r
+ 'role' => $this->getSubject()->getId(),\r
+ 'fields' => 'id'\r
+ ));\r
+ $option = array();\r
+\r
+ foreach ($query->get_results() as $user) {\r
+ $dump = get_user_option('aam_activity', $user);\r
+ if (is_array($dump) && count($dump)) {\r
+ $option[$user] = $dump;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (is_array($option)) {\r
+ $this->setOption($option);\r
+ //filter old activities\r
+ $this->filter();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Decorate Activity description\r
+ *\r
+ * @param array $activity\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function decorate($activity) {\r
+ switch ($activity['action']) {\r
+ case self::ACTIVITY_LOGIN:\r
+ $response = __('System Login', 'aam');\r
+ break;\r
+\r
+ case self::ACTIVITY_LOGOUT:\r
+ $response = __('System Logout', 'aam');\r
+ break;\r
+\r
+ default:\r
+ $response = apply_filters(\r
+ 'aam_activity_decorator',\r
+ __('Unknown Activity', 'aam'),\r
+ $activity\r
+ );\r
+ break;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ * Add User's Activity\r
+ *\r
+ * This method can be used only for Subject User\r
+ *\r
+ * @param int $timestamp\r
+ * @param array $activity\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function add($timestamp, array $activity) {\r
+ //make sure that user's activity is array\r
+ $user_id = $this->getSubject()->getId();\r
+ if (empty($this->_option[$user_id]) || !is_array($this->_option[$user_id])) {\r
+ $this->_option[$user_id] = array();\r
+ }\r
+ //add activity\r
+ $this->_option[$user_id][$timestamp] = $activity;\r
+\r
+ //finally save the activity\r
+ $this->save($this->_option[$user_id]);\r
+ }\r
+\r
+ /**\r
+ * Filter old activities\r
+ *\r
+ * Based on aam.extension.AAM_Activity_Log.date config, filter old activities\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function filter() {\r
+ $date = strtotime(\r
+ aam_Core_ConfigPress::getParam(\r
+ 'aam.extension.AAM_Activity_Log.date', 'today - 30 days'\r
+ )\r
+ );\r
+ foreach ($this->_option as $user_id => $activities) {\r
+ if (is_array($activities)) {\r
+ foreach ($activities as $timestamp => $activity) {\r
+ if ($timestamp < $date) {\r
+ unset($this->_option[$user_id][$timestamp]);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Save Activities\r
+ *\r
+ * @param array $events\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function save($activities = null) {\r
+ if (is_array($activities)) {\r
+ $this->getSubject()->updateOption($activities, self::UID);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * @inheritdoc\r
+ */\r
+ public function cacheObject() {\r
+ return false;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getUID() {\r
+ return self::UID;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $option\r
+ */\r
+ public function setOption($option) {\r
+ $this->_option = (is_array($option) ? $option : array());\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getOption() {\r
+ return $this->_option;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Activity Log Controller\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class AAM_Extension_ActivityLog extends AAM_Core_Extension {\r
+\r
+ /**\r
+ * Current subject\r
+ *\r
+ * @var aam_Control_Subject\r
+ */\r
+ private $_subject = null;\r
+\r
+ /**\r
+ *\r
+ * @param aam|aam_View_Connector $parent\r
+ */\r
+ public function __construct(aam $parent) {\r
+ parent::__construct($parent);\r
+\r
+ //include activity object\r
+ require_once(dirname(__FILE__) . '/activity.php');\r
+\r
+ if (is_admin()) {\r
+ $this->registerFeature();\r
+ }\r
+\r
+ //define new Activity Object\r
+ add_filter('aam_object', array($this, 'activityObject'), 10, 3);\r
+\r
+ //login & logout hooks\r
+ add_action('wp_login', array($this, 'login'), 10, 2);\r
+ add_action('wp_logout', array($this, 'logout'));\r
+ }\r
+\r
+ /**\r
+ * Register new UI feature\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function registerFeature() {\r
+ $capability = aam_Core_ConfigPress::getParam(\r
+ 'aam.feature.activity_log.capability', 'administrator'\r
+ );\r
+\r
+ if (current_user_can($capability)) {\r
+ add_action('admin_print_scripts', array($this, 'printScripts'));\r
+ add_action('admin_print_styles', array($this, 'printStyles'));\r
+ add_filter('aam_ajax_call', array($this, 'ajax'), 10, 2);\r
+ add_action(\r
+ 'aam_localization_labels', array($this, 'localizationLabels')\r
+ );\r
+\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => 'activity_log',\r
+ 'position' => 35,\r
+ 'title' => __('Activity Log', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID, aam_Control_Subject_User::UID\r
+ ),\r
+ 'controller' => $this\r
+ ));\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $username\r
+ * @param type $user\r
+ */\r
+ public function login($username, $user) {\r
+ $this->getParent()->getUser()\r
+ ->getObject(aam_Control_Object_Activity::UID)->add(\r
+ time(),\r
+ array(\r
+ 'action' => aam_Control_Object_Activity::ACTIVITY_LOGIN\r
+ )\r
+ );\r
+ }\r
+\r
+ /**\r
+ *\r
+ */\r
+ public function logout() {\r
+ $user = $this->getParent()->getUser();\r
+ $user->getObject(aam_Control_Object_Activity::UID)->add(\r
+ time(),\r
+ array(\r
+ 'action' => aam_Control_Object_Activity::ACTIVITY_LOGOUT\r
+ ));\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param aam_Control_Object_Activity $object\r
+ * @param type $object_uid\r
+ * @param type $object_id\r
+ * @return \aam_Control_Object_Activity\r
+ */\r
+ public function activityObject($object, $object_uid, $object_id) {\r
+ if ($object_uid === aam_Control_Object_Activity::UID) {\r
+ $object = new aam_Control_Object_Activity(\r
+ $this->getParent()->getUser(), $object_id\r
+ );\r
+ }\r
+\r
+ return $object;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function content() {\r
+ ob_start();\r
+ require dirname(__FILE__) . '/ui.phtml';\r
+ $content = ob_get_contents();\r
+ ob_end_clean();\r
+\r
+ return $content;\r
+ }\r
+\r
+ /**\r
+ * Print necessary scripts\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printScripts() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_script(\r
+ 'aam-activity-log-admin',\r
+ AAM_ACTIVITY_LOG_BASE_URL . '/activity.js',\r
+ array('aam-admin')\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ */\r
+ public function printStyles() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_style(\r
+ 'aam-activity-log-admin',\r
+ AAM_ACTIVITY_LOG_BASE_URL . '/activity.css'\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Add extra UI labels\r
+ *\r
+ * @param array $labels\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function localizationLabels($labels) {\r
+ $labels['Clear Logs'] = __('Clear Logs', 'aam');\r
+ $labels['Get More'] = __('Get More', 'aam');\r
+\r
+ return $labels;\r
+ }\r
+\r
+ /**\r
+ * Hanlde Ajax call\r
+ *\r
+ * @param mixed $default\r
+ * @param aam_Control_Subject $subject\r
+ *\r
+ * @return mixed\r
+ *\r
+ * @access public\r
+ */\r
+ public function ajax($default, aam_Control_Subject $subject = null) {\r
+ $this->setSubject($subject);\r
+\r
+ switch (aam_Core_Request::request('sub_action')) {\r
+ case 'activity_list':\r
+ $response = $this->getActivityList();\r
+ break;\r
+\r
+ case 'clear_activities':\r
+ $response = $this->clearActivities();\r
+ break;\r
+\r
+ default:\r
+ $response = $default;\r
+ break;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ protected function getActivityList() {\r
+ $response = array(\r
+ 'iTotalRecords' => 0,\r
+ 'iTotalDisplayRecords' => 0,\r
+ 'sEcho' => aam_Core_Request::request('sEcho'),\r
+ 'aaData' => array(),\r
+ );\r
+\r
+ $activity = $this->getSubject()->getObject(aam_Control_Object_Activity::UID);\r
+ $activities = $activity->getOption();\r
+\r
+ foreach ($activities as $user_id => $list) {\r
+ $user = new WP_User($user_id);\r
+ if ($user->ID && is_array($list)) {\r
+ foreach ($list as $time => $data) {\r
+ $response['aaData'][] = array(\r
+ $user->ID,\r
+ ($user->display_name ? $user->display_name : $user->user_nicename),\r
+ $activity->decorate($data),\r
+ date('Y-m-d H:i:s', $time)\r
+ );\r
+ }\r
+ }\r
+ }\r
+\r
+ return json_encode($response);\r
+ }\r
+\r
+ /**\r
+ * Clear the activities\r
+ *\r
+ * @global wpdb $wpdb\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ protected function clearActivities() {\r
+ $activity = $this->getSubject()->getObject(aam_Control_Object_Activity::UID);\r
+ foreach ($activity->getOption() as $user_id => $list) {\r
+ delete_user_option($user_id, 'aam_activity');\r
+ }\r
+\r
+ return json_encode(array('status' => 'success'));\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param aam_Control_Subject $subject\r
+ */\r
+ public function setSubject($subject) {\r
+ $this->_subject = $subject;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return aam_Control_Subject\r
+ */\r
+ public function getSubject() {\r
+ return $this->_subject;\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+$dirname = basename(dirname(__FILE__));\r
+define('AAM_ACTIVITY_LOG_BASE_URL', AAM_BASE_URL . 'extension/' . $dirname);\r
+\r
+require_once dirname(__FILE__) . '/extension.php';\r
+\r
+return new AAM_Extension_ActivityLog($this->getParent());
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="activity_log_content">\r
+ <table id="activity_list">\r
+ <thead>\r
+ <tr>\r
+ <th>User ID</th>\r
+ <th style="width:25%;"><?php echo __('Username', 'aam'); ?></th>\r
+ <th><?php echo __('Activity', 'aam'); ?></th>\r
+ <th style="width:30%;"><?php echo __('Time', 'aam'); ?></th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+ \r
+ <div id="clear_activity_dialog" class="aam-dialog" title="<?php echo __('Clear Activity Log', 'aam'); ?>">\r
+ <p class="dialog-content">\r
+ <?php echo __('Are you sure you want to clear activity log?', 'aam'); ?>\r
+ </p>\r
+ </div>\r
+ <div id="info_activity_dialog" class="aam-dialog" title="<?php echo __('Activity Log Info', 'aam'); ?>">\r
+ <p>\r
+ <?php echo sprintf(__('Basic version of Activity Log tracks only user\'s login and logout. Consider to purchase the <b>%s</b> Extension today to get access to advanced list of activities as well as we can develop additional activities on demand.', 'aam'), '<a href="http://wpaam.com/forum/viewtopic.php?f=7&t=91" target="_blank">AAM Activities</a>'); ?>\r
+ </p>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * AAM Multisite Support Extension\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2014 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class AAM_Extension_Multisite extends AAM_Core_Extension {\r
+\r
+ /**\r
+ *\r
+ * @var type\r
+ */\r
+ private $_subject = null;\r
+\r
+ /**\r
+ *\r
+ * @param aam|aam_View_Connector $parent\r
+ */\r
+ public function __construct(aam $parent) {\r
+ parent::__construct($parent);\r
+ if (aam_Core_API::isNetworkPanel()) {\r
+ add_action('admin_print_scripts', array($this, 'printScripts'));\r
+ add_action('admin_print_styles', array($this, 'printStyles'));\r
+ add_action('aam_localization_labels', array($this, 'localizationLabels'));\r
+ add_action('wpmu_new_blog', array($this, 'newBlog'), 10, 6);\r
+ $this->registerSubject();\r
+ } elseif (is_admin()) {\r
+ add_filter('aam_ajax_call', array($this, 'ajax'), 10, 2);\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $blog_id\r
+ * @param type $user_id\r
+ * @param type $domain\r
+ * @param type $path\r
+ * @param type $site_id\r
+ * @param type $meta\r
+ */\r
+ public function newBlog($blog_id, $user_id, $domain, $path, $site_id, $meta) {\r
+ global $wpdb;\r
+\r
+ if ($default_id = aam_Core_API::getBlogOption('aam_default_site', 0, 1)){\r
+ $default_option = $wpdb->get_blog_prefix($default_id) . 'user_roles';\r
+ $roles = aam_Core_API::getBlogOption($default_option, null, $default_id);\r
+ if ($roles){\r
+ aam_Core_API::updateBlogOption(\r
+ $wpdb->get_blog_prefix($blog_id) . 'user_roles',\r
+ $roles, $blog_id\r
+ );\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ protected function getSiteList() {\r
+ //retrieve site list first\r
+ $blog_list = $this->retrieveSiteList();\r
+\r
+ $response = array(\r
+ 'iTotalRecords' => count($blog_list),\r
+ 'iTotalDisplayRecords' => count($blog_list),\r
+ 'sEcho' => aam_Core_Request::request('sEcho'),\r
+ 'aaData' => array(),\r
+ );\r
+ $default = aam_Core_API::getBlogOption('aam_default_site', 0, 1);\r
+\r
+ foreach ($blog_list as $site) {\r
+ $blog = get_blog_details($site->blog_id);\r
+ $response['aaData'][] = array(\r
+ $site->blog_id,\r
+ get_admin_url($site->blog_id, 'admin.php'),\r
+ get_admin_url($site->blog_id, 'admin-ajax.php'),\r
+ $blog->blogname,\r
+ '',\r
+ ($site->blog_id == $default ? 1 : 0)\r
+ );\r
+ }\r
+\r
+ return json_encode($response);\r
+ }\r
+\r
+ /**\r
+ * Retieve the list of sites\r
+ *\r
+ * @return array\r
+ *\r
+ * @access public\r
+ */\r
+ public function retrieveSiteList(){\r
+ global $wpdb;\r
+\r
+ return $wpdb->get_results('SELECT blog_id FROM ' . $wpdb->blogs);\r
+ }\r
+\r
+ /**\r
+ * Register new subject Multisite\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function registerSubject() {\r
+ aam_View_Collection::registerSubject((object)array(\r
+ 'position' => 1,\r
+ 'segment' => 'multisite',\r
+ 'label' => __('Sites', 'aam'),\r
+ 'title' => __('Site Manager', 'aam'),\r
+ 'class' => 'manager-item manager-item-multisite',\r
+ 'uid' => 'multisite',\r
+ 'controller' => $this\r
+ ));\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function content() {\r
+ ob_start();\r
+ require dirname(__FILE__) . '/ui.phtml';\r
+ $content = ob_get_contents();\r
+ ob_end_clean();\r
+\r
+ return $content;\r
+ }\r
+\r
+ /**\r
+ * Print necessary scripts\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printScripts() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_script(\r
+ 'aam-multisite-admin',\r
+ AAM_MULTISITE_BASE_URL . '/multisite.js',\r
+ array('aam-admin')\r
+ );\r
+ $localization = array(\r
+ 'nonce' => wp_create_nonce('aam_ajax'),\r
+ 'addSiteURI' => admin_url('network/site-new.php'),\r
+ 'editSiteURI' => admin_url('network/site-info.php')\r
+ );\r
+\r
+ wp_localize_script(\r
+ 'aam-multisite-admin', 'aamMultisiteLocal', $localization\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ */\r
+ public function printStyles() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_style(\r
+ 'aam-multisite-admin', AAM_MULTISITE_BASE_URL . '/multisite.css'\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $labels\r
+ * @return type\r
+ */\r
+ public function localizationLabels($labels) {\r
+ $labels['Set Default'] = __('Set Default', 'aam');\r
+ $labels['Unset Default'] = __('Unset Default', 'aam');\r
+ $labels['Set as Default'] = __('Set as Default', 'aam');\r
+\r
+ return $labels;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $default\r
+ * @param aam_Control_Subject $subject\r
+ * @return type\r
+ */\r
+ public function ajax($default, aam_Control_Subject $subject = null) {\r
+ $this->setSubject($subject);\r
+\r
+ switch (aam_Core_Request::request('sub_action')) {\r
+ case 'site_list':\r
+ $response = $this->getSiteList();\r
+ break;\r
+\r
+ case 'pin_site':\r
+ $response = $this->pinSite();\r
+ break;\r
+\r
+ case 'unpin_site':\r
+ $response = $this->unpinSite();\r
+ break;\r
+\r
+ default:\r
+ $response = $default;\r
+ break;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ protected function pinSite() {\r
+ return json_encode(array(\r
+ 'status' => aam_Core_API::updateBlogOption(\r
+ 'aam_default_site', aam_Core_Request::post('blog'), 1\r
+ ) ? 'success' : 'failure'\r
+ ));\r
+ }\r
+\r
+ protected function unpinSite() {\r
+ return json_encode(array(\r
+ 'status' => aam_Core_API::deleteBlogOption('aam_default_site', 1) ? 'success' : 'failure'\r
+ ));\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $subject\r
+ */\r
+ public function setSubject($subject) {\r
+ $this->_subject = $subject;\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function getSubject() {\r
+ return $this->_subject;\r
+ }\r
+\r
+}\r
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+$dirname = basename(dirname(__FILE__));\r
+define('AAM_MULTISITE_BASE_URL', AAM_BASE_URL . 'extension/' . $dirname);\r
+\r
+require_once dirname(__FILE__) . '/extension.php';\r
+\r
+return new AAM_Extension_Multisite($this->getParent());
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/** CONTROL MANAGER STYLES **/
+.manager-item-multisite{
+ background-image: url('images/multisite.png');
+}
+
+.manager-item-multisite-active{
+ background-image: url('images/multisite-active.png');
+}
+
+.multisite-top-actions{
+ float: right;
+ display: inline-table;
+ width: auto;
+ text-align: right;
+}
+
+.multisite-top-action{
+ width: 24px;
+ height: 24px;
+ display: table-cell;
+ text-indent: -9999px;
+ padding-right: 10px;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+.multisite-top-action-add{
+ background-image: url('images/add.png');
+}
+
+.multisite-top-action-add:hover{
+ background-image: url('images/add-active.png');
+}
+
+.multisite-top-action-refresh{
+ background-image: url('images/refresh.png');
+}
+
+.multisite-top-action-refresh:hover{
+ background-image: url('images/refresh-active.png');
+}
+
+.multisite-actions{
+ width: 100%;
+ display: table;
+}
+
+.multisite-action{
+ width: 16px;
+ height: 16px;
+ display: table-cell;
+ text-indent: -9999px;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+.multisite-action-manage{
+ background-image: url('images/manage.png');
+}
+
+.multisite-action-manage:hover{
+ background-image: url('images/manage-active.png');
+}
+
+.multisite-action-manage-active{
+ background-image: url('images/manage-active.png');
+}
+
+.multisite-action-pin{
+ background-image: url('images/pin.png');
+}
+
+.multisite-action-pin-active{
+ background-image: url('images/pin-active.png');
+}
+
+.multisite-action-pin:hover{
+ background-image: url('images/pin-active.png');
+}
+
+.multisite-action-edit{
+ background-image: url('images/edit.png');
+}
+
+.multisite-action-edit:hover{
+ background-image: url('images/edit-active.png');
+}
+
+.aam-multisite-bold{
+ font-weight: bold;
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+AAM.prototype.site_id = 1;
+AAM.prototype.segmentTables.siteList = null;
+
+AAM.prototype.reloadSite = function(site_id, siteurl, ajaxurl) {
+ var _this = this;
+ this.site_id = site_id;
+ aamLocal.siteURI = siteurl;
+ aamLocal.ajaxurl = ajaxurl;
+
+ //reset default values for current subjects
+ this.setSubject('role', aamLocal.defaultSegment.role);
+
+ this.retrieveSettings();
+
+ //highlight the active site
+ jQuery('#site_list .aam-multisite-bold').removeClass('aam-multisite-bold');
+ jQuery('#site_list .multisite-action-manage-active').each(function() {
+ _this.terminate(jQuery(this), 'multisite-action-manage');
+ });
+ var nRow = jQuery('#site_list tr[site="' + site_id + '"]');
+ jQuery('td:eq(0)', nRow).addClass('aam-multisite-bold');
+ this.launch(jQuery('.multisite-action-manage', nRow), 'multisite-action-manage');
+
+ //reload all segmentTables
+ for (var i in this.segmentTables) {
+ if (this.segmentTables[i] !== null) {
+ this.segmentTables[i].fnDraw();
+ }
+ }
+};
+
+AAM.prototype.loadMultisiteSegment = function() {
+ var _this = this;
+
+ if (typeof this.siteList === 'undefined') {
+ this.siteList = jQuery('#site_list').dataTable({
+ sDom: "<'top'f<'multisite-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
+ bServerSide: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ sAjaxSource: ajaxurl,
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'site_list'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ aoData.push({
+ name: 's',
+ value: jQuery('#site_list_filter input').val()
+ });
+ },
+ fnInitComplete: function() {
+ var add = jQuery('<a/>', {
+ 'href': aamMultisiteLocal.addSiteURI,
+ 'target': '_blank',
+ 'class': 'multisite-top-action multisite-top-action-add',
+ 'aam-tooltip': aamLocal.labels['Add New Site']
+ });
+ jQuery('#site_list_wrapper .multisite-top-actions').append(add);
+
+ var refresh = jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'multisite-top-action multisite-top-action-refresh',
+ 'aam-tooltip': aamLocal.labels['Refresh']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.siteList.fnDraw();
+ });
+ jQuery('#site_list_wrapper .multisite-top-actions').append(refresh);
+
+ _this.initTooltip(jQuery('#site_list_wrapper .site-top-actions'));
+ },
+ fnDrawCallback: function() {
+ jQuery('#multisite_list_wrapper .clear-table-filter').bind('click', function(event) {
+ event.preventDefault();
+ jQuery('#multisite_list_filter input').val('');
+ _this.siteList.fnFilter('');
+ });
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1, 2, 4]
+ }
+ ],
+ fnRowCallback: function(nRow, aData) { //format data
+ jQuery('td:eq(1)', nRow).html(jQuery('<div/>', {
+ 'class': 'multisite-actions'
+ })); //
+ //add role attribute
+ jQuery(nRow).attr('site', aData[0]);
+
+ if (parseInt(aData[0]) === _this.site_id) {
+ jQuery('.current-site').html(aData[3] + ':');
+ jQuery('td:eq(0)', nRow).addClass('aam-multisite-bold');
+ var current = true;
+ } else {
+ current = false;
+ }
+
+ jQuery('.multisite-actions', nRow).empty();
+ jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'multisite-action multisite-action-manage' + (current ? '-active' : ''),
+ 'aam-tooltip': aamLocal.labels['Manage']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ //change title
+ jQuery('.current-site').html(aData[3] + ':');
+ _this.reloadSite(aData[0], aData[1], aData[2]);
+ }));
+
+ var def_site = (parseInt(aData[5]) === 1 ? true : false);
+
+ jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'multisite-action multisite-action-pin' + (def_site ? '-active' : ''),
+ 'aam-tooltip': (def_site ? aamLocal.labels['Unset Default'] : aamLocal.labels['Set as Default'])
+ }).bind('click', function(event) {
+ event.preventDefault();
+ var button = this;
+
+ if (def_site) {
+ var unpin_data = _this.compileAjaxPackage('unpin_site', false);
+ unpin_data.blog = aData[0];
+ jQuery.ajax(ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: unpin_data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.siteList.fnDraw();
+ }
+ _this.highlight('.control-manager-content', response.status);
+ },
+ error: function() {
+ _this.highlight('.control-manager-content', 'failure');
+ }
+ });
+ } else {
+ jQuery('#default_site').html(aData[3]);
+ var pin_data = _this.compileAjaxPackage('pin_site', false);
+ pin_data.blog = aData[0];
+
+ var buttons = {};
+ buttons[aamLocal.labels['Set Default']] = function() {
+ jQuery.ajax(ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: pin_data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.siteList.fnDraw();
+ }
+ _this.highlight('.control-manager-content', response.status);
+ },
+ error: function() {
+ _this.highlight('.control-manager-content', 'failure');
+ },
+ complete: function() {
+ jQuery("#tap_default_site").dialog("close");
+ }
+ });
+ jQuery("#tap_default_site").dialog("close");
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery("#tap_default_site").dialog("close");
+ };
+
+ jQuery("#tap_default_site").dialog({
+ resizable: false,
+ height: 'auto',
+ modal: true,
+ buttons: buttons
+ });
+ }
+ }));
+
+ jQuery('.multisite-actions', nRow).append(jQuery('<a/>', {
+ 'href': aamMultisiteLocal.editSiteURI + '?id=' + aData[0],
+ 'class': 'multisite-action multisite-action-edit',
+ 'target': '_blank',
+ 'aam-tooltip': aamLocal.labels['Edit']
+ }));
+
+ _this.initTooltip(nRow);
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+ }
+
+ jQuery('#multisite_manager_wrap').show();
+};
+
+jQuery(document).ready(function() {
+ aamInterface.addAction('aam_load_segment', function() {
+ aamInterface.loadMultisiteSegment();
+ });
+ //by default load the Multisite panel first
+ aamInterface.loadSegment('multisite');
+});
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div id="multisite_manager_wrap">\r
+ <table id="site_list">\r
+ <thead>\r
+ <tr>\r
+ <th>Site ID</th>\r
+ <th>Site URL</th>\r
+ <th>Site Ajax URL</th>\r
+ <th width="65%"><?php echo __('Site', 'aam'); ?></th>\r
+ <th><?php echo __('Action', 'aam'); ?></th>\r
+ <th>Default</th>\r
+ </tr>\r
+ </thead>\r
+ <tbody></tbody>\r
+ </table>\r
+ <div id="tap_default_site" class="aam-dialog" title="<?php echo __('Set Default Site', 'aam'); ?>">\r
+ <p class="dialog-content">\r
+ <?php echo __('Would you like to set the site', 'aam'); ?> <b><span id="default_site"></span></b> <?php echo __('as default?', 'aam'); ?>\r
+ </p>\r
+ <p class="dialog-note">\r
+ <?php echo __('All newly created sites will inherit list of Roles & Capabilities.', 'aam'); ?>\r
+ </p>\r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * My Feature View Controller\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class AAM_Extension_MyFeature extends AAM_Core_Extension {\r
+\r
+ /**\r
+ * Constructor\r
+ *\r
+ * @param aam $parent\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct(aam $parent) {\r
+ parent::__construct($parent);\r
+\r
+ if (is_admin()) {\r
+ $this->registerFeature();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Register feature\r
+ *\r
+ * @return void\r
+ *\r
+ * @access protected\r
+ */\r
+ protected function registerFeature() {\r
+ //add feature\r
+ $capability = aam_Core_ConfigPress::getParam(\r
+ 'aam.feature.my_feature.capability', 'administrator'\r
+ );\r
+\r
+ if (current_user_can($capability)) {\r
+ add_action('admin_print_scripts', array($this, 'printScripts'));\r
+ add_action('admin_print_styles', array($this, 'printStyles'));\r
+ aam_View_Collection::registerFeature((object)array(\r
+ 'uid' => 'my_feature',\r
+ 'position' => 100,\r
+ 'title' => __('My Feature', 'aam'),\r
+ 'subjects' => array(\r
+ aam_Control_Subject_Role::UID,\r
+ aam_Control_Subject_User::UID,\r
+ aam_Control_Subject_Visitor::UID\r
+ ),\r
+ 'controller' => $this\r
+ ));\r
+ }\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @return type\r
+ */\r
+ public function content() {\r
+ ob_start();\r
+ require dirname(__FILE__) . '/ui.phtml';\r
+ $content = ob_get_contents();\r
+ ob_end_clean();\r
+\r
+ return $content;\r
+ }\r
+\r
+ /**\r
+ * Print necessary scripts\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printScripts() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_script(\r
+ 'aam-my-feature-admin',\r
+ AAM_MY_FEATURE_BASE_URL . '/my_feature.js',\r
+ array('aam-admin')\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Register stylesheets\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printStyles() {\r
+ if ($this->getParent()->isAAMScreen()) {\r
+ wp_enqueue_style(\r
+ 'aam-my-feature-admin',\r
+ AAM_MY_FEATURE_BASE_URL . '/my_feature.css'\r
+ );\r
+ }\r
+ }\r
+\r
+}
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+$dirname = basename(dirname(__FILE__));\r
+define('AAM_MY_FEATURE_BASE_URL', AAM_BASE_URL . 'extension/' . $dirname);\r
+\r
+require_once dirname(__FILE__) . '/extension.php';\r
+\r
+return new AAM_Extension_MyFeature($this->getParent());
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+.my-feature-banner{
+ width: 100%;
+ background: transparent url('images/worker.png') no-repeat center 10px;
+ padding-top: 150px;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+}
+
+.my-feature-banner .banner-style{
+ margin: 0px 10px;
+ font-family: "Trebuchet MS", Helvetica, sans-serif;
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+AAM.prototype.myFeature = function() {
+ //Send Email to Us
+ jQuery('.my-feature-message-action').bind('click', function(event) {
+ event.preventDefault();
+ jQuery('#aam_message').trigger('click');
+ });
+};
+
+jQuery(document).ready(function() {
+ aamInterface.addAction('aam_init_features', function() {
+ aamInterface.myFeature();
+ });
+});
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+?>\r
+<div class="feature-content-container" id="my_feature_content">\r
+ <div class="my-feature-banner">\r
+ <p class="banner-style">\r
+ <?php echo __('Do you need a custom feature?', 'aam'); ?>\r
+ <a href="https://github.com/wpaam/AAM-Feature-Example" target="_blank">\r
+ <?php echo __('Create your own extension ', 'aam'); ?>\r
+ </a> <?php echo __('or ask us and we will develop it for you.', 'aam'); ?>\r
+ </p> \r
+ </div>\r
+</div>
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ * Feature Secure\r
+ * \r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class AAM_Secure extends AAM_Core_Extension {\r
+\r
+ /**\r
+ * Unique Feature ID\r
+ */\r
+ const FEATURE_ID = 'secure';\r
+\r
+ /**\r
+ *\r
+ * @var type \r
+ */\r
+ private $_cache = array();\r
+\r
+ /**\r
+ *\r
+ * @var type \r
+ */\r
+ private $_cacheLimit = 1000;\r
+\r
+ /**\r
+ *\r
+ * @var type \r
+ */\r
+ private $_stats = array();\r
+\r
+ /**\r
+ * Constructor\r
+ *\r
+ * @param aam $parent Main AAM object\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function __construct(aam $parent) {\r
+ parent::__construct($parent);\r
+\r
+ if (is_admin()) {\r
+ //print required JS & CSS\r
+ add_action('admin_print_scripts', array($this, 'printScripts'));\r
+ add_action('admin_print_styles', array($this, 'printStyles'));\r
+ add_action('admin_head', array($this, 'adminHead'));\r
+\r
+ //manager Admin Menu\r
+ if (aam_Core_API::isNetworkPanel()) {\r
+ add_action('network_admin_menu', array($this, 'adminMenu'), 999);\r
+ } else {\r
+ add_action('admin_menu', array($this, 'adminMenu'), 999);\r
+ }\r
+ //manager AAM Ajax Requests\r
+ add_action('wp_ajax_aam_security', array($this, 'ajax'));\r
+ }\r
+\r
+ add_filter('wp_login_errors', array($this, 'loginFailure'), 10, 2);\r
+ add_action('wp_login', array($this, 'login'), 10, 2);\r
+\r
+ //add_filter('authenticate', array($this, 'authenticate'), 999, 3);\r
+ }\r
+\r
+ /**\r
+ *\r
+ * @param type $username\r
+ * @param type $user\r
+ */\r
+ public function login($username, $user) {\r
+ $this->_cache = aam_Core_API::getBlogOption(\r
+ 'aam_security_login_cache', array()\r
+ );\r
+ $ip = aam_Core_Request::server('REMOTE_ADDR');\r
+ if ($this->hasIPCache($ip)) {\r
+ $data = $this->getIPCache($ip);\r
+ $data->attempts = 0; //reset counter\r
+ $this->addIPCache($ip, $data);\r
+ aam_Core_API::updateBlogOption(\r
+ 'aam_security_login_cache', $this->_cache\r
+ );\r
+ }\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function isGeoLookupOn() {\r
+ $geo_lookup = aam_Core_ConfigPress::getParam(\r
+ 'security.login.geo_lookup', 'false'\r
+ );\r
+\r
+ return ($geo_lookup == 'true' ? true : false);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function isLoginLockoutOn() {\r
+ $login_lock = aam_Core_ConfigPress::getParam(\r
+ 'security.login.lockout', 'false'\r
+ );\r
+\r
+ return ($login_lock == 'true' ? true : false);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $errors\r
+ * @param type $redirect_to\r
+ */\r
+ public function loginFailure($errors, $redirect_to) {\r
+ $this->_cache = aam_Core_API::getBlogOption(\r
+ 'aam_security_login_cache', array()\r
+ );\r
+ $this->_cacheLimit = aam_Core_ConfigPress::getParam(\r
+ 'security.login.cache_limit', 1000\r
+ );\r
+ if ($this->isGeoLookupOn()) {\r
+ $this->_stats = aam_Core_API::getBlogOption(\r
+ 'aam_security_login_stats', array()\r
+ );\r
+ $info = $this->retrieveGeoData();\r
+ if ($info instanceof stdClass) {\r
+ if (!isset($this->_stats[$info->countryCode])) {\r
+ $this->_stats[$info->countryCode] = array(\r
+ 'failed' => 0\r
+ );\r
+ }\r
+ $this->_stats[$info->countryCode]['failed']++;\r
+ aam_Core_API::updateBlogOption(\r
+ 'aam_security_login_stats', $this->_stats\r
+ );\r
+ }\r
+ }\r
+ if ($this->isLoginLockoutOn()) {\r
+ $this->loginLockout();\r
+ }\r
+ aam_Core_API::updateBlogOption(\r
+ 'aam_security_login_cache', $this->_cache\r
+ );\r
+\r
+ return $errors;\r
+ }\r
+\r
+ /**\r
+ * \r
+ */\r
+ protected function loginLockout() {\r
+ $ip = aam_Core_Request::server('REMOTE_ADDR');\r
+ if ($this->hasIPCache($ip)) {\r
+ $info = $this->getIPCache($ip);\r
+ } else {\r
+ $info = new stdClass;\r
+ }\r
+\r
+ if (!isset($info->attempts)) {\r
+ $info->attempts = 1;\r
+ } else {\r
+ $info->attempts++;\r
+ }\r
+ $threshold = aam_Core_ConfigPress::getParam(\r
+ 'security.login.attempts', 10\r
+ );\r
+ if ($info->attempts >= $threshold) {\r
+ $action = aam_Core_ConfigPress::getParam(\r
+ 'security.login.attempt_failure', 'slowdown'\r
+ );\r
+ switch ($action) {\r
+ case 'slowdown':\r
+ $time = aam_Core_ConfigPress::getParam(\r
+ 'security.login.slowdown_time', '5'\r
+ );\r
+ sleep(intval($time));\r
+ break;\r
+\r
+ case 'die':\r
+ wp_die(aam_Core_ConfigPress::getParam(\r
+ 'security.login.die_message', 'You are not allowed to login'\r
+ ));\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return null\r
+ */\r
+ protected function retrieveGeoData() {\r
+ $ip = aam_Core_Request::server('REMOTE_ADDR');\r
+ if ($this->hasIPCache($ip)) {\r
+ $location = $this->getIPCache($ip);\r
+ } else {\r
+ $service = aam_Core_ConfigPress::getParam(\r
+ 'security.login.geoip.service', 'FreeGeoIP'\r
+ );\r
+ $filename = dirname(__FILE__) . '/geoip/' . strtolower($service) . '.php';\r
+\r
+ if (file_exists($filename)) {\r
+ require_once($filename);\r
+ $location = call_user_func("{$service}::query", $ip);\r
+ $this->addIPCache($ip, $location);\r
+ } else {\r
+ $location = null;\r
+ }\r
+ }\r
+\r
+ return $location;\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $ip\r
+ * @return type\r
+ */\r
+ protected function hasIPCache($ip) {\r
+ return (isset($this->_cache[$ip]) ? true : false);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $ip\r
+ * @return type\r
+ */\r
+ protected function getIPCache($ip) {\r
+ return ($this->hasIPCache($ip) ? $this->_cache[$ip] : null);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $ip\r
+ * @param type $data\r
+ */\r
+ protected function addIPCache($ip, $data) {\r
+ if (!is_null($data)) {\r
+ if ((count($this->_cache) >= $this->_cacheLimit) && !isset($this->_cache[$ip])) {\r
+ array_shift($this->_cache);\r
+ }\r
+ $this->_cache[$ip] = $data;\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Print necessary styles\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printStyles() {\r
+ if ($this->isSecurityScreen()) {\r
+ wp_enqueue_style('dashboard');\r
+ wp_enqueue_style('global');\r
+ wp_enqueue_style('wp-admin');\r
+ wp_enqueue_style('aam-ui-style', AAM_MEDIA_URL . 'css/jquery-ui.css');\r
+ wp_enqueue_style('aam-common-style', AAM_MEDIA_URL . 'css/common.css');\r
+ wp_enqueue_style('aam-security-style', AAM_SECURITY_BASE_URL . '/stylesheet/security.css');\r
+ if ($this->isGeoLookupOn()) {\r
+ wp_enqueue_style('aam-datatable', AAM_MEDIA_URL . 'css/jquery.dt.css');\r
+ wp_enqueue_style('aam-country-flags', AAM_SECURITY_BASE_URL . '/stylesheet/flags32.css');\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Print necessary scripts\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function printScripts() {\r
+ if ($this->isSecurityScreen()) {\r
+ wp_enqueue_script('postbox');\r
+ wp_enqueue_script('dashboard');\r
+ if ($this->isGeoLookupOn()) {\r
+ wp_enqueue_script('aam-datatable', AAM_MEDIA_URL . 'js/jquery.dt.js');\r
+ wp_enqueue_script('google-jsapi', 'https://www.google.com/jsapi');\r
+ }\r
+ wp_enqueue_script('aam-security', AAM_SECURITY_BASE_URL . '/javascript/security.js');\r
+ $localization = array(\r
+ 'nonce' => wp_create_nonce('aam_ajax'),\r
+ 'ajaxurl' => admin_url('admin-ajax.php'),\r
+ );\r
+ wp_localize_script('aam-security', 'aamLocal', $localization);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * \r
+ */\r
+ public function adminHead() {\r
+ if ($this->isSecurityScreen() && $this->isGeoLookupOn()) {\r
+ echo '<script type="text/javascript">';\r
+ echo file_get_contents(__DIR__ . '/javascript/loader.js');\r
+ echo '</script>';\r
+ }\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function isSecurityScreen() {\r
+ return (aam_Core_Request::get('page') == 'aam-security' ? true : false);\r
+ }\r
+\r
+ /**\r
+ * Register Admin Menu\r
+ *\r
+ * @return void\r
+ *\r
+ * @access public\r
+ */\r
+ public function adminMenu() {\r
+ //register submenus\r
+ add_submenu_page(\r
+ 'aam', __('Security', 'aam'), __('Security', 'aam'), aam_Core_ConfigPress::getParam(\r
+ 'aam.page.security.capability', 'administrator'\r
+ ), 'aam-security', array($this, 'content')\r
+ );\r
+ }\r
+\r
+ /**\r
+ * \r
+ */\r
+ public function content() {\r
+ require_once(dirname(__FILE__) . '/security.php');\r
+ $security = new aam_View_Security();\r
+ echo $security->run();\r
+ }\r
+\r
+ public function ajax() {\r
+ check_ajax_referer('aam_ajax');\r
+\r
+ //clean buffer to make sure that nothing messing around with system\r
+ while (@ob_end_clean());\r
+\r
+ //process ajax request\r
+ try {\r
+ require_once(dirname(__FILE__) . '/security.php');\r
+ $model = new aam_View_Security();\r
+ echo $model->processAjax();\r
+ } catch (Exception $e) {\r
+ echo '-1';\r
+ }\r
+ die();\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @param type $user\r
+ * @param type $username\r
+ * @param type $password\r
+ * @return type\r
+ */\r
+ public function authenticate($user, $username, $password) {\r
+ if (!is_wp_error($user)) {\r
+ $login_history = get_user_meta($user->ID, 'aam_login_history', true);\r
+ $ip = aam_Core_Request::server('REMOTE_ADDR');\r
+ }\r
+\r
+ return $user;\r
+ }\r
+\r
+}\r
--- /dev/null
+<?php\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+*/\r
+\r
+require_once(dirname(__FILE__) . '/geoip.php');\r
+\r
+class FreeGeoIP extends GeoIP {\r
+\r
+ public static function query($ip) {\r
+ $response = aam_Core_API::cURL('http://freegeoip.net/xml/' . $ip, false, true);\r
+ if ($response['status'] == 'success') {\r
+ $data = simplexml_load_string($response['content']);\r
+ $geodata = (object) array(\r
+ 'countryCode' => (string) $data->CountryCode,\r
+ 'countryName' => (string) $data->CountryName,\r
+ 'region' => (string) $data->RegionCode,\r
+ 'city' => (string) $data->City,\r
+ 'zip' => (string) $data->ZipCode\r
+ );\r
+ } else {\r
+ $geodata = null;\r
+ }\r
+ \r
+ return $geodata;\r
+ } \r
+\r
+}\r
--- /dev/null
+<?php\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+*/\r
+\r
+abstract class GeoIP {\r
+\r
+ public static function query($ip) {\r
+ \r
+ }\r
+\r
+}\r
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+*/\r
+\r
+$dirname = basename(dirname(__FILE__));\r
+define('AAM_SECURITY_BASE_URL', AAM_BASE_URL . 'extension/' . $dirname);\r
+\r
+\r
+//load the Extension Controller\r
+require_once dirname(__FILE__) . '/extension.php';\r
+\r
+return new AAM_Secure($this->getParent());
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+google.load('visualization', '1', {'packages': ['geochart']});
+google.setOnLoadCallback(drawRegionsMap);
+
+function drawRegionsMap() {
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: {
+ action: 'aam_security',
+ sub_action: 'map_data',
+ _ajax_nonce: aamLocal.nonce
+ },
+ success: function(response) {
+ var list = new Array();
+ list.push(['Country', 'Failed Attempts']);
+ for (var i in response.list) {
+ list.push(response.list[i]);
+ }
+ var data = google.visualization.arrayToDataTable(list);
+
+ var options = {
+ colorAxis: {colors: ['#4374e0', '#e7711c']} // orange to blue
+ };
+ var chart = new google.visualization.GeoChart(
+ document.getElementById('geo_map')
+ );
+ chart.draw(data, options);
+ },
+ failure: function() {
+
+ }
+ });
+
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+*/
+
+function AAMSecurity() {
+
+}
+
+AAMSecurity.prototype.init = function() {
+ var _this = this;
+
+ if (jQuery('#country_list').length) {
+ jQuery('#country_list').dataTable({
+ sDom: "t",
+ bAutoWidth: false,
+ bSort: false,
+ aoColumnDefs: [
+ {
+ sClass: 'center',
+ aTargets: [1]
+ }
+ ]
+ });
+ }
+
+ jQuery('.aam-icon', '.large-icons-row').each(function(){
+ jQuery(this).bind('click', function(){
+ _this.switchMode(jQuery(this).attr('mode'));
+ });
+ });
+ jQuery('#setting_trigger_inline').bind('click', function(event){
+ event.preventDefault();
+ _this.switchMode('settings');
+ });
+};
+
+AAMSecurity.prototype.switchMode = function(mode) {
+ jQuery('.mode-container').hide();
+ jQuery('#' + mode + '_mode').show();
+};
+
+jQuery(document).ready(function() {
+ var security = new AAMSecurity();
+ security.init();
+});
\ No newline at end of file
--- /dev/null
+<?php\r
+\r
+/**\r
+ * ======================================================================\r
+ * LICENSE: This file is subject to the terms and conditions defined in *\r
+ * file 'license.txt', which is part of this source code package. *\r
+ * ======================================================================\r
+ */\r
+\r
+/**\r
+ *\r
+ * @package AAM\r
+ * @author Vasyl Martyniuk <support@wpaam.com>\r
+ * @copyright Copyright C 2013 Vasyl Martyniuk\r
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}\r
+ */\r
+class aam_View_Security extends aam_View_Abstract {\r
+\r
+ /**\r
+ * Run the Manager\r
+ *\r
+ * @return string\r
+ *\r
+ * @access public\r
+ */\r
+ public function run() {\r
+ return $this->loadTemplate(dirname(__FILE__) . '/view/security.phtml');\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function processAjax() {\r
+ switch (aam_Core_Request::post('sub_action')) {\r
+ case 'map_data':\r
+ $response = $this->getMapData();\r
+ break;\r
+\r
+ default:\r
+ $response = json_encode(array('status' => 'failure'));\r
+ break;\r
+ }\r
+\r
+ return $response;\r
+ }\r
+\r
+ protected function getMapData() {\r
+ $stats = aam_Core_API::getBlogOption(\r
+ 'aam_security_login_stats', array()\r
+ );\r
+ $list = array();\r
+ foreach($stats as $country => $data){\r
+ $list[] = array($country, $data['failed']);\r
+ }\r
+ return json_encode(\r
+ array('list' => $list)\r
+ );\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function isGeoLookupOn() {\r
+ $geo_lookup = aam_Core_ConfigPress::getParam(\r
+ 'security.login.geo_lookup', 'false'\r
+ );\r
+\r
+ return ($geo_lookup == 'true' ? true : false);\r
+ }\r
+\r
+ /**\r
+ * \r
+ * @return type\r
+ */\r
+ public function isLoginLockoutOn() {\r
+ $login_lock = aam_Core_ConfigPress::getParam(\r
+ 'security.login.lockout', 'false'\r
+ );\r
+\r
+ return ($login_lock == 'true' ? true : false);\r
+ }\r
+\r
+}\r
--- /dev/null
+.flag{
+ display:block;
+ height:32px;
+ min-width:32px;
+ vertical-align: middle;
+ line-height:32px;
+ background:url(images/flags32.png) no-repeat 0 center;
+ padding-left: 36px;
+}
+._African_Union{background-position:0 -32px;}
+._Arab_League{background-position:0 -64px;}
+._ASEAN{background-position:0 -96px;}
+._CARICOM{background-position:0 -128px;}
+._CIS{background-position:0 -160px;}
+._Commonwealth{background-position:0 -192px;}
+._England{background-position:0 -224px;}
+._European_Union, .eu{background-position:0 -256px;}
+._Islamic_Conference{background-position:0 -288px;}
+._Kosovo{background-position:0 -320px;}
+._NATO{background-position:0 -352px;}
+._Northern_Cyprus{background-position:0 -384px;}
+._Northern_Ireland{background-position:0 -416px;}
+._Olimpic_Movement{background-position:0 -448px;}
+._OPEC{background-position:0 -480px;}
+._Red_Cross{background-position:0 -512px;}
+._Scotland{background-position:0 -544px;}
+._Somaliland{background-position:0 -576px;}
+._Tibet{background-position:0 -608px;}
+._United_Nations{background-position:0 -640px;}
+._Wales{background-position:0 -672px;}
+.ad{background-position:0 -704px;}
+.ae{background-position:0 -736px;}
+.af{background-position:0 -768px;}
+.ag{background-position:0 -800px;}
+.ai{background-position:0 -832px;}
+.al{background-position:0 -864px;}
+.am{background-position:0 -896px;}
+.ao{background-position:0 -928px;}
+.aq{background-position:0 -960px;}
+.ar{background-position:0 -992px;}
+.as{background-position:0 -1024px;}
+.at{background-position:0 -1056px;}
+.au{background-position:0 -1088px;}
+.aw{background-position:0 -1120px;}
+.ax{background-position:0 -1152px;}
+.az{background-position:0 -1184px;}
+.ba{background-position:0 -1216px;}
+.bb{background-position:0 -1248px;}
+.bd{background-position:0 -1280px;}
+.be{background-position:0 -1312px;}
+.bf{background-position:0 -1344px;}
+.bg{background-position:0 -1376px;}
+.bh{background-position:0 -1408px;}
+.bi{background-position:0 -1440px;}
+.bj{background-position:0 -1472px;}
+.bm{background-position:0 -1504px;}
+.bn{background-position:0 -1536px;}
+.bo{background-position:0 -1568px;}
+.br{background-position:0 -1600px;}
+.bs{background-position:0 -1632px;}
+.bt{background-position:0 -1664px;}
+.bw{background-position:0 -1696px;}
+.by{background-position:0 -1728px;}
+.bz{background-position:0 -1760px;}
+.ca{background-position:0 -1792px;}
+.cd{background-position:0 -1824px;}
+.cf{background-position:0 -1856px;}
+.cg{background-position:0 -1888px;}
+.ch{background-position:0 -1920px;}
+.ci{background-position:0 -1952px;}
+.ck{background-position:0 -1984px;}
+.cl{background-position:0 -2016px;}
+.cm{background-position:0 -2048px;}
+.cn{background-position:0 -2080px;}
+.co{background-position:0 -2112px;}
+.cr{background-position:0 -2144px;}
+.cu{background-position:0 -2176px;}
+.cv{background-position:0 -2208px;}
+.cy{background-position:0 -2240px;}
+.cz{background-position:0 -2272px;}
+.de{background-position:0 -2304px;}
+.dj{background-position:0 -2336px;}
+.dk{background-position:0 -2368px;}
+.dm{background-position:0 -2400px;}
+.do{background-position:0 -2432px;}
+.dz{background-position:0 -2464px;}
+.ec{background-position:0 -2496px;}
+.ee{background-position:0 -2528px;}
+.eg{background-position:0 -2560px;}
+.eh{background-position:0 -2592px;}
+.er{background-position:0 -2624px;}
+.es{background-position:0 -2656px;}
+.et{background-position:0 -2688px;}
+.fi{background-position:0 -2720px;}
+.fj{background-position:0 -2752px;}
+.fm{background-position:0 -2784px;}
+.fo{background-position:0 -2816px;}
+.fr{background-position:0 -2848px;}
+.bl, .cp, .mf, .yt{background-position:0 -2848px;}
+.ga{background-position:0 -2880px;}
+.gb{background-position:0 -2912px;}
+.sh{background-position:0 -2912px;}
+.gd{background-position:0 -2944px;}
+.ge{background-position:0 -2976px;}
+.gg{background-position:0 -3008px;}
+.gh{background-position:0 -3040px;}
+.gi{background-position:0 -3072px;}
+.gl{background-position:0 -3104px;}
+.gm{background-position:0 -3136px;}
+.gn{background-position:0 -3168px;}
+.gp{background-position:0 -3200px;}
+.gq{background-position:0 -3232px;}
+.gr{background-position:0 -3264px;}
+.gt{background-position:0 -3296px;}
+.gu{background-position:0 -3328px;}
+.gw{background-position:0 -3360px;}
+.gy{background-position:0 -3392px;}
+.hk{background-position:0 -3424px;}
+.hn{background-position:0 -3456px;}
+.hr{background-position:0 -3488px;}
+.ht{background-position:0 -3520px;}
+.hu{background-position:0 -3552px;}
+.id{background-position:0 -3584px;}
+.mc{background-position:0 -3584px;}
+.ie{background-position:0 -3616px;}
+.il{background-position:0 -3648px;}
+.im{background-position:0 -3680px;}
+.in{background-position:0 -3712px;}
+.iq{background-position:0 -3744px;}
+.ir{background-position:0 -3776px;}
+.is{background-position:0 -3808px;}
+.it{background-position:0 -3840px;}
+.je{background-position:0 -3872px;}
+.jm{background-position:0 -3904px;}
+.jo{background-position:0 -3936px;}
+.jp{background-position:0 -3968px;}
+.ke{background-position:0 -4000px;}
+.kg{background-position:0 -4032px;}
+.kh{background-position:0 -4064px;}
+.ki{background-position:0 -4096px;}
+.km{background-position:0 -4128px;}
+.kn{background-position:0 -4160px;}
+.kp{background-position:0 -4192px;}
+.kr{background-position:0 -4224px;}
+.kw{background-position:0 -4256px;}
+.ky{background-position:0 -4288px;}
+.kz{background-position:0 -4320px;}
+.la{background-position:0 -4352px;}
+.lb{background-position:0 -4384px;}
+.lc{background-position:0 -4416px;}
+.li{background-position:0 -4448px;}
+.lk{background-position:0 -4480px;}
+.lr{background-position:0 -4512px;}
+.ls{background-position:0 -4544px;}
+.lt{background-position:0 -4576px;}
+.lu{background-position:0 -4608px;}
+.lv{background-position:0 -4640px;}
+.ly{background-position:0 -4672px;}
+.ma{background-position:0 -4704px;}
+.md{background-position:0 -4736px;}
+.me{background-position:0 -4768px;}
+.mg{background-position:0 -4800px;}
+.mh{background-position:0 -4832px;}
+.mk{background-position:0 -4864px;}
+.ml{background-position:0 -4896px;}
+.mm{background-position:0 -4928px;}
+.mn{background-position:0 -4960px;}
+.mo{background-position:0 -4992px;}
+.mq{background-position:0 -5024px;}
+.mr{background-position:0 -5056px;}
+.ms{background-position:0 -5088px;}
+.mt{background-position:0 -5120px;}
+.mu{background-position:0 -5152px;}
+.mv{background-position:0 -5184px;}
+.mw{background-position:0 -5216px;}
+.mx{background-position:0 -5248px;}
+.my{background-position:0 -5280px;}
+.mz{background-position:0 -5312px;}
+.na{background-position:0 -5344px;}
+.nc{background-position:0 -5376px;}
+.ne{background-position:0 -5408px;}
+.ng{background-position:0 -5440px;}
+.ni{background-position:0 -5472px;}
+.nl{background-position:0 -5504px;}
+.bq{background-position:0 -5504px;}
+.no{background-position:0 -5536px;}
+.bv, .nq, .sj{background-position:0 -5536px;}
+.np{background-position:0 -5568px;}
+.nr{background-position:0 -5600px;}
+.nz{background-position:0 -5632px;}
+.om{background-position:0 -5664px;}
+.pa{background-position:0 -5696px;}
+.pe{background-position:0 -5728px;}
+.pf{background-position:0 -5760px;}
+.pg{background-position:0 -5792px;}
+.ph{background-position:0 -5824px;}
+.pk{background-position:0 -5856px;}
+.pl{background-position:0 -5888px;}
+.pr{background-position:0 -5920px;}
+.ps{background-position:0 -5952px;}
+.pt{background-position:0 -5984px;}
+.pw{background-position:0 -6016px;}
+.py{background-position:0 -6048px;}
+.qa{background-position:0 -6080px;}
+.re{background-position:0 -6112px;}
+.ro{background-position:0 -6144px;}
+.rs{background-position:0 -6176px;}
+.ru{background-position:0 -6208px;}
+.rw{background-position:0 -6240px;}
+.sa{background-position:0 -6272px;}
+.sb{background-position:0 -6304px;}
+.sc{background-position:0 -6336px;}
+.sd{background-position:0 -6368px;}
+.se{background-position:0 -6400px;}
+.sg{background-position:0 -6432px;}
+.si{background-position:0 -6464px;}
+.sk{background-position:0 -6496px;}
+.sl{background-position:0 -6528px;}
+.sm{background-position:0 -6560px;}
+.sn{background-position:0 -6592px;}
+.so{background-position:0 -6624px;}
+.sr{background-position:0 -6656px;}
+.st{background-position:0 -6688px;}
+.sv{background-position:0 -6720px;}
+.sy{background-position:0 -6752px;}
+.sz{background-position:0 -6784px;}
+.tc{background-position:0 -6816px;}
+.td{background-position:0 -6848px;}
+.tg{background-position:0 -6880px;}
+.th{background-position:0 -6912px;}
+.tj{background-position:0 -6944px;}
+.tl{background-position:0 -6976px;}
+.tm{background-position:0 -7008px;}
+.tn{background-position:0 -7040px;}
+.to{background-position:0 -7072px;}
+.tr{background-position:0 -7104px;}
+.tt{background-position:0 -7136px;}
+.tv{background-position:0 -7168px;}
+.tw{background-position:0 -7200px;}
+.tz{background-position:0 -7232px;}
+.ua{background-position:0 -7264px;}
+.ug{background-position:0 -7296px;}
+.us{background-position:0 -7328px;}
+.uy{background-position:0 -7360px;}
+.uz{background-position:0 -7392px;}
+.va{background-position:0 -7424px;}
+.vc{background-position:0 -7456px;}
+.ve{background-position:0 -7488px;}
+.vg{background-position:0 -7520px;}
+.vi{background-position:0 -7552px;}
+.vn{background-position:0 -7584px;}
+.vu{background-position:0 -7616px;}
+.ws{background-position:0 -7648px;}
+.ye{background-position:0 -7680px;}
+.za{background-position:0 -7712px;}
+.zm{background-position:0 -7744px;}
+.zw{background-position:0 -7776px;}
+.sx{background-position:0 -7808px;}
+.cw{background-position:0 -7840px;}
+.ss{background-position:0 -7872px;}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+*/
+
+#aam_form{
+ position: relative;
+}
+
+.clear{
+ line-height: 0;
+ font-size: 0;
+ padding: 0;
+ margin: 0;
+ clear: both;
+}
+
+.main-inside{
+ position: relative;
+ min-height: 200px;
+}
+
+.aam-main-loader{
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 100%;
+ background: transparent url('images/main-loader.gif') no-repeat center;
+}
+
+.aam-icon-large span {
+ background-image: url('images/large-iconset.png');
+}
+
+.aam-icon-large-glob span{
+ background-position: 0 0;
+}
+
+.aam-icon-large-glob:hover span{
+ background-position: 0 -48px;
+}
+
+.aam-icon-large-settings span{
+ background-position: -48px 0;
+}
+
+.aam-icon-large-settings:hover span{
+ background-position: -48px -48px;
+}
+
+
+.restriction{
+ background: transparent url('images/restriction.png') no-repeat center;
+}
+
+.deny{
+ background: transparent url('images/deny.png') no-repeat center;
+}
+
+.center{
+ text-align: center;
+}
+
+.feature-off-notice{
+ width: 90%;
+ text-align: center;
+ padding: 10px 0;
+ font-size: 1.1em;
+ margin: 5px auto 0 auto;
+ border: 1px solid #FFAAAA;
+}
+
+.feature-off-notice a{
+ text-decoration: none;
+ color: #257DA6;
+}
+
+#settings_mode{
+ text-align: justify;
+ padding: 5px 15px;
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+?>
+<div class="wrap">
+ <div class="postbox-container" style="width:70%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <?php echo __('AAM Security', 'aam'); ?>
+ </h3>
+ <div class="inside main-inside">
+ <div class="mode-container" id="map_mode">
+ <?php if ($this->isGeoLookupOn()) { ?>
+ <div id="geo_map" style="width: 100%; height: 500px;"></div>
+ <?php } else { ?>
+ <p class="feature-off-notice">
+ The Geo Lookup feature is off. Turn it on with ConfigPress.<br/>
+ For more information check <a href="#" id="setting_trigger_inline">Settings</a> tab.
+ </p>
+ <?php } ?>
+ </div>
+ <div class="mode-container" id="settings_mode" style="display: none;">
+ <p>
+ In current version of AAM Security you have to utilize ConfigPress to trigger
+ certain features. Please find out below the list of all possible ConfigPress
+ settings:
+ <pre style="background:#fff;color:#000">
+<span style="color:#05a;font-weight: bold;">[security]</span>
+<span style="color:#00b418">#Geo Lookup feature monitors the location of the user based on IP address.</span>
+<span style="color:#00b418">#By default this feature is deactivated and can be activated by changing.</span>
+<span style="color:#00b418">#the <b>false</b> to <b>true</b>.</span>
+<span style="color:#0100b6;font-weight:700;">login.geo_lookup</span> = <span style="color:#d80800">"false"</span>
+<span style="color:#00b418">#We are using FreeGeoIP.net webservice to retrieve the geo location based on</span>
+<span style="color:#00b418">#IP address. Currently this is the only option but we will extend the list of</span>
+<span style="color:#00b418">#possible options in future releases.</span>
+<span style="color:#0100b6;font-weight:700">login.geoip.service</span> = <span style="color:#d80800">"FreeGeoIP"</span>
+<span style="color:#00b418">#Login lockout feature control the admin login process. This prevent your</span>
+<span style="color:#00b418">#website from being hacked by trying different password combinations.</span>
+<span style="color:#0100b6;font-weight:700">login.lockout</span> = <span style="color:#d80800">"false"</span>
+<span style="color:#00b418">#This setting defines how many attempts user has for entering correct password</span>
+<span style="color:#00b418">#before the <b>attempt failure</b> procedure fires.</span>
+<span style="color:#0100b6;font-weight:700">login.attempts</span> = <span style="color:#d80800">"10"</span>
+<span style="color:#00b418">#Attempt failure procedure is fired after user excided the number of attempts</span>
+<span style="color:#00b418">#to enter correct password. By default the server starts slowdown the each </span>
+<span style="color:#00b418">#new request for 5 seconds. Another possible procedure is <b>die</b>.</span>
+<span style="color:#00b418">#In this case the login process is completely locked for user's IP address.</span>
+<span style="color:#0100b6;font-weight:700">login.attempt_failure</span> = <span style="color:#d80800">"slowdown"</span>
+<span style="color:#00b418">#By default every new login request slows down for 5 seconds.</span>
+<span style="color:#0100b6;font-weight:700">login.slowdown_time</span> = <span style="color:#d80800">"5"</span>
+<span style="color:#00b418">#If <b>attempt failure</b> procedure is <b>die</b>, you can define your own</span>
+<span style="color:#00b418">#custom message that will be shown for locked user.</span>
+<span style="color:#0100b6;font-weight:700">login.die_message</span> = <span style="color:#d80800">"You are not allowed to login"</span>
+<span style="color:#00b418">#To speedup the lookup and lockout feature, all IP addresses are cached to database.</span>
+<span style="color:#00b418">#By default AAM caches up to 1000 records.</span>
+<span style="color:#0100b6;font-weight:700">login.cache_limit</span> = <span style="color:#d80800">"1000"</span>
+ </pre>
+ </p>
+ <p style="font-size: 0.9em;">
+ AAM Security is very new but expecting to be one of the biggest features
+ in AAM plugin. Currently it can be considered on development stage so some of
+ the features might not work the way you expect.<br/>
+ We are expecting feedback and recommendations from you how to expend and improve
+ AAM Security feature. Please send your thoughts to our email box
+ <a href="mailto:support@wpaam.com">support@wpaam.com</a>.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <?php if (aam_Core_Console::hasIssues()) { ?>
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('AAM Warnings', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <?php foreach (aam_Core_Console::getWarnings() as $warning) { ?>
+ <div class="aam-warning"><span><?php echo $warning; ?></span></div>
+ <?php } ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder" id="control_panel">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Control Panel', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <div class="large-icons-row">
+ <a href="#" class="aam-icon aam-icon-large aam-icon-large-glob" mode="map">
+ <span></span><?php echo __('Map', 'aam'); ?>
+ </a>
+ <!--<a href="#" class="cpanel-item cpanel-item-graph" ><?php echo __('Graph', 'aam'); ?></a>-->
+ <a href="#" class="aam-icon aam-icon-large aam-icon-large-settings" mode="settings" >
+ <span></span><?php echo __('Settings', 'aam'); ?>
+ </a>
+ </div>
+ <div class="medium-icons-row">
+ <a href="https://twitter.com/wpaam" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-twitter" aam-tooltip="<?php echo __('Follow @wpaam', 'aam'); ?>"><span></span><?php echo __('Follow', 'aam'); ?></a>
+ <a href="http://wpaam.com/support" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-help" aam-tooltip="<?php echo __('Help Forum', 'aam'); ?>"><span></span><?php echo __('Help', 'aam'); ?></a>
+ <a href="#" class="aam-icon aam-icon-medium aam-icon-medium-message" id="aam_message" aam-tooltip="<?php echo __('E-mail Us', 'aam'); ?>"><span></span><?php echo __('E-mail Us', 'aam'); ?></a>
+ <a href="http://wordpress.org/support/view/plugin-reviews/advanced-access-manager" target="_blank" class="aam-icon aam-icon-medium aam-icon-medium-star" aam-tooltip="<?php echo __('Rate AAM', 'aam'); ?>"><span></span><?php echo __('Rate Us', 'aam'); ?></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php if (false && $this->isGeoLookupOn()) { ?>
+ <div class="postbox-container" style="width:25%; margin-left: 2%;">
+ <div class="metabox-holder">
+ <div class="meta-box-sortables">
+ <div class="postbox">
+ <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
+ <h3 class="hndle">
+ <span><?php echo __('Country Impact List', 'aam'); ?></span>
+ </h3>
+ <div class="inside">
+ <table class="dataTable" id="country_list">
+ <thead>
+ <tr>
+ <th width="80%">Country</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+ <br class="clear" />
+</div>
\ No newline at end of file
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM\n"
+"POT-Creation-Date: 2013-12-01 14:07-0500\n"
+"PO-Revision-Date: 2014-01-02 21:40-0500\n"
+"Last-Translator: Vasyl Martyniuk <scarab.regit@gmail.com>\n"
+"Language-Team: WPAAM <support@wpaam.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.3\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: de_DE\n"
+
+#: aam.php:243 aam.php:248 aam.php:267
+msgid "Access denied"
+msgstr "Zugriff verweigert"
+
+#: aam.php:691 aam.php:692
+msgid "AAM"
+msgstr "AAM"
+
+#: aam.php:701 aam.php:702
+msgid "Access Control"
+msgstr "Zugangs Kontrolle"
+
+#: aam.php:709 aam.php:710
+msgid "Extensions"
+msgstr "Erweiterungen"
+
+#: application/view/capability.php:98 application/view/capability.php:179
+msgid "System"
+msgstr "System"
+
+#: application/view/capability.php:99 application/view/capability.php:181
+msgid "Post & Page"
+msgstr "Artikel & Seiten"
+
+#: application/view/capability.php:100 application/view/capability.php:183
+msgid "Backend Interface"
+msgstr "Backend Interface"
+
+#: application/view/capability.php:101
+msgid "Miscellaneous"
+msgstr "Diverses"
+
+#: application/view/capability.php:185
+msgid "Miscelaneous"
+msgstr "Diverses"
+
+#: application/view/manager.php:59
+msgid "Roles"
+msgstr "Rollen"
+
+#: application/view/manager.php:60
+msgid "Role Manager"
+msgstr "Rollen Manager"
+
+#: application/view/manager.php:68
+msgid "Users"
+msgstr "Benutzer"
+
+#: application/view/manager.php:69
+msgid "User Manager"
+msgstr "Benutzer Manager"
+
+#: application/view/manager.php:77
+msgid "Visitor"
+msgstr "Besucher"
+
+#: application/view/manager.php:78
+msgid "Visitor Manager"
+msgstr "Besucher Manager"
+
+#: application/view/manager.php:95
+msgid "Admin Menu"
+msgstr "Admin Menü"
+
+#: application/view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+"Zugangskontrolle für das Admin Menü. Zugangs Beschränkung das vollständige "
+"Menü oder Untermenüs . <b>Anmerkung</b>, das Menü wird aufgrund der "
+"Benutzer- oder Rolleneigenschaften erstellt."
+
+#: application/view/manager.php:103
+msgid "Metabox & Widget"
+msgstr "Metabox & Widgets"
+
+#: application/view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+"Sortiere nach den Metaboxen oder Widgets der ausgewählten Rolle oder des "
+"Benutzers. Wenn eine Metabox oder ein Widget nicht angezeigt wird, klicke "
+"auf <b>Refresh the List</b> oder kopiere den direkten Link zu der Site wo "
+"die Metabox oder das Widget angezeigt werden und klicke <b>Retrieve "
+"Metaboxes from Link</b> ."
+
+#: application/view/manager.php:111
+msgid "Capability"
+msgstr "Eigenschaft"
+
+#: application/view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+"Verwalte die Eigenschaften für die ausgewählte Rolle oder den Benutzer. "
+"<b>Anmerkung</b>, die Eigenschafen der Benutzer werden von der Benutzerrolle "
+"vererbt.<br/><b>Achtung!</b>, sei vorsichtig mit den Eigenschaften. Das "
+"Löschen oder das Abwählen von Eigenschaften kann zeitweisen oder dauerhaften "
+"Verlust von Funktionen verursachen."
+
+#: application/view/manager.php:119
+msgid "Posts & Categories"
+msgstr "Artikel & Kategorien"
+
+#: application/view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+"Verwalte den Zugang zu einzelnen <b>Artikeln</b> oder <b>Ebenen<b/> Unter "
+"<b>Artikeln</b> werden alle Artikel, Seiten oder custom post type und unter "
+"<b>Ebenen<b/> z.B. Kategorien verstanden."
+
+#: application/view/manager.php:127
+msgid "Event Manager"
+msgstr "Event Manager"
+
+#: application/view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+"Definiere deine eigene Aktion, wenn ein Bestimmtes Ereignis auf deinem Blog "
+"eintritt. Diese Auswahl erlaubt dir automatisch eine Aktion auszulösen, wenn "
+"sich der Inhalt eines Artikels oder der Seitenstatus geändert haben. Du "
+"kannst Email Benachichtugungen senden, den Artikel Status ändern oder eigene "
+"Ereignisse beschreiben."
+
+#: application/view/manager.php:135
+msgid "ConfigPress"
+msgstr "ConfigPress"
+
+#: application/view/manager.php:138
+msgid ""
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "
+"<b>ConfigPress tutorial</b>."
+msgstr ""
+"Kontrolliere das Verhalten von <b>AAM</b> mit ConfigPress Für mehr Details "
+"schaue bitte ins <b>ConfigPress Tutorial</b>."
+
+#: application/view/manager.php:342
+msgid "Rollback Settings"
+msgstr "Wiederholungseinstellungen"
+
+#: application/view/manager.php:343
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: application/view/manager.php:344
+msgid "Send E-mail"
+msgstr "E-Mail senden"
+
+#: application/view/manager.php:345 application/view/manager.php:351
+msgid "Add New Role"
+msgstr "Neue Rolle hinzufügen"
+
+#: application/view/manager.php:346
+msgid "Manage"
+msgstr "Verwalten"
+
+#: application/view/manager.php:347
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: application/view/manager.php:348
+msgid "Delete"
+msgstr "Löschen"
+
+#: application/view/manager.php:349
+msgid "Filtered"
+msgstr "Sortieren"
+
+#: application/view/manager.php:350
+msgid "Clear"
+msgstr "Leeren"
+
+#: application/view/manager.php:352
+msgid "Save Changes"
+msgstr "Änderungen speichern"
+
+#: application/view/manager.php:353
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+"Das System hat %d Benutzer mit dieser Rolle identifiziert. Alle Benutzer mit "
+"der Rolle <b>%s</b> werden automatisch gelöscht."
+
+#: application/view/manager.php:354
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr "Bist du sicher, dass du die Rolle <b>%s</b> löschen möchtest?"
+
+#: application/view/manager.php:355
+msgid "Delete Role"
+msgstr "Rolle löschen"
+
+#: application/view/manager.php:356
+msgid "Add User"
+msgstr "Benutzer hinzufügen"
+
+#: application/view/manager.php:357
+msgid "Filter Users"
+msgstr "Benutzer sortieren"
+
+#: application/view/manager.php:358 application/view/manager.php:374
+msgid "Refresh List"
+msgstr "Liste aktualisieren"
+
+#: application/view/manager.php:359
+msgid "Block"
+msgstr "Block"
+
+#: application/view/manager.php:360
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr "Bist du sicher, dass du den Benutzer <b>%s</b> löschen möchtest?"
+
+#: application/view/manager.php:361
+msgid "Filter Capabilities by Category"
+msgstr "Sortiere die Eigenschaften nach der Kategorie"
+
+#: application/view/manager.php:362
+msgid "Inherit Capabilities"
+msgstr "Vererbe Eigenschaften"
+
+#: application/view/manager.php:363
+msgid "Add New Capability"
+msgstr "Neue Eigenschaft hinzufügen"
+
+#: application/view/manager.php:364
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr "Bist du sicher, dass du die Eigenschaft <b>%s</b> löschen möchtest?"
+
+#: application/view/manager.php:365
+msgid "Delete Capability"
+msgstr "Eigenschaft löschen"
+
+#: application/view/manager.php:366
+msgid "Select Role"
+msgstr "Rolle auswählen"
+
+#: application/view/manager.php:367
+msgid "Add Capability"
+msgstr "Eigenschaft hinzufügen"
+
+#: application/view/manager.php:368
+msgid "Add Event"
+msgstr "Event hinzufügen"
+
+#: application/view/manager.php:369
+msgid "Edit Event"
+msgstr "Event bearbeiten"
+
+#: application/view/manager.php:370 application/view/manager.php:372
+msgid "Delete Event"
+msgstr "Event löschen"
+
+#: application/view/manager.php:371
+msgid "Save Event"
+msgstr "Event speichern"
+
+#: application/view/manager.php:373
+msgid "Filter Posts by Post Type"
+msgstr "Sortiere Artikel nach Artikel Typ"
+
+#: application/view/manager.php:375
+msgid "Restore Default"
+msgstr "Standard wiederherstellen"
+
+#: application/view/manager.php:376
+msgid "Apply"
+msgstr "Zustimmen"
+
+#: application/view/manager.php:377
+msgid "Edit Term"
+msgstr "Ebene bearbeiten"
+
+#: application/view/manager.php:378
+msgid "Manager Access"
+msgstr "Zugangs Verwaltung"
+
+#: application/view/manager.php:379
+msgid "Unlock Default Accesss Control"
+msgstr "Öffne Standard Zugangs Kontrolle"
+
+#: application/view/manager.php:380
+msgid "Close"
+msgstr "Schließen"
+
+#: application/view/manager.php:381
+msgid "Edit Role"
+msgstr "Rolle bearbeiten"
+
+#: application/view/metabox.php:179
+msgid "Dashboard Widgets"
+msgstr "Dashboard Widgets"
+
+#: application/view/metabox.php:183
+msgid "Frontend Widgets"
+msgstr "Frontend Widgets"
+
+#: application/view/post.php:181
+msgid "[empty]"
+msgstr "[leer]"
+
+#: application/view/post.php:345 application/view/post.php:353
+msgid "All"
+msgstr ""
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM\n"
+"POT-Creation-Date: 2013-12-01 14:07-0500\n"
+"PO-Revision-Date: 2014-01-02 21:40-0500\n"
+"Last-Translator: Vasyl Martyniuk <scarab.regit@gmail.com>\n"
+"Language-Team: WPAAM <support@wpaam.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en_US\n"
+"X-Generator: Poedit 1.6.3\n"
+
+#: aam.php:243 aam.php:248 aam.php:267
+msgid "Access denied"
+msgstr ""
+
+#: aam.php:691 aam.php:692
+msgid "AAM"
+msgstr ""
+
+#: aam.php:701 aam.php:702
+msgid "Access Control"
+msgstr ""
+
+#: aam.php:709 aam.php:710
+msgid "Extensions"
+msgstr ""
+
+#: application/view/capability.php:98 application/view/capability.php:179
+msgid "System"
+msgstr ""
+
+#: application/view/capability.php:99 application/view/capability.php:181
+msgid "Post & Page"
+msgstr ""
+
+#: application/view/capability.php:100 application/view/capability.php:183
+msgid "Backend Interface"
+msgstr ""
+
+#: application/view/capability.php:101
+msgid "Miscellaneous"
+msgstr ""
+
+#: application/view/capability.php:185
+msgid "Miscelaneous"
+msgstr ""
+
+#: application/view/manager.php:59
+msgid "Roles"
+msgstr ""
+
+#: application/view/manager.php:60
+msgid "Role Manager"
+msgstr ""
+
+#: application/view/manager.php:68
+msgid "Users"
+msgstr ""
+
+#: application/view/manager.php:69
+msgid "User Manager"
+msgstr ""
+
+#: application/view/manager.php:77
+msgid "Visitor"
+msgstr ""
+
+#: application/view/manager.php:78
+msgid "Visitor Manager"
+msgstr ""
+
+#: application/view/manager.php:95
+msgid "Admin Menu"
+msgstr ""
+
+#: application/view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+
+#: application/view/manager.php:103
+msgid "Metabox & Widget"
+msgstr ""
+
+#: application/view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+
+#: application/view/manager.php:111
+msgid "Capability"
+msgstr ""
+
+#: application/view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+
+#: application/view/manager.php:119
+msgid "Posts & Categories"
+msgstr ""
+
+#: application/view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+
+#: application/view/manager.php:127
+msgid "Event Manager"
+msgstr ""
+
+#: application/view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+
+#: application/view/manager.php:135
+msgid "ConfigPress"
+msgstr ""
+
+#: application/view/manager.php:138
+msgid ""
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "
+"<b>ConfigPress tutorial</b>."
+msgstr ""
+
+#: application/view/manager.php:342
+msgid "Rollback Settings"
+msgstr ""
+
+#: application/view/manager.php:343
+msgid "Cancel"
+msgstr ""
+
+#: application/view/manager.php:344
+msgid "Send E-mail"
+msgstr ""
+
+#: application/view/manager.php:345 application/view/manager.php:351
+msgid "Add New Role"
+msgstr ""
+
+#: application/view/manager.php:346
+msgid "Manage"
+msgstr ""
+
+#: application/view/manager.php:347
+msgid "Edit"
+msgstr ""
+
+#: application/view/manager.php:348
+msgid "Delete"
+msgstr ""
+
+#: application/view/manager.php:349
+msgid "Filtered"
+msgstr ""
+
+#: application/view/manager.php:350
+msgid "Clear"
+msgstr ""
+
+#: application/view/manager.php:352
+msgid "Save Changes"
+msgstr ""
+
+#: application/view/manager.php:353
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+
+#: application/view/manager.php:354
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:355
+msgid "Delete Role"
+msgstr ""
+
+#: application/view/manager.php:356
+msgid "Add User"
+msgstr ""
+
+#: application/view/manager.php:357
+msgid "Filter Users"
+msgstr ""
+
+#: application/view/manager.php:358 application/view/manager.php:374
+msgid "Refresh List"
+msgstr ""
+
+#: application/view/manager.php:359
+msgid "Block"
+msgstr ""
+
+#: application/view/manager.php:360
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:361
+msgid "Filter Capabilities by Category"
+msgstr ""
+
+#: application/view/manager.php:362
+msgid "Inherit Capabilities"
+msgstr ""
+
+#: application/view/manager.php:363
+msgid "Add New Capability"
+msgstr ""
+
+#: application/view/manager.php:364
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:365
+msgid "Delete Capability"
+msgstr ""
+
+#: application/view/manager.php:366
+msgid "Select Role"
+msgstr ""
+
+#: application/view/manager.php:367
+msgid "Add Capability"
+msgstr ""
+
+#: application/view/manager.php:368
+msgid "Add Event"
+msgstr ""
+
+#: application/view/manager.php:369
+msgid "Edit Event"
+msgstr ""
+
+#: application/view/manager.php:370 application/view/manager.php:372
+msgid "Delete Event"
+msgstr ""
+
+#: application/view/manager.php:371
+msgid "Save Event"
+msgstr ""
+
+#: application/view/manager.php:373
+msgid "Filter Posts by Post Type"
+msgstr ""
+
+#: application/view/manager.php:375
+msgid "Restore Default"
+msgstr ""
+
+#: application/view/manager.php:376
+msgid "Apply"
+msgstr ""
+
+#: application/view/manager.php:377
+msgid "Edit Term"
+msgstr ""
+
+#: application/view/manager.php:378
+msgid "Manager Access"
+msgstr ""
+
+#: application/view/manager.php:379
+msgid "Unlock Default Accesss Control"
+msgstr ""
+
+#: application/view/manager.php:380
+msgid "Close"
+msgstr ""
+
+#: application/view/manager.php:381
+msgid "Edit Role"
+msgstr ""
+
+#: application/view/metabox.php:179
+msgid "Dashboard Widgets"
+msgstr ""
+
+#: application/view/metabox.php:183
+msgid "Frontend Widgets"
+msgstr ""
+
+#: application/view/post.php:181
+msgid "[empty]"
+msgstr ""
+
+#: application/view/post.php:345 application/view/post.php:353
+msgid "All"
+msgstr ""
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: Advanced Access Manager\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-12-01 14:07-0500\n"
+"PO-Revision-Date: 2014-01-03 18:30-0300\n"
+"Last-Translator: Esteban Truelsegaard <esteban@netmdp.com>\n"
+"Language-Team: Vasyl Martyniuk <whimba@gmail.com>\n"
+"Language: en\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop;__\n"
+"X-Generator: Poedit 1.5.7\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: aam.php:243 aam.php:248 aam.php:267
+msgid "Access denied"
+msgstr "Acceso Denegado"
+
+#: aam.php:691 aam.php:692
+msgid "AAM"
+msgstr "Permisos AAM"
+
+#: aam.php:701 aam.php:702
+msgid "Access Control"
+msgstr "Control de Accesos"
+
+#: aam.php:709 aam.php:710
+msgid "Extensions"
+msgstr "Extensiones"
+
+#: application/view/capability.php:98 application/view/capability.php:179
+msgid "System"
+msgstr "Sistema"
+
+#: application/view/capability.php:99 application/view/capability.php:181
+msgid "Post & Page"
+msgstr "Entrada & Página"
+
+#: application/view/capability.php:100 application/view/capability.php:183
+msgid "Backend Interface"
+msgstr "Backend Interface"
+
+#: application/view/capability.php:101
+msgid "Miscellaneous"
+msgstr "Misceláneo"
+
+#: application/view/capability.php:185
+msgid "Miscelaneous"
+msgstr "Misceláneo"
+
+#: application/view/manager.php:59
+msgid "Roles"
+msgstr "Roles"
+
+#: application/view/manager.php:60
+msgid "Role Manager"
+msgstr "Administrar Roles"
+
+#: application/view/manager.php:68
+msgid "Users"
+msgstr "Usuarios"
+
+#: application/view/manager.php:69
+msgid "User Manager"
+msgstr "Administrar Usuario"
+
+#: application/view/manager.php:77
+msgid "Visitor"
+msgstr "Visita"
+
+#: application/view/manager.php:78
+msgid "Visitor Manager"
+msgstr "Administrar Visitas"
+
+#: application/view/manager.php:95
+msgid "Admin Menu"
+msgstr "Menú principal"
+
+#: application/view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+"Control de Accesos al Menu Admin. Restringe accesos a todo el Menú o por "
+"Submenú. <b>Nota</b>, el menú es mostrado basado en el Rol o capabilities "
+"del Usuario."
+
+#: application/view/manager.php:103
+msgid "Metabox & Widget"
+msgstr "Metabox & Widget"
+
+#: application/view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+"Filtrar lista de Metaboxes o Widgets para el Rol o Usuario seleccionado. Si "
+"el metabox o widget no está listado, intente clickeando el botón "
+"<b>Actualizar Lista</b> o Copie & Pegue el link directo a la página donde se "
+"muestra el metabox o widget y toque el botón <b>Recuperar Metaboxes desde "
+"link</b>."
+
+#: application/view/manager.php:111
+msgid "Capability"
+msgstr "Capability"
+
+#: application/view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+"Administrar lista de Capabilities para el Usuario o Rol seleccionado. "
+"<b>Nota</b>, la lista de capacidades se heredan del Rol de usuario. <br/"
+"><b>Cuidado!</b> Sea cuidadoso con las capacidades. Borrar o desmarcar una "
+"capability puede causar perdida de control temporal o permanente sobre "
+"alguna característica o el panel de Wordpress."
+
+#: application/view/manager.php:119
+msgid "Posts & Categories"
+msgstr "Entradas & Taxonomias"
+
+#: application/view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+"Administrar acceso sobre <b>Entrada</b> o <b>Taxonomía</b> individual. Nota, "
+"bajo <b>Entrada</b>, se asume cualquier post, página o custom post type. Y "
+"bajo <b>Taxonomía</b>, cualquier término como Categorías de Entradas."
+
+#: application/view/manager.php:127
+msgid "Event Manager"
+msgstr "Administrar Eventos"
+
+#: application/view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+"Define su propia acción cuando ocurre algún evento en su blog. Esta sección "
+"le permite agregar una acción a un evento como cambio de contenido de una "
+"entrada, o el estado de actualización de una página. Puede enviar una "
+"notificación por e-mail, cambiar el estado de la entrada o escribir su "
+"propio manejador de eventos."
+
+#: application/view/manager.php:135
+msgid "ConfigPress"
+msgstr "Configuración"
+
+#: application/view/manager.php:138
+msgid ""
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "
+"<b>ConfigPress tutorial</b>."
+msgstr ""
+"Controle el comportamiento de <b>AAM</b> con ConfigPress. Para mas detalles "
+"mire <b>ConfigPress tutorial</b>."
+
+#: application/view/manager.php:342
+msgid "Rollback Settings"
+msgstr "Recuperar Valores"
+
+#: application/view/manager.php:343
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: application/view/manager.php:344
+msgid "Send E-mail"
+msgstr "Enviar email"
+
+#: application/view/manager.php:345 application/view/manager.php:351
+msgid "Add New Role"
+msgstr "Agregar Nuevo Rol"
+
+#: application/view/manager.php:346
+msgid "Manage"
+msgstr "Administrar"
+
+#: application/view/manager.php:347
+msgid "Edit"
+msgstr "Editor"
+
+#: application/view/manager.php:348
+msgid "Delete"
+msgstr "Borrar"
+
+#: application/view/manager.php:349
+msgid "Filtered"
+msgstr "Filtrado"
+
+#: application/view/manager.php:350
+msgid "Clear"
+msgstr "Limpìar"
+
+#: application/view/manager.php:352
+msgid "Save Changes"
+msgstr "Grabar Cambios"
+
+#: application/view/manager.php:353
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+"El sistema ha detectado %d usuario(s) con este rol. ¡Todos los Usuarios con "
+"Rol <b>%s</b> serán borrados automáticamente!"
+
+#: application/view/manager.php:354
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr "Está seguro de borrar el rol <b>%s</b>?"
+
+#: application/view/manager.php:355
+msgid "Delete Role"
+msgstr "Borrar Rol"
+
+#: application/view/manager.php:356
+msgid "Add User"
+msgstr "Agregar Usuario"
+
+#: application/view/manager.php:357
+msgid "Filter Users"
+msgstr "Filtrar Usuarios"
+
+#: application/view/manager.php:358 application/view/manager.php:374
+msgid "Refresh List"
+msgstr "Refrescar Lista"
+
+#: application/view/manager.php:359
+msgid "Block"
+msgstr "Bloquear"
+
+#: application/view/manager.php:360
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr "Está seguro de borrar el usuario <b>%s</b>?"
+
+#: application/view/manager.php:361
+msgid "Filter Capabilities by Category"
+msgstr "Filtrar Capabilities por Categoría"
+
+#: application/view/manager.php:362
+msgid "Inherit Capabilities"
+msgstr "Inherit Capabilities"
+
+#: application/view/manager.php:363
+msgid "Add New Capability"
+msgstr "Agregar nueva Capability"
+
+#: application/view/manager.php:364
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr "Por favor confirme el borrado de Capability - <b>%s</b>"
+
+#: application/view/manager.php:365
+msgid "Delete Capability"
+msgstr "Borrar Capability"
+
+#: application/view/manager.php:366
+msgid "Select Role"
+msgstr "Seleccionar Rol"
+
+#: application/view/manager.php:367
+msgid "Add Capability"
+msgstr "Agregar Capability"
+
+#: application/view/manager.php:368
+msgid "Add Event"
+msgstr "Agregar Evento"
+
+#: application/view/manager.php:369
+msgid "Edit Event"
+msgstr "Editar Evento"
+
+#: application/view/manager.php:370 application/view/manager.php:372
+msgid "Delete Event"
+msgstr "Borrar Evento"
+
+#: application/view/manager.php:371
+msgid "Save Event"
+msgstr "Salvar Evento"
+
+#: application/view/manager.php:373
+msgid "Filter Posts by Post Type"
+msgstr "Filtrar Entradas por Post Type"
+
+#: application/view/manager.php:375
+msgid "Restore Default"
+msgstr "Restaurar valores por defecto"
+
+#: application/view/manager.php:376
+msgid "Apply"
+msgstr "Aplicar Todo"
+
+#: application/view/manager.php:377
+msgid "Edit Term"
+msgstr "Editar Term"
+
+#: application/view/manager.php:378
+msgid "Manager Access"
+msgstr "Administrar Accesos"
+
+#: application/view/manager.php:379
+msgid "Unlock Default Accesss Control"
+msgstr "Desbloquear Control de Accesos por Defecto"
+
+#: application/view/manager.php:380
+msgid "Close"
+msgstr "Cerrar"
+
+#: application/view/manager.php:381
+msgid "Edit Role"
+msgstr "Editar Rol"
+
+#: application/view/metabox.php:179
+msgid "Dashboard Widgets"
+msgstr "Metaboxes & Widgets"
+
+#: application/view/metabox.php:183
+msgid "Frontend Widgets"
+msgstr "Frontend Widgets"
+
+#: application/view/post.php:181
+msgid "[empty]"
+msgstr "[vaciar]"
+
+#: application/view/post.php:345 application/view/post.php:353
+msgid "All"
+msgstr "Todo"
+
+#~ msgid "Password Protected"
+#~ msgstr "Protegido por contraseña"
+
+#~ msgid "Public"
+#~ msgstr "Público"
+
+#~ msgid "Advanced Access Manager"
+#~ msgstr "Administrador de Accesos"
+
+#~ msgid "Alert"
+#~ msgstr "Alerta"
+
+#~ msgid "Options updated successfully"
+#~ msgstr "Opciones guardadas"
+
+#~ msgid "Drag and Drop Menu in the List and click <b>Save Order</b>"
+#~ msgstr ""
+#~ "Para Reorganizar el menu sólo arrastre y suelte Items en la lista y "
+#~ "clickee <b>Salvar Orden</b>"
+
+#~ msgid "Reorganize"
+#~ msgstr "Reorganizar"
+
+#~ msgid "Whole Branch"
+#~ msgstr "Toda la Rama"
+
+#~ msgid ""
+#~ "To initialize list of metaboxes manually, copy and paste the URL to edit "
+#~ "screen page (e.g. http://localhost/wp-admin/post.php?post=1&action=edit) "
+#~ "into text field and click \"Initiate URL\". List of all new metaboxes "
+#~ "will be added automatically."
+#~ msgstr ""
+#~ "Para inicializar la lista de metaboxes manualmente, copie y pegue la URL "
+#~ "a la pag. admin en este sitio en el campo de texto y clickee \"Iniciar URL"
+#~ "\". La lista de todas las metaboxes nuevas serán agregadas "
+#~ "automaticamente."
+
+#~ msgid "Enter Correct URL"
+#~ msgstr "Ingrese URL correcta"
+
+#~ msgid "Initialize URL"
+#~ msgstr "Inicializar URL"
+
+#~ msgid "ID"
+#~ msgstr "ID"
+
+#~ msgid "Priority"
+#~ msgstr "Prioridad"
+
+#~ msgid "Position"
+#~ msgstr "Posición"
+
+#~ msgid "Restrict"
+#~ msgstr "Restringir"
+
+#~ msgid "List of Metaboxes is empty or not initialized."
+#~ msgstr "La lista de metaboxes esta vacía o no inicializada."
+
+#~ msgid "Initialize the List"
+#~ msgstr "Inicializar la Lista"
+
+#~ msgid "Error"
+#~ msgstr "Error"
+
+#~ msgid "Role Administrator's List of Capabilities"
+#~ msgstr "Dar lista de Capabilities de Administrador"
+
+#~ msgid "Administrator"
+#~ msgstr "Administrador"
+
+#~ msgid "Role Editor's List of Capabilities"
+#~ msgstr "Dar lista de Capabilities de Editor"
+
+#~ msgid "Role Author's List of Capabilities"
+#~ msgstr "Dar lista de Capabilities de Autor"
+
+#~ msgid "Author"
+#~ msgstr "Autor"
+
+#~ msgid "Role Contributor's List of Capabilities"
+#~ msgstr "Dar lista de Capabilities de Contribuidor"
+
+#~ msgid "Contributor"
+#~ msgstr "Contribuidor"
+
+#~ msgid "Role Subscriber's List of Capabilities"
+#~ msgstr "Dar lista de Capabilities de Suscriptor"
+
+#~ msgid "Subscriber"
+#~ msgstr "Suscriptor"
+
+#~ msgid "Collapse All"
+#~ msgstr "Colapsar Todo"
+
+#~ msgid "Expand All"
+#~ msgstr "Expandir Todo"
+
+#~ msgid "Error during saving"
+#~ msgstr "Error mientras guardaba"
+
+#~ msgid "Apply Restrictions Only for Current Role or User"
+#~ msgstr "Aplicar Restricciones solo para el Rol o Usuario Actual"
+
+#~ msgid "Apply Restrictions for All Roles"
+#~ msgstr "Aplicar valores para TODOS los Roles de Usuario ?"
+
+#~ msgid "Apply for All"
+#~ msgstr "Aplicar para Todo"
+
+#~ msgid "Select Post, Page or Taxonomy"
+#~ msgstr "Seleccionar Entrada, Página o Taxonomía"
+
+#~ msgid "Click to toggle"
+#~ msgstr "Click para intercambiar"
+
+#~ msgid "General"
+#~ msgstr "General"
+
+#~ msgid "Current Role"
+#~ msgstr "Rol Actual"
+
+#~ msgid "OK"
+#~ msgstr "OK"
+
+#~ msgid "Saving..."
+#~ msgstr "Salvando..."
+
+#~ msgid "Save"
+#~ msgstr "Salvar"
+
+#~ msgid "Enter New Role"
+#~ msgstr "Ingrese Nuevo Rol"
+
+#~ msgid "Add"
+#~ msgstr "Agregar"
+
+#~ msgid "New Role Created successfully"
+#~ msgstr "Nuevo Rol creado"
+
+#~ msgid "Role can not be created"
+#~ msgstr "El Rol no puede ser creado"
+
+#~ msgid "Delete Role?"
+#~ msgstr "Borrar Rol ?"
+
+#~ msgid "Please confirm deleting Role %s"
+#~ msgstr "Por favor confirme el borrado del Rol %s"
+
+#~ msgid "Save Menu Order"
+#~ msgstr "Salvar Orden del Menú?"
+
+#~ msgid "Save Menu Order <b>ONLY</b> for Role %s?"
+#~ msgstr "Le gustaría salvar el orden del Menú <b>SOLO</b> para el Rol %s?"
+
+#~ msgid "Delete Capability?"
+#~ msgstr "Borrar Capability?"
+
+#~ msgid "Restore Default Settings?"
+#~ msgstr "Restaurar valores por defecto de Rol?"
+
+#~ msgid "All current settings will be lost. Are you sure?"
+#~ msgstr "Todos los valores actuales se perderán. Está seguro?"
+
+#~ msgid "Apply Setting for ALL Roles?"
+#~ msgstr "Aplicar valores para TODOS los Roles de Usuario ?"
+
+#~ msgid "Do you really want to apply these settings to <b>ALL</b> Roles?"
+#~ msgstr ""
+#~ "Realmente quiere aplicar estos valores para <b>TODOS</b> los Roles de "
+#~ "Usuario ?"
+
+#~ msgid "Do not show me this message again"
+#~ msgstr "No mostrarme este mensaje otra vez."
+
+#~ msgid "Description"
+#~ msgstr "Posición"
+
+#~ msgid "Upgrade functionality"
+#~ msgstr "Actualizar funcionalidad"
+
+#~ msgid "Important Message"
+#~ msgstr "Mensaje Importante"
+
+#~ msgid "No Description found"
+#~ msgstr "No se encontró descripción"
+
+#~ msgid "WARNING"
+#~ msgstr "WARNING"
+
+#~ msgid ""
+#~ "Advanced Access Manager requires WordPress 3.2 or newer. <a href=\"http://"
+#~ "codex.wordpress.org/Upgrading_WordPress\">Update now!</a>"
+#~ msgstr ""
+#~ "Advanced Access Manager requiere WordPress 3.1 o mayor. <a href=\"http://"
+#~ "codex.wordpress.org/Upgrading_WordPress\">Update now!</a>"
+
+#~ msgid "Advanced Access Manager requires PHP 5.1.2 or newer"
+#~ msgstr "Advanced Access Manager requiere PHP 5.0 o superior"
+
+#~ msgid "Empty Capability"
+#~ msgstr "Borrar Capability"
+
+#~ msgid "Current Capability can not be deleted"
+#~ msgstr "Capability Actual no puede ser borrada"
+
+#~ msgid "Super Admin"
+#~ msgstr "Super Admin"
+
+#~ msgid "Unauthorized Action"
+#~ msgstr "Acción no Autorizada"
+
+#~ msgid "Options List"
+#~ msgstr "Lista de Opciones"
+
+#~ msgid "Yes"
+#~ msgstr "Si"
+
+#~ msgid "Error appeared during Metabox initialization!"
+#~ msgstr "Aparece un error durante la inicialización Metabox!"
+
+#~ msgid "Restore"
+#~ msgstr "Restaurar"
+
+#~ msgid "Current Role can not be restored!"
+#~ msgstr "Rol actual no puede ser restaurado!"
+
+#~ msgid "Apply All"
+#~ msgstr "Aplicar Todo"
+
+#~ msgid "Error during information grabbing!"
+#~ msgstr "Error during information grabbing!"
+
+#~ msgid "Premium"
+#~ msgstr " "
+
+#~ msgid "Create"
+#~ msgstr "Crear"
+
+#~ msgid "Do not Create"
+#~ msgstr "No Crear"
+
+#~ msgid "Change Role"
+#~ msgstr "Cambiar Rol"
+
+#~ msgid "Current Site"
+#~ msgstr "Sitio Actual"
+
+#~ msgid ""
+#~ "cURL library returned empty result. Contact your system administrator to "
+#~ "fix this issue."
+#~ msgstr ""
+#~ "cURL library returned empty result. Contact your system administrator to "
+#~ "fix this issue."
+
+#~ msgid ""
+#~ "You are not an active user for current blog. Please click <a href=\"#\" "
+#~ "id=\"add-user-toblog\">here</a> to add yourself to current blog as "
+#~ "Administrator"
+#~ msgstr ""
+#~ "No es un usuario activo para el blog Actual. Por favor clickea <a href="
+#~ "\"#\" id=\"add-user-toblog\">aquí</a> para agregarte como admin del blog "
+#~ "actual"
+
+#~ msgid "Basic"
+#~ msgstr " "
+
+#~ msgid "Administrator added Successfully"
+#~ msgstr "Administrador agregado"
+
+#~ msgid "Failed to add new Administrator"
+#~ msgstr "Falla al agregar Administrador"
+
+#~ msgid "Click for more information"
+#~ msgstr "Click para Tooltip"
+
+#~ msgid "Current User"
+#~ msgstr "Usuario Actual"
+
+#~ msgid "Delete current capability"
+#~ msgstr "Borrar Capability"
+
+#~ msgid "Read more..."
+#~ msgstr "Leer Más..."
+
+#~ msgid "Restore Default Settings"
+#~ msgstr "Restaurar valores por defecto de Rol?"
+
+#~ msgid ""
+#~ "Check Menu or Submenu to restrict or <b>Whole Branch</b> to restrict "
+#~ "whole menu."
+#~ msgstr ""
+#~ "Marque Menú o Sub-menú para restringir el acceso o <b>Toda la Rama</b> "
+#~ "para restringir el acceso a todo el menú."
+
+#~ msgid ""
+#~ "Only Latin letters, numbers and space are allowed. All other symbols will "
+#~ "be filtered.<br/>New Capability will be added to Super Admin and Admin "
+#~ "Roles automatically."
+#~ msgstr ""
+#~ "Sólo se permiten letras, números y espacios. Todo lo demás será filtrado."
+#~ "<br/>La nueva Capability se agregará automáticamente a los roles Super "
+#~ "Admin y Admin."
+
+#~ msgid "Enter New Capability"
+#~ msgstr "Agregar nueva Capability"
+
+#~ msgid "Would you like to restore default restrictions?"
+#~ msgstr "Quiere restaurar los permisos por defecto ?"
+
+#~ msgid "Restore Restrictions"
+#~ msgstr "Restaurar valores por defecto de Rol?"
+
+#~ msgid "Posts in %s"
+#~ msgstr "Entradas en %s"
+
+#~ msgid "Information"
+#~ msgstr "Información"
+
+#~ msgid "Refresh"
+#~ msgstr "Refrescar"
+
+#~ msgid "Frontend"
+#~ msgstr "Frontend"
+
+#~ msgid "Backend"
+#~ msgstr "Backend"
+
+#~ msgid "List"
+#~ msgstr "Lista de Roles"
+
+#~ msgid "Exclude"
+#~ msgstr "Excluir Página"
+
+#~ msgid "Read"
+#~ msgstr "Leer"
+
+#~ msgid "Trash"
+#~ msgstr "Papelera"
+
+#~ msgid "Install Plugin"
+#~ msgstr "Instalar Plugin"
+
+#~ msgid "Publish"
+#~ msgstr "Público"
+
+#~ msgid "Comment"
+#~ msgstr "Comentario"
+
+#~ msgid "Browse"
+#~ msgstr "Mostrar"
+
+#~ msgid "Worth checking"
+#~ msgstr "Chequeo de errores"
+
+#~ msgid "Additional features available"
+#~ msgstr "Características adicionales"
+
+#~ msgid "You have a JavaScript Error on a page"
+#~ msgstr "Tiene un error Javascript en una página"
+
+#~ msgid "For support send an email to address"
+#~ msgstr "Para soporte envíe un email a"
+
+#~ msgid "Add New Cap"
+#~ msgstr "Agregar Cap"
+
+#~ msgid "Title"
+#~ msgstr "Título"
+
+#~ msgid "This is the title of selected Post or Page"
+#~ msgstr "Este es el título del Post o Página seleccionada"
+
+#~ msgid "Selected item's type"
+#~ msgstr "Tipo de Item seleccionado"
+
+#~ msgid "Type"
+#~ msgstr "Tipo"
+
+#~ msgid "Status"
+#~ msgstr "Status"
+
+#~ msgid "Current Post or Page Status"
+#~ msgstr "Estado actual del Post o Página"
+
+#~ msgid "Visibility"
+#~ msgstr "Visibilidad"
+
+#~ msgid "Visibility of current Post or Page"
+#~ msgstr "Visibilidad del Post o Página Actual"
+
+#~ msgid "Restrict Admin"
+#~ msgstr "Restringir Admin"
+
+#~ msgid "Restrict access to current Post or Page on BackEnd"
+#~ msgstr "Restringir acceso al Post o Página actual en el BackEnd"
+
+#~ msgid "Restrict Front"
+#~ msgstr "Restringir Frente"
+
+#~ msgid "Restrict access to current Post or Page on FrontEnd"
+#~ msgstr "Restringir acceso al Post o Página actual en el FrontEnd"
+
+#~ msgid "Just Exclude page from navitation but do not restrict access"
+#~ msgstr "Sólo Excluye la página de la navegación pero no restringe el acceso"
+
+#~ msgid "Expire"
+#~ msgstr "Expirar"
+
+#~ msgid ""
+#~ "If Restric is checked then restrict access to current Post or Page until "
+#~ "the picked date. If Restrict is unchecked then allow access to Page or "
+#~ "Post until the picked date"
+#~ msgstr ""
+#~ "Si Restringir está checkeado entonces restringe acceso al post o página "
+#~ "actual hasta la fecha elegida. Si Restringir no está checkeado entonces "
+#~ "permite acceso al post o página actual hasta la fecha elegida."
+
+#~ msgid "Update info only for current role"
+#~ msgstr "Actualizar info sólo para el rol actual"
+
+#~ msgid "Update Current"
+#~ msgstr "Actualizar"
+
+#~ msgid "Update info for all role"
+#~ msgstr "Actualizar info para todos los roles"
+
+#~ msgid "Update All"
+#~ msgstr "Actualziar todo"
+
+#~ msgid "Category"
+#~ msgstr "Categoría"
+
+#~ msgid "Category title"
+#~ msgstr "Título de categoría"
+
+#~ msgid "This is just a type of post's taxonomy. Always Category"
+#~ msgstr "Esto es sólo un tipo de taxonomía de post. Siempre Category"
+
+#~ msgid "Posts"
+#~ msgstr "Posts"
+
+#~ msgid "Number of posts current category has"
+#~ msgstr "Número de posts que tiene la categoría actual"
+
+#~ msgid ""
+#~ "Restrict access to current category and for all Sub Categories on "
+#~ "BackEnd. Also it'll restrict access to all posts under these categories"
+#~ msgstr ""
+#~ "Restringir acceso a la categoría actual y a todas las subcategorías en el "
+#~ "BackEnd. También restringirá acceso a todos los posts bajo estas "
+#~ "categorías"
+
+#~ msgid ""
+#~ "Restrict access to current category and for all Sub Categories on "
+#~ "FrontEnd. Also it'll restrict access to all posts under these categories"
+#~ msgstr ""
+#~ "Restringir acceso a la categoría actual y a todas las subcategorías en el "
+#~ "FrontEnd. También restringirá acceso a todos los posts bajo estas "
+#~ "categorías"
+
+#~ msgid ""
+#~ "If Restric is checked then restrict access to current Category and all "
+#~ "Sub Categories, and Posts since the picked date. If Restrict is unchecked "
+#~ "then allow access to current Category and all Sub Categories, and Posts "
+#~ "since the picked date"
+#~ msgstr ""
+#~ "Si Restringir está checkeado entonces restringe acceso a la categoría "
+#~ "actual y sus subcategorías, y Posts desde la fecha elegida. Si "
+#~ "Restringir no está checkeado entonces permite acceso a la categoría "
+#~ "actual y sus subcategorías, y Posts hasta la fecha elegida."
+
+#~ msgid "Select a proper Page, Post or Category."
+#~ msgstr "Seleccionar una página, Post, o Categoría adecuada."
+
+#~ msgid "Restore Default Setting for Current Role"
+#~ msgstr "Restaurar valores por defecto del Rol Actual"
+
+#~ msgid "Export Configurations"
+#~ msgstr "Exportar configuraciones"
+
+#~ msgid "Import Configurations"
+#~ msgstr "Importar Configuraciones"
+
+#~ msgid "Support"
+#~ msgstr "Soporte"
+
+#~ msgid "Find on Facebook"
+#~ msgstr "Buscar en Facebook"
+
+#~ msgid "Follow on Twitter"
+#~ msgstr "Seguir en Twitter"
+
+#~ msgid "LinkedIn"
+#~ msgstr "LinkedIn"
+
+#~ msgid "Leave Without Saving?"
+#~ msgstr "Salir Sin Salvar ?"
+
+#~ msgid ""
+#~ "Some changed detected. Are you sure that you want to leave without saving"
+#~ msgstr "Detectados algunos cambios. Está seguro de salir sin salvar ?"
+
+#~ msgid "Additional Features Available"
+#~ msgstr "Disponibles características adicionales"
+
+#~ msgid ""
+#~ "Additional features detected to extend Advanced Access Manager "
+#~ "functionality."
+#~ msgstr ""
+#~ "Características adicionales detectadas para extender la funcionalidad del "
+#~ "Administrador Avanzado de Acceso."
+
+#~ msgid ""
+#~ "Do you want to create a <b>Super Admin</b> Role to get access to ALL "
+#~ "features?"
+#~ msgstr ""
+#~ "Quiere crear el Rol <b>Super Admin</b> para acceder a todas las "
+#~ "características ?"
+
+#~ msgid ""
+#~ "After importing, ALL current configurations will be lost. If you are "
+#~ "sure, please select proper INI file and click on <i>Import</i> button."
+#~ msgstr ""
+#~ "Despues de importar, TODAS las configuraciones actuales de perderán. Si "
+#~ "está seguro, seleccione el Archivo INI apropiado y haga click en el botón "
+#~ "<i>Importar</i>"
+
+#~ msgid "Uploading..."
+#~ msgstr "Actualizando..."
+
+#~ msgid "Please wait. Importer is working..."
+#~ msgstr "Espere por favor. Realizando la importación..."
+
+#~ msgid "You are not authorized to view this page"
+#~ msgstr "No está autorizado a ver esta página"
+
+#~ msgid "Import"
+#~ msgstr "Importar"
+
+#~ msgid "Error during importing"
+#~ msgstr "Error durante la Importación"
+
+#~ msgid "Apply to ALL Blogs"
+#~ msgstr "Aplicar a TODOS los Blogs"
+
+#~ msgid "Action completed successfully"
+#~ msgstr "Acción completada con éxito"
+
+#~ msgid "Action failed"
+#~ msgstr "Error en la acción"
+
+#~ msgid "Settings applied successfully to ALL Blogs"
+#~ msgstr "Valores aplicados con éxito a todos los Blogs"
+
+#~ msgid ""
+#~ "<b>Since 2.0</b><br/>\n"
+#~ " <b>Note:</b> No longer used."
+#~ msgstr ""
+#~ "<b>Since 2.0</b><br/>\n"
+#~ " <b>Nota:</b> No usado mas."
+
+#~ msgid "<b>Description does not exist</b>"
+#~ msgstr "<b>Descripción no existe</b>"
+
+#~ msgid "<p>You do not have sufficient permissions to perform this action</p>"
+#~ msgstr "<p>No tienes los permisos suficientes para realizar esta acción</p>"
+
+#~ msgid ""
+#~ "<p><h3>General Information</h3></p>\n"
+#~ " <p>If you want to filter Admin Menu for some User Roles or just "
+#~ "delete unnecessary dashboard widgets or metaboxes in Edit Post Page, this "
+#~ "plugin is for you.\n"
+#~ " You can do following things with Advanced Access Manager:</p>\n"
+#~ "<ul>\n"
+#~ "<li>Filter Admin Menu for specific User Role</li>\n"
+#~ "<li>Filter Dashboard Widgets for specific User Role</li>\n"
+#~ "<li>Filter List of Metaboxes in Edit Post page for specific User Role</"
+#~ "li>\n"
+#~ "<li>Add new User Capabilities</li>\n"
+#~ "<li>Delete created User Capabilities</li>\n"
+#~ "<li>Create new User Roles</li>\n"
+#~ "<li>Delete any User Role</li>\n"
+#~ "<li>Save current User Roles settings and restore later</li>\n"
+#~ "<li>View the list of Posts Pages and Categories in a nice hierarchical "
+#~ "tree</li>\n"
+#~ "<li>Filter Posts and Post Categories</li>\n"
+#~ "<li>Filter Pages and Sub Pages</li>\n"
+#~ "<li>Set expiration Date for specific Posts, Pages or even Categories</"
+#~ "li>\n"
+#~ "<li>Reorganize Order of Main Menu for specific User Role</li>\n"
+#~ "</ul>\n"
+#~ " <p><h3>Main Menu</h3></p>\n"
+#~ " <p>Under Main Menu Tab there is a list of admin menu and submenus. "
+#~ "You can Restrict access to certain menus of submenus by checking proper "
+#~ "checkbox.\n"
+#~ " Also you can reorganize the menu order by draggin and dropping menus "
+#~ "in order you want.</p>\n"
+#~ " <p><h3>Metabox & Widgets</h3></p>\n"
+#~ " <p>This section allows you to filter the list of metaboxes (sections "
+#~ "to the Write Post, Write Page, and Write Link editing pages) and "
+#~ "dashboard widgets.</p>\n"
+#~ " <p><h3>Capabilities</h3></p>\n"
+#~ " <p>This is more advanced Tab which allows to create different "
+#~ "combinations of Capabilities for current User Role. If you are not "
+#~ "familiar with Capabilities please read <a href=\"http://codex.wordpress."
+#~ "org/Roles_and_Capabilities\" target=\"_blank\">Roles and Capabilities</a>."
+#~ "</p>\n"
+#~ " <p><h3>Posts & Pages</h3></p>\n"
+#~ " <p>Tree View of Posts (grouped into categories) and Pages (organized "
+#~ "hierarchically according to Parent Page parameter) where you can restrict "
+#~ "access to certain page or post or the whole category for current User "
+#~ "Role. There is also possibility to set expiration date to posts or pages."
+#~ "</p>\n"
+#~ msgstr ""
+#~ "<p><h3>Información General</h3></p>\n"
+#~ " <p>Si quiere flitrar el Menú Admin para algunos Roles de usuario o "
+#~ "borrar widgets no necesarios del Escritorio o metaboxes en la Edición de "
+#~ "páginas , Este plugin es para ti.\n"
+#~ " You can do following things with Advanced Access Manager:</p>\n"
+#~ "<ul>\n"
+#~ "<li>Filter Admin Menu for specific User Role</li>\n"
+#~ "<li>Filter Dashboard Widgets for specific User Role</li>\n"
+#~ "<li>Filter List of Metaboxes in Edit Post page for specific User Role</"
+#~ "li>\n"
+#~ "<li>Add new User Capabilities</li>\n"
+#~ "<li>Delete created User Capabilities</li>\n"
+#~ "<li>Create new User Roles</li>\n"
+#~ "<li>Delete any User Role</li>\n"
+#~ "<li>Save current User Roles settings and restore later</li>\n"
+#~ "<li>View the list of Posts Pages and Categories in a nice hierarchical "
+#~ "tree</li>\n"
+#~ "<li>Filter Posts and Post Categories</li>\n"
+#~ "<li>Filter Pages and Sub Pages</li>\n"
+#~ "<li>Set expiration Date for specific Posts, Pages or even Categories</"
+#~ "li>\n"
+#~ "<li>Reorganize Order of Main Menu for specific User Role</li>\n"
+#~ "</ul>\n"
+#~ " <p><h3>Main Menu</h3></p>\n"
+#~ " <p>Under Main Menu Tab there is a list of admin menu and submenus. "
+#~ "You can Restrict access to certain menus of submenus by checking proper "
+#~ "checkbox.\n"
+#~ " Also you can reorganize the menu order by draggin and dropping menus "
+#~ "in order you want.</p>\n"
+#~ " <p><h3>Metabox & Widgets</h3></p>\n"
+#~ " <p>This section allows you to filter the list of metaboxes (sections "
+#~ "to the Write Post, Write Page, and Write Link editing pages) and "
+#~ "dashboard widgets.</p>\n"
+#~ " <p><h3>Capabilities</h3></p>\n"
+#~ " <p>This is more advanced Tab which allows to create different "
+#~ "combinations of Capabilities for current User Role. If you are not "
+#~ "familiar with Capabilities please read <a href=\"http://codex.wordpress."
+#~ "org/Roles_and_Capabilities\" target=\"_blank\">Roles and Capabilities</a>."
+#~ "</p>\n"
+#~ " <p><h3>Posts & Pages</h3></p>\n"
+#~ " <p>Tree View of Posts (grouped into categories) and Pages (organized "
+#~ "hierarchically according to Parent Page parameter) where you can restrict "
+#~ "access to certain page or post or the whole category for current User "
+#~ "Role. There is also possibility to set expiration date to posts or pages."
+#~ "</p>\n"
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM\n"
+"POT-Creation-Date: 2014-02-20 08:00+0330\n"
+"PO-Revision-Date: 2014-02-20 09:05+0330\n"
+"Last-Translator: Ghaem Omidi <ghaemomidi@yahoo.com>\n"
+"Language-Team: WP-Parsi <ghaemomidi@yahoo.com>\n"
+"Language: fa_IR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.7\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Poedit-KeywordsList: __;_e;_x;_n\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:380
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:387
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:414
+msgid "Access denied"
+msgstr "امکان دسترسی وجود ندارد."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:873
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:874
+msgid "AAM"
+msgstr "افزونه مدیریت دسترسی پیشرفته"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:883
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:884
+msgid "Access Control"
+msgstr "کنترل دسترسی"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:891
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:892
+msgid "ConfigPress"
+msgstr "پیکربندی"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:899
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/aam.php:900
+msgid "Extensions"
+msgstr "افزودنی ها"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/config.php:61
+msgid "Failed to create wp-content/aam folder"
+msgstr "ایجاد پوشه wp-content/aam انجام نشد."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/config.php:64
+msgid "Folder wp-content/aam is not writable"
+msgstr "پوشه wp-content/aam قابل نوشتن نیست."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:100
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:204
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:100
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:204
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:100
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:204
+msgid "System"
+msgstr "سیستم"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:101
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:206
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:101
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:206
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:101
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:206
+msgid "Post & Page"
+msgstr "نوشته و برگه"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:102
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:208
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:102
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:208
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:102
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:208
+msgid "Backend Interface"
+msgstr "رابط بخش مدیریت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:103
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/capability.php:210
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:103
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/capability.php:210
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:103
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/capability.php:210
+msgid "Miscellaneous"
+msgstr "متفرقه"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/extension.php:99
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/extension.php:99
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/extension.php:99
+msgid "Folder advanced-access-manager/extension is not writable"
+msgstr "پوشه advanced-access-manager/extension قابل نوشتن نیست."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:59
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:59
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:59
+msgid "Roles"
+msgstr "قوانین"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:60
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:60
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:60
+msgid "Role Manager"
+msgstr "مدیریت قانون"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:68
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:68
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:68
+msgid "Users"
+msgstr "کاربران"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:69
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:69
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:69
+msgid "User Manager"
+msgstr "مدیریت کاربر"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:77
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:77
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:77
+msgid "Visitor"
+msgstr "بازدیدکنندگان"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:78
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:78
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:78
+msgid "Visitor Manager"
+msgstr "مدیریت بازدیدکنندگان"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:95
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:95
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:95
+msgid "Admin Menu"
+msgstr "منوی مدیریت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:98
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:98
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+"<b>کنترل دسترسی به منوی مدیریت. محدود کردن دسترسی به منو یا زیر منو. توجه، "
+"منو بر اساس قابلیت های کاربران یا قوانین ارائه شده است.</b>"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:103
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:103
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:103
+msgid "Metabox & Widget"
+msgstr "متاباکس و ابزارک"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:106
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:106
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+"<b>فیلترکردن متاباکس ها یا ابزارک ها برای قانون یا کاربر انتخاب شده. اگر "
+"متاباکس یا ابزارک فهرست نشده است، روی ((تازه کردن فهرست)) کلیک کنید یا لینک "
+"مستقیم را کپی کنید و قرار دهید.</b>"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:111
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:111
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:111
+msgid "Capability"
+msgstr "قابلیت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:114
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:114
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+"مدیریت فهرست قابلیت ها برای کاربر یا قانون انتخاب شده. <b>توجه</b>، با "
+"قابلیت ها خیلی با دقت باشید. پاک کردن یا برداشتن هر قابلیتی ممکن است باعث "
+"شوذ کنترل موقت یا دائم برخی از ویژگی ها یا پیشخوان وردپرس را از دست داد."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:119
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:119
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:119
+msgid "Posts & Pages"
+msgstr "نوشته ها و برگه ها"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:122
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:122
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+"<b>مدیریت دسترسی یه نوشته یا دوره فردی. توجه، ما فرض می کنیم هر نوشته، برگه "
+"یا پست تایپ دلخواه بر اساس نوشته است. و هر دوره ای شبیه دسته های نوشته بر "
+"اساس دوره است.</b>"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:127
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:127
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:127
+msgid "Event Manager"
+msgstr "مدیریت رویداد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:130
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:130
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+"<b>هنگامی که تعدادی رویداد در سایت وردپرسی شما ظاهر می شوند عمل خود را تعریف "
+"کنید. این بخش ها به شما اجازه می دهند تا باعث یک عمل در رویداد شبیه تغییر "
+"محتوای نوشته یا بروزرسانی وضعیت برگه شوید. شما می توانید تنظیم کنید تا تغییر "
+"وضعیت نوشته یا نوشتن یک رویداد دلخواه به عنوان یک اطلاعیه به ایمیل شما ارسال "
+"شوند.</b>"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:331
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:331
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:331
+msgid "Rollback Settings"
+msgstr "تنظیمات عقبگرد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:332
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:332
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:332
+msgid "Cancel"
+msgstr "لغو"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:333
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:333
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:333
+msgid "Send E-mail"
+msgstr "ارسال ایمیل"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:334
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:340
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:334
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:340
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:334
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:340
+msgid "Add New Role"
+msgstr "افزودن قانون جدید"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:335
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:335
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:335
+msgid "Manage"
+msgstr "مدیریت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:336
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:336
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:336
+msgid "Edit"
+msgstr "ویرایش"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:337
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:337
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:337
+msgid "Delete"
+msgstr "پاک کردن"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:338
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:338
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:338
+msgid "Filtered"
+msgstr "فیلترشده"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:339
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:339
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:339
+msgid "Clear"
+msgstr "پاک کردن"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:341
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:341
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:341
+msgid "Save Changes"
+msgstr "ذخیره ی تغییرات"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:342
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:342
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:342
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+"سیستم %d کاربر را با این قانون شناسایی کرده است. همه کاربران با قانون <b>%s</"
+"b> به طور خودکار پاک خواهند شد."
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:343
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:343
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:343
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr "آیا شما مطمئنید که می خواهید قانون <b>%s</b> را پاک کنید؟"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:344
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:344
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:344
+msgid "Delete Role"
+msgstr "پاک کردن قانون"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:345
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:345
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:345
+msgid "Add User"
+msgstr "افزودن کاربر"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:346
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:346
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:346
+msgid "Filter Users"
+msgstr "فیلتر کاربران"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:347
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:363
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:347
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:363
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:347
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:363
+msgid "Refresh List"
+msgstr "تازه کردن فهرست"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:348
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:348
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:348
+msgid "Block"
+msgstr "مسدود کردن"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:349
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:349
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:349
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr "آیا شما مطمئنید که می خواهید <b>%s</b> را پاک کنید؟"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:350
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:350
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:350
+msgid "Filter Capabilities by Category"
+msgstr "فیلترکردن قابلیت ها بر اساس دسته"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:351
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:351
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:351
+msgid "Inherit Capabilities"
+msgstr "به ارث بردن قابلیت ها"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:352
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:352
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:352
+msgid "Add New Capability"
+msgstr "افزودن قابلیت جدید"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:353
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:353
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:353
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr "آیا شما مطمئنید که می خواهید قابلیت <b>%s</b> را پاک کنید؟"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:354
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:354
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:354
+msgid "Delete Capability"
+msgstr "پاک کردن قابلیت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:355
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:355
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:355
+msgid "Select Role"
+msgstr "انتخاب قانون"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:356
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:356
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:356
+msgid "Add Capability"
+msgstr "افزودن قابلیت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:357
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:357
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:357
+msgid "Add Event"
+msgstr "افزودن رویداد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:358
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:358
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:358
+msgid "Edit Event"
+msgstr "ویرایش رویداد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:359
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:361
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:359
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:361
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:359
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:361
+msgid "Delete Event"
+msgstr "پاک کردن رویداد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:360
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:360
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:360
+msgid "Save Event"
+msgstr "ذخیره رویداد"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:362
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:362
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:362
+msgid "Filter Posts by Post Type"
+msgstr "فیلتر کردن نوشته ها بر اساس پست تایپ"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:364
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:364
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:364
+msgid "Restore Default"
+msgstr "بازگردانی به پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:365
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:365
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:365
+msgid "Apply"
+msgstr "اعمال کردن"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:366
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:366
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:366
+msgid "Edit Term"
+msgstr "ویرایش دوره"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:367
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:367
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:367
+msgid "Manager Access"
+msgstr "دسترسی مدیریت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:368
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:368
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:368
+msgid "Unlock Default Accesss Control"
+msgstr "بازکردن کنترل دسترسی پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:369
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:369
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:369
+msgid "Close"
+msgstr "بستن"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:370
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:370
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:370
+msgid "Edit Role"
+msgstr "ویرایش قانون"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:371
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:371
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:371
+msgid "Restore Default Capabilities"
+msgstr "بازگردانی قابلیت های پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:372
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:372
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:372
+#, php-format
+msgid "Are you sure you want to delete <b>%s</b>?"
+msgstr "آیا شما مطمئنید که می خواهید <b>%s</b> را پاک کنید؟"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:373
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:373
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:373
+#, php-format
+msgid "Are you sure you want to move <b>%s</b> to trash?"
+msgstr "آیا شما مطمئنید که می خواهید <b>%s</b> را به زباله دان انتقال دهید؟"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:374
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:374
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:374
+msgid "Delete Post"
+msgstr "پاک کردن نوشته"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:375
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:375
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:375
+msgid "Delete Permanently"
+msgstr "پاک کردن برای همیشه"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:376
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:376
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:376
+msgid "Trash Post"
+msgstr "زباله دان نوشته"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/manager.php:377
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/manager.php:377
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/manager.php:377
+msgid "Restore Default Access"
+msgstr "بازگردانی دسترسی پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/metabox.php:190
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/metabox.php:190
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/metabox.php:190
+msgid "Dashboard Widgets"
+msgstr "ابزارک های پیشخوان"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/metabox.php:194
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/metabox.php:194
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/metabox.php:194
+msgid "Frontend Widgets"
+msgstr "ابزارک های جلو"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/post.php:213
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/post.php:213
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/post.php:213
+msgid "[empty]"
+msgstr "(خالی)"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/post.php:396
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/application/view/post.php:404
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/post.php:396
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application/view/post.php:404
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/post.php:396
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\application\view/post.php:404
+msgid "All"
+msgstr "همه"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/activity.php:98
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/activity.php:98
+msgid "System Login"
+msgstr "ورود به سیستم"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/activity.php:102
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/activity.php:102
+msgid "System Logout"
+msgstr "خروج از سیستم"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/activity.php:108
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/activity.php:108
+msgid "Unknown Activity"
+msgstr "فعالیت ناشناخته"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/extension.php:112
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/extension.php:112
+msgid "Activity Log"
+msgstr "گزارش فعالیت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/extension.php:116
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/extension.php:116
+msgid ""
+"Tracks User Activities like user login/logout or post changes. Check <b>AAM "
+"Activities</b> Extension to get advanced list of possible activities."
+msgstr ""
+"<b>ردیابی فعالیت های کاربر مانند ورود و خروج کاربر یا تغییرات کاربر. افزودنی "
+"فعالیت های افزونه کنترل دسترسی پیشرفته را بررسی کنید تا فهرست پیشرفته از "
+"فعالیت های ممکن را دریافت کنید.</b>"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/extension.php:177
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/extension.php:177
+msgid "Clear Logs"
+msgstr "پاک کردن گزارش ها"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Activity_Log/extension.php:178
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Activity_Log/extension.php:178
+msgid "Get More"
+msgstr "بیشتر"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Multisite_Support/extension.php:125
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Multisite_Support/extension.php:125
+msgid "Sites"
+msgstr "سایت ها"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Multisite_Support/extension.php:126
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Multisite_Support/extension.php:126
+msgid "Site Manager"
+msgstr "مدیریت سایت"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Multisite_Support/extension.php:189
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Multisite_Support/extension.php:189
+msgid "Set Default"
+msgstr "تنظیم پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Multisite_Support/extension.php:190
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Multisite_Support/extension.php:190
+msgid "Unset Default"
+msgstr "تنظیم نکردن پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_Multisite_Support/extension.php:191
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_Multisite_Support/extension.php:191
+msgid "Set as Default"
+msgstr "تنظیم به عنوان پیش فرض"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_My_Feature/extension.php:50
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_My_Feature/extension.php:50
+msgid "My Feature"
+msgstr "ویژگی من"
+
+#: C:\Users\Ghaem\Desktop\advanced-access-manager/extension/AAM_My_Feature/extension.php:53
+#: C:\Users\Ghaem\Desktop\advanced-access-manager\extension\AAM_My_Feature/extension.php:53
+msgid "My customly developed feature"
+msgstr "<b>ویژگی دلخواه توسعه یافته من</b>"
--- /dev/null
+msgid ""\r
+msgstr ""\r
+"Project-Id-Version: AAM\n"\r
+"POT-Creation-Date: 2013-12-01 14:07-0500\n"\r
+"PO-Revision-Date: 2014-01-15 23:25+0100\n"\r
+"Last-Translator: Moskito7 <moskito7@wanadoo.fr>\n"\r
+"Language-Team: WPAAM <support@wpaam.com>\n"\r
+"MIME-Version: 1.0\n"\r
+"Content-Type: text/plain; charset=UTF-8\n"\r
+"Content-Transfer-Encoding: 8bit\n"\r
+"Language: fr_FR\n"\r
+"X-Generator: Poedit 1.5.4\n"\r
+\r
+#: aam.php:243 aam.php:248 aam.php:267\r
+msgid "Access denied"\r
+msgstr "Accès refusé"\r
+\r
+#: aam.php:691 aam.php:692\r
+msgid "AAM"\r
+msgstr "AAM"\r
+\r
+#: aam.php:701 aam.php:702\r
+msgid "Access Control"\r
+msgstr "Contrôle d'accès"\r
+\r
+#: aam.php:709 aam.php:710\r
+msgid "Extensions"\r
+msgstr "Extensions"\r
+\r
+#: application/view/capability.php:98 application/view/capability.php:179\r
+msgid "System"\r
+msgstr "Système"\r
+\r
+#: application/view/capability.php:99 application/view/capability.php:181\r
+msgid "Post & Page"\r
+msgstr "Articles et Pages"\r
+\r
+#: application/view/capability.php:100 application/view/capability.php:183\r
+msgid "Backend Interface"\r
+msgstr "Interface d'administration"\r
+\r
+#: application/view/capability.php:101\r
+msgid "Miscellaneous"\r
+msgstr "Divers"\r
+\r
+#: application/view/capability.php:185\r
+msgid "Miscelaneous"\r
+msgstr "Divers"\r
+\r
+#: application/view/manager.php:59\r
+msgid "Roles"\r
+msgstr "Rôles"\r
+\r
+#: application/view/manager.php:60\r
+msgid "Role Manager"\r
+msgstr "Gestionnaire de rôle"\r
+\r
+#: application/view/manager.php:68\r
+msgid "Users"\r
+msgstr "Utilisateurs"\r
+\r
+#: application/view/manager.php:69\r
+msgid "User Manager"\r
+msgstr "Gestionnaire d'utilisateurs"\r
+\r
+#: application/view/manager.php:77\r
+msgid "Visitor"\r
+msgstr "Visiteur"\r
+\r
+#: application/view/manager.php:78\r
+msgid "Visitor Manager"\r
+msgstr "Gestionnaire de visiteurs"\r
+\r
+#: application/view/manager.php:95\r
+msgid "Admin Menu"\r
+msgstr "Menu d'administration"\r
+\r
+#: application/view/manager.php:98\r
+msgid ""\r
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "\r
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."\r
+msgstr ""\r
+"Contrôler l'accès au menu d'administration. Restreindre l'accès au menu "\r
+"entier ou à un sous-menu. <b>Note</b>, l'affichage des menus est basé sur le "\r
+"rôle ou les capacités de l'utilisateur."\r
+\r
+#: application/view/manager.php:103\r
+msgid "Metabox & Widget"\r
+msgstr "Métabox & Widget"\r
+\r
+#: application/view/manager.php:106\r
+msgid ""\r
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "\r
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "\r
+"or Copy & Paste direct link to page where specific metabox or widget is "\r
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."\r
+msgstr ""\r
+"Filtrer la liste des métabox ou widgets pour le rôle ou l'utilisateur "\r
+"sélectionné. Si une métabox ou un widget n'est pas listé, essayez de cliquer "\r
+"sur le bouton <b>Rafraîchir la liste</b> ou copier et coller directement le "\r
+"lien vers la page où la métabox ou le widget est affiché et cliquez sur le "\r
+"bouton <b>Récupérer une métabox à partir d'un lien</b>."\r
+\r
+#: application/view/manager.php:111\r
+msgid "Capability"\r
+msgstr "Capacités"\r
+\r
+#: application/view/manager.php:114\r
+msgid ""\r
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "\r
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"\r
+"b> Be very careful with capabilities. Deleting or unchecking any capability "\r
+"may cause temporary or permanent constrol lost over some features or "\r
+"WordPress dashboard."\r
+msgstr ""\r
+"Gérer la liste des capacités pour l'utilisateur ou le rôle sélectionné. "\r
+"<b>Note</b>, la liste des capacités de l'utilisateur est héritée du rôle de "\r
+"l'utilisateur.</br><b>Attention !</b> Faites très attention avec les "\r
+"capacités. Supprimer ou décocher n'importe quelle capacité pourrait "\r
+"entrainer la perte temporaire ou définitive de certaines fonctionnalités ou "\r
+"du tableau de bord de Wordpress."\r
+\r
+#: application/view/manager.php:119\r
+msgid "Posts & Categories"\r
+msgstr "Articles et Catégories"\r
+\r
+#: application/view/manager.php:122\r
+msgid ""\r
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "\r
+"<b>Post</b>, we assume any post, page or custom post type. And under "\r
+"<b>Term</b> - any term like Post Categories."\r
+msgstr ""\r
+"Gérer l'accès individuellement aux <b>articles</b> ou <b>termes</b>. Note, "\r
+"on entend par <b>article</b> n'importe quel article, page ou type d'article. "\r
+"Et par <b>terme</b> n'importe quel élément comme des catégories d'articles."\r
+\r
+#: application/view/manager.php:127\r
+msgid "Event Manager"\r
+msgstr "Gestionnaire d'événements"\r
+\r
+#: application/view/manager.php:130\r
+msgid ""\r
+"Define your own action when some event appeared in your WordPress blog. This "\r
+"sections allows you to trigger an action on event like post content change, "\r
+"or page status update. You can setup to send email notification, change the "\r
+"post status or write your own custom event handler."\r
+msgstr ""\r
+"Définir votre propre action lorsqu'un événement apparaît sur votre blog "\r
+"WordPress. Cette section vous permet de déclencher une action sur un "\r
+"événement comme le changement de contenu d'un article, ou une mise à jour de "\r
+"l'état de la page. Vous pouvez configurer l'envoi d'une notification par E-"\r
+"mail, la modification du statut de l'article ou écrire votre propre "\r
+"gestionnaire d'événements."\r
+\r
+#: application/view/manager.php:135\r
+msgid "ConfigPress"\r
+msgstr "ConfigPress"\r
+\r
+#: application/view/manager.php:138\r
+msgid ""\r
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "\r
+"<b>ConfigPress tutorial</b>."\r
+msgstr ""\r
+"Contrôler le comportement de <b>AAM</b> avec ConfigPress. Pour plus de "\r
+"détails regardez le <b>tutoriel ConfigPress</b>."\r
+\r
+#: application/view/manager.php:342\r
+msgid "Rollback Settings"\r
+msgstr "Rétablir les paramètres"\r
+\r
+#: application/view/manager.php:343\r
+msgid "Cancel"\r
+msgstr "Annuler"\r
+\r
+#: application/view/manager.php:344\r
+msgid "Send E-mail"\r
+msgstr "Envoyer un E-mail"\r
+\r
+#: application/view/manager.php:345 application/view/manager.php:351\r
+msgid "Add New Role"\r
+msgstr "Ajouter un rôle"\r
+\r
+#: application/view/manager.php:346\r
+msgid "Manage"\r
+msgstr "Gérer"\r
+\r
+#: application/view/manager.php:347\r
+msgid "Edit"\r
+msgstr "Editer"\r
+\r
+#: application/view/manager.php:348\r
+msgid "Delete"\r
+msgstr "Supprimer"\r
+\r
+#: application/view/manager.php:349\r
+msgid "Filtered"\r
+msgstr "Filtré"\r
+\r
+#: application/view/manager.php:350\r
+msgid "Clear"\r
+msgstr "Nettoyer"\r
+\r
+#: application/view/manager.php:352\r
+msgid "Save Changes"\r
+msgstr "Sauvegarder les modifications"\r
+\r
+#: application/view/manager.php:353\r
+#, php-format\r
+msgid ""\r
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "\r
+"will be deleted automatically!"\r
+msgstr ""\r
+"Le système a détecté %d utilisateur(s) avec ce rôle. Tous les utilisateurs "\r
+"avec le rôle <b>%s</b> seront automatiquement supprimés !"\r
+\r
+#: application/view/manager.php:354\r
+#, php-format\r
+msgid "Are you sure that you want to delete role <b>%s</b>?"\r
+msgstr "Êtes-vous certain de vouloir supprimer <b>%s</b> ?"\r
+\r
+#: application/view/manager.php:355\r
+msgid "Delete Role"\r
+msgstr "Supprimer le rôle"\r
+\r
+#: application/view/manager.php:356\r
+msgid "Add User"\r
+msgstr "Ajouter un utilisateur"\r
+\r
+#: application/view/manager.php:357\r
+msgid "Filter Users"\r
+msgstr "Filtrer les utilisateurs"\r
+\r
+#: application/view/manager.php:358 application/view/manager.php:374\r
+msgid "Refresh List"\r
+msgstr "Rafraîchir la liste"\r
+\r
+#: application/view/manager.php:359\r
+msgid "Block"\r
+msgstr "Bloquer"\r
+\r
+#: application/view/manager.php:360\r
+#, php-format\r
+msgid "Are you sure you want to delete user <b>%s</b>?"\r
+msgstr "Êtes-vous certain de vouloir supprimer l'utilisateur <b>%s</b> ?"\r
+\r
+#: application/view/manager.php:361\r
+msgid "Filter Capabilities by Category"\r
+msgstr "Filtrer les capacités par catégorie"\r
+\r
+#: application/view/manager.php:362\r
+msgid "Inherit Capabilities"\r
+msgstr "Capacités héritées"\r
+\r
+#: application/view/manager.php:363\r
+msgid "Add New Capability"\r
+msgstr "Ajouter une nouvelle capacité"\r
+\r
+#: application/view/manager.php:364\r
+#, php-format\r
+msgid "Are you sure that you want to delete capability <b>%s</b>?"\r
+msgstr "Êtes-vous certain de vouloir supprimer la capacité <b>%s</b> ?"\r
+\r
+#: application/view/manager.php:365\r
+msgid "Delete Capability"\r
+msgstr "Supprimer la capacité"\r
+\r
+#: application/view/manager.php:366\r
+msgid "Select Role"\r
+msgstr "Sélectionner le rôle"\r
+\r
+#: application/view/manager.php:367\r
+msgid "Add Capability"\r
+msgstr "Ajouter la capacité"\r
+\r
+#: application/view/manager.php:368\r
+msgid "Add Event"\r
+msgstr "Ajouter un événement"\r
+\r
+#: application/view/manager.php:369\r
+msgid "Edit Event"\r
+msgstr "Editer un événement"\r
+\r
+#: application/view/manager.php:370 application/view/manager.php:372\r
+msgid "Delete Event"\r
+msgstr "Supprimer un événement"\r
+\r
+#: application/view/manager.php:371\r
+msgid "Save Event"\r
+msgstr "Sauvegarder un événement"\r
+\r
+#: application/view/manager.php:373\r
+msgid "Filter Posts by Post Type"\r
+msgstr "Filtrer les articles par type"\r
+\r
+#: application/view/manager.php:375\r
+msgid "Restore Default"\r
+msgstr "Restaurer les paramètres par défaut"\r
+\r
+#: application/view/manager.php:376\r
+msgid "Apply"\r
+msgstr "Appliquer"\r
+\r
+#: application/view/manager.php:377\r
+msgid "Edit Term"\r
+msgstr "Editer les termes"\r
+\r
+#: application/view/manager.php:378\r
+msgid "Manager Access"\r
+msgstr "Gestionnaire d'accès"\r
+\r
+#: application/view/manager.php:379\r
+msgid "Unlock Default Accesss Control"\r
+msgstr "Déverrouiller le contrôle d'accès par défaut"\r
+\r
+#: application/view/manager.php:380\r
+msgid "Close"\r
+msgstr "Fermer"\r
+\r
+#: application/view/manager.php:381\r
+msgid "Edit Role"\r
+msgstr "Editer le rôle"\r
+\r
+#: application/view/metabox.php:179\r
+msgid "Dashboard Widgets"\r
+msgstr "Widgets du tableau de bord"\r
+\r
+#: application/view/metabox.php:183\r
+msgid "Frontend Widgets"\r
+msgstr "Widgets du site"\r
+\r
+#: application/view/post.php:181\r
+msgid "[empty]"\r
+msgstr "[vide]"\r
+\r
+#: application/view/post.php:345 application/view/post.php:353\r
+msgid "All"\r
+msgstr "Tout"\r
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM v2.2.2\n"
+"POT-Creation-Date: 2014-01-23 20:56-0500\n"
+"PO-Revision-Date: 2014-02-06 21:37+0100\n"
+"Last-Translator: Gustaw Lasek <biuro@servitium.pl>\n"
+"Language-Team: Servitium <biuro@servitium.pl>\n"
+"Language: pl_PL\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.7\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#: aam.php:346 aam.php:351 aam.php:379
+msgid "Access denied"
+msgstr "Brak dostępu"
+
+#: aam.php:833 aam.php:834
+msgid "AAM"
+msgstr "AAM"
+
+#: aam.php:843 aam.php:844
+msgid "Access Control"
+msgstr "Kontrola dostępu"
+
+#: aam.php:851 aam.php:852
+msgid "Extensions"
+msgstr "Rozszerzenia"
+
+#: config.php:58
+msgid "<b>wp-content</b> folder is not writable or does not exists. "
+msgstr "<b>wp-content</b> folder nie ma uparwnień do zapisu lub nie istnieje."
+
+#: config.php:60
+msgid "Read more."
+msgstr "Czytaj więcej."
+
+#: config.php:85
+msgid "Migrate your old AAM settings to the new AAM platform. "
+msgstr ""
+"Migracja ustawień ze starych wersji AAM (do v1.9.1) do nowej wersji wtyczki "
+"AAM."
+
+#: config.php:86
+msgid "Click to Migrate"
+msgstr "Kliknij by migrować"
+
+#: application/view/capability.php:100 application/view/capability.php:199
+msgid "System"
+msgstr "System"
+
+#: application/view/capability.php:101 application/view/capability.php:201
+msgid "Post & Page"
+msgstr "Wpisy i Strony"
+
+#: application/view/capability.php:102 application/view/capability.php:203
+msgid "Backend Interface"
+msgstr "Interfejs panelu zarządzania"
+
+#: application/view/capability.php:103 application/view/capability.php:205
+msgid "Miscellaneous"
+msgstr "Pozostałe"
+
+#: application/view/manager.php:59
+msgid "Roles"
+msgstr "Role"
+
+#: application/view/manager.php:60
+msgid "Role Manager"
+msgstr "Zarządzanie rolami"
+
+#: application/view/manager.php:68
+msgid "Users"
+msgstr "Użytkownicy"
+
+#: application/view/manager.php:69
+msgid "User Manager"
+msgstr "Zarządzanie użytkownikami"
+
+#: application/view/manager.php:77
+msgid "Visitor"
+msgstr "Gość"
+
+#: application/view/manager.php:78
+msgid "Visitor Manager"
+msgstr "Zarządzaj gośćmi"
+
+#: application/view/manager.php:95
+msgid "Admin Menu"
+msgstr "Admin Menu"
+
+#: application/view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+"Kontroluj dostęp do menu administracyjnego. Ogranicz dostęp do całych "
+"pozycji menu lub do pozycji podmenu. <b>Wskazówka</b> menu jest dynamicznie "
+"generowane zależnie od ról i uprawnień."
+
+#: application/view/manager.php:103
+msgid "Metabox & Widget"
+msgstr "Metaboxy i Widżety"
+
+#: application/view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+"Filtruj listę Widżetów i Metaboksów dla wybranej roli lub użytkownika. "
+"Jeżeli brakuje Metaboxów i/lub Widżetów na liście, kliknij ikonkę <b>Odśwież "
+"listę</b> lub skopiuj i wklej bezpośredni odnośnik do strony, gdzie "
+"wyświetlają się braujące Metaboksy i/lub Widżety i kliknij ikonkę plusa "
+"<b>Wczytaj elementy ze strony</b>"
+
+#: application/view/manager.php:111
+msgid "Capability"
+msgstr "Szczegółowe prawa"
+
+#: application/view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+"Zarządzaj listą uprawnień dla wybranego użytkownia lub roli. <b>Wskazówka</"
+"b> Lista uprawnień jest dziedziczona z roli/ról uzytkownika. <b>Ostrzeżenie!"
+"</b> Bądź ostrony z uprawnieniami. Usuwanie lub odbieranie uprawnień może "
+"spowodować tymczasowy lub całkowity brak dostępu do panelu administracyjnego "
+"WordPress."
+
+#: application/view/manager.php:119
+msgid "Posts & Categories"
+msgstr "Wpisy i Kategorie"
+
+#: application/view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+"Zarządzaj dostępen do poszczególnych <b>Wpisów</b> i/lub <b>Typów</b>. "
+"Wyjaśnienie, <b>Wpisy</b> rozumiane jako dowolne strony, wpisy lub "
+"niestandardowe typy wpisów. <b>Typy</b> rozumiane jako dowolne kategorie."
+
+#: application/view/manager.php:127
+msgid "Event Manager"
+msgstr "Menadżer reguł"
+
+#: application/view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+"Zdefiniuj własną akcję dla zdarzeń wystepujących w Twoim WordPress. Ta "
+"skecja pozwala ustawić akcję na jakieś zdarzenie np.: zmiana treści wpisu/"
+"strony lub statusu. Możesz skonfigurować wysyłanie powiadomień email, "
+"zmienić status wpisu/strony lub zdefiniować własną obsługę zdarzenia. "
+
+#: application/view/manager.php:135
+msgid "ConfigPress"
+msgstr "Konfiguracja"
+
+#: application/view/manager.php:138
+msgid ""
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "
+"<b>ConfigPress tutorial</b>."
+msgstr ""
+"Konfiguruj <b>AAM</b> przez ConfigPress. Aby uzyskać więcej informacji "
+"zapoznaj się <b>poradnikiem ConfigPress</b>."
+
+#: application/view/manager.php:339
+msgid "Rollback Settings"
+msgstr "Wycofaj ustawienia"
+
+#: application/view/manager.php:340
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: application/view/manager.php:341
+msgid "Send E-mail"
+msgstr "Wyślij E-mail"
+
+#: application/view/manager.php:342 application/view/manager.php:348
+msgid "Add New Role"
+msgstr "Dodaj nową rolę"
+
+#: application/view/manager.php:343
+msgid "Manage"
+msgstr "Zarządzaj/Edytuj"
+
+#: application/view/manager.php:344
+msgid "Edit"
+msgstr "Edytuj"
+
+#: application/view/manager.php:345
+msgid "Delete"
+msgstr "Usuń"
+
+#: application/view/manager.php:346
+msgid "Filtered"
+msgstr "Przefiltrowane"
+
+#: application/view/manager.php:347
+msgid "Clear"
+msgstr "Wyczyść"
+
+#: application/view/manager.php:349
+msgid "Save Changes"
+msgstr "Zapisz zmiany"
+
+#: application/view/manager.php:350
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+"System wykrył użytkownika/ów z tej roli. Wszyscy użytkownicy z tą rolą "
+"zostaną usunięci!"
+
+#: application/view/manager.php:351
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr "Czy na pewno chcesz usunąć rolę/e?"
+
+#: application/view/manager.php:352
+msgid "Delete Role"
+msgstr "Usuń rolę"
+
+#: application/view/manager.php:353
+msgid "Add User"
+msgstr "Dodaj użytkownika"
+
+#: application/view/manager.php:354
+msgid "Filter Users"
+msgstr "FIltruj uzytkowników"
+
+#: application/view/manager.php:355 application/view/manager.php:371
+msgid "Refresh List"
+msgstr "Odśwież listę"
+
+#: application/view/manager.php:356
+msgid "Block"
+msgstr "Zablokuj"
+
+#: application/view/manager.php:357
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr "Czy na pewno chcesz usunąć użytkownika/ów?"
+
+#: application/view/manager.php:358
+msgid "Filter Capabilities by Category"
+msgstr "Filtruj prawa wg kategorii"
+
+#: application/view/manager.php:359
+msgid "Inherit Capabilities"
+msgstr "Dziedzicz prawa"
+
+#: application/view/manager.php:360
+msgid "Add New Capability"
+msgstr "Dodaj nowe prawo"
+
+#: application/view/manager.php:361
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr "Czy na pewno chcesz usunąć pozycję/e?"
+
+#: application/view/manager.php:362
+msgid "Delete Capability"
+msgstr "Usuń pozycję"
+
+#: application/view/manager.php:363
+msgid "Select Role"
+msgstr "Wybierz rolę"
+
+#: application/view/manager.php:364
+msgid "Add Capability"
+msgstr "Dodaj pozycję"
+
+#: application/view/manager.php:365
+msgid "Add Event"
+msgstr "Dodaj regułę"
+
+#: application/view/manager.php:366
+msgid "Edit Event"
+msgstr "Edytuj regułę"
+
+#: application/view/manager.php:367 application/view/manager.php:369
+msgid "Delete Event"
+msgstr "Usuń regułę"
+
+#: application/view/manager.php:368
+msgid "Save Event"
+msgstr "Zapisz regułę"
+
+#: application/view/manager.php:370
+msgid "Filter Posts by Post Type"
+msgstr "Filtruj wpisy typy wpisów"
+
+#: application/view/manager.php:372
+msgid "Restore Default"
+msgstr "Przywróć domyślne"
+
+#: application/view/manager.php:373
+msgid "Apply"
+msgstr "Zastosuj"
+
+#: application/view/manager.php:374
+msgid "Edit Term"
+msgstr "Edytuj termin"
+
+#: application/view/manager.php:375
+msgid "Manager Access"
+msgstr "Menadżer dostępu"
+
+#: application/view/manager.php:376
+msgid "Unlock Default Accesss Control"
+msgstr "Odblokuj domyślną kontrolę dostępu"
+
+#: application/view/manager.php:377
+msgid "Close"
+msgstr "Zamknij"
+
+#: application/view/manager.php:378
+msgid "Edit Role"
+msgstr "Edytuj rolę"
+
+#: application/view/manager.php:379
+msgid "Restore Default Capabilities"
+msgstr "Przywróć domyślne"
+
+#: application/view/metabox.php:185
+msgid "Dashboard Widgets"
+msgstr "Widżety panelu"
+
+#: application/view/metabox.php:189
+msgid "Frontend Widgets"
+msgstr "Widżety strony"
+
+#: application/view/post.php:181
+msgid "[empty]"
+msgstr "[puste]"
+
+#: application/view/post.php:345 application/view/post.php:353
+msgid "All"
+msgstr "Wszystkie"
+
+#: extension/AAM_Multisite_Support/extension.php:125
+msgid "Sites"
+msgstr "Strony"
+
+#: extension/AAM_Multisite_Support/extension.php:126
+msgid "Site Manager"
+msgstr "Zarządzanie stroną"
+
+#: extension/AAM_Multisite_Support/extension.php:189
+msgid "Set Default"
+msgstr "Ustaw domyślne"
+
+#: extension/AAM_Multisite_Support/extension.php:190
+msgid "Unset Default"
+msgstr "Odznacz domyślne"
+
+#: extension/AAM_Multisite_Support/extension.php:191
+msgid "Set as Default"
+msgstr "Zaznacz jako domyślne"
+
+#: extension/AAM_My_Feature/extension.php:50
+msgid "My Feature"
+msgstr "Moje funckcje"
+
+#: extension/AAM_My_Feature/extension.php:53
+msgid "My customly developed feature"
+msgstr "Własna funkcjonalność"
+
+#~ msgid "Miscelaneous"
+#~ msgstr "Pozostałe"
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM\n"
+"POT-Creation-Date: 2013-12-01 14:07-0500\n"
+"PO-Revision-Date: 2014-01-31 21:24+0400\n"
+"Last-Translator: Maxim Kernozhitskiy <maxim@aeromultimedia.com>\n"
+"Language-Team: WPAAM <support@wpaam.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en_US\n"
+"X-Generator: Poedit 1.5.7\n"
+
+#: aam.php:243 aam.php:248 aam.php:267
+msgid "Access denied"
+msgstr "Доступ запрещен"
+
+#: aam.php:691 aam.php:692
+msgid "AAM"
+msgstr "AAM"
+
+#: aam.php:701 aam.php:702
+msgid "Access Control"
+msgstr "Контроль доступа"
+
+#: aam.php:709 aam.php:710
+msgid "Extensions"
+msgstr "Расширение"
+
+#: application/view/capability.php:98 application/view/capability.php:179
+msgid "System"
+msgstr "Система"
+
+#: application/view/capability.php:99 application/view/capability.php:181
+msgid "Post & Page"
+msgstr "Пост и Страница"
+
+#: application/view/capability.php:100 application/view/capability.php:183
+msgid "Backend Interface"
+msgstr "Интерфейс Админа"
+
+#: application/view/capability.php:101
+msgid "Miscellaneous"
+msgstr "Разное"
+
+#: application/view/capability.php:185
+msgid "Miscelaneous"
+msgstr "Разное"
+
+#: application/view/manager.php:59
+msgid "Roles"
+msgstr "Роли"
+
+#: application/view/manager.php:60
+msgid "Role Manager"
+msgstr "Менеджер ролей"
+
+#: application/view/manager.php:68
+msgid "Users"
+msgstr "Пользователи"
+
+#: application/view/manager.php:69
+msgid "User Manager"
+msgstr "Менеджер пользователей"
+
+#: application/view/manager.php:77
+msgid "Visitor"
+msgstr "Посетители"
+
+#: application/view/manager.php:78
+msgid "Visitor Manager"
+msgstr "Менеджер посетителей"
+
+#: application/view/manager.php:95
+msgid "Admin Menu"
+msgstr "Меню Админа"
+
+#: application/view/manager.php:98
+msgid ""
+"Control Access to Admin Menu. Restrict access to entire Menu or Submenu. "
+"<b>Notice</b>, the menu is rendered based on Role's or User's capabilities."
+msgstr ""
+"Контроль доступа к меню Администратора. Запретить доступ ко всему меню или в "
+"подменю. <b>Внимание</b>, меню отображается основываясь на Роли или доступе "
+"пользователя."
+
+#: application/view/manager.php:103
+msgid "Metabox & Widget"
+msgstr "Виджеты и Метабоксы"
+
+#: application/view/manager.php:106
+msgid ""
+"Filter the list of Metaboxes or Widgets for selected Role or User. If "
+"metabox or widget is not listed, try to click <b>Refresh the List</b> button "
+"or Copy & Paste direct link to page where specific metabox or widget is "
+"shown and hit <b>Retrieve Metaboxes from Link</b> button."
+msgstr ""
+"Фильтрует лист Виджетов или Метабоксов для выбранной Роли Пользователя. Если "
+"метабокс или виджет не в списке попробуйте нажать кнопку <b>Обновить список</"
+"b> или скопировать и вставить прямую ссылку на страницу, где показан "
+"метабокс или виджет и нажать кнопку <b>Извлеч Метабоксы из ссылки</b>"
+
+#: application/view/manager.php:111
+msgid "Capability"
+msgstr "Возможность"
+
+#: application/view/manager.php:114
+msgid ""
+"Manage the list of Capabilities for selected User or Role. <b>Notice</b>, "
+"list of user's capabilities are inherited from user's Role.<br/><b>Warning!</"
+"b> Be very careful with capabilities. Deleting or unchecking any capability "
+"may cause temporary or permanent constrol lost over some features or "
+"WordPress dashboard."
+msgstr ""
+"Управляйте листом возможностей для выбранных Пользователя или Роли. "
+"<b>Внимание</b>, лист пользовательских возможностей унаследован от Роли "
+"пользователя.<br/> <b>ВНИМАНИЕ!</b> будьте осторожны с возможностями. "
+"Удаление или снятие некоторых возможностей пользователя может привести к "
+"временной, либо постоянной потере контроля над некоторыми функциями "
+"Wordpress."
+
+#: application/view/manager.php:119
+msgid "Posts & Categories"
+msgstr "Посты и Категории"
+
+#: application/view/manager.php:122
+msgid ""
+"Manage access to individual <b>Post</b> or <b>Term</b>. Notice, under "
+"<b>Post</b>, we assume any post, page or custom post type. And under "
+"<b>Term</b> - any term like Post Categories."
+msgstr ""
+"Управляйте доступом к индивидуальным <b>Постам</b> или <b>Терминам</b>. "
+"Понятие <b>Пост</b> в данном случае - любой пост, страница или Собственный "
+"тип поста. А под <b>Термином</b> - любой термин типа Категории поста."
+
+#: application/view/manager.php:127
+msgid "Event Manager"
+msgstr "Менеджер событий"
+
+#: application/view/manager.php:130
+msgid ""
+"Define your own action when some event appeared in your WordPress blog. This "
+"sections allows you to trigger an action on event like post content change, "
+"or page status update. You can setup to send email notification, change the "
+"post status or write your own custom event handler."
+msgstr ""
+"Укажите ваше собственное действие, когда происходит некоторое событие в "
+"Wordpress. Эта секция позволяет вам отрабатывать действие или даже изменение "
+"контента, или изменение статуса страницы. Вы можете отправлять уведомления "
+"на email, менять статус поста или написать свой собственный обработчик."
+
+#: application/view/manager.php:135
+msgid "ConfigPress"
+msgstr "ConfigPress"
+
+#: application/view/manager.php:138
+msgid ""
+"Control <b>AAM</b> behavior with ConfigPress. For more details please check "
+"<b>ConfigPress tutorial</b>."
+msgstr ""
+"Контролируйте поведение <b>AAM</b> с ConfigPress. Для подробностей "
+"посмотрите <b>ConfigPress туториал</b>."
+
+#: application/view/manager.php:342
+msgid "Rollback Settings"
+msgstr "Настройки Rollback"
+
+#: application/view/manager.php:343
+msgid "Cancel"
+msgstr "Отменить"
+
+#: application/view/manager.php:344
+msgid "Send E-mail"
+msgstr "Отправить E-mail"
+
+#: application/view/manager.php:345 application/view/manager.php:351
+msgid "Add New Role"
+msgstr "Добавить Роль"
+
+#: application/view/manager.php:346
+msgid "Manage"
+msgstr "Управление"
+
+#: application/view/manager.php:347
+msgid "Edit"
+msgstr "Редактировать"
+
+#: application/view/manager.php:348
+msgid "Delete"
+msgstr "Удалить"
+
+#: application/view/manager.php:349
+msgid "Filtered"
+msgstr "Фильтровано"
+
+#: application/view/manager.php:350
+msgid "Clear"
+msgstr "Отчистить"
+
+#: application/view/manager.php:352
+msgid "Save Changes"
+msgstr "Сохранить изменения"
+
+#: application/view/manager.php:353
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+"Система определила %d пользователя(лей) с этой ролью. Все Пользователи с "
+"Ролью <b>%s</b> будут удалены автоматически!"
+
+#: application/view/manager.php:354
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr "Вы уверены, что хотите удалить роль <b>%s</b>?"
+
+#: application/view/manager.php:355
+msgid "Delete Role"
+msgstr "Удалить Роль"
+
+#: application/view/manager.php:356
+msgid "Add User"
+msgstr "Добавить пользователя"
+
+#: application/view/manager.php:357
+msgid "Filter Users"
+msgstr "Фильтр пользователей"
+
+#: application/view/manager.php:358 application/view/manager.php:374
+msgid "Refresh List"
+msgstr "Обновить список"
+
+#: application/view/manager.php:359
+msgid "Block"
+msgstr "Заблокировать"
+
+#: application/view/manager.php:360
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr "Вы уверены, что хотите удалить пользователя <b>%s</b>?"
+
+#: application/view/manager.php:361
+msgid "Filter Capabilities by Category"
+msgstr "Фильтр возможностей по категории"
+
+#: application/view/manager.php:362
+msgid "Inherit Capabilities"
+msgstr "Назледовать возможности"
+
+#: application/view/manager.php:363
+msgid "Add New Capability"
+msgstr "Добавить новую возможность"
+
+#: application/view/manager.php:364
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr "Вы уверены, что хотите удалить возможность <b>%s</b>?"
+
+#: application/view/manager.php:365
+msgid "Delete Capability"
+msgstr "Удалить возможность"
+
+#: application/view/manager.php:366
+msgid "Select Role"
+msgstr "Выбрать роль"
+
+#: application/view/manager.php:367
+msgid "Add Capability"
+msgstr "Добавить возможность"
+
+#: application/view/manager.php:368
+msgid "Add Event"
+msgstr "Добавить событие"
+
+#: application/view/manager.php:369
+msgid "Edit Event"
+msgstr "Редактировать событие"
+
+#: application/view/manager.php:370 application/view/manager.php:372
+msgid "Delete Event"
+msgstr "Удалить событие"
+
+#: application/view/manager.php:371
+msgid "Save Event"
+msgstr "Сохранить событие"
+
+#: application/view/manager.php:373
+msgid "Filter Posts by Post Type"
+msgstr "Фильтр постов по Типу"
+
+#: application/view/manager.php:375
+msgid "Restore Default"
+msgstr "Сбросить настройки"
+
+#: application/view/manager.php:376
+msgid "Apply"
+msgstr "Применить"
+
+#: application/view/manager.php:377
+msgid "Edit Term"
+msgstr "Редактировать Термин"
+
+#: application/view/manager.php:378
+msgid "Manager Access"
+msgstr "Диспетчер доступу"
+
+#: application/view/manager.php:379
+msgid "Unlock Default Accesss Control"
+msgstr "Разблокировать стандартный контроль доступа"
+
+#: application/view/manager.php:380
+msgid "Close"
+msgstr "Закрыть"
+
+#: application/view/manager.php:381
+msgid "Edit Role"
+msgstr "Редактировать роль"
+
+#: application/view/metabox.php:179
+msgid "Dashboard Widgets"
+msgstr "Панель виджетов"
+
+#: application/view/metabox.php:183
+msgid "Frontend Widgets"
+msgstr "Frontend виджеты"
+
+#: application/view/post.php:181
+msgid "[empty]"
+msgstr "[пусто]"
+
+#: application/view/post.php:345 application/view/post.php:353
+msgid "All"
+msgstr "Все"
--- /dev/null
+msgid ""
+msgstr ""
+"Project-Id-Version: AAM\n"
+"POT-Creation-Date: 2014-05-04 19:41-0500\n"
+"PO-Revision-Date: \n"
+"Last-Translator: WPAAM <support@wpaam.com>\n"
+"Language-Team: WP AAM <support@wpaam.com>\n"
+"Language: en\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.5\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-KeywordsList: __\n"
+"X-Poedit-Basepath: d:\\xampp\\htdocs\\aam\\wp-content\\plugins\\aam\\\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: aam.php:404 aam.php:412 aam.php:439
+msgid "Access denied"
+msgstr ""
+
+#: aam.php:927 aam.php:928
+msgid "AAM"
+msgstr ""
+
+#: aam.php:939 aam.php:940
+msgid "Access Control"
+msgstr ""
+
+#: aam.php:949 aam.php:950
+msgid "ConfigPress"
+msgstr ""
+
+#: aam.php:959 aam.php:960
+msgid "Extensions"
+msgstr ""
+
+#: application/core/repository.php:261
+msgid "Failed to Remove Extension"
+msgstr ""
+
+#: application/core/repository.php:306
+msgid "Invalid License Key"
+msgstr ""
+
+#: application/core/repository.php:309
+msgid "Failed to write file to wp-content/aam folder"
+msgstr ""
+
+#: application/core/repository.php:313
+msgid "Failed to reach the WPAAM Server"
+msgstr ""
+
+#: application/core/repository.php:329
+msgid "Failed to insert extension to extension folder"
+msgstr ""
+
+#: application/view/abstract.php:81
+msgid "You are not allowed to manager current view"
+msgstr ""
+
+#: application/view/capability.php:101 application/view/capability.php:205
+msgid "System"
+msgstr ""
+
+#: application/view/capability.php:102 application/view/capability.php:207
+msgid "Post & Page"
+msgstr ""
+
+#: application/view/capability.php:103 application/view/capability.php:209
+msgid "Backend Interface"
+msgstr ""
+
+#: application/view/capability.php:104 application/view/capability.php:211
+msgid "Miscellaneous"
+msgstr ""
+
+#: application/view/extension.php:100
+msgid "Folder advanced-access-manager/extension is not writable"
+msgstr ""
+
+#: application/view/manager.php:76
+msgid "Roles"
+msgstr ""
+
+#: application/view/manager.php:77
+msgid "Role Manager"
+msgstr ""
+
+#: application/view/manager.php:86
+msgid "Users"
+msgstr ""
+
+#: application/view/manager.php:87
+msgid "User Manager"
+msgstr ""
+
+#: application/view/manager.php:96
+msgid "Visitor"
+msgstr ""
+
+#: application/view/manager.php:97
+msgid "Visitor Manager"
+msgstr ""
+
+#: application/view/manager.php:120
+msgid "Admin Menu"
+msgstr ""
+
+#: application/view/manager.php:132
+msgid "Metabox & Widget"
+msgstr ""
+
+#: application/view/manager.php:145 application/view/tmpl/capability.phtml:17
+#: application/view/tmpl/control_area.phtml:47
+#: application/view/tmpl/control_area.phtml:94
+#: application/view/tmpl/control_area.phtml:148
+#: application/view/tmpl/control_area.phtml:199
+#: extension/AAM_Plus_Package/ui.phtml:28
+#: extension/AAM_Plus_Package/ui.phtml:60
+#: extension/AAM_Plus_Package/ui.phtml:93
+#: extension/AAM_Plus_Package/ui.phtml:125
+msgid "Capability"
+msgstr ""
+
+#: application/view/manager.php:156
+msgid "Posts & Pages"
+msgstr ""
+
+#: application/view/manager.php:169
+msgid "Event Manager"
+msgstr ""
+
+#: application/view/manager.php:241
+msgid "You are not allowed to manage any AAM Features."
+msgstr ""
+
+#: application/view/manager.php:820
+msgid "Rollback Settings"
+msgstr ""
+
+#: application/view/manager.php:821
+msgid "Cancel"
+msgstr ""
+
+#: application/view/manager.php:822
+msgid "Send E-mail"
+msgstr ""
+
+#: application/view/manager.php:823 application/view/manager.php:829
+msgid "Add New Role"
+msgstr ""
+
+#: application/view/manager.php:824
+msgid "Manage"
+msgstr ""
+
+#: application/view/manager.php:825
+msgid "Edit"
+msgstr ""
+
+#: application/view/manager.php:826
+msgid "Delete"
+msgstr ""
+
+#: application/view/manager.php:827
+msgid "Filtered"
+msgstr ""
+
+#: application/view/manager.php:828
+msgid "Clear"
+msgstr ""
+
+#: application/view/manager.php:830
+msgid "Save Changes"
+msgstr ""
+
+#: application/view/manager.php:831
+#, php-format
+msgid ""
+"System detected %d user(s) with this role. All Users with Role <b>%s</b> "
+"will be deleted automatically!"
+msgstr ""
+
+#: application/view/manager.php:832
+#, php-format
+msgid "Are you sure that you want to delete role <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:833 application/view/tmpl/role.phtml:53
+msgid "Delete Role"
+msgstr ""
+
+#: application/view/manager.php:834
+msgid "Add User"
+msgstr ""
+
+#: application/view/manager.php:835
+msgid "Filter Users"
+msgstr ""
+
+#: application/view/manager.php:836 application/view/manager.php:852
+msgid "Refresh List"
+msgstr ""
+
+#: application/view/manager.php:837
+msgid "Block"
+msgstr ""
+
+#: application/view/manager.php:838
+#, php-format
+msgid "Are you sure you want to delete user <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:839
+msgid "Filter Capabilities by Category"
+msgstr ""
+
+#: application/view/manager.php:840 application/view/tmpl/capability.phtml:47
+msgid "Inherit Capabilities"
+msgstr ""
+
+#: application/view/manager.php:841 application/view/tmpl/capability.phtml:62
+msgid "Add New Capability"
+msgstr ""
+
+#: application/view/manager.php:842
+#, php-format
+msgid "Are you sure that you want to delete capability <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:843 application/view/tmpl/capability.phtml:81
+msgid "Delete Capability"
+msgstr ""
+
+#: application/view/manager.php:844
+msgid "Select Role"
+msgstr ""
+
+#: application/view/manager.php:845
+msgid "Add Capability"
+msgstr ""
+
+#: application/view/manager.php:846
+msgid "Add Event"
+msgstr ""
+
+#: application/view/manager.php:847
+msgid "Edit Event"
+msgstr ""
+
+#: application/view/manager.php:848 application/view/manager.php:850
+#: application/view/tmpl/event.phtml:105
+msgid "Delete Event"
+msgstr ""
+
+#: application/view/manager.php:849
+msgid "Save Event"
+msgstr ""
+
+#: application/view/manager.php:851
+msgid "Filter Posts by Post Type"
+msgstr ""
+
+#: application/view/manager.php:853 application/view/tmpl/manager.phtml:63
+msgid "Restore Default"
+msgstr ""
+
+#: application/view/manager.php:854
+msgid "Apply"
+msgstr ""
+
+#: application/view/manager.php:855
+msgid "Edit Term"
+msgstr ""
+
+#: application/view/manager.php:856
+msgid "Manager Access"
+msgstr ""
+
+#: application/view/manager.php:857
+msgid "Unlock Default Accesss Control"
+msgstr ""
+
+#: application/view/manager.php:858
+msgid "Close"
+msgstr ""
+
+#: application/view/manager.php:859
+msgid "Edit Role"
+msgstr ""
+
+#: application/view/manager.php:860
+msgid "Restore Default Capabilities"
+msgstr ""
+
+#: application/view/manager.php:861
+#, php-format
+msgid "Are you sure you want to delete <b>%s</b>?"
+msgstr ""
+
+#: application/view/manager.php:862
+#, php-format
+msgid "Are you sure you want to move <b>%s</b> to trash?"
+msgstr ""
+
+#: application/view/manager.php:863 application/view/tmpl/post.phtml:27
+msgid "Delete Post"
+msgstr ""
+
+#: application/view/manager.php:864
+msgid "Delete Permanently"
+msgstr ""
+
+#: application/view/manager.php:865
+msgid "Trash Post"
+msgstr ""
+
+#: application/view/manager.php:866
+msgid "Restore Default Access"
+msgstr ""
+
+#: application/view/manager.php:867
+msgid "Duplicate"
+msgstr ""
+
+#: application/view/manager.php:868
+msgid "Actions Locked"
+msgstr ""
+
+#: application/view/manager.php:869
+msgid ""
+"<h3>AAM Documentation</h3><div class=\"inner\">Find more information about "
+"Advanced Access Manager here.</div>"
+msgstr ""
+
+#: application/view/metabox.php:191
+msgid "Dashboard Widgets"
+msgstr ""
+
+#: application/view/metabox.php:195
+msgid "Frontend Widgets"
+msgstr ""
+
+#: application/view/post.php:199
+msgid "[empty]"
+msgstr ""
+
+#: application/view/post.php:383 application/view/post.php:391
+msgid "All"
+msgstr ""
+
+#: config.php:62
+msgid "Failed to create wp-content/aam folder"
+msgstr ""
+
+#: config.php:65
+msgid "Folder wp-content/aam is not writable"
+msgstr ""
+
+#: extension/AAM_Activity_Log/activity.php:98
+msgid "System Login"
+msgstr ""
+
+#: extension/AAM_Activity_Log/activity.php:102
+msgid "System Logout"
+msgstr ""
+
+#: extension/AAM_Activity_Log/activity.php:108
+msgid "Unknown Activity"
+msgstr ""
+
+#: extension/AAM_Activity_Log/extension.php:72
+msgid "Activity Log"
+msgstr ""
+
+#: extension/AAM_Activity_Log/extension.php:177
+msgid "Clear Logs"
+msgstr ""
+
+#: extension/AAM_Activity_Log/extension.php:178
+msgid "Get More"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/extension.php:122
+msgid "Sites"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/extension.php:123
+msgid "Site Manager"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/extension.php:186
+msgid "Set Default"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/extension.php:187
+msgid "Unset Default"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/extension.php:188
+msgid "Set as Default"
+msgstr ""
+
+#: extension/AAM_My_Feature/extension.php:56
+msgid "My Feature"
+msgstr ""
+
+#: extension/AAM_Plus_Package/extension.php:168
+msgid "Comments"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:16
+msgid "Category"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:18
+#: application/view/tmpl/event.phtml:19 application/view/tmpl/post.phtml:19
+msgid "Control"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:24
+msgid "Filter Capability List"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:28
+msgid "Group Name"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:29
+msgid "Select"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:53
+#: application/view/tmpl/role.phtml:27 application/view/tmpl/role.phtml:46
+#: application/view/tmpl/user.phtml:31
+msgid "Role Name"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:54
+#: application/view/tmpl/event.phtml:17 application/view/tmpl/event.phtml:65
+#: application/view/tmpl/role.phtml:17 application/view/tmpl/user.phtml:17
+#: application/view/tmpl/user.phtml:32
+#: extension/AAM_Multisite_Support/ui.phtml:18
+msgid "Action"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:66
+msgid "Capability Name"
+msgstr ""
+
+#: application/view/tmpl/capability.phtml:70
+msgid "Keep Unfiltered"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:15
+#: application/view/tmpl/configpress.phtml:34
+#: application/view/tmpl/configpress.phtml:53
+#: application/view/tmpl/extension.phtml:15
+#: application/view/tmpl/extension.phtml:148
+#: application/view/tmpl/extension.phtml:167
+#: application/view/tmpl/extension.phtml:187
+#: application/view/tmpl/manager.phtml:17
+#: application/view/tmpl/manager.phtml:38
+#: application/view/tmpl/manager.phtml:57
+#: application/view/tmpl/manager.phtml:87
+msgid "Click to toggle"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:18
+msgid "AAM ConfigPress"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:36
+#: application/view/tmpl/extension.phtml:150
+#: application/view/tmpl/manager.phtml:40
+msgid "AAM Warnings"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:55
+#: application/view/tmpl/manager.phtml:59
+msgid "Control Panel"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:59
+#: application/view/tmpl/manager.phtml:64
+msgid "Save"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:62
+#: application/view/tmpl/manager.phtml:67
+msgid "Follow @wpaam"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:62
+#: application/view/tmpl/manager.phtml:67
+msgid "Follow"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:63
+#: application/view/tmpl/manager.phtml:68
+msgid "Help Forum"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:63
+#: application/view/tmpl/manager.phtml:68
+msgid "Help"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:64
+#: application/view/tmpl/manager.phtml:69
+#: application/view/tmpl/manager.phtml:77
+msgid "E-mail Us"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:65
+#: application/view/tmpl/manager.phtml:70
+msgid "Rate AAM"
+msgstr ""
+
+#: application/view/tmpl/configpress.phtml:65
+#: application/view/tmpl/manager.phtml:70
+msgid "Rate Us"
+msgstr ""
+
+#: application/view/tmpl/control_area.phtml:43
+#: application/view/tmpl/control_area.phtml:90
+#: application/view/tmpl/control_area.phtml:142
+#: application/view/tmpl/control_area.phtml:193
+msgid "Access"
+msgstr ""
+
+#: application/view/tmpl/control_area.phtml:48
+#: application/view/tmpl/control_area.phtml:95
+#: application/view/tmpl/control_area.phtml:149
+#: application/view/tmpl/control_area.phtml:200
+#: extension/AAM_Plus_Package/ui.phtml:29
+#: extension/AAM_Plus_Package/ui.phtml:61
+#: extension/AAM_Plus_Package/ui.phtml:94
+#: extension/AAM_Plus_Package/ui.phtml:126
+msgid "Restrict"
+msgstr ""
+
+#: application/view/tmpl/control_area.phtml:140
+#: application/view/tmpl/control_area.phtml:191
+#, php-format
+msgid "All %s in Term"
+msgstr ""
+
+#: application/view/tmpl/control_area.phtml:239
+msgid "Get AAM Plus Package"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:14 application/view/tmpl/event.phtml:28
+msgid "Event"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:15
+msgid "Event Specifier"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:16
+msgid "Bind Post Type"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:18
+msgid "Action Specifier"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:24
+msgid "Manager Event"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:31
+msgid "Post Status Change"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:32
+msgid "Post Content Change"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:37
+msgid "Status Changed To"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:52
+msgid "Bind to Post Type"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:68
+msgid "Email Notification"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:69
+msgid "Change Status"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:70
+msgid "Callback"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:75
+msgid "Email Address"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:81
+msgid "Change Status To"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:96
+msgid "Callback Function"
+msgstr ""
+
+#: application/view/tmpl/event.phtml:106
+msgid "Are you sure you want to delete selected Event?"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:18
+msgid "Extension List"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:25
+#: application/view/tmpl/post.phtml:17
+msgid "Name"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:26
+msgid "Description"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:27
+msgid "Price"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:28
+msgid "Actions"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:123
+msgid "Install Extension"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:125
+msgid ""
+"If you already have license key for current extension, please enter it "
+"below. Othewise click <b>Purchase</b> button to checkout your order."
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:130
+msgid "Update Extension"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:132
+msgid "Extension has been installed. Your license key: "
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:169
+msgid "Connect with AAM"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:189
+msgid "Development License"
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:193
+msgid ""
+"Become a member of <b>AAM Community</b>. Obtain <b>Development License</b> "
+"today for $119 and get access to all extensions that are available today and "
+"will be developed witin a year."
+msgstr ""
+
+#: application/view/tmpl/extension.phtml:196
+msgid "Read More"
+msgstr ""
+
+#: application/view/tmpl/manager.phtml:63
+msgid "Default"
+msgstr ""
+
+#: application/view/tmpl/manager.phtml:74
+msgid "Undo Change"
+msgstr ""
+
+#: application/view/tmpl/manager.phtml:75
+msgid "Would your like to role back current settings?"
+msgstr ""
+
+#: application/view/tmpl/manager.phtml:78
+msgid "Our E-mail address is <b>support@wpaam.com</b>"
+msgstr ""
+
+#: application/view/tmpl/manager.phtml:89
+msgid "Control Manager"
+msgstr ""
+
+#: application/view/tmpl/menu.phtml:33
+msgid "Restrict All"
+msgstr ""
+
+#: application/view/tmpl/menu.phtml:70
+msgid "There is no single menu item allowed for current Role or User"
+msgstr ""
+
+#: application/view/tmpl/metabox.phtml:15
+msgid "Retrieve Metaboxes From Link"
+msgstr ""
+
+#: application/view/tmpl/metabox.phtml:16
+msgid "Refresh the List"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:18
+msgid "Status"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:31
+msgid "Filter Posts by Type"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:34
+msgid "Collapse All"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:35
+msgid "Expand All"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:36
+msgid "Refresh"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:45
+msgid "You reached the limit. Get <a href=\""
+msgstr ""
+
+#: application/view/tmpl/post.phtml:50
+msgid "Frontend"
+msgstr ""
+
+#: application/view/tmpl/post.phtml:51
+msgid "Backend"
+msgstr ""
+
+#: application/view/tmpl/role.phtml:16
+msgid "Role"
+msgstr ""
+
+#: application/view/tmpl/role.phtml:31
+msgid "Inherit Caps"
+msgstr ""
+
+#: application/view/tmpl/role.phtml:38 application/view/tmpl/role.phtml:42
+msgid "Duplicate Role"
+msgstr ""
+
+#: application/view/tmpl/role.phtml:56
+msgid "Notice"
+msgstr ""
+
+#: application/view/tmpl/role.phtml:58
+msgid "You can not delete <b>Administrator</b> Role"
+msgstr ""
+
+#: application/view/tmpl/user.phtml:16 extension/AAM_Activity_Log/ui.phtml:15
+msgid "Username"
+msgstr ""
+
+#: application/view/tmpl/user.phtml:25
+msgid "Filter Users by Role"
+msgstr ""
+
+#: application/view/tmpl/user.phtml:39
+msgid "Delete User"
+msgstr ""
+
+#: application/view/tmpl/visitor.phtml:11
+msgid ""
+"Control Access to your blog for visitor (any user that is not logged in)"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:16
+msgid "Activity"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:17
+msgid "Time"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:23
+msgid "Clear Activity Log"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:25
+msgid "Are you sure you want to clear activity log?"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:28
+msgid "Activity Log Info"
+msgstr ""
+
+#: extension/AAM_Activity_Log/ui.phtml:30
+#, php-format
+msgid ""
+"Basic version of Activity Log tracks only user's login and logout. Consider "
+"to purchase the <b>%s</b> Extension today to get access to advanced list of "
+"activities as well as we can develop additional activities on demand."
+msgstr ""
+
+#: extension/AAM_Multisite_Support/ui.phtml:17
+msgid "Site"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/ui.phtml:24
+msgid "Set Default Site"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/ui.phtml:26
+msgid "Would you like to set the site"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/ui.phtml:26
+msgid "as default?"
+msgstr ""
+
+#: extension/AAM_Multisite_Support/ui.phtml:29
+msgid "All newly created sites will inherit list of Roles & Capabilities."
+msgstr ""
+
+#: extension/AAM_My_Feature/ui.phtml:13
+msgid "Do you need a custom feature?"
+msgstr ""
+
+#: extension/AAM_My_Feature/ui.phtml:15
+msgid "Create your own extension "
+msgstr ""
+
+#: extension/AAM_My_Feature/ui.phtml:16
+msgid "or ask us and we will develop it for you."
+msgstr ""
+
+#: extension/AAM_Plus_Package/ui.phtml:24
+#: extension/AAM_Plus_Package/ui.phtml:56
+msgid "All Categories Default Access"
+msgstr ""
+
+#: extension/AAM_Plus_Package/ui.phtml:89
+#: extension/AAM_Plus_Package/ui.phtml:121
+msgid "All Posts Default Access"
+msgstr ""
--- /dev/null
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Config.php 23775 2011-03-01 17:25:24Z ralph $
+ */
+
+/**
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
+ * project needs.
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config implements Countable, Iterator
+{
+ /**
+ * Whether in-memory modifications to configuration data are allowed
+ *
+ * @var boolean
+ */
+ protected $_allowModifications;
+
+ /**
+ * Iteration index
+ *
+ * @var integer
+ */
+ protected $_index;
+
+ /**
+ * Number of elements in configuration data
+ *
+ * @var integer
+ */
+ protected $_count;
+
+ /**
+ * Contains array of configuration data
+ *
+ * @var array
+ */
+ protected $_data;
+
+ /**
+ * Used when unsetting values during iteration to ensure we do not skip
+ * the next element
+ *
+ * @var boolean
+ */
+ protected $_skipNextIteration;
+
+ /**
+ * Contains which config file sections were loaded. This is null
+ * if all sections were loaded, a string name if one section is loaded
+ * and an array of string names if multiple sections were loaded.
+ *
+ * @var mixed
+ */
+ protected $_loadedSection;
+
+ /**
+ * This is used to track section inheritance. The keys are names of sections that
+ * extend other sections, and the values are the extended sections.
+ *
+ * @var array
+ */
+ protected $_extends = array();
+
+ /**
+ * Load file error string.
+ *
+ * Is null if there was no error while file loading
+ *
+ * @var string
+ */
+ protected $_loadFileErrorStr = null;
+
+ /**
+ * Zend_Config provides a property based interface to
+ * an array. The data are read-only unless $allowModifications
+ * is set to true on construction.
+ *
+ * Zend_Config also implements Countable and Iterator to
+ * facilitate easy access to the data.
+ *
+ * @param array $array
+ * @param boolean $allowModifications
+ * @return void
+ */
+ public function __construct(array $array, $allowModifications = false)
+ {
+ $this->_allowModifications = (boolean) $allowModifications;
+ $this->_loadedSection = null;
+ $this->_index = 0;
+ $this->_data = array();
+ foreach ($array as $key => $value) {
+ if (is_array($value)) {
+ $this->_data[$key] = new self($value, $this->_allowModifications);
+ } else {
+ $this->_data[$key] = $value;
+ }
+ }
+ $this->_count = count($this->_data);
+ }
+
+ /**
+ * Retrieve a value and return $default if there is no element set.
+ *
+ * @param string $name
+ * @param mixed $default
+ * @return mixed
+ */
+ public function get($name, $default = null)
+ {
+ $result = $default;
+ if (array_key_exists($name, $this->_data)) {
+ $result = $this->_data[$name];
+ }
+ return $result;
+ }
+
+ /**
+ * Magic function so that $obj->value will work.
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return $this->get($name);
+ }
+
+ /**
+ * Only allow setting of a property if $allowModifications
+ * was set to true on construction. Otherwise, throw an exception.
+ *
+ * @param string $name
+ * @param mixed $value
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __set($name, $value)
+ {
+ if ($this->_allowModifications) {
+ if (is_array($value)) {
+ $this->_data[$name] = new self($value, true);
+ } else {
+ $this->_data[$name] = $value;
+ }
+ $this->_count = count($this->_data);
+ } else {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Zend_Config is read only');
+ }
+ }
+
+ /**
+ * Deep clone of this instance to ensure that nested Zend_Configs
+ * are also cloned.
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ $array = array();
+ foreach ($this->_data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $array[$key] = clone $value;
+ } else {
+ $array[$key] = $value;
+ }
+ }
+ $this->_data = $array;
+ }
+
+ /**
+ * Return an associative array of the stored data.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ $array = array();
+ $data = $this->_data;
+ foreach ($data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $array[$key] = $value->toArray();
+ } else {
+ $array[$key] = $value;
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * Support isset() overloading on PHP 5.1
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ return isset($this->_data[$name]);
+ }
+
+ /**
+ * Support unset() overloading on PHP 5.1
+ *
+ * @param string $name
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __unset($name)
+ {
+ if ($this->_allowModifications) {
+ unset($this->_data[$name]);
+ $this->_count = count($this->_data);
+ $this->_skipNextIteration = true;
+ } else {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Zend_Config is read only');
+ }
+
+ }
+
+ /**
+ * Defined by Countable interface
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return mixed
+ */
+ public function current()
+ {
+ $this->_skipNextIteration = false;
+ return current($this->_data);
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return mixed
+ */
+ public function key()
+ {
+ return key($this->_data);
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ */
+ public function next()
+ {
+ if ($this->_skipNextIteration) {
+ $this->_skipNextIteration = false;
+ return;
+ }
+ next($this->_data);
+ $this->_index++;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ */
+ public function rewind()
+ {
+ $this->_skipNextIteration = false;
+ reset($this->_data);
+ $this->_index = 0;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ return $this->_index < $this->_count;
+ }
+
+ /**
+ * Returns the section name(s) loaded.
+ *
+ * @return mixed
+ */
+ public function getSectionName()
+ {
+ if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
+ $this->_loadedSection = $this->_loadedSection[0];
+ }
+ return $this->_loadedSection;
+ }
+
+ /**
+ * Returns true if all sections were loaded
+ *
+ * @return boolean
+ */
+ public function areAllSectionsLoaded()
+ {
+ return $this->_loadedSection === null;
+ }
+
+
+ /**
+ * Merge another Zend_Config with this one. The items
+ * in $merge will override the same named items in
+ * the current config.
+ *
+ * @param Zend_Config $merge
+ * @return Zend_Config
+ */
+ public function merge(Zend_Config $merge)
+ {
+ foreach($merge as $key => $item) {
+ if(array_key_exists($key, $this->_data)) {
+ if($item instanceof Zend_Config && $this->$key instanceof Zend_Config) {
+ $this->$key = $this->$key->merge(new Zend_Config($item->toArray(), !$this->readOnly()));
+ } else {
+ $this->$key = $item;
+ }
+ } else {
+ if($item instanceof Zend_Config) {
+ $this->$key = new Zend_Config($item->toArray(), !$this->readOnly());
+ } else {
+ $this->$key = $item;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Prevent any more modifications being made to this instance. Useful
+ * after merge() has been used to merge multiple Zend_Config objects
+ * into one object which should then not be modified again.
+ *
+ */
+ public function setReadOnly()
+ {
+ $this->_allowModifications = false;
+ foreach ($this->_data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $value->setReadOnly();
+ }
+ }
+ }
+
+ /**
+ * Returns if this Zend_Config object is read only or not.
+ *
+ * @return boolean
+ */
+ public function readOnly()
+ {
+ return !$this->_allowModifications;
+ }
+
+ /**
+ * Get the current extends
+ *
+ * @return array
+ */
+ public function getExtends()
+ {
+ return $this->_extends;
+ }
+
+ /**
+ * Set an extend for Zend_Config_Writer
+ *
+ * @param string $extendingSection
+ * @param string $extendedSection
+ * @return void
+ */
+ public function setExtend($extendingSection, $extendedSection = null)
+ {
+ if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
+ unset($this->_extends[$extendingSection]);
+ } else if ($extendedSection !== null) {
+ $this->_extends[$extendingSection] = $extendedSection;
+ }
+ }
+
+ /**
+ * Throws an exception if $extendingSection may not extend $extendedSection,
+ * and tracks the section extension if it is valid.
+ *
+ * @param string $extendingSection
+ * @param string $extendedSection
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ protected function _assertValidExtend($extendingSection, $extendedSection)
+ {
+ // detect circular section inheritance
+ $extendedSectionCurrent = $extendedSection;
+ while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
+ if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Illegal circular inheritance detected');
+ }
+ $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
+ }
+ // remember that this section extends another section
+ $this->_extends[$extendingSection] = $extendedSection;
+ }
+
+ /**
+ * Handle any errors from simplexml_load_file or parse_ini_file
+ *
+ * @param integer $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param integer $errline
+ */
+ protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
+ {
+ if ($this->_loadFileErrorStr === null) {
+ $this->_loadFileErrorStr = $errstr;
+ } else {
+ $this->_loadFileErrorStr .= (PHP_EOL . $errstr);
+ }
+ }
+
+ /**
+ * Merge two arrays recursively, overwriting keys of the same name
+ * in $firstArray with the value in $secondArray.
+ *
+ * @param mixed $firstArray First array
+ * @param mixed $secondArray Second array to merge into first array
+ * @return array
+ */
+ protected function _arrayMergeRecursive($firstArray, $secondArray)
+ {
+ if (is_array($firstArray) && is_array($secondArray)) {
+ foreach ($secondArray as $key => $value) {
+ if (isset($firstArray[$key])) {
+ $firstArray[$key] = $this->_arrayMergeRecursive($firstArray[$key], $value);
+ } else {
+ if($key === 0) {
+ $firstArray= array(0=>$this->_arrayMergeRecursive($firstArray, $value));
+ } else {
+ $firstArray[$key] = $value;
+ }
+ }
+ }
+ } else {
+ $firstArray = $secondArray;
+ }
+
+ return $firstArray;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
+ */
+
+/**
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
+ * project needs.
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Exception extends Zend_Exception {}
--- /dev/null
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Ini.php 24045 2011-05-23 12:45:11Z rob $
+ */
+
+/**
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
+ * project needs.
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Ini extends Zend_Config
+{
+ /**
+ * String that separates nesting levels of configuration data identifiers
+ *
+ * @var string
+ */
+ protected $_nestSeparator = '.';
+
+ /**
+ * String that separates the parent section name
+ *
+ * @var string
+ */
+ protected $_sectionSeparator = ':';
+
+ /**
+ * Whether to skip extends or not
+ *
+ * @var boolean
+ */
+ protected $_skipExtends = false;
+
+ /**
+ * Loads the section $section from the config file $filename for
+ * access facilitated by nested object properties.
+ *
+ * If the section name contains a ":" then the section name to the right
+ * is loaded and included into the properties. Note that the keys in
+ * this $section will override any keys of the same
+ * name in the sections that have been included via ":".
+ *
+ * If the $section is null, then all sections in the ini file are loaded.
+ *
+ * If any key includes a ".", then this will act as a separator to
+ * create a sub-property.
+ *
+ * example ini file:
+ * [all]
+ * db.connection = database
+ * hostname = live
+ *
+ * [staging : all]
+ * hostname = staging
+ *
+ * after calling $data = new Zend_Config_Ini($file, 'staging'); then
+ * $data->hostname === "staging"
+ * $data->db->connection === "database"
+ *
+ * The $options parameter may be provided as either a boolean or an array.
+ * If provided as a boolean, this sets the $allowModifications option of
+ * Zend_Config. If provided as an array, there are three configuration
+ * directives that may be set. For example:
+ *
+ * $options = array(
+ * 'allowModifications' => false,
+ * 'nestSeparator' => ':',
+ * 'skipExtends' => false,
+ * );
+ *
+ * @param string $filename
+ * @param mixed $section
+ * @param boolean|array $options
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __construct($filename, $section = null, $options = false)
+ {
+ if (empty($filename)) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception('Filename is not set');
+ }
+
+ $allowModifications = false;
+ if (is_bool($options)) {
+ $allowModifications = $options;
+ } elseif (is_array($options)) {
+ if (isset($options['allowModifications'])) {
+ $allowModifications = (bool) $options['allowModifications'];
+ }
+ if (isset($options['nestSeparator'])) {
+ $this->_nestSeparator = (string) $options['nestSeparator'];
+ }
+ if (isset($options['skipExtends'])) {
+ $this->_skipExtends = (bool) $options['skipExtends'];
+ }
+ }
+
+ $iniArray = $this->_loadIniFile($filename);
+
+ if (null === $section) {
+ // Load entire file
+ $dataArray = array();
+ foreach ($iniArray as $sectionName => $sectionData) {
+ if(!is_array($sectionData)) {
+ $dataArray = $this->_arrayMergeRecursive($dataArray, $this->_processKey(array(), $sectionName, $sectionData));
+ } else {
+ $dataArray[$sectionName] = $this->_processSection($iniArray, $sectionName);
+ }
+ }
+ parent::__construct($dataArray, $allowModifications);
+ } else {
+ // Load one or more sections
+ if (!is_array($section)) {
+ $section = array($section);
+ }
+ $dataArray = array();
+ foreach ($section as $sectionName) {
+ if (!isset($iniArray[$sectionName])) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Section '$sectionName' cannot be found in $filename");
+ }
+ $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray);
+
+ }
+ parent::__construct($dataArray, $allowModifications);
+ }
+
+ $this->_loadedSection = $section;
+ }
+
+ /**
+ * Load the INI file from disk using parse_ini_file(). Use a private error
+ * handler to convert any loading errors into a Zend_Config_Exception
+ *
+ * @param string $filename
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _parseIniFile($filename)
+ {
+ set_error_handler(array($this, '_loadFileErrorHandler'));
+ $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed
+ restore_error_handler();
+
+ // Check if there was a error while loading file
+ if ($this->_loadFileErrorStr !== null) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception($this->_loadFileErrorStr);
+ }
+
+ return $iniArray;
+ }
+
+ /**
+ * Load the ini file and preprocess the section separator (':' in the
+ * section name (that is used for section extension) so that the resultant
+ * array has the correct section names and the extension information is
+ * stored in a sub-key called ';extends'. We use ';extends' as this can
+ * never be a valid key name in an INI file that has been loaded using
+ * parse_ini_file().
+ *
+ * @param string $filename
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _loadIniFile($filename)
+ {
+ $loaded = $this->_parseIniFile($filename);
+ $iniArray = array();
+ foreach ($loaded as $key => $data)
+ {
+ $pieces = explode($this->_sectionSeparator, $key);
+ $thisSection = trim($pieces[0]);
+ switch (count($pieces)) {
+ case 1:
+ $iniArray[$thisSection] = $data;
+ break;
+
+ case 2:
+ $extendedSection = trim($pieces[1]);
+ $iniArray[$thisSection] = array_merge(array(';extends'=>$extendedSection), $data);
+ break;
+
+ default:
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Section '$thisSection' may not extend multiple sections in $filename");
+ }
+ }
+
+ return $iniArray;
+ }
+
+ /**
+ * Process each element in the section and handle the ";extends" inheritance
+ * key. Passes control to _processKey() to handle the nest separator
+ * sub-property syntax that may be used within the key name.
+ *
+ * @param array $iniArray
+ * @param string $section
+ * @param array $config
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _processSection($iniArray, $section, $config = array())
+ {
+ $thisSection = $iniArray[$section];
+
+ foreach ($thisSection as $key => $value) {
+ if (strtolower($key) == ';extends') {
+ if (isset($iniArray[$value])) {
+ $this->_assertValidExtend($section, $value);
+
+ if (!$this->_skipExtends) {
+ $config = $this->_processSection($iniArray, $value, $config);
+ }
+ } else {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Parent section '$section' cannot be found");
+ }
+ } else {
+ $config = $this->_processKey($config, $key, $value);
+ }
+ }
+ return $config;
+ }
+
+ /**
+ * Assign the key's value to the property list. Handles the
+ * nest separator for sub-properties.
+ *
+ * @param array $config
+ * @param string $key
+ * @param string $value
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _processKey($config, $key, $value)
+ {
+ if (strpos($key, $this->_nestSeparator) !== false) {
+ $pieces = explode($this->_nestSeparator, $key, 2);
+ if (strlen($pieces[0]) && strlen($pieces[1])) {
+ if (!isset($config[$pieces[0]])) {
+ if ($pieces[0] === '0' && !empty($config)) {
+ // convert the current values in $config into an array
+ $config = array($pieces[0] => $config);
+ } else {
+ $config[$pieces[0]] = array();
+ }
+ } elseif (!is_array($config[$pieces[0]])) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Cannot create sub-key for '{$pieces[0]}' as key already exists");
+ }
+ $config[$pieces[0]] = $this->_processKey($config[$pieces[0]], $pieces[1], $value);
+ } else {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Invalid key '$key'");
+ }
+ } else {
+ $config[$key] = $value;
+ }
+ return $config;
+ }
+}
--- /dev/null
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
+ */
+
+/**
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
+ * project needs.
+ */
+
+/**
+* @category Zend
+* @package Zend
+* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
+* @license http://framework.zend.com/license/new-bsd New BSD License
+*/
+class Zend_Exception extends Exception
+{
+ /**
+ * @var null|Exception
+ */
+ private $_previous = null;
+
+ /**
+ * Construct the exception
+ *
+ * @param string $msg
+ * @param int $code
+ * @param Exception $previous
+ * @return void
+ */
+ public function __construct($msg = '', $code = 0, Exception $previous = null)
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ parent::__construct($msg, (int) $code);
+ $this->_previous = $previous;
+ } else {
+ parent::__construct($msg, (int) $code, $previous);
+ }
+ }
+
+ /**
+ * Overloading
+ *
+ * For PHP < 5.3.0, provides access to the getPrevious() method.
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, array $args)
+ {
+ if ('getprevious' == strtolower($method)) {
+ return $this->_getPrevious();
+ }
+ return null;
+ }
+
+ /**
+ * String representation of the exception
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ if (null !== ($e = $this->getPrevious())) {
+ return $e->__toString()
+ . "\n\nNext "
+ . parent::__toString();
+ }
+ }
+ return parent::__toString();
+ }
+
+ /**
+ * Returns previous Exception
+ *
+ * @return Exception|null
+ */
+ protected function _getPrevious()
+ {
+ return $this->_previous;
+ }
+}
--- /dev/null
+Copyright (C) <2013> Vasyl Martyniuk <support@wpaam.com>\r
+\r
+This program is free software: you can redistribute it and/or modify\r
+it under the terms of the GNU General Public License as published by\r
+the Free Software Foundation, either version 3 of the License, or\r
+(at your option) any later version.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+GNU General Public License for more details.\r
+\r
+You should have received a copy of the GNU General Public License\r
+along with this program. If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+*/
+
+
+/** GLOBAL AAM STYLES */
+#aam_form{
+ position: relative;
+}
+
+.aam-asterix{
+ display: inline-block;
+ font-size: 0.9em;
+ color: #bf0909;
+ margin-left: 3px;
+}
+
+.aam-form-table{
+ width: 100%;
+}
+
+.aam-form-table th{
+ text-align: right;
+}
+
+.aam-form-table input, .aam-form-table select{
+ width: 100%;
+}
+
+.dialog-content{
+ text-align: center;
+}
+
+.dialog-note{
+ font-size: 0.8em;
+ margin-bottom: 0;
+}
+
+.dialog-input{
+ width: 55%;
+ margin-left: 5%;
+}
+
+.aam-input{
+ width: 100%;
+}
+
+.dialog-input-dynamic{
+ width: 55%;
+ margin-left: 5%;
+ background: transparent url('images/cmanager/field-loader.gif') no-repeat center;
+}
+
+.input-dynamic{
+ background: transparent url('images/cmanager/field-loader.gif') no-repeat center;
+}
+
+.dialog-fieldset{
+ width: 100%;
+ margin: 10px 0px;
+}
+
+.aam-medium-loader span{
+ background-image: url('images/common/medium-loader.gif');
+ background-position: 0 0 !important;
+}
+
+.aam-list-top-actions{
+ float: right;
+ display: inline-table;
+ width: auto;
+ text-align: right;
+}
+
+.aam-list-top-actions a{
+ display: table-cell;
+ min-width: 30px;
+}
+
+.aam-list-row-actions{
+ width: 100%;
+ display: inline-table;
+ text-align: center;
+}
+
+.aam-list-row-actions .aam-icon{
+ display: table-cell;
+}
+
+.clear{
+ line-height: 0;
+ font-size: 0;
+ padding: 0;
+ margin: 0;
+ clear: both;
+}
+
+.main-inside{
+ position: relative;
+ min-height: 200px;
+}
+
+.aam-main-loader{
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 100%;
+ background: transparent url('images/main-loader.gif') no-repeat center;
+}
+
+.aam-metabox-loader{
+ display: none;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 100%;
+ background: transparent url('images/metabox-loader.gif') no-repeat center;
+}
+
+.aam-bold{
+ font-weight: bold;
+}
+
+.current-site{
+ text-transform: capitalize;
+ font-weight: bold;
+ color: #257DA6;
+ margin-right: 4px;
+}
+
+
+.current-subject{
+ text-transform: capitalize;
+ font-weight: bold;
+ color: #bf0909;
+}
+
+/** FEATURE LIST STYLES */
+.feature-list{
+ width: 25%;
+ float: left;
+}
+
+.feature-item{
+ height: 28px;
+ width: 100%;
+ display: table;
+ font-size: 1em;
+ border: 1px solid #CCCCCC;
+ font-family: "Lucida Console", Monaco, monospace;
+ cursor: pointer;
+ background: transparent url('images/feature.png') no-repeat 2px 2px;
+}
+
+.feature-item:hover{
+ border: 1px solid #006400;
+}
+
+.feature-item-active{
+ border: 1px solid #257DA6;
+ background: #257DA6 url('images/feature-active.png') no-repeat 2px 2px;
+}
+
+.feature-item span{
+ text-transform: uppercase;
+ display: table-cell;
+ padding-left: 38px;
+ vertical-align: middle;
+}
+
+.feature-item-active span{
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+.feature-content{
+ float: right;
+ width: 72%;
+ border-radius: 4px;
+ border: 1px solid #CCCCCC;
+ padding: 5px;
+}
+
+.feature-content-container{
+ position: relative;
+}
+
+.feature-list-empty{
+ text-align: center;
+ font-size: 1.1em;
+ color: #AAAAAA;
+ padding: 10px;
+}
+
+/** CONTROL PANEL STYLES */
+
+#major-publishing-actions{
+ margin-top: 5px;
+ border-top: 1px solid #D5D5D5;
+}
+
+/** CONTROL MANAGER STYLES */
+.control-manager{
+ display: table;
+ width: 100%;
+ margin-bottom: 5px;
+}
+
+.manager-item{
+ height: 50px;
+ min-width: 32px;
+ display: table-cell;
+ text-align: center;
+ vertical-align: bottom;
+ text-decoration: none;
+ text-transform: uppercase;
+ font-size: 10px;
+ font-weight: bold;
+ color: #333333;
+ background-repeat: no-repeat;
+ background-position: center top;
+}
+
+.control-manager-content{
+ border-top: 1px solid #F5F5F5;
+ visibility: hidden;
+}
+
+/**
+ ================
+ ALL OTHER STYLES
+ ================
+*/
+
+/** ROLE MANAGER STYLES */
+.manager-item-role{
+ background-image: url('images/cmanager/role.png');
+}
+
+.manager-item-role-active{
+ background-image: url('images/cmanager/role-active.png');
+}
+
+/** USER MANAGER STYLES */
+.manager-item-user{
+ background-image: url('images/cmanager/user.png');
+}
+
+.manager-item-user-active{
+ background-image: url('images/cmanager/user-active.png');
+}
+
+.user-settings{
+ border: 1px solid #E2E4FF;
+ width: 100%;
+}
+
+.user-settings td {
+ border-bottom: 1px solid #CCCCCC;
+}
+
+.user-settings th {
+ padding: 2px 10px;
+ border-bottom: 1px solid #CCCCCC;
+ font-weight: bold;
+ text-transform: uppercase;
+ cursor: pointer;
+ text-align: right;
+ background-color: #257da6;
+}
+
+.user-settings input, .user-settings select{
+ width: 100%;
+ border: 0px solid transparent;
+}
+
+.user-action-locked{
+ display: inline-block;
+ width:16px;
+ height: 16px;
+ background: transparent url('images/cmanager/lock.png') no-repeat center;
+}
+
+
+/** VISITOR MANAGER STYLES */
+.manager-item-visitor{
+ background-image: url('images/cmanager/visitor.png');
+}
+
+.manager-item-visitor-active{
+ background-image: url('images/cmanager/visitor-active.png');
+}
+
+.control-manager-visitor{
+ margin-top: 10px;
+ width: auto;
+ border-top: 4px solid #257DA6;
+ border-bottom: 1px solid #CCCCCC;
+ border-left: 1px solid #CCCCCC;
+ border-right: 1px solid #CCCCCC;
+ text-align: justify;
+ padding: 10px;
+ font-family: 'Lucida Console', Monaco, monospace;
+}
+
+
+/** ADMIN MENU STYLES */
+.menu-item-action{
+ background-repeat: no-repeat;
+ background-position: center;
+ width: 26px;
+ height: 26px;
+ display: block;
+ margin: -10px auto 4px auto;
+ text-indent: -9999px;
+ text-decoration: none;
+}
+
+.menu-item-action-restrict{
+ background-image:url(images/menu/visibility.png);
+}
+
+.menu-item-action-restrict-active{
+ background-image:url(images/menu/visibility-active.png);
+}
+
+.whole-menu{
+ width: 50%;
+ background-color: #F9F9F9;
+ border-radius: 5px;
+ text-align: center;
+ font-family: 'Lucida Console', Monaco, monospace;
+ vertical-align: top;
+ margin: 0px auto 5px auto;
+ padding: 0px 10px;
+}
+
+.whole-menu label{
+ display: inline-block;
+ line-height: 25px;
+ height: 23px;
+}
+
+.menu-submenu-list{
+ border: 1px solid #CCCCCC;
+ border-radius: 5px;
+ padding: 12px 5px 5px;
+ background-color: #F9F9F9;
+ width: 95%;
+ margin: auto;
+ display: table;
+}
+
+.menu-submenu-row{
+ display: table-row;
+}
+
+.menu-submenu-item{
+ text-align: right;
+ padding-right: 10px;
+ font-family: 'Lucida Console', Monaco, monospace;
+ vertical-align: top;
+ display: table-cell;
+}
+
+.menu-submenu-item label{
+ display: inline-block;
+ line-height: 25px;
+ height: 29px;
+ font-size: 0.8em;
+}
+
+#main_menu_list input[type="checkbox"] {
+ display:none;
+}
+
+#main_menu_list input[type="checkbox"] + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/menu/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+}
+
+#main_menu_list input[type="checkbox"]:checked + label span {
+ background:url(images/menu/checked.png) no-repeat center;
+}
+
+.menu-empty-list{
+ border: 1px solid #bf0909;
+ border-radius: 4px;
+ padding: 8px 10px;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1em;
+ background-color: #E2E4FF;
+}
+
+/** METABOX & WIDGETS STYLES */
+.metabox-top-actions{
+ padding: 2px 0;
+ width: 100%;
+ margin-bottom: 10px;
+}
+
+.metabox-top-action-link{
+ width: 75%;
+ float: left;
+}
+
+.metabox-top-action-link input{
+ height: 24px;
+ width: 100%;
+ background-repeat: no-repeat;
+ background-position: 5px center;
+ background-image: url('images/metabox/link.png');
+ padding-left: 24px;
+}
+
+.metabox-top-action-link input:focus{
+ background-image: url('images/metabox/link-active.png');
+}
+
+.metabox-top-actions .aam-icon-medium-add{
+ margin-left: 10px;
+ display: inline-block;
+}
+
+.metabox-top-actions .aam-icon-medium-refresh{
+ float: right;
+ display: inline-block;
+}
+
+.metabox-group{
+ border: 1px solid #CCCCCC;
+ border-radius: 5px;
+ padding: 12px 5px 5px;
+ background-color: #F9F9F9;
+ width: 95%;
+ margin: auto;
+ display: table;
+}
+
+.metabox-row{
+ display: table-row;
+}
+
+.metabox-item{
+ text-align: right;
+ font-family: 'Lucida Console', Monaco, monospace;
+ vertical-align: top;
+ display: table-cell;
+}
+
+.metabox-item label{
+ display: inline-block;
+ line-height: 25px;
+ height: 29px;
+ font-size: 0.8em;
+}
+
+.metabox-item input[type="checkbox"] {
+ display:none;
+}
+
+.metabox-item input[type="checkbox"] + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/metabox/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+ margin-left: 6px;
+}
+
+.metabox-item input[type="checkbox"]:checked + label span {
+ background:url(images/metabox/checked.png) no-repeat center;
+}
+
+#metabox_content{
+ min-height: 200px;
+}
+
+/** CAPABILITIES STYLES */
+.capability-actions{
+ display: table;
+ width: 100%;
+}
+
+.capability-action{
+ width: 16px;
+ height: 16px;
+ display: table-cell;
+ text-align: center;
+ vertical-align: middle;
+ text-decoration: none;
+ outline: 0;
+}
+
+a.capability-action{
+ outline: 0;
+}
+
+.capability-action input[type="checkbox"] {
+ display:none;
+}
+
+.capability-action input[type="checkbox"] + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/capability/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+}
+
+.capability-action input[type="checkbox"]:checked + label span {
+ background:url(images/capability/checked.png) no-repeat center;
+}
+
+.capability-action-delete{
+ background: transparent url('images/capability/delete.png') no-repeat center;
+}
+
+.capability-action-delete:hover{
+ background: transparent url('images/capability/delete-active.png') no-repeat center;
+}
+
+.capability-action-delete-active{
+ background: transparent url('images/capability/delete-active.png') no-repeat center;
+}
+
+.capability-action-select{
+ background: transparent url('images/capability/select.png') no-repeat center;
+}
+
+.capability-action-select:hover{
+ background: transparent url('images/capability/select-active.png') no-repeat center;
+}
+
+.capability-action-select-active{
+ background: transparent url('images/capability/select-active.png') no-repeat center;
+}
+
+#capability_unfiltered {
+ display:none;
+}
+
+#capability_unfiltered + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/capability/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+}
+
+#capability_unfiltered:checked + label span {
+ background:url(images/capability/checked.png) no-repeat center;
+}
+
+.aam-align-right{
+ text-align: right;
+}
+
+
+/** POSTS & CATEGORIES STYLES */
+.post-type-post{
+ height: 16px;
+ background: transparent url('images/post/post.png') no-repeat left center;
+ display: inline-block;
+ padding-left: 20px;
+ text-decoration: none;
+}
+
+.post-action-check{
+ text-align: center;
+}
+
+.post-action-lock{
+ background-image: url('images/lock.png');
+}
+
+.post-action input[type="checkbox"] {
+ display:none;
+}
+
+.post-action input[type="checkbox"] + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/post/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+}
+
+.post-action input[type="checkbox"]:checked + label span {
+ background:url(images/post/checked.png) no-repeat center;
+}
+
+.post-access-area{
+ margin: 5px 0;
+ text-align: center;
+}
+
+.post-access-area .ui-button-text-only .ui-button-text{
+ padding: 0.1em 1em;
+}
+
+.post-category-subposts .ui-button-text-only .ui-button-text{
+ padding: 0.1em 1em;
+}
+
+.post-access{
+ display: inline-block;
+ font-size: 14px;
+ font-weight: bold;
+ padding: 2px 0 4px 5px;
+ text-transform: uppercase;
+}
+
+.post-access-inherited{
+ border: 1px solid #CCCCCC;
+ border-radius: 3px;
+ color: #FF0000;
+ margin: 5px 0 10px;
+ padding: 2px;
+ text-align: center;
+ display: none;
+}
+
+.post-breadcrumb{
+ margin-top: 4px;
+ border: 1px solid #CCCCCC;
+ width: 100%;
+ padding: 4px 0px;
+ font-family: 'Lucida Console', Monaco, monospace;
+}
+
+.post-breadcrumb-loading{
+ background: transparent url('images/post/loader.gif') no-repeat center;
+}
+
+.post-breadcrumb-line{
+ width: 88%;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.post-breadcrumb-line a{
+ text-decoration: none;
+ font-weight: bold;
+ color: #257DA6;
+ margin-left: 5px;
+}
+
+.aam-gt{
+ display: inline-block;
+ margin: 0 2px;
+}
+
+.post-breadcrumb-line-actions{
+ width: 10%;
+ display:inline-table;
+ border-left: 1px solid #CCCCCC;
+ vertical-align: middle;
+ text-align: center;
+}
+
+.post-breadcrumb-line-actions a{
+ display: table-cell;
+ width: 16px;
+ height: 16px;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+
+.post-breadcrumb-line-action-lock{
+ background-image: url('images/lock.png');
+}
+
+#access_dialog{
+ position: relative;
+}
+
+.aam-lock-message{
+ margin: 5px 0 10px 0;
+ border: 1px solid #bf0909;
+ border-radius: 4px;
+ background: transparent url('images/lock.png') no-repeat 5px center;
+ display: table;
+ width: 100%;
+}
+
+.attachment-access-block{
+ border: 1px solid #257DA6;
+ border-radius: 4px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ padding-left: 22px;
+ box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ background: transparent url('images/post/info-active.png') no-repeat 2px center;
+ font-size: 0.8em;
+}
+
+.aam-lock-message span{
+ font-weight: bold;
+ vertical-align: middle;
+ display: table-cell;
+ padding: 5px 2px 5px 28px;
+}
+
+.aam-lock-message a{
+ color: #257DA6;
+ outline: 0;
+}
+
+.ui-menu {
+ width: 150px;
+ z-index: 9999;
+}
+
+.post-term-descend{
+ margin: 5px 0;
+ text-align: left;
+ display: table;
+ vertical-align: middle;
+}
+
+.post-term-descend label{
+ display: table-cell;
+}
+
+.post-term-descend input[type="checkbox"] {
+ display:none;
+}
+
+.post-term-descend input[type="checkbox"] + label span {
+ display:inline-block;
+ width:16px;
+ height:16px;
+ background:url(images/capability/unchecked.png) no-repeat center;
+ cursor:pointer;
+ margin-top: 4px;
+ margin-left: 8px;
+}
+
+.post-term-descend input[type="checkbox"]:checked + label span {
+ background:url(images/capability/checked.png) no-repeat center;
+}
+
+#access_dialog table.dataTable td{
+ padding: 0px 10px;
+}
+
+.dataTable th.term-access-title, .dataTable th.post-access-title{
+ background-color: #CCCCCC;
+}
+
+.post-access-list{
+ position: relative;
+}
+
+.post-access-list .post-access-block{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: #F5F5F5;
+ opacity: 0.8;
+}
+
+.aam-lock-big{
+ display: table;
+ width: 100%;
+ height: 120px;
+ background: transparent url('images/post/lock-big.png') no-repeat center;
+}
+
+a.aam-lock-big{
+ text-decoration: none;
+ outline: 0;
+}
+
+.aam-lock-big span{
+ display: table-cell;
+ vertical-align: bottom;
+ text-align: center;
+ text-transform: uppercase;
+ font-size: 0.8em;
+ font-weight: bold;
+}
+
+.aam-post-access-notice{
+ display: inline-block;
+ margin-right: 2px;
+ color: #257DA6;
+ font-weight: bold;
+}
+
+.post-access-description{
+ font-size: 0.75em;
+}
+
+
+/** EVENT MANAGER STYLES */
+.event-actions{
+ display: table;
+ width: 100%;
+}
+
+.event-action{
+ width: 16px;
+ height: 16px;
+ display: table-cell;
+ padding: 2px 0;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+.event-action-edit{
+ background-image: url('images/event/edit.png');
+}
+
+.event-action-edit:hover{
+ background-image: url('images/event/edit-active.png');
+}
+
+.event-action-edit-active{
+ background-image: url('images/event/edit-active.png');
+}
+
+.event-action-delete{
+ background-image: url('images/event/delete.png');
+}
+
+.event-action-delete:hover{
+ background-image: url('images/event/delete-active.png');
+}
+
+.event-action-delete-active{
+ background-image: url('images/event/delete-active.png');
+}
+
+.event-specifier{
+ display:none;
+}
\ No newline at end of file
--- /dev/null
+/* BASICS */
+
+.CodeMirror {
+ /* Set height, width, borders, and global font properties here */
+ font-family: monospace;
+ height: 300px;
+}
+.CodeMirror-scroll {
+ /* Set scrolling behaviour here */
+ overflow: auto;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+ padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+ padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+ border-right: 1px solid #ddd;
+ background-color: #f7f7f7;
+ white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+ padding: 0 3px 0 5px;
+ min-width: 20px;
+ text-align: right;
+ color: #999;
+}
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+ border-left: 1px solid black;
+ z-index: 3;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+ border-left: 1px solid silver;
+}
+.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
+ width: auto;
+ border: 0;
+ background: #7e7;
+ z-index: 1;
+}
+/* Can style cursor different in overwrite (non-insert) mode */
+.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
+
+.cm-tab { display: inline-block; }
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable {color: black;}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-property {color: black;}
+.cm-s-default .cm-operator {color: black;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-error {color: #f00;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+
+.cm-invalidchar {color: #f00;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+.CodeMirror-activeline-background {background: #e8f2ff;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+ the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+ line-height: 1;
+ position: relative;
+ overflow: hidden;
+ background: #FFFFFF;
+ color: black;
+ border: 1px solid #CCCCCC;
+ border-radius: 4px;
+ padding: 1px;
+}
+
+.CodeMirror-scroll {
+ /* 30px is the magic margin used to hide the element's real scrollbars */
+ /* See overflow: hidden in .CodeMirror */
+ background-color: #F9F9F9;
+ font-size: 1.1em;
+ height: 100%;
+ outline: none; /* Prevent dragging from highlighting the element */
+ position: relative;
+}
+.CodeMirror-sizer {
+ position: relative;
+}
+
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+ before actuall scrolling happens, thus preventing shaking and
+ flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ position: absolute;
+ z-index: 6;
+ display: none;
+}
+.CodeMirror-vscrollbar {
+ right: 0; top: 0;
+ overflow-x: hidden;
+ overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+ bottom: 0; left: 0;
+ overflow-y: hidden;
+ overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+ right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+ left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
+ position: absolute; left: 0; top: 0;
+ padding-bottom: 30px;
+ z-index: 3;
+}
+.CodeMirror-gutter {
+ white-space: normal;
+ height: 100%;
+ padding-bottom: 30px;
+ margin-bottom: -32px;
+ display: inline-block;
+ /* Hack to make IE7 behave */
+ *zoom:1;
+ *display:inline;
+}
+.CodeMirror-gutter-elt {
+ position: absolute;
+ cursor: default;
+ z-index: 4;
+}
+
+.CodeMirror-lines {
+ cursor: text;
+}
+.CodeMirror pre {
+ /* Reset some styles that the rest of the page might have set */
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+ border-width: 0;
+ background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+ line-height: inherit;
+ color: inherit;
+ z-index: 2;
+ position: relative;
+ overflow: visible;
+}
+.CodeMirror-wrap pre {
+ word-wrap: break-word;
+ white-space: pre-wrap;
+ word-break: normal;
+}
+.CodeMirror-code pre {
+ border-right: 30px solid transparent;
+ width: -webkit-fit-content;
+ width: -moz-fit-content;
+ width: fit-content;
+}
+.CodeMirror-wrap .CodeMirror-code pre {
+ border-right: none;
+ width: auto;
+}
+.CodeMirror-linebackground {
+ position: absolute;
+ left: 0; right: 0; top: 0; bottom: 0;
+ z-index: 0;
+}
+
+.CodeMirror-linewidget {
+ position: relative;
+ z-index: 2;
+ overflow: auto;
+}
+
+.CodeMirror-widget {
+}
+
+.CodeMirror-wrap .CodeMirror-scroll {
+ overflow-x: hidden;
+}
+
+.CodeMirror-measure {
+ position: absolute;
+ width: 100%; height: 0px;
+ overflow: hidden;
+ visibility: hidden;
+}
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+ position: absolute;
+ visibility: hidden;
+ border-right: none;
+ width: 0;
+}
+.CodeMirror-focused div.CodeMirror-cursor {
+ visibility: visible;
+}
+
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+
+.cm-searching {
+ background: #ffa;
+ background: rgba(255, 255, 0, .4);
+}
+
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
+
+@media print {
+ /* Hide the cursor when printing */
+ .CodeMirror div.CodeMirror-cursor {
+ visibility: hidden;
+ }
+}
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+*/
+.aam-beta-version{
+ margin: 15px 10px;
+ border: 1px solid #FF8888;
+ border-radius: 4px;
+ padding: 4px;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.aam-hidden{
+ display: none;
+}
+
+.aam-dialog{
+ display: none;
+}
+
+.wrap a{
+ outline: 0;
+}
+
+.aam-tooltip {
+ display:none;
+ position:absolute;
+ border:1px solid #CCCCCC;
+ background-color: #F5F5F5;
+ border-radius: 4px;
+ box-shadow: 0 0 5px #AAAAAA;
+ padding: 5px 10px;
+ z-index: 9999;
+ color: #333333;
+ font-size: 1em;
+ max-width: 300px;
+ left:0px;
+ top: 0px;
+ font-weight: bold;
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+}
+
+.aam-icon{
+ text-indent: -9999px;
+ text-align: center;
+ background-repeat: no-repeat;
+}
+
+a.aam-icon{
+ outline: none;
+}
+
+.aam-icon span {
+ content: "";
+ display: block;
+ background-repeat: no-repeat;
+ opacity: 1;
+ -webkit-transition: opacity 0.5s;
+ -moz-transition: opacity 0.5s;
+ -o-transition: opacity 0.5s;
+}
+
+.aam-icon span:hover{
+ opacity: 1;
+}
+
+.aam-icon-large span {
+ background-image: url('images/common/large-iconset.png');
+ width: 48px;
+ height: 48px;
+ margin-left: calc(50% - 24px);
+ margin-left: -moz-calc(50% - 24px);
+}
+
+.aam-icon-medium span {
+ background-image: url('images/common/medium-iconset.png');
+ width: 24px;
+ height: 24px;
+ margin-left: calc(50% - 12px);
+ margin-left: -moz-calc(50% - 12px);
+}
+
+.aam-icon-small span {
+ background-image: url('images/common/small-iconset.png');
+ width: 16px;
+ height: 16px;
+ margin-left: calc(50% - 8px);
+ margin-left: -moz-calc(50% - 8px);
+}
+
+.aam-icon-large-active{
+ background-position-y: -48px !important;
+}
+
+.aam-icon-medium-active{
+ background-position-y: -24px !important;
+}
+
+.aam-icon-small-active{
+ background-position-y: -16px !important;
+}
+
+.aam-icon-large-save span{
+ background-position: 0 0;
+}
+
+.aam-icon-large-save:hover span{
+ background-position: 0 -48px;
+}
+
+.aam-icon-large-roleback span{
+ background-position: -48px 0;
+}
+
+.aam-icon-large-roleback:hover span{
+ background-position: -48px -48px;
+}
+
+.aam-icon-large-twitter span{
+ background-position: -96px 0;
+}
+
+.aam-icon-large-twitter:hover span{
+ background-position: -96px -48px;
+}
+
+.aam-icon-large-message span{
+ background-position: -144px 0;
+}
+
+.aam-icon-large-message:hover span{
+ background-position: -144px -48px;
+}
+
+.aam-icon-large-link span{
+ background-position: -192px 0;
+}
+
+.aam-icon-large-link:hover span{
+ background-position: -192px -48px;
+}
+
+.aam-icon-large-info span{
+ background-position: -240px 0;
+}
+
+.aam-icon-large-info:hover span{
+ background-position: -240px -48px;
+}
+
+.aam-icon-large-editor span{
+ background-position: -288px 0;
+}
+
+.aam-icon-large-editor:hover span{
+ background-position: -288px -48px;
+}
+
+.aam-icon-medium-add span{
+ background-position: 0 0;
+}
+
+.aam-icon-medium-add:hover span{
+ background-position: 0 -24px;
+}
+
+.aam-icon-medium-refresh span{
+ background-position: -24px 0px;
+}
+
+.aam-icon-medium-refresh:hover span{
+ background-position: -24px -24px;
+}
+
+.aam-icon-medium-filter span{
+ background-position: -48px 0px;
+}
+
+.aam-icon-medium-filter:hover span{
+ background-position: -48px -24px;
+}
+
+.aam-icon-medium-copy span{
+ background-position: -72px 0px;
+}
+
+.aam-icon-medium-copy:hover span{
+ background-position: -72px -24px;
+}
+
+.aam-icon-medium-roleback span{
+ background-position: -96px 0px;
+}
+
+.aam-icon-medium-roleback:hover span{
+ background-position: -96px -24px;
+}
+
+.aam-icon-medium-twitter span{
+ background-position: -120px 0;
+}
+
+.aam-icon-medium-twitter:hover span{
+ background-position: -120px -24px;
+}
+
+.aam-icon-medium-help span{
+ background-position: -144px 0;
+}
+
+.aam-icon-medium-help:hover span{
+ background-position: -144px -24px;
+}
+
+.aam-icon-medium-message span{
+ background-position: -168px 0;
+}
+
+.aam-icon-medium-message:hover span{
+ background-position: -168px -24px;
+}
+
+.aam-icon-medium-star span{
+ background-position: -192px 0;
+}
+
+.aam-icon-medium-star:hover span{
+ background-position: -192px -24px;
+}
+
+.aam-icon-small-manage span{
+ background-position: 0 0;
+}
+
+.aam-icon-small-manage:hover span{
+ background-position: 0 -16px;
+}
+
+.aam-icon-small-delete span{
+ background-position: -16px 0;
+}
+
+.aam-icon-small-delete:hover span{
+ background-position: -16px -16px;
+}
+
+.aam-icon-small-pen span{
+ background-position: -32px 0;
+}
+
+.aam-icon-small-pen:hover span{
+ background-position: -32px -16px;
+}
+
+.aam-icon-small-edit-user span{
+ background-position: -48px 0;
+}
+
+.aam-icon-small-edit-user:hover span{
+ background-position: -48px -16px;
+}
+
+.aam-icon-small-block span{
+ background-position: -64px 0;
+}
+
+.aam-icon-small-block:hover span{
+ background-position: -64px -16px;
+}
+
+.aam-icon-small-roleback span{
+ background-position: -80px 0;
+}
+
+.aam-icon-small-roleback:hover span{
+ background-position: -80px -16px;
+}
+
+.aam-icon-small-trash span{
+ background-position: -96px 0;
+}
+
+.aam-icon-small-trash:hover span{
+ background-position: -96px -16px;
+}
+
+.aam-icon-small-select span{
+ background-position: -112px 0;
+}
+
+.aam-icon-small-select:hover span{
+ background-position: -112px -16px;
+}
+
+.large-icons-row{
+ display: table;
+ width: 100%;
+ margin-bottom: 5px;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #CCCCCC;
+}
+
+.large-icons-row .aam-icon{
+ display: table-cell;
+ text-align: center;
+ vertical-align: bottom;
+ text-decoration: none;
+ text-transform: uppercase;
+ font-size: 10px;
+ font-weight: bold;
+ color: #333333;
+}
+
+.large-icons-row a.disabled span{
+ opacity: 0.8;
+ cursor: none;
+ pointer-events: none;
+ text-decoration: line-through;
+}
+
+.medium-icons-row{
+ display: inline-table;
+ width: 100%;
+ margin-top: 10px;
+}
+
+.medium-icons-row .aam-icon{
+ display: table-cell;
+ text-indent: 0;
+ font-size: 9px;
+ font-weight: bold;
+ color: #333333;
+}
+
+.medium-icons-row a.aam-icon{
+ text-decoration: none;
+}
+
+.aam-list-row-actions{
+ width: 100%;
+ display: inline-table;
+ text-align: center;
+}
+
+.aam-list-row-actions .aam-icon{
+ display: table-cell;
+}
+
+.aam-warning{
+ width: 100%;
+ height: 40px;
+ display: table-row;
+ background: transparent url('images/common/warning.png') no-repeat 2px center;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-top: 1px;
+}
+
+.aam-warning span{
+ display: table-cell;
+ vertical-align: middle;
+ padding-left: 30px;
+ font-size: 0.9em;
+}
\ No newline at end of file
--- /dev/null
+#major-publishing-actions{
+ margin-top: 5px;
+ border-top: 1px solid #D5D5D5;
+}
\ No newline at end of file
--- /dev/null
+.extension-name{
+ font-weight: bold;
+ font-family: Tahoma, Geneva, sans-serif;
+}
+
+.extension-description{
+ text-align: justify;
+}
+
+.extension-description a{
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.extension-price{
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.free{
+ color: #006400;
+}
+
+.payed{
+ color: #212121;
+}
+
+.cpanel-item-twitter{
+ background-image: url('images/extension/twitter.png');
+}
+
+.cpanel-item-twitter:hover{
+ background-image: url('images/extension/twitter-active.png');
+}
+
+.cpanel-item-message{
+ background-image: url('images/extension/message.png');
+}
+
+.cpanel-item-message:hover{
+ background-image: url('images/extension/message-active.png');
+}
+
+.cpanel-item-website{
+ background-image: url('images/extension/link.png');
+}
+
+.cpanel-item-website:hover{
+ background-image: url('images/extension/link-active.png');
+}
+
+.extension-actions{
+ display: table;
+ width: 100%;
+}
+
+.extension-action{
+ width: 26px;
+ height: 26px;
+ display: table-cell;
+ text-align: center;
+ vertical-align: middle;
+ text-decoration: none;
+ background-color: transparent;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+a.extension-action{
+ outline: 0;
+}
+
+.extension-action-youtube{
+ background-image: url('images/extension/youtube.png');
+}
+
+.extension-action-youtube:hover{
+ background-image: url('images/extension/youtube-active.png');
+}
+
+.extension-action-forum{
+ background-image: url('images/extension/forum.png');
+}
+
+.extension-action-forum:hover{
+ background-image: url('images/extension/forum-active.png');
+}
+
+.extension-action-purchase{
+ background-image: url('images/extension/plus.png');
+}
+
+.extension-action-purchase:hover{
+ background-image: url('images/extension/plus-active.png');
+}
+
+.extension-action-ok{
+ background-image: url('images/extension/ok.png');
+}
+
+.extension-action-ok:hover{
+ background-image: url('images/extension/ok-active.png');
+}
+
+.extension-action-download{
+ background-image: url('images/extension/download.png');
+}
+
+.extension-action-download:hover{
+ background-image: url('images/extension/download-active.png');
+}
+
+.dialog-content{
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+}
+
+.dialog-content a{
+ font-weight: bold;
+ text-decoration: none;
+ color: #257DA6;
+ outline: 0;
+}
+
+input.license-input{
+ width: 100%;
+ border: 1px solid #CCCCCC;
+ border-radius: 0px;
+ margin-top: 5px;
+ padding: 2px;
+ font-size: 12px;
+ line-height: 16px;
+}
+
+#install_extension{
+ position: relative;
+}
+
+.loading-extension{
+ width: 100%;
+ height: 100%;
+ background: #CCCCCC url('images/main-loader.gif') no-repeat center;
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0.8;
+}
+
+.license-error-list{
+ margin-top: 5px;
+ display: none;
+ font-size: 0.8em;
+ color: #FF8888;
+ font-weight: bold;
+}
\ No newline at end of file
--- /dev/null
+/*! jQuery UI - v1.10.3 - 2013-09-12
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
\ No newline at end of file
--- /dev/null
+.dataTable {
+ margin: 10px auto;
+ clear: both;
+ width: 100%;
+ border: 1px solid #CCCCCC;
+}
+
+table.dataTable thead th {
+ padding: 3px 18px 3px 10px;
+ border-bottom: 1px solid #CCCCCC;
+ font-weight: bold;
+ text-transform: uppercase;
+ cursor: pointer;
+ background-color: #257da6;
+}
+
+table.dataTable tfoot td {
+ border-top: 1px solid #CCCCCC;
+}
+
+table.dataTable td {
+ padding: 3px 10px;
+}
+
+table.dataTable td.center,
+table.dataTable td.dataTables_empty {
+ text-align: center;
+}
+
+table.dataTable tr.odd { background-color: #E2E4FF; }
+table.dataTable tr.even { background-color: white; }
+
+table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }
+table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }
+table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }
+table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }
+table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }
+table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }
+
+
+/*
+ * Table wrapper
+*/
+.dataTables_wrapper {
+ position: relative;
+ clear: both;
+}
+
+
+/*
+ * Page length menu
+*/
+.dataTables_length {
+ float: left;
+ margin-right: 5px;
+}
+
+/*
+ * Filter
+*/
+.dataTables_filter {
+ text-align: left;
+ width: 60%;
+ float:left;
+}
+
+.dataTables_filter input{
+ width: 90%;
+ height: 28px;
+ padding-left: 24px;
+ background: transparent url('images/search.png') no-repeat 5px center;
+}
+
+.dataTables_filter input:focus{
+ background: transparent url('images/search-active.png') no-repeat 5px center;
+}
+
+.table-filtered{
+ background: transparent url('images/table-filtered.png') no-repeat 2px center;
+ height: 16px;
+ display: inline-block;
+ padding-left: 20px;
+ font-size: 0.8em;
+}
+
+a.clear-table-filter{
+ text-decoration: none;
+ color: #257DA6;
+ font-size: 0.9em;
+ font-weight: bold;
+}
+
+/*
+ * Table information
+*/
+.dataTables_info {
+ clear: both;
+ float: left;
+}
+
+
+/*
+ * Pagination
+*/
+.dataTables_paginate {
+ float: right;
+ text-align: right;
+ font-size: 0.8em;
+}
+
+/* Two button pagination - previous / next */
+.paginate_disabled_previous,
+.paginate_enabled_previous,
+.paginate_disabled_next,
+.paginate_enabled_next {
+ height: 19px;
+ float: left;
+ cursor: pointer;
+ *cursor: hand;
+ color: #111 !important;
+}
+.paginate_disabled_previous:hover,
+.paginate_enabled_previous:hover,
+.paginate_disabled_next:hover,
+.paginate_enabled_next:hover {
+ text-decoration: none !important;
+}
+.paginate_disabled_previous:active,
+.paginate_enabled_previous:active,
+.paginate_disabled_next:active,
+.paginate_enabled_next:active {
+ outline: none;
+}
+
+.paginate_disabled_previous,
+.paginate_disabled_next {
+ color: #666 !important;
+}
+.paginate_disabled_previous,
+.paginate_enabled_previous {
+ padding-left: 23px;
+}
+.paginate_disabled_next,
+.paginate_enabled_next {
+ padding-right: 23px;
+ margin-left: 10px;
+}
+
+.paginate_enabled_previous { background: url('images/back_enabled.png') no-repeat top left; }
+.paginate_enabled_previous:hover { background: url('images/back_enabled_hover.png') no-repeat top left; }
+.paginate_disabled_previous { background: url('images/back_disabled.png') no-repeat top left; }
+
+.paginate_enabled_next { background: url('images/forward_enabled.png') no-repeat top right; }
+.paginate_enabled_next:hover { background: url('images/forward_enabled_hover.png') no-repeat top right; }
+.paginate_disabled_next { background: url('images/forward_disabled.png') no-repeat top right; }
+
+/* Full number pagination */
+.paging_full_numbers {
+ height: 22px;
+ line-height: 22px;
+}
+.paging_full_numbers a:active {
+ outline: none
+}
+.paging_full_numbers a:hover {
+ text-decoration: none;
+}
+
+.paging_full_numbers a.paginate_button,
+.paging_full_numbers a.paginate_active {
+ border: 1px solid #aaa;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ padding: 2px 5px;
+ margin: 0 3px;
+ cursor: pointer;
+ *cursor: hand;
+ color: #333 !important;
+}
+
+.paging_full_numbers a.paginate_button {
+ background-color: #ddd;
+}
+
+.paging_full_numbers a.paginate_button:hover {
+ background-color: #ccc;
+ text-decoration: none !important;
+}
+
+.paging_full_numbers a.paginate_active {
+ background-color: #99B3FF;
+}
+
+
+/*
+ * Processing indicator
+*/
+.dataTables_processing {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 250px;
+ height: 30px;
+ margin-left: -125px;
+ margin-top: -15px;
+ padding: 14px 0 2px 0;
+ border: 1px solid #ddd;
+ text-align: center;
+ color: #999;
+ font-size: 14px;
+ background-color: white;
+}
+
+
+/*
+ * Sorting
+*/
+.sorting { background: url('images/sort_both.png') no-repeat center right; }
+.sorting_asc { background: url('images/sort_asc.png') no-repeat center right; }
+.sorting_desc { background: url('images/sort_desc.png') no-repeat center right; }
+
+.sorting_asc_disabled { background: url('images/sort_asc_disabled.png') no-repeat center right; }
+.sorting_desc_disabled { background: url('images/sort_desc_disabled.png') no-repeat center right; }
+
+table.dataTable thead th:active,
+table.dataTable thead td:active {
+ outline: none;
+}
+
+
+/*
+ * Scrolling
+*/
+.dataTables_scroll {
+ clear: both;
+}
+
+.dataTables_scrollBody {
+ *margin-top: -1px;
+ -webkit-overflow-scrolling: touch;
+}
\ No newline at end of file
--- /dev/null
+.treeview, .treeview ul {\r
+ padding: 0;\r
+ margin: 0;\r
+ list-style: none;\r
+}\r
+\r
+.treeview ul {\r
+\r
+ margin-top: 4px;\r
+}\r
+\r
+.treeview .hitarea {\r
+ background: url(images/treeview/treeview-default.gif) -64px -25px no-repeat;\r
+ height: 16px;\r
+ width: 16px;\r
+ margin-left: -16px;\r
+ float: left;\r
+ cursor: pointer;\r
+}\r
+/* fix for IE6 */\r
+* html .hitarea {\r
+ display: inline;\r
+ float:none;\r
+}\r
+\r
+.treeview li {\r
+ margin: 0;\r
+ padding: 3px 0pt 3px 16px;\r
+}\r
+\r
+.treeview a.selected {\r
+ background-color: #eee;\r
+}\r
+\r
+#treecontrol { margin: 1em 0; display: none; }\r
+\r
+.treeview .hover { color: red; cursor: pointer; }\r
+\r
+.treeview li { background: url(images/treeview/treeview-default-line.gif) 0 0 no-repeat; }\r
+.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }\r
+\r
+.treeview .expandable-hitarea { background-position: -80px -3px; }\r
+\r
+.treeview li.last { background-position: 0 -1766px }\r
+.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview/treeview-default.gif); }\r
+.treeview li.lastCollapsable { background-position: 0 -111px }\r
+.treeview li.lastExpandable { background-position: -32px -67px }\r
+\r
+.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }\r
+\r
+.treeview-red li { background-image: url(images/treeview/treeview-red-line.gif); }\r
+.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); }\r
+\r
+.treeview-black li { background-image: url(images/treeview/treeview-black-line.gif); }\r
+.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }\r
+\r
+.treeview-gray li { background-image: url(images/treeview/treeview-gray-line.gif); }\r
+.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); }\r
+\r
+.treeview-famfamfam li { background-image: url(images/treeview/treeview-famfamfam-line.gif); }\r
+.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); }\r
+\r
+.treeview .placeholder {\r
+ background: url(images/treeview/ajax-loader.gif) 0 0 no-repeat;\r
+ height: 16px;\r
+ width: 16px;\r
+ display: block;\r
+}\r
+\r
+.filetree li { padding: 3px 0 2px 16px; }\r
+.filetree span.folder { padding-left: 18px; display: block; }\r
+.filetree span.folder { background: url(images/treeview/folder-open.png) 0 0 no-repeat; }\r
+.filetree li.expandable span.folder { background: url(images/treeview/folder-close.png) 0 0 no-repeat; }\r
+.filetree span.folder a{\r
+ text-decoration: none;\r
+}\r
+\r
+.treeview .important{\r
+ font-weight: bold;\r
+}\r
+\r
+.treeview .roots{\r
+ font-weight: bold;\r
+ color: #257DA6;\r
+}\r
+\r
+#sidetreecontrol{\r
+ font-size: 12px;\r
+ margin-bottom: 10px;\r
+ float: right;\r
+ padding-bottom: 6px;\r
+ border-bottom: 2px solid #257DA6;\r
+}\r
+\r
+#sidetreecontrol span{\r
+ color: #006505;\r
+ text-decoration: underline;\r
+ cursor: pointer;\r
+}\r
+\r
+#sidetreecontrol span:hover{\r
+ color: #257da6;\r
+}\r
+\r
+.tree-holder{\r
+ width: auto;\r
+ padding: 10px;\r
+}\r
+\r
+#sidetreecontrol a{\r
+ color: #006505;\r
+ outline: none;\r
+}\r
+\r
+#sidetreecontrol a:hover{\r
+ color: #257da6;\r
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+/**
+ * Main AAM UI Class
+ *
+ * @returns {AAM}
+ */
+function AAM() {
+
+ /**
+ * Current Subject
+ *
+ * @type {Object}
+ *
+ * @access public
+ */
+ this.subject = {
+ type: 'role',
+ id: aamLocal.defaultSegment.role
+ };
+
+ /**
+ * Current Post Term
+ *
+ * @type {Int}
+ *
+ * @access public
+ */
+ this.postTerm = '';
+
+ /**
+ * User Role to filter
+ *
+ * @type String
+ *
+ * @access public
+ */
+ this.userRoleFilter = aamLocal.defaultSegment.role;
+
+ /**
+ * ConfigPress editor
+ *
+ * @type {Object}
+ *
+ * @access public
+ */
+ this.editor = null;
+
+ /**
+ * JavaScript Custom Actions
+ *
+ * @type Array
+ */
+ this.actions = new Array();
+
+ //Let's init the UI
+ this.initUI();
+}
+
+/**
+ * List of Blog Tables
+ *
+ * @type {Object}
+ *
+ * @access public
+ */
+AAM.prototype.blogTables = {
+ capabilities: null,
+ inheritRole: null,
+ postList: null,
+ eventList: null,
+ filterRoleList: null
+};
+
+/**
+ * List of Segment Tables
+ *
+ * @type {Object}
+ *
+ * @access public
+ */
+AAM.prototype.segmentTables = {
+ roleList: null,
+ userList: null
+};
+
+/**
+ * Add Custom Action to queue
+ *
+ * @param {String} action
+ * @param {Fuction} callback
+ *
+ * @returns {void}
+ */
+AAM.prototype.addAction = function(action, callback) {
+ if (typeof this.actions[action] === 'undefined') {
+ this.actions[action] = new Array();
+ }
+
+ this.actions[action].push(callback);
+};
+
+/**
+ * Do Custom Action queue
+ *
+ * @param {String} action
+ * @param {Object} params
+ *
+ * @returns {void}
+ */
+AAM.prototype.doAction = function(action, params) {
+ if (typeof this.actions[action] !== 'undefined') {
+ for (var i in this.actions[action]) {
+ this.actions[action][i].call(this, params);
+ }
+ }
+};
+
+/**
+ * Set Current Subject
+ *
+ * @param {String} type
+ * @param {String} id
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.setSubject = function(type, id) {
+ //reset subject first
+ this.subject.type = type;
+ this.subject.id = id;
+};
+
+/**
+ * Get Current Subject
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.getSubject = function() {
+ return this.subject;
+};
+
+/**
+ * Initialize the UI
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initUI = function() {
+ //initialize side blocks - Control Panel & Control Manager
+ this.initControlPanel();
+ this.initControlManager();
+
+ //Retrieve settings for default segment
+ this.retrieveSettings();
+
+ //init contextual menu if necessary
+ this.initContextualMenu();
+};
+
+/**
+ * Initial Contextual Menu
+ *
+ * @returns void
+ *
+ * @access public
+ */
+AAM.prototype.initContextualMenu = function(){
+ var _this = this;
+ if (parseInt(aamLocal.contextualMenu) !== 1){
+ jQuery('#contextual-help-link-wrap').pointer({
+ pointerClass : 'aam-help-pointer',
+ pointerWidth : 300,
+ content: aamLocal.labels['AAM Documentation'],
+ position: {
+ edge : 'top',
+ align : 'right'
+ },
+ close: function() {
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: _this.compileAjaxPackage('discardHelp', false)
+ });
+ }
+ }).pointer('open');
+ }
+};
+
+/**
+ * Initialize tooltip for selected area
+ *
+ * @param {String} selector
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initTooltip = function(selector) {
+ jQuery('[aam-tooltip]', selector).hover(function() {
+ // Hover over code
+ var title = jQuery(this).attr('aam-tooltip');
+ jQuery(this).data('tipText', title).removeAttr('aam-tooltip');
+ jQuery('<div/>', {
+ 'class': 'aam-tooltip'
+ }).text(title).appendTo('body').fadeIn('slow');
+ }, function() {
+ //Hover out code
+ jQuery(this).attr('aam-tooltip', jQuery(this).data('tipText'));
+ jQuery('.aam-tooltip').remove();
+ }).mousemove(function(e) {
+ jQuery('.aam-tooltip').css({
+ top: e.pageY + 15, //Get Y coordinates
+ left: e.pageX + 15 //Get X coordinates
+ });
+ });
+};
+
+/**
+ * Show Metabox Loader
+ *
+ * @param {String} selector
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.showMetaboxLoader = function(selector) {
+ jQuery('.aam-metabox-loader', selector).show();
+};
+
+/**
+ * Hide Metabox Loader
+ *
+ * @param {String} selector
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.hideMetaboxLoader = function(selector) {
+ jQuery('.aam-metabox-loader', selector).hide();
+};
+
+/**
+ * Compile default Ajax POST package
+ *
+ * @param {String} action
+ * @param {Boolean} include_subject
+ *
+ * @returns {Object}
+ *
+ * @access public
+ */
+AAM.prototype.compileAjaxPackage = function(action, include_subject) {
+ var data = {
+ action: 'aam',
+ sub_action: action,
+ _ajax_nonce: aamLocal.nonce
+ };
+ if (include_subject) {
+ data.subject = this.getSubject().type;
+ data.subject_id = this.getSubject().id;
+ }
+
+ return data;
+};
+
+/**
+ * Disable roleback button
+ *
+ * @returns void
+ *
+ * @access public
+ */
+AAM.prototype.disableRoleback = function(){
+ jQuery('#aam_roleback').addClass('disabled');
+};
+
+/**
+ * Enable roleback button
+ *
+ * @returns void
+ *
+ * @access public
+ */
+AAM.prototype.enableRoleback = function(){
+ jQuery('#aam_roleback').removeClass('disabled');
+};
+
+/**
+ * Initialize Control Panel Metabox
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initControlPanel = function() {
+ var _this = this;
+ //Role Back feature
+ var roleback = this.createIcon('large', 'roleback').append('Roleback').bind('click', function(event) {
+ event.preventDefault();
+ if (!jQuery(this).hasClass('cpanel-item-disabled')){
+ var buttons = {};
+ buttons[aamLocal.labels['Rollback Settings']] = function() {
+ _this.showMetaboxLoader('#control_panel');
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: _this.compileAjaxPackage('roleback', true),
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.retrieveSettings();
+ _this.disableRoleback();
+ }
+ _this.highlight('#control_panel .inside', response.status);
+ },
+ error: function() {
+ _this.highlight('#control_panel .inside', 'failure');
+ },
+ complete: function() {
+ _this.hideMetaboxLoader('#control_panel');
+ jQuery("#restore_dialog").dialog("close");
+ }
+ });
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery("#restore_dialog").dialog("close");
+ };
+
+ jQuery("#restore_dialog").dialog({
+ resizable: false,
+ height: 180,
+ modal: true,
+ buttons: buttons
+ });
+ }
+ });
+ jQuery('#cpanel_major').append(roleback);
+
+ //Save the AAM settings
+ var save = this.createIcon('large', 'save').append('Save').bind('click', function(event) {
+ event.preventDefault();
+ _this.showMetaboxLoader('#control_panel');
+
+ //get information from the form
+ var data = _this.compileAjaxPackage('save', true);
+ //collect data from the form
+ //1. Collect Main Menu
+ if (jQuery('#admin_menu_content').length){
+ jQuery('input', '#admin_menu_content').each(function() {
+ data[jQuery(this).attr('name')] = (jQuery(this).prop('checked') ? 1 : 0);
+ });
+ }
+ //2. Collect Metaboxes & Widgets
+ if (jQuery('#metabox_content').length){
+ jQuery('input', '#metabox_list').each(function() {
+ data[jQuery(this).attr('name')] = (jQuery(this).prop('checked') ? 1 : 0);
+ });
+ }
+ //3. Collect Capabilities
+ if (jQuery('#capability_content').length){
+ var caps = _this.blogTables.capabilities.fnGetData();
+ for (var i in caps) {
+ data['aam[capability][' + caps[i][0] + ']'] = caps[i][1];
+ }
+ }
+ //4. Collect Events
+ if (jQuery('#event_manager_content').length){
+ var events = _this.blogTables.eventList.fnGetData();
+ for (var j in events) {
+ data['aam[event][' + j + '][event]'] = events[j][0];
+ data['aam[event][' + j + '][event_specifier]'] = events[j][1];
+ data['aam[event][' + j + '][post_type]'] = events[j][2];
+ data['aam[event][' + j + '][action]'] = events[j][3];
+ data['aam[event][' + j + '][action_specifier]'] = events[j][4];
+ }
+ }
+
+ _this.doAction('aam_before_save', data);
+
+ //send the Ajax request to save the data
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.retrieveSettings();
+ }
+ _this.highlight('#control_panel .inside', response.status);
+ },
+ error: function() {
+ _this.highlight('#control_panel .inside', 'failure');
+ },
+ complete: function() {
+ _this.hideMetaboxLoader('#control_panel');
+ }
+ });
+ });
+ jQuery('#cpanel_major').append(save);
+
+ //create minor actions
+ jQuery('#cpanel_minor').append(
+ this.createIcon('medium', 'twitter', 'Follow Us').attr({
+ href: 'https://twitter.com/wpaam',
+ target: '_blank'
+ }).append('Twitter')
+ );
+ jQuery('#cpanel_minor').append(
+ this.createIcon('medium', 'help', 'Support').attr({
+ href: 'http://wpaam.com/support',
+ target: '_blank'
+ }).append('Support')
+ );
+ jQuery('#cpanel_minor').append(
+ this.createIcon('medium', 'message', 'Message').append('Support').bind('click', function(event) {
+ event.preventDefault();
+ var buttons = {};
+ buttons[aamLocal.labels['Send E-mail']] = function() {
+ location.href = 'mailto:support@wpaam.com';
+ jQuery("#message_dialog").dialog("close");
+ };
+ jQuery("#message_dialog").dialog({
+ resizable: false,
+ height: 'auto',
+ width: '20%',
+ modal: true,
+ buttons: buttons
+ });
+ }));
+ jQuery('#cpanel_minor').append(
+ this.createIcon('medium', 'star', 'Rate Us').attr({
+ href: 'http://wordpress.org/support/view/plugin-reviews/advanced-access-manager',
+ target: '_blank'
+ }).append('Rate')
+ );
+
+ //Init Tooltip
+ this.initTooltip('#control_panel');
+};
+
+/**
+ * Initialize Control Manager Metabox
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initControlManager = function() {
+ var _this = this;
+ jQuery('.control-manager a').each(function() {
+ jQuery(this).bind('click', function(event) {
+ event.preventDefault();
+ var segment = jQuery(this).attr('segment');
+ _this.loadSegment(segment);
+ });
+ });
+
+ //by default load the Role Segment
+ this.loadSegment('role');
+
+ //show the list
+ jQuery('.control-manager-content').css('visibility', 'visible');
+};
+
+/**
+ * Initialize & Load the Control Segment
+ *
+ * Segment is a access control area like Blog, Role or User. It is virtual
+ * understanding of what we are managing right now
+ *
+ * @param {String} segment
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadSegment = function(segment) {
+ //clear all active segments
+ jQuery('.control-manager a').each(function() {
+ jQuery(this).removeClass(
+ 'manager-item-' + jQuery(this).attr('segment') + '-active'
+ );
+ });
+
+ //hide all segment contents from control manager
+ jQuery('.control-manager-content > div').hide();
+
+ switch (segment) {
+ case 'role':
+ this.loadRoleSegment();
+ break;
+
+ case 'user':
+ this.loadUserSegment();
+ break;
+
+ case 'visitor':
+ this.loadVisitorSegment();
+ break;
+
+ default:
+ this.doAction('aam_load_segment');
+ break;
+ }
+
+ //activate segment icon
+ jQuery('.manager-item-' + segment).addClass(
+ 'manager-item-' + segment + '-active'
+ );
+};
+
+/**
+ * Initialize & Load Role Segment
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadRoleSegment = function() {
+ var _this = this;
+
+ jQuery('#role_manager_wrap').show();
+ if (this.segmentTables.roleList === null) {
+ this.segmentTables.roleList = jQuery('#role_list').dataTable({
+ sDom: "<'top'f<'aam-list-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
+ bServerSide: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'roleList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ },
+ fnInitComplete: function() {
+ var add = _this.createIcon(
+ 'medium',
+ 'add',
+ aamLocal.labels['Add New Role']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.activateIcon(this, 'medium');
+
+ //retrieve list of roles dynamically
+ jQuery('#parent_cap_role').addClass('input-dynamic');
+ jQuery('#parent_cap_role_holder').show();
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: _this.compileAjaxPackage('plainRoleList'),
+ success: function(response) {
+ //reset selector
+ jQuery('#parent_cap_role').empty();
+ jQuery('#parent_cap_role').append(
+ jQuery('<option/>', {value : ''})
+ );
+ for(var i in response){
+ jQuery('#parent_cap_role').append(
+ jQuery('<option/>', {
+ 'value' : i
+ }).html(response[i].name)
+ );
+ }
+ },
+ complete: function(){
+ jQuery('#parent_cap_role').removeClass(
+ 'input-dynamic'
+ );
+ }
+ });
+ _this.launchAddRoleDialog(this);
+ });
+ jQuery('#role_list_wrapper .aam-list-top-actions').append(add);
+ _this.initTooltip(
+ jQuery('#role_list_wrapper .aam-list-top-actions')
+ );
+ },
+ fnDrawCallback: function() {
+ jQuery('#role_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#role_list_filter input').val('');
+ _this.segmentTables.roleList.fnFilter('');
+ }
+ );
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1]
+ }
+ ],
+ fnRowCallback: function(nRow, aData) { //format data
+ jQuery('td:eq(1)', nRow).html(jQuery('<div/>', {
+ 'class': 'aam-list-row-actions'
+ })); //
+ //add role attribute
+ jQuery(nRow).attr('role', aData[0]);
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'manage',
+ aamLocal.labels['Manage']
+ ).bind('click', {
+ role: aData[0]
+ }, function(event) {
+ event.preventDefault();
+ _this.setSubject('role', event.data.role);
+ _this.userRoleFilter = event.data.role;
+ _this.retrieveSettings();
+ _this.setCurrent('role', nRow, aData[2]);
+ if (_this.segmentTables.userList !== null) {
+ _this.segmentTables.userList.fnDraw();
+ }
+ }));
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'pen',
+ aamLocal.labels['Edit']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.activateIcon(this, 'small');
+ _this.launchEditRoleDialog(this, aData);
+ }));
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'delete',
+ aamLocal.labels['Delete']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ var button = this;
+ if ((aData[0] === 'administrator')) {
+ //open the dialog
+ var buttons = {};
+ _this.activateIcon(this, 'small');
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#delete_admin_role_dialog').dialog("close");
+ };
+ jQuery('#delete_admin_role_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '25%',
+ modal: true,
+ buttons: buttons,
+ close: function(){
+ _this.deactivateIcon(button);
+ }
+ });
+ } else {
+ _this.activateIcon(this, 'small');
+ _this.launchDeleteRoleDialog(this, aData);
+ }
+ }));
+
+ //set active
+ if (_this.getSubject().type === 'role'
+ && _this.getSubject().id === aData[0]) {
+ _this.setCurrent('role', nRow, aData[2]);
+ }
+
+ _this.initTooltip(nRow);
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+ }
+};
+
+/**
+ * Highlight current subject
+ *
+ * @param {String} subject
+ * @param {Object} nRow
+ * @param {String} name
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.setCurrent = function(subject, nRow, name) {
+ var _this = this;
+
+ //terminate any active subject
+ jQuery('.aam-icon-small-active').removeClass('aam-icon-small-active');
+
+ jQuery('.aam-bold').each(function() {
+ jQuery(this).removeClass('aam-bold');
+ });
+
+ //highlight the row
+ jQuery('td:eq(0)', nRow).addClass('aam-bold');
+ _this.activateIcon(jQuery('.aam-icon-manage', nRow), 'small');
+ jQuery('.current-subject').html(subject + ' ' + name);
+};
+
+/**
+ * Generate clear filter indicator for all tables
+ *
+ * @returns {String}
+ *
+ * @access public
+ */
+AAM.prototype.clearFilterIndicator = function() {
+ var info = '<div class="table-filtered">';
+ info += aamLocal.labels['Filtered'] + '. ';
+ info += '<a href="#" class="clear-table-filter">';
+ info += aamLocal.labels['Clear'] + '.</a></div>';
+
+ return info;
+};
+
+/**
+ * Launch Add Role Dialog
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchAddRoleDialog = function(button) {
+ var _this = this;
+ //clean-up the form first
+ jQuery('#role_name').val('');
+ //open the dialog
+ var buttons = {};
+ buttons[aamLocal.labels['Add New Role']] = function() {
+ //prepare ajax package
+ var data = _this.compileAjaxPackage('addRole');
+ data.name = jQuery('#role_name').val();
+ data.inherit = jQuery('#parent_cap_role').val();
+
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.segmentTables.roleList.fnDraw();
+ }
+ _this.highlight('#control_manager .inside', response.status);
+ }
+ });
+ jQuery('#manage_role_dialog').dialog("close");
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#manage_role_dialog').dialog("close");
+ };
+
+ jQuery('#manage_role_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ title: aamLocal.labels['Add New Role'],
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch Edit Role Dialog
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchEditRoleDialog = function(button, aData) {
+ var _this = this;
+ //populate the form with data
+ jQuery('#role_name').val(aData[2]);
+ jQuery('#parent_cap_role_holder').hide();
+ //launch the dialog
+ var buttons = {};
+ buttons[aamLocal.labels['Save Changes']] = function() {
+ var data = _this.compileAjaxPackage('editRole');
+ data.subject = 'role';
+ data.subject_id = aData[0];
+ data.name = jQuery('#role_name').val();
+ //save the changes
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.segmentTables.roleList.fnDraw();
+ }
+ _this.highlight('#control_manager .inside', response.status);
+ },
+ error: function() {
+ _this.highlight('#control_manager .inside', 'failure');
+ },
+ complete: function() {
+ jQuery('#manage_role_dialog').dialog("close");
+ }
+ });
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#manage_role_dialog').dialog("close");
+ };
+
+ jQuery('#manage_role_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ modal: true,
+ width: '30%',
+ title: aamLocal.labels['Edit Role'],
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch Delete Role Dialog
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchDeleteRoleDialog = function(button, aData) {
+ var _this = this;
+ //render the message first
+ if (aData[1]) {
+ var message = aamLocal.labels['Delete Role with Users Message'].replace(
+ '%d', aData[1]
+ );
+ message = message.replace('%s', aData[2]);
+ jQuery('#delete_role_dialog .dialog-content').html(message);
+ } else {
+ message = aamLocal.labels['Delete Role Message'].replace('%s', aData[2]);
+ jQuery('#delete_role_dialog .dialog-content').html(message);
+ }
+
+ var buttons = {};
+ buttons[aamLocal.labels['Delete Role']] = function() {
+ //prepare ajax package
+ var data = _this.compileAjaxPackage('deleteRole');
+ data.subject = 'role';
+ data.subject_id = aData[0];
+ data.delete_users = parseInt(aData[1]);
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ //reset the current role
+ var subject = _this.getSubject();
+ if (subject.type === 'role' && subject.id === aData[0]) {
+ _this.setSubject('role', null);
+ }
+ _this.segmentTables.roleList.fnDraw();
+ }
+ _this.highlight('#control_manager .inside', response.status);
+ },
+ error: function() {
+ _this.highlight('#control_manager .inside', 'failure');
+ },
+ complete: function() {
+ jQuery('#delete_role_dialog').dialog("close");
+ }
+ });
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#delete_role_dialog').dialog("close");
+ };
+
+ //launch the dialog
+ jQuery('#delete_role_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ modal: true,
+ title: aamLocal.labels['Delete Role'],
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Initialize & Load User Segment
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadUserSegment = function() {
+ var _this = this;
+ jQuery('#user_manager_wrap').show();
+ if (this.segmentTables.userList === null) {
+ this.segmentTables.userList = jQuery('#user_list').dataTable({
+ sDom: "<'top'f<'aam-list-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
+ bServerSide: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'userList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ aoData.push({
+ name: 'role',
+ value: _this.userRoleFilter
+ });
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1, 4, 5]
+ }
+ ],
+ fnInitComplete: function() {
+ var add = _this.createIcon(
+ 'medium',
+ 'add'
+ ).attr({
+ href: aamLocal.addUserURI,
+ target: '_blank'
+ });
+
+ var filter = _this.createIcon(
+ 'medium',
+ 'filter'
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.activateIcon(this, 'medium');
+ _this.launchFilterUserDialog(this);
+ });
+
+ var refresh = _this.createIcon(
+ 'medium',
+ 'refresh'
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.segmentTables.userList.fnDraw();
+ });
+
+ jQuery('#user_list_wrapper .aam-list-top-actions').append(filter);
+ jQuery('#user_list_wrapper .aam-list-top-actions').append(add);
+ jQuery('#user_list_wrapper .aam-list-top-actions').append(refresh);
+ _this.initTooltip(jQuery('#user_list_wrapper .aam-list-top-actions'));
+ },
+ fnDrawCallback: function() {
+ jQuery('#user_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#user_list_filter input').val('');
+ _this.userRoleFilter = '';
+ _this.segmentTables.userList.fnFilter('');
+ }
+ );
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ },
+ fnRowCallback: function(nRow, aData, iDisplayIndex) { //format data
+ //add User attribute
+ jQuery(nRow).attr('user', aData[0]);
+ jQuery('td:eq(1)', nRow).html(jQuery('<div/>', {
+ 'class': 'aam-list-row-actions'
+ }));
+
+ if (parseInt(aData[5]) === 1){
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'manage',
+ aamLocal.labels['Manage']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.setSubject('user', aData[0]);
+ _this.retrieveSettings();
+ _this.setCurrent('user', nRow, aData[2]);
+ }));
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'edit-user',
+ aamLocal.labels['Edit']
+ ).attr({
+ href: aamLocal.editUserURI + '?user_id=' + aData[0],
+ target: '_blank'
+ }));
+
+ var block = _this.createIcon(
+ 'small',
+ 'block',
+ aamLocal.labels['Block']
+ );
+ if (parseInt(aData[4]) === 1){
+ _this.activateIcon(block, 'small');
+ }
+ block.bind('click', function(event) {
+ event.preventDefault();
+ _this.blockUser(this, aData);
+ });
+ jQuery('.aam-list-row-actions', nRow).append(block);
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'delete',
+ aamLocal.labels['Delete']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.deleteUser(this, aData);
+ }));
+ } else {
+ jQuery('.aam-list-row-actions', nRow).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'user-action-locked',
+ 'aam-tooltip': aamLocal.labels['Actions Locked']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ }));
+ }
+
+ //set active
+ if (_this.getSubject().type === 'user'
+ && _this.getSubject().id === aData[0]) {
+ _this.setCurrent('user', nRow, aData[2]);
+ }
+
+ _this.initTooltip(nRow);
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+ }
+};
+
+/**
+ * Block the selected user
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.blockUser = function(button, aData) {
+ var _this = this;
+ var data = this.compileAjaxPackage('blockUser');
+ data.subject = 'user';
+ data.subject_id = aData[0];
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ _this.highlight('#control_manager .inside', response.status);
+ if (response.user_status === 1) {
+ _this.activateIcon(button, 'small');
+ } else {
+ _this.deactivateIcon(button);
+ }
+ },
+ error: function() {
+ _this.highlight('#control_manager .inside', 'failure');
+ }
+ });
+};
+
+/**
+ * Delete selected User
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.deleteUser = function(button, aData) {
+ var _this = this;
+ //insert content
+ jQuery('#delete_user_dialog .dialog-content').html(
+ aamLocal.labels['Delete User Message'].replace('%s', aData[2])
+ );
+ var buttons = {};
+ buttons[aamLocal.labels['Delete']] = function() {
+ var data = _this.compileAjaxPackage('deleteUser');
+ data.subject = 'user';
+ data.subject_id = aData[0];
+ //send request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.segmentTables.userList.fnDraw();
+ }
+ _this.highlight('#control_manager .inside', response.status);
+
+ },
+ error: function() {
+ _this.highlight('#control_manager .inside', 'failure');
+ },
+ complete: function() {
+ jQuery('#delete_user_dialog').dialog('close');
+ }
+ });
+ };
+
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#delete_user_dialog').dialog("close");
+ };
+ //show the dialog
+ jQuery('#delete_user_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch the Filter User List by User Role dialog
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchFilterUserDialog = function(button) {
+ var _this = this;
+ if (this.blogTables.filterRoleList === null) {
+ this.blogTables.filterRoleList = jQuery('#filter_role_list').dataTable({
+ sDom: "<'top'f<'clear'>>t<'footer'ip<'clear'>>",
+ bServerSide: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'roleList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ },
+ fnDrawCallback: function() {
+ jQuery('#filter_role_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#filter_role_list_filter input').val('');
+ _this.blogTables.filterRoleList.fnFilter('');
+ }
+ );
+ _this.initTooltip('#filter_role_list_wrapper');
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1]
+ }
+ ],
+ fnRowCallback: function(nRow, aData) { //format data
+ jQuery('td:eq(1)', nRow).html(jQuery('<div/>', {
+ 'class': 'aam-list-row-actions'
+ }));
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'select',
+ aamLocal.labels['Select Role']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.userRoleFilter = aData[0];
+ _this.segmentTables.userList.fnDraw();
+ jQuery('#filter_user_dialog').dialog('close');
+ }));
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+ } else {
+ this.blogTables.filterRoleList.fnDraw();
+ }
+ //show the dialog
+ var buttons = {};
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#filter_user_dialog').dialog("close");
+ };
+ jQuery('#filter_user_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '40%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Initialize & Load visitor segment
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadVisitorSegment = function() {
+ jQuery('#visitor_manager_wrap').show();
+ this.setSubject('visitor', 1);
+ this.setCurrent('Visitor', '', '');
+ this.retrieveSettings();
+};
+
+/**
+ * Retrieve main metabox settings
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.retrieveSettings = function() {
+ var _this = this;
+
+ jQuery('.aam-main-loader').show();
+ jQuery('.aam-main-content').empty();
+
+ //reset blog Tables first
+ for (var i in this.blogTables) {
+ this.blogTables[i] = null;
+ }
+
+ jQuery.ajax(aamLocal.siteURI, {
+ type: 'POST',
+ dataType: 'html',
+ data: {
+ action: 'features',
+ _ajax_nonce: aamLocal.nonce,
+ subject: _this.getSubject().type,
+ subject_id: _this.getSubject().id
+ },
+ success: function(response) {
+ jQuery('.aam-main-content').html(response);
+ _this.checkRoleback();
+ _this.initSettings();
+ },
+ complete: function() {
+ jQuery('.aam-main-loader').hide();
+ }
+ });
+};
+
+/**
+ * Check if current subject has roleback available
+ *
+ * @returns {undefined}
+ */
+AAM.prototype.checkRoleback = function() {
+ var _this = this;
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: _this.compileAjaxPackage('hasRoleback', true),
+ success: function(response) {
+ if (parseInt(response.status) === 0) {
+ _this.disableRoleback();
+ } else {
+ _this.enableRoleback();
+ }
+ },
+ complete: function() {
+ jQuery('.aam-main-loader').hide();
+ }
+ });
+};
+
+/**
+ * Initialize Main metabox settings
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initSettings = function() {
+ var _this = this;
+
+ //remove all dialogs to make sure that there are no confusions
+ jQuery('.ui-dialog').remove();
+
+ //init Settings Menu
+ jQuery('.feature-list .feature-item').each(function() {
+ jQuery(this).bind('click', function() {
+ //feature activation hook
+ _this.doAction(
+ 'aam_feature_activation',
+ {'feature': jQuery(this).attr('feature')}
+ );
+
+ jQuery('.feature-list .feature-item').removeClass(
+ 'feature-item-active'
+ );
+ jQuery(this).addClass('feature-item-active');
+ jQuery('.feature-content .feature-content-container').hide();
+ jQuery('#' + jQuery(this).attr('feature') + '_content').show();
+ });
+ });
+
+ //init default tabs
+ if (jQuery('#admin_menu_content').length){
+ this.initMenuTab();
+ }
+ if (jQuery('#metabox_content').length){
+ this.initMetaboxTab();
+ }
+ if (jQuery('#capability_content').length){
+ this.initCapabilityTab();
+ }
+ if (jQuery('#post_access_content').length){
+ this.initPostTab();
+ }
+ if (jQuery('#event_manager_content').length){
+ this.initEventTab();
+ }
+
+ this.doAction('aam_init_features');
+
+ jQuery('.feature-list .feature-item:eq(0)').trigger('click');
+};
+
+/**
+ * Initialize Capability Feature
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initCapabilityTab = function() {
+ var _this = this;
+
+ //indicator that current user has default capability set. In case he does
+ //not, it will show additional top action - Restore Default Capabilities
+ var userDefault = true;
+
+ this.blogTables.capabilities = jQuery('#capability_list').dataTable({
+ sDom: "<'top'lf<'aam-list-top-actions'><'clear'>>t<'footer'ip<'clear'>>",
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ bDestroy: true,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback) {
+ jQuery.ajax({
+ dataType: 'json',
+ type: "POST",
+ url: aamLocal.ajaxurl,
+ data: aoData,
+ success: function(data) {
+ //set Default Capability set indicator
+ userDefault = parseInt(data.aaDefault);
+ //populate oTable
+ fnCallback(data);
+ },
+ error: function() {
+ _this.parent.failure();
+ }
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'loadCapabilities'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ aoData.push({
+ name: 'subject',
+ value: _this.getSubject().type
+ });
+ aoData.push({
+ name: 'subject_id',
+ value: _this.getSubject().id
+ });
+ },
+ fnInitComplete: function() {
+ var a = jQuery('#capability_list_wrapper .aam-list-top-actions');
+
+ var filter = _this.createIcon(
+ 'medium',
+ 'filter',
+ aamLocal.labels['Filter Capabilities by Category']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.activateIcon(this, 'medium');
+ _this.launchCapabilityFilterDialog(this);
+ });
+ jQuery(a).append(filter);
+
+ //do not allow for user to add any new capabilities or copy from
+ //existing role
+ if (_this.getSubject().type !== 'user') {
+ var copy = _this.createIcon(
+ 'medium',
+ 'copy',
+ aamLocal.labels['Inherit Capabilities']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchRoleCopyDialog(this);
+ });
+
+ jQuery(a).append(copy);
+ var add = _this.createIcon(
+ 'medium',
+ 'add',
+ aamLocal.labels['Add New Capability']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchAddCapabilityDialog(this);
+ });
+ jQuery(a).append(add);
+ } else if (userDefault === 0) {
+ //add Restore Default Capability button
+ var restore = _this.createIcon(
+ 'medium',
+ 'roleback',
+ aamLocal.labels['Restore Default Capabilities']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ var data = _this.compileAjaxPackage('restoreCapabilities', true);
+ //show indicator that is running
+ _this.loadingIcon(jQuery(this), 'medium');
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.retrieveSettings();
+ } else {
+ _this.highlight('#capability_content', 'failure');
+ }
+ },
+ error: function() {
+ _this.highlight('#capability_content', 'failure');
+ }
+ });
+ });
+ jQuery(a).append(restore);
+ }
+
+ _this.initTooltip(a);
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1]
+ }
+ ],
+ fnRowCallback: function(nRow, aData) {
+ jQuery('td:eq(2)', nRow).empty().append(jQuery('<div/>', {
+ 'class': 'capability-actions'
+ }));
+ var actions = jQuery('.capability-actions', nRow);
+ //add capability checkbox
+ jQuery(actions).append(jQuery('<div/>', {
+ 'class': 'capability-action'
+ }));
+ jQuery('.capability-action', actions).append(jQuery('<input/>', {
+ type: 'checkbox',
+ id: aData[0],
+ checked: (parseInt(aData[1]) === 1 ? true : false),
+ name: 'aam[capability][' + aData[0] + ']'
+ }).bind('change', function() {
+ var status = (jQuery(this).prop('checked') === true ? 1 : 0);
+ _this.blogTables.capabilities.fnUpdate(status, nRow, 1, false);
+ }));
+ jQuery('.capability-action', actions).append(
+ '<label for="' + aData[0] + '"><span></span></label>'
+ );
+ //add capability delete
+ jQuery(actions).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'capability-action capability-action-delete',
+ 'aam-tooltip': aamLocal.labels['Delete']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchDeleteCapabilityDialog(this, aData, nRow);
+ }));
+ _this.initTooltip(nRow);
+ },
+ fnDrawCallback: function() {
+ jQuery('#capability_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#capability_list_wrapper input').val('');
+ _this.blogTables.capabilities.fnFilter('');
+ _this.blogTables.capabilities.fnFilter('', 2);
+ }
+ );
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ },
+ sLengthMenu: "_MENU_"
+ }
+ });
+};
+
+/**
+ * Launch the Delete Capability Dialog
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ * @param {Object} nRow
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchDeleteCapabilityDialog = function(button, aData, nRow) {
+ var _this = this;
+ jQuery('#delete_capability .dialog-content').html(
+ aamLocal.labels['Delete Capability Message'].replace('%s', aData[3])
+ );
+
+ var buttons = {};
+ buttons[aamLocal.labels['Delete Capability']] = function() {
+ var data = _this.compileAjaxPackage('deleteCapability');
+ data.capability = aData[0];
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.blogTables.capabilities.fnDeleteRow(nRow);
+ }
+ _this.highlight('#capability_content', response.status);
+ },
+ error: function() {
+ _this.highlight('#capability_content', 'failure');
+ }
+ });
+ jQuery('#delete_capability').dialog("close");
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#delete_capability').dialog("close");
+ };
+
+ jQuery('#delete_capability').dialog({
+ resizable: false,
+ height: 'auto',
+ modal: true,
+ title: aamLocal.labels['Delete Capability'],
+ buttons: buttons,
+ close: function() {
+ }
+ });
+};
+
+/**
+ * Launch Capability Filter Dialog
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchCapabilityFilterDialog = function(button) {
+ var _this = this;
+
+ jQuery('#capability_group_list').dataTable({
+ sDom: "t",
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ bDestroy: true,
+ fnRowCallback: function(nRow, aData) {
+ jQuery('.aam-icon-select', nRow).bind('click', function(event) {
+ event.preventDefault();
+ _this.blogTables.capabilities.fnFilter(
+ aData[0].replace('&', '&'), 2
+ );
+ jQuery('#filter_capability_dialog').dialog('close');
+ });
+ }
+ });
+ var buttons = {};
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#filter_capability_dialog').dialog("close");
+ };
+ jQuery('#filter_capability_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch Capability Role Copy dialog
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchRoleCopyDialog = function(button) {
+ var _this = this;
+
+ this.blogTables.inheritRole = jQuery('#copy_role_list').dataTable({
+ sDom: "<'top'f<'clear'>>t<'footer'ip<'clear'>>",
+ bServerSide: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ bDestroy: true,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'roleList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ },
+ fnDrawCallback: function() {
+ jQuery('#copy_role_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#copy_role_list_filter input').val('');
+ _this.blogTables.inheritRole.fnFilter('');
+ }
+ );
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1]
+ }
+ ],
+ fnRowCallback: function(nRow, aData, iDisplayIndex) { //format data
+ jQuery('td:eq(1)', nRow).html(jQuery('<div/>', {
+ 'class': 'aam-list-row-actions'
+ })); //
+ jQuery('.aam-list-row-actions', nRow).empty();
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'select',
+ aamLocal.labels['Select Role']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.showMetaboxLoader('#copy_role_dialog');
+ var data = _this.compileAjaxPackage('roleCapabilities');
+ data.subject = 'role';
+ data.subject_id = aData[0];
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ //reset the capability list
+ var oSettings = _this.blogTables.capabilities.fnSettings();
+ for (var i in oSettings.aoData) {
+ var cap = oSettings.aoData[i]._aData[0];
+ var ntr = oSettings.aoData[i].nTr;
+ if (typeof response.capabilities[cap] !== 'undefined') {
+ _this.blogTables.capabilities.fnUpdate(1, ntr, 1, false);
+ jQuery('#' + cap).attr('checked', 'checked');
+ } else {
+ _this.blogTables.capabilities.fnUpdate(0, ntr, 1, false);
+ jQuery('#' + cap).removeAttr('checked');
+ }
+ }
+ }
+ _this.highlight('#capability_content', response.status);
+ },
+ error: function() {
+ _this.highlight('#capability_content', 'failure');
+ },
+ complete: function() {
+ //grab the capability list for selected role
+ _this.hideMetaboxLoader('#copy_role_dialog');
+ jQuery('#copy_role_dialog').dialog('close');
+ }
+ });
+ }));
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+
+ var buttons = {};
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#copy_role_dialog').dialog("close");
+ };
+
+ //show the dialog
+ jQuery('#copy_role_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '40%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch Add Capability Dialog
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchAddCapabilityDialog = function(button) {
+ var _this = this;
+ //reset form
+ jQuery('#capability_name').val('');
+
+ var buttons = {};
+ buttons[aamLocal.labels['Add Capability']] = function() {
+ var capability = jQuery.trim(jQuery('#capability_name').val());
+ if (capability) {
+ _this.showMetaboxLoader('#capability_form_dialog');
+ var data = _this.compileAjaxPackage('addCapability');
+ data.capability = capability;
+ data.unfiltered = (jQuery('#capability_unfiltered').attr('checked') ? 1 : 0);
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.blogTables.capabilities.fnAddData([
+ response.capability,
+ 1,
+ 'Miscelaneous',
+ data.capability,
+ '']);
+ _this.highlight('#capability_content', 'success');
+ jQuery('#capability_form_dialog').dialog("close");
+ } else {
+ _this.highlight('#capability_form_dialog', 'failure');
+ }
+ },
+ error: function() {
+ _this.highlight('#capability_form_dialog', 'failure');
+ },
+ complete: function() {
+ _this.hideMetaboxLoader('#capability_form_dialog');
+ }
+ });
+ } else {
+ jQuery('#capability_name').effect('highlight', 2000);
+ }
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#capability_form_dialog').dialog("close");
+ };
+
+ //show dialog
+ jQuery('#capability_form_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: 'auto',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Initialize and Load the Menu Feature
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initMenuTab = function() {
+ this.initMenuAccordion(false);
+
+ jQuery('.whole_menu').each(function() {
+ jQuery(this).bind('change', function() {
+ if (jQuery(this).attr('checked')) {
+ jQuery('input[type="checkbox"]', '#submenu_' + jQuery(this).attr('id')).attr(
+ 'checked', 'checked'
+ );
+ } else {
+ jQuery('input[type="checkbox"]', '#submenu_' + jQuery(this).attr('id')).removeAttr(
+ 'checked'
+ );
+ }
+ });
+ });
+
+ this.initTooltip('#main_menu_list');
+};
+
+/**
+ * Init Main Menu Accordion
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initMenuAccordion = function() {
+ //destroy if already initialized
+ if (jQuery('#main_menu_list').hasClass('ui-accordion')) {
+ jQuery('#main_menu_list').accordion('destroy');
+ }
+
+ //initialize
+ jQuery('#main_menu_list').accordion({
+ collapsible: true,
+ header: 'h4',
+ heightStyle: 'content',
+ icons: {
+ header: "ui-icon-circle-arrow-e",
+ headerSelected: "ui-icon-circle-arrow-s"
+ },
+ active: false
+ });
+};
+
+/**
+ * Initialize and load Metabox Feature
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initMetaboxTab = function() {
+ var _this = this;
+
+ jQuery('#retrieve_url').bind('click', function(event) {
+ event.preventDefault();
+ var icon = this;
+ var link = jQuery.trim(jQuery('#metabox_link').val());
+ if (link) {
+ _this.loadingIcon(icon, 'medium');
+ //init metaboxes
+ var data = _this.compileAjaxPackage('initLink');
+ data.link = link;
+
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ jQuery('#metabox_link').val('');
+ _this.loadMetaboxes(0);
+ }
+ _this.highlight('#metabox_content', response.status);
+ },
+ error: function() {
+ _this.highlight('#metabox_content', 'failure');
+ },
+ complete: function(){
+ _this.removeLoadingIcon(icon);
+ }
+ });
+ } else {
+ jQuery('#metabox_link').effect('highlight', 2000);
+ }
+
+ });
+
+ jQuery('#refresh_metaboxes').bind('click', function(event) {
+ event.preventDefault();
+ _this.loadMetaboxes(1);
+ });
+
+ this.initTooltip('.metabox-top-actions');
+
+ this.loadMetaboxes(0);
+};
+
+/**
+ * Load Metabox list
+ *
+ * @param {Boolean} refresh
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadMetaboxes = function(refresh) {
+ var _this = this;
+ //init metaboxes
+ var data = this.compileAjaxPackage('loadMetaboxes', true);
+ data.refresh = refresh;
+ //show loader and reset the metabox list holder
+ jQuery('#metabox_list_container').empty();
+ this.showMetaboxLoader('#metabox_content');
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'html',
+ data: data,
+ success: function(response) {
+ jQuery('#metabox_list_container').html(response);
+ jQuery('#metabox_list').accordion({
+ collapsible: true,
+ header: 'h4',
+ heightStyle: 'content',
+ icons: {
+ header: "ui-icon-circle-arrow-e",
+ headerSelected: "ui-icon-circle-arrow-s"
+ },
+ active: false
+ });
+ //init Tooltips
+ _this.initTooltip('#metabox_list_container');
+ },
+ error: function() {
+ _this.highlight('#metabox_content', 'failure');
+ },
+ complete: function() {
+ _this.hideMetaboxLoader('#metabox_content');
+ }
+ });
+};
+
+/**
+ * Initialize and Load Event Feature
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initEventTab = function() {
+ var _this = this;
+
+ jQuery('#event_event').bind('change', function() {
+ if (jQuery(this).val() === 'status_change') {
+ jQuery('#status_changed').show();
+ } else {
+ jQuery('#status_changed').hide();
+ }
+ });
+
+ jQuery('#event_action').bind('change', function() {
+ jQuery('.event-specifier').hide();
+ jQuery('#event_specifier_' + jQuery(this).val() + '_holder').show();
+ });
+
+ this.blogTables.eventList = jQuery('#event_list').dataTable({
+ sDom: "<'aam-list-top-actions'><'clear'>t<'footer'p<'clear'>>",
+ //bProcessing : false,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'eventList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ aoData.push({
+ name: 'subject',
+ value: _this.getSubject().type
+ });
+ aoData.push({
+ name: 'subject_id',
+ value: _this.getSubject().id
+ });
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [1, 4]
+ }
+ ],
+ fnInitComplete: function() {
+ var add = _this.createIcon(
+ 'medium',
+ 'add',
+ aamLocal.labels['Add Event']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchManageEventDialog(this, null);
+ });
+ jQuery('#event_list_wrapper .aam-list-top-actions').append(add);
+ _this.initTooltip(
+ jQuery('#event_list_wrapper .aam-list-top-actions')
+ );
+ },
+ fnDrawCallback: function() {
+ jQuery('#event_list_wrapper .clear-table-filter').bind('click', function(event) {
+ event.preventDefault();
+ jQuery('#event_list_filter input').val('');
+ _this.blogTables.eventList.fnFilter('');
+ });
+ },
+ fnRowCallback: function(nRow, aData) {
+ if (jQuery('.event-actions', nRow).length) {
+ jQuery('.event-actions', nRow).empty();
+ } else {
+ jQuery('td:eq(3)', nRow).html(jQuery('<div/>', {
+ 'class': 'event-actions'
+ }));
+ }
+ jQuery('.event-actions', nRow).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'event-action event-action-edit',
+ 'aam-tooltip': aamLocal.labels['Edit Event']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchManageEventDialog(this, aData, nRow);
+ }));
+ jQuery('.event-actions', nRow).append(jQuery('<a/>', {
+ 'href': '#',
+ 'class': 'event-action event-action-delete',
+ 'aam-tooltip': aamLocal.labels['Delete Event']
+ }).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchDeleteEventDialog(this, aData, nRow);
+ }));
+
+ _this.initTooltip(nRow);
+
+ //decorate the data in row
+ jQuery('td:eq(0)', nRow).html(
+ jQuery('#event_event option[value="' + aData[0] + '"]').text()
+ );
+ jQuery('td:eq(1)', nRow).html(
+ jQuery('#event_bind option[value="' + aData[2] + '"]').text()
+ );
+ jQuery('td:eq(2)', nRow).html(
+ jQuery('#event_action option[value="' + aData[3] + '"]').text()
+ );
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ }
+ }
+ });
+};
+
+/**
+ * Launch Add/Edit Event Dialog
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ * @param {Object} nRow
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchManageEventDialog = function(button, aData, nRow) {
+ var _this = this;
+
+ //reset form and pre-populate if edit mode
+ jQuery('input, select', '#manage_event_dialog').val('');
+ jQuery('.event-specifier', '#manage_event_dialog').hide();
+ jQuery('#status_changed', '#manage_event_dialog').hide();
+
+ if (aData !== null) {
+ jQuery('#event_event', '#manage_event_dialog').val(aData[0]);
+ jQuery('#event_specifier', '#manage_event_dialog').val(aData[1]);
+ jQuery('#event_bind', '#manage_event_dialog').val(aData[2]);
+ jQuery('#event_action', '#manage_event_dialog').val(aData[3]);
+ jQuery('#event_specifier_' + aData[3], '#manage_event_dialog').val(aData[4]);
+ //TODO - Make this more dynamical
+ jQuery('#event_event', '#manage_event_dialog').trigger('change');
+ jQuery('#event_action', '#manage_event_dialog').trigger('change');
+ }
+
+ var buttons = {};
+ buttons[aamLocal.labels['Save Event']] = function() {
+ //validate first
+ var data = _this.validEvent();
+ if (data !== null) {
+ if (aData !== null) {
+ _this.blogTables.eventList.fnUpdate(data, nRow);
+ } else {
+ _this.blogTables.eventList.fnAddData(data);
+ }
+ jQuery('#manage_event_dialog').dialog("close");
+ } else {
+ jQuery('#manage_event_dialog').effect('highlight', 3000);
+ }
+ };
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#manage_event_dialog').dialog("close");
+ };
+ jQuery('#manage_event_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '40%',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ }
+ });
+};
+
+/**
+ * Validate Event Form
+ *
+ * @returns {Boolean}
+ *
+ * @access public
+ */
+AAM.prototype.validEvent = function() {
+ var data = new Array();
+
+ data.push(jQuery('#event_event').val());
+ data.push(jQuery('#event_specifier').val());
+ data.push(jQuery('#event_bind').val());
+ var action = jQuery('#event_action').val();
+ data.push(action);
+ data.push(jQuery('#event_specifier_' + action).val());
+ data.push('--'); //Event Actions Cell
+
+ return data;
+};
+
+/**
+ * Launch Delete Event Dialog
+ *
+ * @param {Object} button
+ * @param {Object} aData
+ * @param {Object} nRow
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchDeleteEventDialog = function(button, aData, nRow) {
+ var _this = this;
+ var buttons = {};
+ buttons[aamLocal.labels['Delete Event']] = function() {
+ _this.blogTables.eventList.fnDeleteRow(nRow);
+ jQuery('#delete_event').dialog("close");
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#delete_event').dialog("close");
+ };
+ jQuery('#delete_event').dialog({
+ resizable: false,
+ height: 'auto',
+ modal: true,
+ title: aamLocal.labels['Delete Event'],
+ buttons: buttons,
+ close: function() {
+ }
+ });
+};
+
+/**
+ * Initialize and Load Post Feature
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initPostTab = function() {
+ var _this = this;
+
+ this.initPostTree();
+
+ jQuery('#sidetreecontrol span').bind('click', function() {
+ jQuery("#tree").replaceWith('<ul id="tree" class="filetree"></ul>');
+ _this.initPostTree();
+ });
+
+ jQuery('.post-access-area').buttonset();
+ jQuery('.post-access-area input', '#access_dialog').each(function() {
+ jQuery(this).bind('click', function() {
+ jQuery('#access_dialog .dataTable').hide();
+ jQuery('#term_access_' + jQuery(this).val()).show();
+ jQuery('#post_access_' + jQuery(this).val()).show();
+ });
+ });
+
+ this.blogTables.postList = jQuery('#post_list').dataTable({
+ sDom: "<'top'lf<'aam-list-top-actions'><'clear'>><'post-breadcrumb'>t<'footer'ip<'clear'>>",
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ bServerSide: true,
+ sAjaxSource: true,
+ fnServerData: function(sSource, aoData, fnCallback, oSettings) {
+ oSettings.jqXHR = jQuery.ajax({
+ "dataType": 'json',
+ "type": "POST",
+ "url": aamLocal.ajaxurl,
+ "data": aoData,
+ "success": fnCallback
+ });
+ },
+ fnServerParams: function(aoData) {
+ aoData.push({
+ name: 'action',
+ value: 'aam'
+ });
+ aoData.push({
+ name: 'sub_action',
+ value: 'postList'
+ });
+ aoData.push({
+ name: '_ajax_nonce',
+ value: aamLocal.nonce
+ });
+ aoData.push({
+ name: 'subject',
+ value: _this.getSubject().type
+ });
+ aoData.push({
+ name: 'subject_id',
+ value: _this.getSubject().id
+ });
+ aoData.push({
+ name: 'term',
+ value: _this.postTerm
+ });
+ },
+ fnInitComplete: function() {
+ var a = jQuery('#post_list_wrapper .aam-list-top-actions');
+
+ var filter = _this.createIcon(
+ 'medium',
+ 'filter',
+ aamLocal.labels['Filter Posts by Post Type']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchFilterPostDialog(this);
+ });
+ jQuery(a).append(filter);
+
+ var refresh = _this.createIcon(
+ 'medium',
+ 'refresh',
+ aamLocal.labels['Refresh List']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.blogTables.postList.fnDraw();
+ });
+ jQuery(a).append(refresh);
+ _this.initTooltip(a);
+ },
+ oLanguage: {
+ sSearch: "",
+ oPaginate: {
+ sFirst: "≪",
+ sLast: "≫",
+ sNext: ">",
+ sPrevious: "<"
+ },
+ sLengthMenu: "_MENU_"
+ },
+ aoColumnDefs: [
+ {
+ bVisible: false,
+ aTargets: [0, 1, 2, 6]
+ }
+ ],
+ fnRowCallback: function(nRow, aData) { //format data
+ jQuery('td:eq(0)', nRow).html(jQuery('<a/>', {
+ 'href': "#",
+ 'class': "post-type-post"
+ }).bind('click', function(event) {
+ event.preventDefault();
+ var button = jQuery('.aam-icon-manage', nRow);
+ _this.launchManageAccessDialog(button, nRow, aData, 'post');
+ }).text(aData[3]));
+
+ jQuery('td:eq(2)', nRow).append(jQuery('<div/>', {
+ 'class': 'aam-list-row-actions'
+ }));
+
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'manage',
+ aamLocal.labels['Manage Access']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchManageAccessDialog(this, nRow, aData, 'post');
+ }));
+
+ var edit = _this.createIcon(
+ 'small',
+ 'pen',
+ aamLocal.labels['Edit']
+ ).attr({
+ href: aData[2].replace('&', '&'),
+ target: '_blank'
+ });
+ jQuery('.aam-list-row-actions', nRow).append(edit);
+
+ if (aData[1] === 'trash') {
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'delete',
+ aamLocal.labels['Delete Post']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchDeletePostDialog(this, nRow, aData, true);
+ }));
+ } else {
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'trash',
+ aamLocal.labels['Move to Trash']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.launchDeletePostDialog(this, nRow, aData, false);
+ }));
+ }
+
+ if (parseInt(aData[6]) === 1) {
+ jQuery('.aam-list-row-actions', nRow).append(_this.createIcon(
+ 'small',
+ 'roleback',
+ aamLocal.labels['Restore Default Access']
+ ).bind('click', function(event) {
+ event.preventDefault();
+ _this.restorePostAccess(aData[0], 'post', nRow);
+ jQuery(this).remove();
+ }));
+ }
+
+ _this.initTooltip(nRow);
+ },
+ fnDrawCallback: function() {
+ jQuery('.post-breadcrumb').addClass('post-breadcrumb-loading');
+ _this.loadBreadcrumb();
+ jQuery('#event_list_wrapper .clear-table-filter').bind(
+ 'click', function(event) {
+ event.preventDefault();
+ jQuery('#event_list_filter input').val('');
+ _this.blogTables.postList.fnFilter('');
+ }
+ );
+ },
+ fnInfoCallback: function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
+ return (iMax !== iTotal ? _this.clearFilterIndicator() : '');
+ }
+ });
+};
+
+/**
+ * Launch Filter Post Dialog (Category Tree)
+ *
+ * @param {Object} button
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchFilterPostDialog = function(button) {
+ var _this = this;
+ var buttons = {};
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#filter_post_dialog').dialog("close");
+ };
+ jQuery('#filter_post_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: 'auto',
+ modal: true,
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Launch Manage Access Control for selected post
+ *
+ * @param {Object} button
+ * @param {Object} nRow
+ * @param {Array} aData
+ * @param {String} type
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchManageAccessDialog = function(button, nRow, aData, type) {
+ var _this = this;
+
+ //reset the Frontend/Backend radio
+ if (jQuery('.post-access-area', '#access_dialog').length) {
+ //in case it is Visitor, this section is not rendered
+ jQuery('.post-access-area #post_area_frontend').attr('checked', true);
+ jQuery('.post-access-area').buttonset('refresh');
+ }
+
+ //retrieve settings and display the dialog
+ var data = this.compileAjaxPackage('getAccess', true);
+ data.id = aData[0];
+ data.type = type;
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ jQuery('#access_control_area').html(response.html);
+ jQuery('#access_dialog .dataTable').hide();
+
+ if (type === 'term') {
+ jQuery('#term_access_frontend').show();
+ if (parseInt(response.counter) !== -1) {
+ jQuery('.post-access-block', '#access_dialog').show();
+ } else {
+ jQuery('.post-access-block', '#access_dialog').hide();
+ }
+ } else {
+ jQuery('.post-access-block', '#access_dialog').hide();
+ }
+
+ jQuery('#post_access_frontend').show();
+
+
+ var buttons = {};
+ buttons[aamLocal.labels['Restore Default']] = function() {
+ _this.restorePostAccess(aData[0], type, nRow);
+ jQuery('#access_dialog').dialog("close");
+ };
+
+ if (response.counter <= 10) {
+ buttons[aamLocal.labels['Apply']] = function() {
+ _this.showMetaboxLoader('#access_dialog');
+ var data = _this.compileAjaxPackage('saveAccess', true);
+ data.id = aData[0];
+ data.type = type;
+
+ jQuery('input', '#access_control_area').each(function() {
+ data[jQuery(this).attr('name')] = (jQuery(this).prop('checked') ? 1 : 0);
+ });
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ _this.highlight(nRow, response.status);
+ },
+ error: function() {
+ _this.highlight(nRow, 'failure');
+ },
+ complete: function() {
+ _this.hideMetaboxLoader('#access_dialog');
+ }
+ });
+ jQuery('#access_dialog').dialog("close");
+ };
+ jQuery('.aam-lock-message', '#access_dialog').hide();
+ } else {
+ jQuery('.aam-lock-message', '#access_dialog').show();
+ }
+
+ buttons[aamLocal.labels['Close']] = function() {
+ jQuery('#access_dialog').dialog("close");
+ };
+
+ jQuery('#access_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '25%',
+ modal: true,
+ title: 'Manage Access',
+ buttons: buttons,
+ close: function() {
+ }
+ });
+
+ _this.doAction('aam_get_access_loaded');
+ },
+ error: function() {
+ _this.highlight(nRow, 'failure');
+ }
+ });
+};
+
+/**
+ * Restore Default Post/Term Access
+ *
+ * @param {type} id
+ * @param {type} type
+ * @param {type} nRow
+ *
+ * @returns {void}
+ */
+AAM.prototype.restorePostAccess = function(id, type, nRow) {
+ var _this = this;
+
+ //retrieve settings and display the dialog
+ var data = this.compileAjaxPackage('clearAccess', true);
+ data.id = id;
+ data.type = type;
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ _this.highlight(nRow, response.status);
+ },
+ error: function() {
+ _this.highlight(nRow, 'failure');
+ }
+ });
+};
+
+/**
+ * Launch the Delete Post Dialog
+ *
+ * @param {Object} button
+ * @param {Object} nRow
+ * @param {Object} aData
+ * @param {Boolean} force
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.launchDeletePostDialog = function(button, nRow, aData, force) {
+ var _this = this;
+
+ jQuery('#delete_post_dialog .dialog-content').html(
+ aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post Message'].replace('%s', aData[3])
+ );
+ var buttons = {};
+
+ if (force === false) {
+ buttons[aamLocal.labels['Delete Permanently']] = function() {
+ _this.deletePost(aData[0], true, nRow);
+ };
+ }
+
+ buttons[aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post']] = function() {
+ _this.deletePost(aData[0], force, nRow);
+ };
+ buttons[aamLocal.labels['Cancel']] = function() {
+ jQuery('#delete_post_dialog').dialog("close");
+ };
+
+ jQuery('#delete_post_dialog').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ title: aamLocal.labels[(force ? 'Delete' : 'Trash') + ' Post'],
+ buttons: buttons,
+ close: function() {
+ _this.deactivateIcon(button);
+ }
+ });
+};
+
+/**
+ * Delete or Trash the Post
+ *
+ * @param {type} id
+ * @param {type} force
+ * @param {type} nRow
+ *
+ * @returns {void}
+ */
+AAM.prototype.deletePost = function(id, force, nRow) {
+ var _this = this;
+
+ var data = _this.compileAjaxPackage('deletePost');
+ data.post = id;
+ data.force = (force ? 1 : 0);
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ if (response.status === 'success') {
+ _this.blogTables.postList.fnDeleteRow(nRow);
+ }
+ _this.highlight('#post_list_wrapper', response.status);
+ },
+ error: function() {
+ _this.highlight('#post_list_wrapper', 'failure');
+ }
+ });
+ jQuery('#delete_post_dialog').dialog("close");
+};
+
+/**
+ * Build Post Breadcrumb
+ *
+ * @param {Object} response
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.buildPostBreadcrumb = function(response) {
+ var _this = this;
+
+ jQuery('.post-breadcrumb').empty();
+ //create a breadcrumb
+ jQuery('.post-breadcrumb').append(jQuery('<div/>', {
+ 'class': 'post-breadcrumb-line'
+ }));
+
+ for (var i in response.breadcrumb) {
+ jQuery('.post-breadcrumb-line').append(jQuery('<a/>', {
+ href: '#'
+ }).bind('click', {
+ term: response.breadcrumb[i][0]
+ }, function(event) {
+ event.preventDefault();
+ _this.postTerm = event.data.term;
+ _this.blogTables.postList.fnDraw();
+ }).html(response.breadcrumb[i][1])).append(jQuery('<span/>', {
+ 'class': 'aam-gt'
+ }).html('≫'));
+ }
+ //deactive last one
+ jQuery('.post-breadcrumb-line a:last').replaceWith(response.breadcrumb[i][1]);
+ jQuery('.post-breadcrumb-line .aam-gt:last').remove();
+
+ jQuery('.post-breadcrumb').append(jQuery('<div/>', {
+ 'class': 'post-breadcrumb-line-actions'
+ }));
+
+ if (/^[\d]+$/.test(this.postTerm)) {
+ var edit = _this.createIcon(
+ 'small',
+ 'pen',
+ aamLocal.labels['Edit Term']
+ ).attr({
+ href: response.link,
+ target: '_blank'
+ });
+ jQuery('.post-breadcrumb-line-actions').append(edit);
+ jQuery('.post-breadcrumb-line-actions').append(_this.createIcon(
+ 'small',
+ 'manage',
+ aamLocal.labels['Manage Access']
+ ).bind('click', {id: response.breadcrumb[i][0]}, function(event) {
+ event.preventDefault();
+ var aData = new Array();
+ aData[0] = event.data.id;
+ _this.launchManageAccessDialog(
+ this, jQuery('.post-breadcrumb'), aData, 'term'
+ );
+ }));
+ } else {
+ jQuery('.post-breadcrumb-line-actions').append(jQuery('<a/>', {
+ 'href': 'http://wpaam.com',
+ 'target': '_blank',
+ 'class': 'post-breadcrumb-line-action post-breadcrumb-line-action-lock',
+ 'aam-tooltip': aamLocal.labels['Unlock Default Accesss Control']
+ }));
+ this.doAction('aam_breadcrumb_action', response);
+ }
+ _this.initTooltip(jQuery('.post-breadcrumb-line-actions'));
+};
+
+/**
+ * Load Post Breadcrumb
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.loadBreadcrumb = function() {
+ var _this = this;
+ var data = this.compileAjaxPackage('postBreadcrumb');
+ data.id = _this.postTerm;
+ //send the request
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: data,
+ success: function(response) {
+ _this.buildPostBreadcrumb(response);
+ },
+ complete: function() {
+ jQuery('.post-breadcrumb').removeClass('post-breadcrumb-loading');
+ }
+ });
+};
+
+/**
+ * Initialize and Load Category Tree
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.initPostTree = function() {
+ var _this = this;
+
+ var data = this.compileAjaxPackage('postTree');
+
+ jQuery("#tree").treeview({
+ url: aamLocal.ajaxurl,
+ // add some additional, dynamic data and request with POST
+ ajax: {
+ data: data,
+ type: 'post',
+ complete: function() {
+ jQuery('#tree li').each(function() {
+ var id = jQuery(this).attr('id');
+ if (id && !jQuery(this).attr('active')) {
+ jQuery('.important', this).html(jQuery('<a/>', {
+ href: '#'
+ }).html(jQuery('.important', this).text()).bind('click', {
+ id: id
+ }, function(event) {
+ event.preventDefault();
+ _this.postTerm = event.data.id;
+ _this.blogTables.postList.fnDraw();
+ jQuery('#filter_post_dialog').dialog('close');
+ }));
+ jQuery(this).attr('active', true);
+ }
+ });
+ }
+ },
+ animated: "medium",
+ control: "#sidetreecontrol",
+ persist: "location"
+ });
+};
+
+/**
+ * Create AAM icon
+ *
+ * @param string size
+ * @param string qualifier
+ * @param string tooltip
+ *
+ * @returns {object}
+ *
+ * @access public
+ */
+AAM.prototype.createIcon = function(size, qualifier, tooltip){
+ var icon = jQuery('<a/>', {
+ class: 'aam-icon aam-icon-' + size + ' aam-icon-' + size + '-' + qualifier,
+ href: '#'
+ });
+ //add tooltip if defined
+ if (typeof tooltip !== 'undefined'){
+ icon.attr('aam-tooltip', tooltip);
+ }
+
+ //add iternal span to apply table-cell css
+ icon.html(jQuery('<span/>'));
+
+ return icon;
+};
+
+/**
+ * Mark icons as loading
+ *
+ * @param object|string icon
+ * @param string size
+ *
+ * @returns void
+ *
+ * @access public
+ */
+AAM.prototype.loadingIcon = function(icon, size){
+ jQuery(icon).addClass('aam-' + size + '-loader');
+};
+
+/**
+ * Remove loading icon
+ *
+ * @param object|string icon
+ *
+ * @returns void
+ *
+ * @access public
+ */
+AAM.prototype.removeLoadingIcon = function(icon){
+ if (jQuery(icon).hasClass('aam-medium-loader')){
+ jQuery(icon).removeClass('aam-medium-loader');
+ } else if (jQuery(icon).hasClass('aam-small-loader')){
+ jQuery(icon).removeClass('aam-small-loader');
+ }
+};
+
+/**
+ * Launch the button
+ *
+ * @param {Object} element
+ * @param {String} inactive
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.activateIcon = function(element, size) {
+ jQuery(element).addClass('aam-icon-' + size + '-active');
+};
+
+/**
+ * Terminate the button
+ *
+ * @param {Object} element
+ * @param {String} inactive
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.deactivateIcon = function(element) {
+ if (jQuery(element).hasClass('aam-icon-small-active')){
+ jQuery(element).removeClass('aam-icon-small-active');
+ } else if (jQuery(element).hasClass('aam-icon-medium-active')){
+ jQuery(element).removeClass('aam-icon-medium-active');
+ } else if (jQuery(element).hasClass('aam-icon-minor-active')){
+ jQuery(element).removeClass('aam-icon-minor-active');
+ }
+};
+
+/**
+ * Highlight the specified DOM area
+ *
+ * @param {String} selector
+ * @param {String} status
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+AAM.prototype.highlight = function(selector, status) {
+ if (status === 'success') {
+ jQuery(selector).effect("highlight", {
+ color: '#98CE90'
+ }, 3000);
+ } else {
+ jQuery(selector).effect("highlight", {
+ color: '#FFAAAA'
+ }, 3000);
+ }
+};
+
+jQuery(document).ready(function() {
+ aamInterface = new AAM();
+});
\ No newline at end of file
--- /dev/null
+window.CodeMirror=function(){function m(a,b){if(!(this instanceof m))return new m(a,b);this.options=b=b||{};for(var c in Rb)!b.hasOwnProperty(c)&&Rb.hasOwnProperty(c)&&(b[c]=Rb[c]);Sb(b);c=this.display=Td(a,"string"==typeof b.value?0:b.value.first);c.wrapper.CodeMirror=this;Nc(this);b.autofocus&&!Tb&&N(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ub};Oc(this);b.lineWrapping&&(this.display.wrapper.className+= " CodeMirror-wrap");var d=b.value;"string"==typeof d&&(d=new I(b.value,b.mode));t(this,Pc)(this,d);B&&setTimeout(O(Y,this,!0),20);Ud(this);var e;try{e=document.activeElement==c.input}catch(f){}e||b.autofocus&&!Tb?setTimeout(O(ha,this),20):Vb(this);t(this,function(){for(var a in pa)if(pa.propertyIsEnumerable(a))pa[a](this,b[a],Qc);for(a=0;a<Wb.length;++a)Wb[a](this)})()}function Td(a,b){var c={},d=c.input=p("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;"); K?d.style.width="1000px":d.setAttribute("wrap","off");Ia&&(d.style.border="1px solid black");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");c.inputDiv=p("div",[d],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");c.scrollbarH=p("div",[p("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");c.scrollbarV=p("div",[p("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");c.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"); c.gutterFiller=p("div",null,"CodeMirror-gutter-filler");c.lineDiv=p("div",null,"CodeMirror-code");c.selectionDiv=p("div",null,null,"position: relative; z-index: 1");c.cursor=p("div","\u00a0","CodeMirror-cursor");c.otherCursor=p("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor");c.measure=p("div",null,"CodeMirror-measure");c.lineSpace=p("div",[c.measure,c.selectionDiv,c.lineDiv,c.cursor,c.otherCursor],null,"position: relative; outline: none");c.mover=p("div",[p("div",[c.lineSpace],"CodeMirror-lines")], null,"position: relative");c.sizer=p("div",[c.mover],"CodeMirror-sizer");c.heightForcer=p("div",null,null,"position: absolute; height: "+qa+"px; width: 1px;");c.gutters=p("div",null,"CodeMirror-gutters");c.lineGutter=null;c.scroller=p("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll");c.scroller.setAttribute("tabIndex","-1");c.wrapper=p("div",[c.inputDiv,c.scrollbarH,c.scrollbarV,c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror");ra&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight= 0);a.appendChild?a.appendChild(c.wrapper):a(c.wrapper);Ia&&(d.style.width="0px");K||(c.scroller.draggable=!0);Xb?(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"):ra&&(c.scrollbarH.style.minWidth=c.scrollbarV.style.minWidth="18px");c.viewOffset=c.lastSizeC=0;c.showingFrom=c.showingTo=b;c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null;c.prevInput="";c.alignWidgets=!1;c.pollingFast=!1;c.poll=new Ub;c.cachedCharWidth=c.cachedTextHeight=null;c.measureLineCache=[];c.measureLineCachePos= 0;c.inaccurateSelection=!1;c.maxLine=null;c.maxLineLength=0;c.maxLineChanged=!1;c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null;return c}function Ja(a){a.doc.mode=m.getMode(a.options,a.doc.modeOption);a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Ka(a,100);a.state.modeGen++;a.curOp&&D(a)}function Rc(a){var b=sa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Sc(a.display)-3);return function(e){return ia(a.doc, e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function Tc(a){var b=a.doc,c=Rc(a);b.iter(function(a){var b=c(a);b!=a.height&&R(a,b)})}function Uc(a){var b=Z[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:"");a.state.disableInput=b.disableInput}function Oc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ta(a)}function La(a){Nc(a); D(a);setTimeout(function(){Yb(a)},20)}function Nc(a){var b=a.display.gutters,c=a.options.gutters;Ma(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(p("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function mb(a,b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ua(e,-1);)d=d.find(),e=u(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=b;d=nb(e);)d=d.find(),c-=e.text.length- d.from.ch,e=u(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Zb(a){var b=a.display,c=a.doc;b.maxLine=u(c,c.first);b.maxLineLength=mb(c,b.maxLine);b.maxLineChanged=!0;c.iter(function(a){var e=mb(c,a);e>b.maxLineLength&&(b.maxLineLength=e,b.maxLine=a)})}function Sb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function $b(a){var b=a.display,c=a.doc.height+ (b.mover.offsetHeight-b.lineSpace.offsetHeight);b.sizer.style.minHeight=b.heightForcer.style.top=c+"px";b.gutters.style.height=Math.max(c,b.scroller.clientHeight-qa)+"px";var c=Math.max(c,b.scroller.scrollHeight),d=b.scroller.scrollWidth>b.scroller.clientWidth+1,e=c>b.scroller.clientHeight+1;e?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=d?Na(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=c-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display= "",b.scrollbarV.firstChild.style.height="0");d?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=e?Na(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0");d&&e?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=Na(b.measure)+"px"):b.scrollbarFiller.style.display="";d&&a.options.coverGutterNextToScrollbar&& a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=Na(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="";Vd&&0===Na(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=Wd?"18px":"12px")}function ac(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:Oa(b,d),to:Oa(b,a)}} function Yb(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=bc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Xd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=cc(a.options,b.first+b.size-1);a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(p("div", [p("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-c);a.lineNumWidth=a.lineNumInnerWidth+c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function cc(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function bc(a){return y(a.scroller).left-y(a.sizer).left}function ob(a,b,c,d){for(var e= a.display.showingFrom,f=a.display.showingTo,g,h=ac(a.display,a.doc,c);Yd(a,b,h,d);){d=!1;g=!0;dc(a);$b(a);c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top));h=ac(a.display,a.doc,c);if(h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break;b=[]}g&&(M(a,"update",a),a.display.showingFrom==e&&a.display.showingTo==f||M(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo));return g}function Yd(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)e.showingFrom= e.showingTo=f.first,e.viewOffset=0;else if(d||!(0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){Xd(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";g=Infinity;if(a.options.lineNumbers)for(var h=0;h<b.length;++h)b[h].diff&&b[h].from<g&&(g=b[h].from);var h=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first);c=Math.min(h,c.to+a.options.viewportMargin);e.showingFrom<k&&20>k-e.showingFrom&& (k=Math.max(f.first,e.showingFrom));e.showingTo>c&&20>e.showingTo-c&&(c=Math.min(h,e.showingTo));if(Pa)for(k=P($(f,u(f,k)));c<h&&ia(f,u(f,c));)++c;var l=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,h)}],l=l[0].from>=l[0].to?[]:Zd(l,b);if(Pa)for(h=0;h<l.length;++h){b=l[h];for(var n;n=nb(u(f,b.to-1));)if(n=n.find().from.line,n>b.from)b.to=n;else{l.splice(h--,1);break}}for(h=f=0;h<l.length;++h)b=l[h],b.from<k&&(b.from=k),b.to>c&&(b.to=c),b.from>=b.to?l.splice(h--,1):f+=b.to-b.from; if(d||f!=c-k||k!=e.showingFrom||c!=e.showingTo){l.sort(function(a,b){return a.from-b.from});try{var E=document.activeElement}catch(q){}f<0.7*(c-k)&&(e.lineDiv.style.display="none");$d(a,k,c,l,g);e.lineDiv.style.display="";E&&document.activeElement!=E&&E.offsetHeight&&E.focus();if(k!=e.showingFrom||c!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight)e.lastSizeC=e.wrapper.clientHeight,Ka(a,400);e.showingFrom=k;e.showingTo=c;ae(a);Vc(a);return!0}Vc(a)}}function ae(a){a=a.display;for(var b=a.lineDiv.offsetTop, c=a.lineDiv.firstChild,d;c;c=c.nextSibling)if(c.lineObj){if(ra){var e=c.offsetTop+c.offsetHeight;d=e-b;b=e}else d=y(c),d=d.bottom-d.top;e=c.lineObj.height-d;2>d&&(d=sa(a));if(0.001<e||-0.001>e)if(R(c.lineObj,d),d=c.lineObj.widgets)for(e=0;e<d.length;++e)d[e].height=d[e].node.offsetHeight}}function Vc(a){var b=a.display.viewOffset=Qa(a,u(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function Zd(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,k=a.length;h< k;++h){var l=a[h];e.to<=l.from&&e.diff?f.push({from:l.from+g,to:l.to+g}):e.to<=l.from||e.from>=l.to?f.push(l):(e.from>l.from&&f.push({from:l.from,to:e.from}),e.to<l.to&&f.push({from:e.to+g,to:l.to+g}))}a=f}return a}function be(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:bc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}} function $d(a,b,c,d,e){function f(b){var c=b.nextSibling;K&&va&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=be(a),h=a.display,k=a.options.lineNumbers;d.length||K&&a.display.currentWheelTarget||Ma(h.lineDiv);var l=h.lineDiv,n=l.firstChild,E=d.shift(),q=b;for(a.doc.iter(b,c,function(b){E&&E.to==q&&(E=d.shift());if(ia(a.doc,b)){if(0!=b.height&&R(b,0),b.widgets&&n&&n.previousSibling)for(var c=0;c<b.widgets.length;++c){var h=b.widgets[c]; if(h.showIfHidden){var m=n.previousSibling;if(/pre/i.test(m.nodeName)){var C=p("div",null,null,"position: relative");m.parentNode.replaceChild(C,m);C.appendChild(m);m=C}C=m.appendChild(p("div",[h.node],"CodeMirror-linewidget"));h.handleMouseEvents||(C.ignoreEvents=!0);ec(h,C,m,g)}}}else if(E&&E.from<=q&&E.to>q){for(;n.lineObj!=b;)n=f(n);k&&e<=q&&n.lineNumber&&Wc(n.lineNumber,cc(a.options,q));n=n.nextSibling}else{if(b.widgets)for(var C=0,r=n;r&&20>C;++C,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){c= r;break}var C=a,u=q,H=c,r=fc(C,b),G=b.gutterMarkers,s=C.display;if(C.options.lineNumbers||G||b.bgClass||b.wrapClass||b.widgets){if(H){H.alignable=null;for(var t=!0,v=0,w=null,x=H.firstChild,z;x;x=z)if(z=x.nextSibling,/\bCodeMirror-linewidget\b/.test(x.className)){for(var y=0;y<b.widgets.length;++y){var B=b.widgets[y];if(B.node==x.firstChild){B.above||w||(w=x);ec(B,x,H,g);++v;break}}if(y==b.widgets.length){t=!1;break}}else H.removeChild(x);H.insertBefore(r,w);t&&v==b.widgets.length&&(h=H,H.className= b.wrapClass||"")}h||(h=p("div",null,b.wrapClass,"position: relative"),h.appendChild(r));b.bgClass&&h.insertBefore(p("div",null,b.bgClass+" CodeMirror-linebackground"),h.firstChild);if(C.options.lineNumbers||G)if(m=h.insertBefore(p("div",null,null,"position: absolute; left: "+(C.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"),h.firstChild),C.options.fixedGutter&&(h.alignable||(h.alignable=[])).push(m),!C.options.lineNumbers||G&&G["CodeMirror-linenumbers"]||(h.lineNumber=m.appendChild(p("div", cc(C.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"))),G)for(y=0;y<C.options.gutters.length;++y)B=C.options.gutters[y],(u=G.hasOwnProperty(B)&&G[B])&&m.appendChild(p("div",[u],"CodeMirror-gutter-elt","left: "+g.gutterLeft[B]+"px; width: "+g.gutterWidth[B]+"px"));ra&&(h.style.zIndex=2);if(b.widgets&&h!=H)for(y=0,H=b.widgets;y<H.length;++y)B=H[y],G=p("div",[B.node],"CodeMirror-linewidget"),B.handleMouseEvents|| (G.ignoreEvents=!0),ec(B,G,h,g),B.above?h.insertBefore(G,C.options.lineNumbers&&0!=b.height?m:r):h.appendChild(G),M(B,"redraw")}else h=r;if(h!=c)l.insertBefore(h,n);else{for(;n!=c;)n=f(n);n=n.nextSibling}h.lineObj=b}++q});n;)n=f(n)}function ec(a,b,c,d){a.noHScroll&&((c.alignable||(c.alignable=[])).push(b),c=d.wrapperWidth,b.style.left=d.fixedPos+"px",a.coverGutter||(c-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=c+"px");a.coverGutter&&(b.style.zIndex=5,b.style.position= "relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function dc(a){var b=a.display,c=x(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting){var d=a.display,e=U(a,a.doc.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=e.other.top+ "px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display="none":ce(a);a.options.moveInputWithCursor&&(a=U(a,a.doc.sel.head,"div"),c=y(b.wrapper),d=y(b.lineDiv),b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px")}function ce(a){function b(a, b,c,d){0>b&&(b=0);g.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,d,f){var g=u(e,c),l=g.text.length,n,m;de(V(g),d||0,null==f?l:f,function(e,u,H){var p=rb(a,r(c,e),"div",g,"left"),s,t;e==u?(s=p,H=t=p.left):(s=rb(a,r(c,u-1),"div",g,"right"),"rtl"==H&&(H=p,p=s,s=H),H=p.left,t=s.right);null==d&&0==e&&(H=k);3<s.top-p.top&&(b(H,p.top,null,p.bottom),H=k,p.bottom<s.top&&b(H,p.bottom,null,s.top)); null==f&&u==l&&(t=h);if(!n||p.top<n.top||p.top==n.top&&p.left<n.left)n=p;if(!m||s.bottom>m.bottom||s.bottom==m.bottom&&s.right>m.right)m=s;H<k+1&&(H=k);b(H,s.top,t-H,s.bottom)});return{start:n,end:m}}var d=a.display,e=a.doc,f=a.doc.sel,g=document.createDocumentFragment(),h=d.lineSpace.offsetWidth,k=W(a.display.measure,p("pre",null,null,"text-align: left")).appendChild(p("span","x")).offsetLeft;if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{var l=u(e,f.from.line),n=u(e,f.to.line), n=$(e,l)==$(e,n),l=c(f.from.line,f.from.ch,n?l.text.length:null).end,f=c(f.to.line,n?0:null,f.to.ch).start;n&&(l.top<f.top-2?(b(l.right,l.top,null,l.bottom),b(k,f.top,f.left,f.bottom)):b(l.right,l.top,f.left-l.right,l.bottom));l.bottom<f.top&&b(k,l.bottom,null,f.top)}W(d.selectionDiv,g);d.selectionDiv.style.display=""}function sb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";0<a.options.cursorBlinkRate&&(b.blinker= setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Ka(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,O(ee,a))}function ee(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.showingTo)){var c=+new Date+a.options.workTime,d=wa(b.mode,Ra(a,b.frontier)),e=[],f;b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>= a.display.showingFrom){var h=g.styles;g.styles=Xc(a,g,d);for(var k=!h||h.length!=g.styles.length,l=0;!k&&l<h.length;++l)k=h[l]!=g.styles[l];k&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1}));g.stateAfter=wa(b.mode,d)}else Yc(a,g,d),g.stateAfter=0==b.frontier%5?wa(b.mode,d):null;++b.frontier;if(+new Date>c)return Ka(a,a.options.workDelay),!0});e.length&&t(a,function(){for(var a=0;a<e.length;++a)D(this,e[a].start,e[a].end)})()}}function fe(a,b,c){var d,e,f=a.doc,g=b;for(b-= a.doc.mode.innerMode?1E3:100;g>b;--g){if(g<=f.first)return f.first;var h=u(f,g-1);if(h.stateAfter&&(!c||g<=f.frontier))return g;h=xa(h.text,null,a.options.tabSize);if(null==e||d>h)e=g-1,d=h}return e}function Ra(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=fe(a,b,c),g=f>d.first&&u(d,f-1).stateAfter,g=g?wa(d.mode,g):Zc(d.mode);d.iter(f,b,function(c){Yc(a,c,g);c.stateAfter=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo?wa(d.mode,g):null;++f});return g}function gc(a,b,c,d,e){var f= -1;d=d||hc(a,b);for(a=c;;a+=f){var g=d[a];if(g)break;0>f&&0==a&&(f=1)}e=a>c?"left":a<c?"right":e;"left"==e&&g.leftSide?g=g.leftSide:"right"==e&&g.rightSide&&(g=g.rightSide);return{left:a<c?g.right:g.left,right:a>c?g.left:g.right,top:g.top,bottom:g.bottom}}function ic(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return e}}function ge(a, b){var c=ic(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function hc(a,b){var c=ic(a,b);if(c)return c.measure;var c=he(a,b),d=a.display.measureLineCache,e={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:c,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++a.display.measureLineCachePos%16]=e:d.push(e);return c}function he(a,b){function c(a){var b=a.top-pb.top,c=a.bottom-pb.top;c>r&&(c=r);0>b&&(b=0);for(var d=m.length-2;0<=d;d-=2){var e=m[d],f=m[d+ 1];if(!(e>c||f<b)&&(e<=b&&f>=c||b<=e&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){m[d]=Math.min(b,e);m[d+1]=Math.max(c,f);break}}0>d&&(d=m.length,m.push(b,c));return{left:a.left-pb.left,right:a.right-pb.left,top:d,bottom:null}}function d(a){a.bottom=m[a.top+1];a.top=m[a.top]}var e=a.display,f=$c(b.text.length),g=fc(a,b,f,!0);if(B&&!ra&&!a.options.lineWrapping&&100<g.childNodes.length){for(var h=document.createDocumentFragment(),k=g.childNodes.length,l=0,n=Math.ceil(k/10);l<n;++l){for(var E=p("div", null,null,"display: inline-block"),q=0;10>q&&k;++q)E.appendChild(g.firstChild),--k;h.appendChild(E)}g.appendChild(h)}W(e.measure,g);var pb=y(e.lineDiv),m=[],h=$c(b.text.length),r=g.offsetHeight;Q&&e.measure.first!=g&&W(e.measure,g);for(l=0;l<f.length;++l)if(e=f[l])g=e,k=null,/\bCodeMirror-widget\b/.test(e.className)&&e.getClientRects&&(1==e.firstChild.nodeType&&(g=e.firstChild),n=g.getClientRects(),1<n.length&&(k=h[l]=c(n[0]),k.rightSide=c(n[n.length-1]))),k||(k=h[l]=c(y(g))),e.measureRight&&(k.right= y(e.measureRight).left),e.leftSide&&(k.leftSide=c(y(e.leftSide)));Ma(a.display.measure);for(l=0;l<h.length;++l)if(e=h[l])d(e),e.leftSide&&d(e.leftSide),e.rightSide&&d(e.rightSide);return h}function ta(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function jc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f= tb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=Qa(a,b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=y(a.display.lineSpace),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function ad(a,b,c){if("div"==c)return b;var d=b.left; b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=y(a.display.sizer),d+=c.left,b+=c.top);a=y(a.display.lineSpace);return{left:d-a.left,top:b-a.top}}function rb(a,b,c,d,e){d||(d=u(a.doc,b.line));return jc(a,d,gc(a,d,b.ch,null,e),c)}function U(a,b,c,d,e){function f(b,f){var g=gc(a,d,b,e,f?"right":"left");f?g.left=g.right:g.right=g.left;return jc(a,d,g,c)}function g(a, b){var c=h[b],d=c.level%2;a==kc(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=lc(c)-(c.level%2?0:1),d=!0):a==lc(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=kc(c)-c.level%2,d=!1);return d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||u(a.doc,b.line);e||(e=hc(a,d));var h=V(d);b=b.ch;if(!h)return f(b);var k=mc(h,b),k=g(b,k);null!=ya&&(k.other=g(b,ya));return k}function ub(a,b,c,d){a=new r(a,b);a.xRel=d;c&&(a.outside=!0);return a}function nc(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return ub(d.first, 0,!0,-1);var e=Oa(d,c),f=d.first+d.size-1;if(e>f)return ub(d.first+d.size-1,u(d,f).text.length,!0,1);for(0>b&&(b=0);;){var f=u(d,e),e=ie(a,f,e,b,c),g=(f=nb(f))&&f.find();if(f&&(e.ch>g.from.ch||e.ch==g.from.ch&&0<e.xRel))e=g.to.line;else return e}}function ie(a,b,c,d,e){function f(d){d=U(a,r(c,d),"line",b,l);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+k;h=!1;return d.left}var g=e-Qa(a,b),h=!1,k=2*a.display.wrapper.clientWidth,l=hc(a,b),n=V(b),E=b.text.length;e=vb(b);var q=wb(b),m=f(e), p=h,s=f(q),u=h;if(d>s)return ub(c,q,u,1);for(;;){if(n?q==e||q==oc(b,e,1):1>=q-e){n=d<m||d-m<=s-d?e:q;for(d-=n==e?m:s;pc.test(b.text.charAt(n));)++n;return ub(c,n,n==e?p:u,0>d?-1:d?1:0)}var C=Math.ceil(E/2),t=e+C;if(n)for(var t=e,v=0;v<C;++v)t=oc(b,t,1);v=f(t);if(v>d){q=t;s=v;if(u=h)s+=1E3;E=C}else e=t,m=v,p=h,E-=C}}function sa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==ja){ja=p("pre");for(var b=0;49>b;++b)ja.appendChild(document.createTextNode("x")),ja.appendChild(p("br")); ja.appendChild(document.createTextNode("x"))}W(a.measure,ja);b=ja.offsetHeight/50;3<b&&(a.cachedTextHeight=b);Ma(a.measure);return b||1}function Sc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=p("span","x"),c=p("pre",[b]);W(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function za(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++je};xb++|| (da=[])}function Aa(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&Zb(a);if(d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e;e=d.maxLine;var f=!1;if(e.markedSpans)for(var g=0;g<e.markedSpans;++g){var h=e.markedSpans[g];!h.collapsed||null!=h.to&&h.to!=e.text.length||(f=!0)}(f=!f&&ic(a,e))?e=gc(a,e,e.text.length,f.measure,"right").right:(e=fc(a,e,null,!0),f=e.appendChild(Sa(a.display.measure)),W(a.display.measure,e),e=y(f).right-y(a.display.lineDiv).left);d.sizer.style.minWidth= Math.max(0,e+3+qa)+"px";d.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&!b.updateScrollPos&&Ba(a,Math.min(d.scroller.scrollLeft,e),!0)}var k,l;b.updateScrollPos?k=b.updateScrollPos:b.selectionChanged&&d.scroller.clientHeight&&(k=U(a,c.sel.head),k=yb(a,k.left,k.top,k.left,k.bottom));if(b.changes.length||b.forceUpdate||k&&null!=k.scrollTop)l=ob(a,b.changes,k&&k.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop= a.display.scroller.scrollTop);!l&&b.selectionChanged&&dc(a);if(b.updateScrollPos)d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=k.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=k.scrollLeft,Yb(a),b.scrollToPos&&bd(a,s(a.doc,b.scrollToPos),b.scrollToPosMargin);else if(k&&(c=bd(a,a.doc.sel.head,a.options.cursorScrollMargin),a.state.focused&&(d=a.display,k=y(d.sizer),l=null,0>c.top+k.top?l=!0:c.bottom+k.top>(window.innerHeight||document.documentElement.clientHeight)&&(l= !1),null!=l&&!ke))){if(k="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=c.left+"px",d.cursor.style.top=c.top-d.viewOffset+"px";d.cursor.scrollIntoView(l);k&&(d.cursor.style.display="none")}b.selectionChanged&&sb(a);a.state.focused&&b.updateInput&&Y(a,b.userSelChange);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(l=0;l<c.length;++l)c[l].lines.length||J(c[l],"hide");if(d)for(l=0;l<d.length;++l)d[l].lines.length&&J(d[l],"unhide");var n;--xb||(n=da,da=null);b.textChanged&& J(a,"change",a,b.textChanged);b.cursorActivity&&J(a,"cursorActivity",a);if(n)for(l=0;l<n.length;++l)n[l]()}function t(a,b){return function(){var c=a||this,d=!c.curOp;d&&za(c);try{var e=b.apply(c,arguments)}finally{d&&Aa(c)}return e}}function Ta(a){return function(){var b=this.cm&&!this.cm.curOp,c;b&&za(this.cm);try{c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function qc(a,b){var c=!a.curOp,d;c&&za(a);try{d=b()}finally{c&&Aa(a)}return d}function D(a,b,c,d){null==b&&(b=a.doc.first);null== c&&(c=a.doc.first+a.doc.size);a.curOp.changes.push({from:b,to:c,diff:d})}function zb(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){rc(a);a.state.focused&&zb(a)})}function Ua(a){function b(){rc(a)||c?(a.display.pollingFast=!1,zb(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function rc(a){var b=a.display.input,c=a.display.prevInput,d=a.doc,e=d.sel;if(!a.state.focused||le(b)||Va(a)||a.state.disableInput)return!1;a.state.pasteIncoming&& a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var f=b.value;if(f==c&&x(e.from,e.to))return!1;if(B&&!Q&&a.display.inputHasSelection===f)return Y(a,!0),!1;var g=!a.curOp;g&&za(a);e.shift=!1;for(var h=0,k=Math.min(c.length,f.length);h<k&&c.charCodeAt(h)==f.charCodeAt(h);)++h;k=e.from;e=e.to;h<c.length?k=r(k.line,k.ch-(c.length-h)):a.state.overwrite&&x(k,e)&&!a.state.pasteIncoming&&(e=r(e.line,Math.min(u(d,e.line).text.length,e.ch+(f.length-h))));c=a.curOp.updateInput; h={from:k,to:e,text:ka(f.slice(h)),origin:a.state.pasteIncoming?"paste":"+input"};Ca(a.doc,h,"end");a.curOp.updateInput=c;M(a,"inputRead",a,h);1E3<f.length||-1<f.indexOf("\n")?b.value=a.display.prevInput="":a.display.prevInput=f;g&&Aa(a);a.state.pasteIncoming=!1;return!0}function Y(a,b){var c,d,e=a.doc;x(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value="",B&&!Q&&(a.display.inputHasSelection=null)):(a.display.prevInput="",d=(c=cd&&(100<e.sel.to.line-e.sel.from.line||1E3<(d=a.getSelection()).length))? "-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&dd(a.display.input),B&&!Q&&(a.display.inputHasSelection=d));a.display.inaccurateSelection=c}function N(a){"nocursor"==a.options.readOnly||Tb&&document.activeElement==a.display.input||a.display.input.focus()}function Va(a){return a.options.readOnly||a.doc.cantEdit}function Ud(a){function b(){a.state.focused&&setTimeout(O(N,a),0)}function c(){null==h&&(h=setTimeout(function(){h=null;g.cachedCharWidth=g.cachedTextHeight=Wa=null;ta(a);qc(a, O(D,a))},100))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5E3):aa(window,"resize",c)}function e(b){X(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,Xa(b))||Ya(b)}function f(){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),dd(g.input))}var g=a.display;v(g.scroller,"mousedown",t(a,me));B?v(g.scroller,"dblclick",t(a,function(b){if(!X(a,b)){var c=Za(a,b);!c||ed(a,b)||la(a.display,b)||(A(b),b=sc(u(a.doc, c.line).text,c),F(a.doc,b.from,b.to))}})):v(g.scroller,"dblclick",function(b){X(a,b)||A(b)});v(g.lineSpace,"selectstart",function(a){la(g,a)||A(a)});tc||v(g.scroller,"contextmenu",function(b){fd(a,b)});v(g.scroller,"scroll",function(){g.scroller.clientHeight&&($a(a,g.scroller.scrollTop),Ba(a,g.scroller.scrollLeft,!0),J(a,"scroll",a))});v(g.scrollbarV,"scroll",function(){g.scroller.clientHeight&&$a(a,g.scrollbarV.scrollTop)});v(g.scrollbarH,"scroll",function(){g.scroller.clientHeight&&Ba(a,g.scrollbarH.scrollLeft)}); v(g.scroller,"mousewheel",function(b){gd(a,b)});v(g.scroller,"DOMMouseScroll",function(b){gd(a,b)});v(g.scrollbarH,"mousedown",b);v(g.scrollbarV,"mousedown",b);v(g.wrapper,"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});var h;v(window,"resize",c);setTimeout(d,5E3);v(g.input,"keyup",t(a,function(b){X(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,Xa(b))||16!=b.keyCode||(a.doc.sel.shift=!1)}));v(g.input,"input",O(Ua,a));v(g.input,"keydown",t(a,hd));v(g.input,"keypress",t(a,ne)); v(g.input,"focus",O(ha,a));v(g.input,"blur",O(Vb,a));a.options.dragDrop&&(v(g.scroller,"dragstart",function(b){var c=a;if(B&&(!c.state.draggingText||100>+new Date-id))Ya(b);else if(!X(c,b)&&!la(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",d);b.dataTransfer.setDragImage&&!uc&&(d=p("img",null,null,"position: fixed; left: 0; top: 0;"),S&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),S&&d.parentNode.removeChild(d))}}), v(g.scroller,"dragenter",e),v(g.scroller,"dragover",e),v(g.scroller,"drop",t(a,oe)));v(g.scroller,"paste",function(b){la(g,b)||(N(a),Ua(a))});v(g.input,"paste",function(){if(K&&!(a.state.fakedLastChar||200>new Date-a.state.lastMiddleDown)){var b=g.input.selectionStart,c=g.input.selectionEnd;g.input.value+="$";g.input.selectionStart=b;g.input.selectionEnd=c;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;Ua(a)});v(g.input,"cut",f);v(g.input,"copy",f);Xb&&v(g.sizer,"mouseup",function(){document.activeElement== g.input&&g.input.blur();N(a)})}function la(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Za(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller||c==d.gutterFiller))return null;var e,f,d=y(d.lineSpace);try{e=b.clientX,f=b.clientY}catch(g){return null}return nc(a,e-d.left,f-d.top)}function me(a){function b(a){if(!x(p, a))if(p=a,"single"==n)F(e.doc,s(g,k),a);else if(q=s(g,q),m=s(g,m),"double"==n){var b=sc(u(g,a.line).text,a);z(a,q)?F(e.doc,b.from,m):F(e.doc,q,b.to)}else"triple"==n&&(z(a,q)?F(e.doc,m,s(g,r(a.line,0))):F(e.doc,q,s(g,r(a.line+1,0))))}function c(a){var d=++qb,h=Za(e,a,!0);if(h)if(x(h,E)){var k=a.clientY<w.top?-20:a.clientY>w.bottom?20:0;k&&setTimeout(t(e,function(){qb==d&&(f.scroller.scrollTop+=k,c(a))}),50)}else{e.state.focused||ha(e);E=h;b(h);var l=ac(f,g);(h.line>=l.to||h.line<l.from)&&setTimeout(t(e, function(){qb==d&&c(a)}),150)}}function d(a){qb=Infinity;A(a);N(e);aa(document,"mousemove",C);aa(document,"mouseup",D)}if(!X(this,a)){var e=this,f=e.display,g=e.doc,h=g.sel;h.shift=a.shiftKey;if(la(f,a))K||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!ed(e,a)){var k=Za(e,a);switch(jd(a)){case 3:tc&&fd.call(e,e,a);return;case 2:K&&(e.state.lastMiddleDown=+new Date);k&&F(e.doc,k);setTimeout(O(N,e),20);A(a);return}if(k){e.state.focused||ha(e);var l=+new Date, n="single";Ab&&Ab.time>l-400&&x(Ab.pos,k)?(n="triple",A(a),setTimeout(O(N,e),20),pe(e,k.line)):Bb&&Bb.time>l-400&&x(Bb.pos,k)?(n="double",Ab={time:l,pos:k},A(a),l=sc(u(g,k.line).text,k),F(e.doc,l.from,l.to)):Bb={time:l,pos:k};var E=k;if(!e.options.dragDrop||!qe||Va(e)||x(h.from,h.to)||z(k,h.from)||z(h.to,k)||"single"!=n){A(a);"single"==n&&F(e.doc,s(g,k));var q=h.from,m=h.to,p=k,w=y(f.wrapper),qb=0,C=t(e,function(a){B||jd(a)?c(a):d(a)}),D=t(e,d);v(document,"mousemove",C);v(document,"mouseup",D)}else{var J= t(e,function(b){K&&(f.scroller.draggable=!1);e.state.draggingText=!1;aa(document,"mouseup",J);aa(f.scroller,"drop",J);10>Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)&&(A(b),F(e.doc,k),N(e))});K&&(f.scroller.draggable=!0);e.state.draggingText=J;f.scroller.dragDrop&&f.scroller.dragDrop();v(document,"mouseup",J);v(f.scroller,"drop",J)}}else(a.target||a.srcElement)==f.scroller&&A(a)}}}function ed(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(y(c.gutters).right))return!1; A(b);if(!ba(a,"gutterClick"))return!0;var g=y(c.lineDiv);if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&y(h).right>=d){c=Oa(a.doc,e);M(a,"gutterClick",a,c,a.options.gutters[g],b);break}}return!0}function oe(a){var b=this;if(!(X(b,a)||la(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,Xa(a)))){A(a);B&&(id=+new Date);var c=Za(b,a,!0),d=a.dataTransfer.files;if(c&&!Va(b))if(d&&d.length&&window.FileReader&&window.File){var e= d.length,f=Array(e),g=0;a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=s(b.doc,c),Ca(b.doc,{from:c,to:c,text:ka(f.join("\n")),origin:"paste"},"around"))};h.readAsText(a)};for(var h=0;h<e;++h)a(d[h],h)}else if(!b.state.draggingText||z(c,b.doc.sel.from)||z(b.doc.sel.to,c))try{if(f=a.dataTransfer.getData("Text")){var h=b.doc.sel.from,k=b.doc.sel.to;ea(b.doc,c,c);b.state.draggingText&&fa(b.doc,"",h,k,"paste");b.replaceSelection(f,null,"paste");N(b);ha(b)}}catch(l){}else b.state.draggingText(a), setTimeout(O(N,b),20)}}function $a(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,Da||ob(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),Da&&ob(a,[]),Ka(a,100))}function Ba(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,Yb(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft= b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function gd(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&b.detail&&b.axis==b.HORIZONTAL_AXIS&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);var e=a.display,f=e.scroller;if(c&&f.scrollWidth>f.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&va&&K)for(var g=b.target;g!=f;g=g.parentNode)if(g.lineObj){a.display.currentWheelTarget=g;break}if(!c||Da||S||null==T){if(d&&null!= T){var g=d*T,h=a.doc.scrollTop,k=h+e.wrapper.clientHeight;0>g?h=Math.max(0,h+g-50):k=Math.min(a.doc.height,k+g+50);ob(a,[],{top:h,bottom:k})}20>Cb&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(T=(T*Cb+a)/(Cb+1),++Cb)}},200)):(e.wheelDX+=c,e.wheelDY+= d))}else d&&$a(a,Math.max(0,Math.min(f.scrollTop+d*T,f.scrollHeight-f.clientHeight))),Ba(a,Math.max(0,Math.min(f.scrollLeft+c*T,f.scrollWidth-f.clientWidth))),A(b),e.wheelStartX=null}}function Db(a,b,c){if("string"==typeof b&&(b=vc[b],!b))return!1;a.display.pollingFast&&rc(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Va(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=kd}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ld(a){var b=a.state.keyMaps.slice(0); a.options.extraKeys&&b.push(a.options.extraKeys);b.push(a.options.keyMap);return b}function md(a,b){var c=wc(a.options.keyMap),d=c.auto;clearTimeout(nd);d&&!od(b)&&(nd=setTimeout(function(){wc(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,Uc(a))},50));var e=pd(b,!0),f=!1;if(!e)return!1;f=ld(a);if(f=b.shiftKey?ab("Shift-"+e,f,function(b){return Db(a,b,!0)})||ab(e,f,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Db(a,b)}):ab(e,f,function(b){return Db(a,b)}))A(b), sb(a),Q&&(b.oldKeyCode=b.keyCode,b.keyCode=0),M(a,"keyHandled",a,e,b);return f}function re(a,b,c){var d=ab("'"+c+"'",ld(a),function(b){return Db(a,b,!0)});d&&(A(b),sb(a),M(a,"keyHandled",a,"'"+c+"'",b));return d}function hd(a){this.state.focused||ha(this);if(!(X(this,a)||this.options.onKeyEvent&&this.options.onKeyEvent(this,Xa(a)))){B&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.doc.sel.shift=16==b||a.shiftKey;var c=md(this,a);S&&(xc=c?b:null,!c&&88==b&&!cd&&(va?a.metaKey:a.ctrlKey)&&this.replaceSelection(""))}} function ne(a){var b=this;if(!(X(b,a)||b.options.onKeyEvent&&b.options.onKeyEvent(b,Xa(a)))){var c=a.keyCode,d=a.charCode;S&&c==xc?(xc=null,A(a)):(S&&(!a.which||10>a.which)||Xb)&&md(b,a)||(c=String.fromCharCode(null==d?c:d),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Va(this)&&-1<this.doc.mode.electricChars.indexOf(c)&&setTimeout(t(b,function(){Eb(b,b.doc.sel.to.line,"smart")}),75),re(b,a,c)||(B&&!Q&&(b.display.inputHasSelection=null),Ua(b)))}}function ha(a){"nocursor"!= a.options.readOnly&&(a.state.focused||(J(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Y(a,!0),K&&setTimeout(O(Y,a,!0),0))),zb(a),sb(a))}function Vb(a){a.state.focused&&(J(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)}, 150)}function fd(a,b){function c(){if(null!=e.input.selectionStart){var a=e.input.value=" "+(x(f.from,f.to)?"":e.input.value);e.prevInput=" ";e.input.selectionStart=1;e.input.selectionEnd=a.length}}function d(){e.inputDiv.style.position="relative";e.input.style.cssText=k;Q&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=h);zb(a);if(null!=e.input.selectionStart){B&&!Q||c();clearTimeout(yc);var b=0,d=function(){" "==e.prevInput&&0==e.input.selectionStart?t(a,vc.selectAll)(a):10>b++?yc=setTimeout(d,500): Y(a)};yc=setTimeout(d,200)}}if(!X(a,b,"contextmenu")){var e=a.display,f=a.doc.sel;if(!la(e,b)){var g=Za(a,b),h=e.scroller.scrollTop;if(g&&!S){(x(f.from,f.to)||z(g,f.from)||!z(g,f.to))&&t(a,ea)(a.doc,g,g);var k=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);"; N(a);Y(a,!0);x(f.from,f.to)&&(e.input.value=e.prevInput=" ");B&&!Q&&c();if(tc){Ya(b);var l=function(){aa(window,"mouseup",l);setTimeout(d,20)};v(window,"mouseup",l)}else setTimeout(d,50)}}}}function qd(a,b,c){if(!z(b.from,c))return s(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d)return b=c.line-d,d=a.first+a.size-1,b>d?r(d,u(a,d).text.length):Fb(c,u(a,b).text.length);if(c.line==b.to.line+d)return Fb(c,L(b.text).length+(1==b.text.length?b.from.ch:0)+u(a,b.to.line).text.length- b.to.ch);a=c.line-b.from.line;return Fb(c,b.text[a].length+(a?0:b.from.ch))}function zc(a,b,c){if(c&&"object"==typeof c)return{anchor:qd(a,b,c.anchor),head:qd(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=Ac(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};c=function(a){if(z(a,b.from))return a;if(!z(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,g=a.ch;a.line==b.to.line&&(g+=d.ch-b.to.ch);return r(c,g)};return{anchor:c(a.sel.anchor), head:c(a.sel.head)}}function rd(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=s(a,b));c&&(this.to=s(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});J(a,"beforeChange",a,b);a.cm&&J(a.cm,"beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Ca(a,b,c,d){if(a.cm){if(!a.cm.curOp)return t(a.cm,Ca)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(ba(a, "beforeChange")||a.cm&&ba(a.cm,"beforeChange"))if(b=rd(a,b,!0),!b)return;if(d=sd&&!d&&se(a,b.from,b.to)){for(var e=d.length-1;1<=e;--e)Bc(a,{from:d[e].from,to:d[e].to,text:[""]});d.length&&Bc(a,{from:d[0].from,to:d[0].to,text:b.text},c)}else Bc(a,b,c)}function Bc(a,b,c){c=zc(a,b,c);td(a,b,c,a.cm?a.cm.curOp.id:NaN);bb(a,b,c,Cc(a,b));var d=[];Ea(a,function(a,c){c||-1!=ca(d,a.history)||(ud(a.history,b),d.push(a.history));bb(a,b,null,Cc(a,b))})}function vd(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c= a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e);c.generation=d.generation||++c.maxGeneration;for(var f=ba(a,"beforeChange")||a.cm&&ba(a.cm,"beforeChange"),g=d.changes.length-1;0<=g;--g){var h=d.changes[g];h.origin=b;if(f&&!rd(a,h,!1)){("undo"==b?c.done:c.undone).length=0;break}e.changes.push(Dc(a,h));var k=g?zc(a,h,null): {anchor:d.anchorBefore,head:d.headBefore};bb(a,h,k,wd(a,h));var l=[];Ea(a,function(a,b){b||-1!=ca(l,a.history)||(ud(a.history,h),l.push(a.history));bb(a,h,null,wd(a,h))})}}}}function xd(a,b){function c(a){return r(a.line+b,a.ch)}a.first+=b;a.cm&&D(a.cm,a.first,a.first,b);a.sel.head=c(a.sel.head);a.sel.anchor=c(a.sel.anchor);a.sel.from=c(a.sel.from);a.sel.to=c(a.sel.to)}function bb(a,b,c,d){if(a.cm&&!a.cm.curOp)return t(a.cm,bb)(a,b,c,d);if(b.to.line<a.first)xd(a,b.text.length-1-(b.to.line-b.from.line)); else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);xd(a,e);b={from:r(a.first,0),to:r(b.to.line+e,b.to.ch),text:[L(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:r(e,u(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ec(a,b.from,b.to);c||(c=zc(a,b,null));a.cm?te(a.cm,b,d,c):Fc(a,b,d,c)}}function te(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,k=!1,l=g.line;a.options.lineWrapping||(l=P($(e,u(e,g.line))), e.iter(l,h.line+1,function(a){if(a==f.maxLine)return k=!0}));z(e.sel.head,b.from)||z(b.to,e.sel.head)||(a.curOp.cursorActivity=!0);Fc(e,b,c,d,Rc(a));a.options.lineWrapping||(e.iter(l,g.line+b.text.length,function(a){var b=mb(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,k=!1)}),k&&(a.curOp.updateMaxLine=!0));e.frontier=Math.min(e.frontier,g.line);Ka(a,400);D(a,g.line,h.line+1,b.text.length-(h.line-g.line)-1);if(ba(a,"change"))if(b={from:g,to:h,text:b.text,removed:b.removed, origin:b.origin},a.curOp.textChanged){for(a=a.curOp.textChanged;a.next;a=a.next);a.next=b}else a.curOp.textChanged=b}function fa(a,b,c,d,e){d||(d=c);if(z(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=ka(b));Ca(a,{from:c,to:d,text:b,origin:e},null)}function r(a,b){if(!(this instanceof r))return new r(a,b);this.line=a;this.ch=b}function x(a,b){return a.line==b.line&&a.ch==b.ch}function z(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function ma(a){return r(a.line,a.ch)}function s(a,b){if(b.line< a.first)return r(a.first,0);var c=a.first+a.size-1;return b.line>c?r(c,u(a,c).text.length):Fb(b,u(a,b.line).text.length)}function Fb(a,b){var c=a.ch;return null==c||c>b?r(a.line,b):0>c?r(a.line,0):a}function Fa(a,b){return b>=a.first&&b<a.first+a.size}function F(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=z(b,e);f!=z(c,e)?(e=b,b=c):f!=z(b,c)&&(b=c)}ea(a,e,b,d)}else ea(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function ea(a,b,c,d,e){if(!e&&ba(a,"beforeSelectionChange")|| a.cm&&ba(a.cm,"beforeSelectionChange"))b={anchor:b,head:c},J(a,"beforeSelectionChange",a,b),a.cm&&J(a.cm,"beforeSelectionChange",a.cm,b),b.anchor=s(a,b.anchor),b.head=s(a,b.head),c=b.head,b=b.anchor;var f=a.sel;f.goalColumn=null;if(e||!x(b,f.anchor))b=Gb(a,b,d,"push"!=e);if(e||!x(c,f.head))c=Gb(a,c,d,"push"!=e);x(f.anchor,b)&&x(f.head,c)||(f.anchor=b,f.head=c,d=z(c,b),f.from=d?c:b,f.to=d?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),M(a,"cursorActivity", a))}function yd(a){ea(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Gb(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=u(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var l=h.markedSpans[k],n=l.marker;if((null==l.from||(n.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(n.inclusiveRight?l.to>=f.ch:l.to>f.ch))){if(d&&(J(n,"beforeCursorEnter"),n.explicitlyCleared))if(h.markedSpans){--k;continue}else break;if(n.atomic){k=n.find()[0>g?"from":"to"];if(x(k, f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?s(a,r(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?r(k.line+1,0):null),!k)){if(e){if(!d)return Gb(a,b,c,!0);a.cantEdit=!0;return r(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}function bd(a,b,c){for(null==c&&(c=0);;){var d=!1,e=U(a,b),f=yb(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;null!=f.scrollTop&&($a(a,f.scrollTop),1<Math.abs(a.doc.scrollTop-g)&&(d=!0));null!=f.scrollLeft&&(Ba(a,f.scrollLeft),1<Math.abs(a.doc.scrollLeft- h)&&(d=!0));if(!d)return e}}function yb(a,b,c,d,e){var f=a.display,g=sa(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-qa,k=f.scroller.scrollTop,l={};a=a.doc.height+(f.mover.offsetHeight-f.lineSpace.offsetHeight);var n=c<g,g=e>a-g;c<k?l.scrollTop=n?0:c:e>k+h&&(c=Math.min(c,(g?a:e)-h),c!=k&&(l.scrollTop=c));k=f.scroller.clientWidth-qa;c=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;e=b<f+10;b<c+f||e?(e&&(b=0),l.scrollLeft=Math.max(0,b-10-f)):d> k+c-3&&(l.scrollLeft=d+10-k);return l}function Hb(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Gc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop});a=a.display.scroller;d.scrollTop=Math.max(0,Math.min(a.scrollHeight-a.clientHeight,d.scrollTop+c));d.scrollLeft=Math.max(0,Math.min(a.scrollWidth-a.clientWidth,d.scrollLeft+b))}function Eb(a,b,c,d){var e=a.doc;null== c&&(c="add");if("smart"==c)if(a.doc.mode.indent)var f=Ra(a,b);else c="prev";var g=a.options.tabSize,h=u(e,b),k=xa(h.text,null,g),l=h.text.match(/^\s*/)[0],n;if("smart"==c&&(n=a.doc.mode.indent(f,h.text.slice(l.length),h.text),n==kd)){if(!d)return;c="prev"}"prev"==c?n=b>e.first?xa(u(e,b-1).text,null,g):0:"add"==c?n=k+a.options.indentUnit:"subtract"==c?n=k-a.options.indentUnit:"number"==typeof c&&(n=k+c);n=Math.max(0,n);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(n/g);e;--e)d+=g,c+="\t";d< n&&(c+=zd(n-d));c!=l&&fa(a.doc,c,r(b,0),r(b,l.length),"+input");h.stateAfter=null}function Ib(a,b,c){var d=b,e=b,f=a.doc;"number"==typeof b?e=u(f,Math.max(f.first,Math.min(b,f.first+f.size-1))):d=P(b);if(null!=d&&c(e,d))D(a,d,d+1);else return null;return e}function Hc(a,b,c,d,e){function f(b){var d=(e?oc:Ad)(k,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=l=!1:(g=b,b=k=u(a,b));if(b)h=e?(0>c?wb:vb)(k):0>c?k.text.length:0;else return l=!1}else h=d;return!0}var g=b.line,h=b.ch;b=c; var k=u(a,g),l=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var n=null;d="group"==d;for(var E=!0;!(0>c)||f(!E);E=!1){var q=k.text.charAt(h)||"\n",q=cb(q)?"w":d?/\s/.test(q)?null:"p":null;if(n&&n!=q){0>c&&(c=1,f());break}q&&(n=q);if(0<c&&!f(!E))break}}b=Gb(a,r(g,h),b,!0);l||(b.hitSide=!0);return b}function Bd(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*(d-(0> c?1.5:0.5)*sa(a.display))):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){var h=nc(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function sc(a,b){var c=b.ch,d=b.ch;if(a){(0>b.xRel||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),e=cb(e)?cb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!cb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:r(b.line,c),to:r(b.line,d)}}function pe(a,b){F(a.doc,r(b,0),s(a.doc, r(b+1,0)))}function w(a,b,c,d){m.defaults[a]=b;c&&(pa[a]=d?function(a,b,d){d!=Qc&&c(a,b,d)}:c)}function wa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function Zc(a,b,c){return a.startState?a.startState(b,c):!0}function wc(a){return"string"==typeof a?Z[a]:a}function ab(a,b,c){function d(b){b=wc(b);var e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough; if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return d(b);for(var e=0,f=b.length;e<f;++e){var l=d(b[e]);if(l)return l}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function od(a){a=na[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function pd(a,b){if(S&&34==a.keyCode&&a["char"])return!1;var c=na[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(Cd?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(Cd?a.ctrlKey:a.metaKey)c="Cmd-"+ c;!b&&a.shiftKey&&(c="Shift-"+c);return c}function db(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lastColumnPos=this.lastColumnValue=0}function ga(a,b){this.lines=[];this.type=b;this.doc=a}function eb(a,b,c,d,e){if(d&&d.shared)return ue(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return t(a.cm,eb)(a,b,c,d,e);var f=new ga(a,e);if("range"==e&&!z(b,c))return f;d&&Jb(d,f);f.replacedWith&&(f.collapsed=!0,f.replacedWith=p("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents= !0));f.collapsed&&(Pa=!0);f.addToHistory&&td(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},NaN);var g=b.line,h=0,k,l,n=a.cm,E;a.iter(g,c.line+1,function(d){n&&f.collapsed&&!n.options.lineWrapping&&$(a,d)==n.display.maxLine&&(E=!0);var e={from:null,to:null,marker:f};h+=d.text.length;g==b.line&&(e.from=b.ch,h-=b.ch);g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch);f.collapsed&&(g==c.line&&(l=ua(d,c.ch)),g==b.line?k=ua(d,b.ch):R(d,0));d.markedSpans=d.markedSpans?d.markedSpans.concat([e]): [e];e.marker.attachLine(d);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){ia(a,b)&&R(b,0)});f.clearOnEnter&&v(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(sd=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());if(f.collapsed){if(k!=l)throw Error("Inserting collapsed marker overlapping an existing one");f.size=h;f.atomic=!0}n&&(E&&(n.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&D(n,b.line,c.line+1),f.atomic&&yd(n));return f} function fb(a,b){this.markers=a;this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,v(a[c],"clear",function(){d.clear()})}function ue(a,b,c,d,e){d=Jb(d);d.shared=!1;var f=[eb(a,b,c,d,e)],g=f[0],h=d.replacedWith;Ea(a,function(a){h&&(d.replacedWith=h.cloneNode(!0));f.push(eb(a,s(a,b),s(a,c),d,e));for(var l=0;l<a.linked.length;++l)if(a.linked[l].isParent)return;g=L(f)});return new fb(f,g)}function gb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Cc(a, b){var c=Fa(a,b.from.line)&&u(a,b.from.line).markedSpans,d=Fa(a,b.to.line)&&u(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=x(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var l=c[h],n=l.marker;if(null==l.from||(n.inclusiveLeft?l.from<=e:l.from<e)||"bookmark"==n.type&&!(l.from!=e||g&&l.marker.insertLeft)){var E=null==l.to||(n.inclusiveRight?l.to>=e:l.to>e);(k||(k=[])).push({from:l.from,to:E?null:l.to,marker:n})}}c=k;if(d)for(var h=0,m;h<d.length;++h)if(k=d[h],l=k.marker, null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||"bookmark"==l.type&&k.from==f&&(!g||k.marker.insertLeft))n=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(m||(m=[])).push({from:n?null:k.from-f,to:null==k.to?null:k.to-f,marker:l});d=m;g=1==b.text.length;m=L(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=c[f],null==h.to)(k=gb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+m):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=m),null==h.from?(k=gb(c,h.marker),k||(h.from=m,g&&(c|| (c=[])).push(h))):(h.from+=m,g&&(c||(c=[])).push(h));if(g&&c){for(f=0;f<c.length;++f)null!=c[f].from&&c[f].from==c[f].to&&"bookmark"!=c[f].marker.type&&c.splice(f--,1);c.length||(c=null)}e=[c];if(!g){var g=b.text.length-2,p;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(p||(p=[])).push({from:null,to:null,marker:c[f].marker});for(f=0;f<g;++f)e.push(p);e.push(d)}return e}function wd(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(ve(c[d]));c=e}else c=null;d=Cc(a,b);if(!c)return d; if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function se(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=ca(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(),f=0;f<a.length;++f){var g= a[f];if(!z(g.to,e.from)&&!z(e.to,g.from)){var h=[f,1];(z(g.from,e.from)||!c.inclusiveLeft&&x(g.from,e.from))&&h.push({from:g.from,to:e.from});(z(e.to,g.to)||!c.inclusiveRight&&x(g.to,e.to))&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function ua(a,b){var c=Pa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function nb(a){return ua(a,a.text.length+ 1)}function $(a,b){for(var c;c=ua(b,-1);)b=u(a,c.find().from.line);return b}function ia(a,b){var c=Pa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Ic(a,b,d)))return!0}function Ic(a,b,c){if(null==c.to)return b=c.marker.find().to,b=u(a,b.line),Ic(a,b,gb(b.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e], d.marker.collapsed&&!d.marker.replacedWith&&d.from==c.to&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Ic(a,b,d))return!0}function Dd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Ed(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Fd(a){return function(){var b=!this.cm.curOp;b&&za(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function tb(a){if(null!=a.height)return a.height; a.node.parentNode&&1==a.node.parentNode.nodeType||W(a.cm.display.measure,p("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function we(a,b,c,d){var e=new Kb(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);Ib(a,b,function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;if(!ia(a.doc,b)||e.showIfHidden)c=Qa(a,b)<a.doc.scrollTop,R(b,b.height+tb(e)),c&&Gc(a,0,e.height);return!0});return e}function Gd(a, b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var g=0,h=null,k=new db(b,a.options.tabSize),l;for(""==b&&c.blankLine&&c.blankLine(d);!k.eol();)k.pos>a.options.maxHighlightLength?(f=!1,k.pos=Math.min(b.length,k.start+5E4),l=null):l=c.token(k,d),f&&h==l||(g<k.start&&e(k.start,h),g=k.start,h=l),k.start=k.pos;g<k.pos&&e(k.pos,h)}function Xc(a,b,c){var d=[a.state.modeGen];Gd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.state.overlays.length;++c){var e=a.state.overlays[c], f=1,g=0;Gd(a,b.text,e.mode,!0,function(a,b){for(var c=f;g<a;){var n=d[f];n>a&&d.splice(f,1,a,d[f+1],n);f+=2;g=Math.min(a,n)}if(b)if(e.opaque)d.splice(c,f-c,a,b),f=c+2;else for(;c<f;c+=2)n=d[c+1],d[c+1]=n?n+" "+b:b})}return d}function Hd(a,b){b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Xc(a,b,b.stateAfter=Ra(a,P(b))));return b.styles}function Yc(a,b,c){var d=a.doc.mode,e=new db(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e, c),e.start=e.pos}function Id(a){return a?Jd[a]||(Jd[a]="cm-"+a.replace(/ +/g," cm-")):null}function fc(a,b,c,d){for(var e,f=b,g=!0;e=ua(f,-1);)f=u(a.doc,e.find().from.line);d={pre:p("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:d};f.textClass&&(d.pre.className=f.textClass);do{f.text&&(g=!1);d.measure=f==b&&c;d.pos=0;d.addToken=d.measure?xe:Kd;(B||K)&&a.getOption("lineWrapping")&&(d.addToken=ye(d.addToken));a:{e=d;var h=Hd(a,f),k=f.markedSpans,l=f.text,n=0;if(k)for(var m=l.length, q=0,r=1,s="",t=void 0,v=0,C=void 0,w=void 0,x=void 0,y=void 0,G=void 0;;){if(v==q){for(var C=w=x=y="",G=null,v=Infinity,z=[],D=0;D<k.length;++D){var A=k[D],F=A.marker;A.from<=q&&(null==A.to||A.to>q)?(null!=A.to&&v>A.to&&(v=A.to,w=""),F.className&&(C+=" "+F.className),F.startStyle&&A.from==q&&(x+=" "+F.startStyle),F.endStyle&&A.to==v&&(w+=" "+F.endStyle),F.title&&!y&&(y=F.title),F.collapsed&&(!G||G.marker.size<F.size)&&(G=A)):A.from>q&&v>A.from&&(v=A.from);"bookmark"==F.type&&A.from==q&&F.replacedWith&& z.push(F)}if(G&&(G.from||0)==q&&(Ld(e,(null==G.to?m:G.to)-q,G.marker,null==G.from),null==G.to)){e=G.marker.find();break a}if(!G&&z.length)for(D=0;D<z.length;++D)Ld(e,0,z[D])}if(q>=m)break;for(z=Math.min(m,v);;){if(s){D=q+s.length;G||(A=D>z?s.slice(0,z-q):s,e.addToken(e,A,t?t+C:C,x,q+A.length==v?w:"",y));if(D>=z){s=s.slice(z-q);q=z;break}q=D;x=""}s=l.slice(n,n=h[r++]);t=Id(h[r++])}}else for(var r=1;r<h.length;r+=2)e.addToken(e,l.slice(n,n=h[r]),Id(h[r+1]));e=void 0}c&&f==b&&!d.measuredSomething&&(c[0]= d.pre.appendChild(Sa(a.display.measure)),d.measuredSomething=!0);e&&(f=u(a.doc,e.to.line))}while(e);!c||d.measuredSomething||c[0]||(c[0]=d.pre.appendChild(g?p("span","\u00a0"):Sa(a.display.measure)));d.pre.firstChild||ia(a.doc,b)||d.pre.appendChild(document.createTextNode("\u00a0"));var I;c&&B&&(I=V(f))&&(g=I.length-1,I[g].from==I[g].to&&--g,f=I[g],I=I[g-1],f.from+1==f.to&&I&&f.level<I.level&&(c=c[d.pos-1])&&c.parentNode.insertBefore(c.measureRight=Sa(a.display.measure),c.nextSibling));J(a,"renderLine", a,b,d.pre);return d.pre}function Kd(a,b,c,d,e,f){if(b){if(Jc.test(b))for(var g=document.createDocumentFragment(),h=0;;){Jc.lastIndex=h;var k=Jc.exec(b),l=k?k.index-h:b.length-h;l&&(g.appendChild(document.createTextNode(b.slice(h,h+l))),a.col+=l);if(!k)break;h+=l+1;"\t"==k[0]?(k=a.cm.options.tabSize,k-=a.col%k,g.appendChild(p("span",zd(k),"cm-tab")),a.col+=k):(l=p("span","\u2022","cm-invalidchar"),l.title="\\u"+k[0].charCodeAt(0).toString(16),g.appendChild(l),a.col+=1)}else{a.col+=b.length;var g=document.createTextNode(b)}if(c|| d||e||a.measure)return b=c||"",d&&(b+=d),e&&(b+=e),l=p("span",[g],b),f&&(l.title=f),a.pre.appendChild(l);a.pre.appendChild(g)}}function xe(a,b,c,d,e){for(var f=a.cm.options.lineWrapping,g=0;g<b.length;++g){var h=b.charAt(g),k=0==g;"\ud800"<=h&&"\udbff">h&&g<b.length-1?(h=b.slice(g,g+2),++g):g&&f&&Lb(b,g)&&a.pre.appendChild(p("wbr"));var l=a.measure[a.pos],k=a.measure[a.pos]=Kd(a,h,c,k&&d,g==b.length-1&&e);l&&(k.leftSide=l.leftSide||l);B&&f&&" "==h&&g&&!/\s/.test(b.charAt(g-1))&&g<b.length-1&&!/\s/.test(b.charAt(g+ 1))&&(k.style.whiteSpace="normal");a.pos+=h.length}b.length&&(a.measuredSomething=!0)}function ye(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":"\u00a0";return b+" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/,b),e,f,g,h)}}function Ld(a,b,c,d){if(d=!d&&c.replacedWith)if(a.copyWidgets&&(d=d.cloneNode(!0)),a.pre.appendChild(d),a.measure){if(b)a.measure[a.pos]=d;else{var e=Sa(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]= a.pre.insertBefore(e,d)}else a.measure[a.pos]=a.pre.appendChild(e)}a.measuredSomething=!0}a.pos+=b}function Fc(a,b,c,d,e){function f(a,c,d){var f=e;a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);Dd(a);Ed(a,d);c=f?f(a):1;c!=a.height&&R(a,c);M(a,"change",a,b)}var g=b.from,h=b.to,k=b.text,l=u(a,g.line),n=u(a,h.line),m=L(k),q=c?c[k.length-1]:null,r=h.line-g.line;if(0==g.ch&&0==h.ch&&""==m){for(var p=0,s=k.length-1,t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]: null,e));f(n,n.text,q);r&&a.remove(g.line,r);t.length&&a.insert(g.line,t)}else if(l==n)if(1==k.length)f(l,l.text.slice(0,g.ch)+m+l.text.slice(h.ch),q);else{t=[];p=1;for(s=k.length-1;p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));t.push(new Ga(m+l.text.slice(h.ch),q,e));f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);a.insert(g.line+1,t)}else if(1==k.length)f(l,l.text.slice(0,g.ch)+k[0]+n.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,r);else{f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);f(n,m+n.text.slice(h.ch), q);p=1;s=k.length-1;for(t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));1<r&&a.remove(g.line+1,r-1);a.insert(g.line+1,t)}M(a,"change",a,b);ea(a,d.anchor,d.head,null,!0)}function Mb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function hb(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function Ea(a,b,c){function d(a,f,g){if(a.linked)for(var h= 0;h<a.linked.length;++h){var k=a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function Pc(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;Tc(a);Ja(a);a.options.lineWrapping||Zb(a);a.options.mode=b.modeOption;D(a)}function u(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function Ec(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text; e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function Kc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function R(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function P(a){if(null==a.parent)return null;var b=a.parent;a=ca(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function Oa(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;d<e;++d){var f= a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function Qa(a,b){b=$(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;else c+=f.height}for(f=d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function V(a){var b=a.order;null==b&&(b=a.order=ze(a.text));return b}function Nb(a){return{done:[], undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function Md(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function Dc(a,b){var c={from:{line:b.from.line,ch:b.from.ch},to:Ac(b),text:Ec(a,b.from,b.to)};Md(a,c,b.from.line,b.to.line+1);Ea(a,function(a){Md(a,c,b.from.line,b.to.line+1)},!0);return c}function td(a,b,c,d){var e= a.history;e.undone.length=0;var f=+new Date,g=L(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=L(g.changes);x(b.from,b.to)&&x(b.from,h.to)?h.to=Ac(b):g.changes.push(Dc(a,b));g.anchorAfter=c.anchor;g.headAfter=c.head}else for(g={changes:[Dc(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation= ++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f;e.lastOp=d;e.lastOrigin=b.origin}function ve(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ob(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(e=0;e<f.length;++e){var h=f[e],k;g.push({from:h.from, to:h.to,text:h.text});if(b)for(var l in h)(k=l.match(/^spans_(\d+)$/))&&-1<ca(b,Number(k[1]))&&(L(g)[l]=h[l],delete h[l])}}return d}function Pb(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Nd(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var k=f.changes[h];f.copied||(k.from=ma(k.from),k.to=ma(k.to));if(c<k.from.line)k.from.line+=d,k.to.line+=d;else if(b<=k.to.line){g=!1;break}}f.copied||(f.anchorBefore=ma(f.anchorBefore),f.headBefore=ma(f.headBefore), f.anchorAfter=ma(f.anchorAfter),f.readAfter=ma(f.headAfter),f.copied=!0);g?(Pb(f.anchorBefore),Pb(f.headBefore),Pb(f.anchorAfter),Pb(f.headAfter)):(a.splice(0,e+1),e=0)}}function ud(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Nd(a.done,c,d,e);Nd(a.undone,c,d,e)}function Ae(){Ya(this)}function Xa(a){a.stop||(a.stop=Ae);return a}function A(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Od(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ya(a){A(a); Od(a)}function jd(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));va&&a.ctrlKey&&1==b&&(b=3);return b}function v(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function aa(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}} function J(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function M(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);da||(++xb,da=[],setTimeout(Be,0));for(var f=0;f<d.length;++f)da.push(c(d[f]))}}function X(a,b,c){J(a,c||b.type,a,b);return(null!=b.defaultPrevented?b.defaultPrevented:!1==b.returnValue)||b.codemirrorIgnore}function Be(){--xb; var a=da;da=null;for(var b=0;b<a.length;++b)a[b]()}function ba(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Ha(a){a.prototype.on=function(a,c){v(this,a,c)};a.prototype.off=function(a,c){aa(this,a,c)}}function Ub(){this.id=null}function xa(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function zd(a){for(;Qb.length<=a;)Qb.push(L(Qb)+" ");return Qb[a]}function L(a){return a[a.length-1]}function dd(a){if(Ia)a.selectionStart= 0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function ca(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function Pd(a,b){function c(){}c.prototype=a;var d=new c;b&&Jb(b,d);return d}function Jb(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function $c(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function O(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function cb(a){return/\w/.test(a)|| "\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||Ce.test(a))}function Qd(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function p(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Wc(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Ma(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function W(a,b){return Ma(a).appendChild(b)}function Wc(a,b){Q?(a.innerHTML="",a.appendChild(document.createTextNode(b))): a.textContent=b}function y(a){return a.getBoundingClientRect()}function Lb(){return!1}function Na(a){if(null!=Wa)return Wa;var b=p("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");W(a,b);b.offsetWidth&&(Wa=b.offsetHeight-b.clientHeight);return Wa||0}function Sa(a){if(null==Lc){var b=p("span","\u200b");W(a,p("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Lc=1>=b.offsetWidth&&2<b.offsetHeight&&!ra)}return Lc?p("span","\u200b"):p("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")} function de(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function kc(a){return a.level%2?a.to:a.from}function lc(a){return a.level%2?a.from:a.to}function vb(a){return(a=V(a))?kc(a[0]):0}function wb(a){var b=V(a);return b?lc(L(b)):a.text.length}function Rd(a,b){var c=u(a.doc,b),d=$(a.doc,c);d!=c&&(b=P(d));d=(c=V(d))?c[0].level%2?wb(d):vb(d):0;return r(b, d)}function De(a,b){for(var c,d;c=nb(d=u(a.doc,b));)b=c.find().to.line;d=(c=V(d))?c[0].level%2?vb(d):wb(d):d.text.length;return r(b,d)}function mc(a,b){for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return ya=null,c;if(e.from==b||e.to==b)if(null==d)d=c;else{var e=e.level,f=a[d].level,g=a[0].level,e=e==g?!0:f==g?!1:e<f;if(e)return ya=d,c;ya=c;return d}}ya=null;return d}function Mc(a,b,c,d){if(!d)return b+c;do b+=c;while(0<b&&pc.test(a.text.charAt(b)));return b}function oc(a,b,c,d){var e= V(a);if(!e)return Ad(a,b,c,d);var f=mc(e,b),g=e[f];for(b=Mc(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(mc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?Mc(a,g.to,-1,d):Mc(a,g.from,1,d)}}function Ad(a,b,c,d){b+=c;if(d)for(;0<b&&pc.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var Da=/gecko\/\d/i.test(navigator.userAgent),B=/MSIE \d/.test(navigator.userAgent),ra=B&&(null==document.documentMode|| 8>document.documentMode),Q=B&&(null==document.documentMode||9>document.documentMode),K=/WebKit\//.test(navigator.userAgent),Ee=K&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Fe=/Chrome\//.test(navigator.userAgent),S=/Opera\//.test(navigator.userAgent),uc=/Apple Computer/.test(navigator.vendor),Xb=/KHTML\//.test(navigator.userAgent),Vd=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Wd=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ke=/PhantomJS/.test(navigator.userAgent),Ia=/AppleWebKit/.test(navigator.userAgent)&& /Mobile\/\w+/.test(navigator.userAgent),Tb=Ia||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),va=Ia||/Mac/.test(navigator.platform),Ge=/win/i.test(navigator.platform),oa=S&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);oa&&(oa=Number(oa[1]));oa&&15<=oa&&(S=!1,K=!0);var Cd=va&&(Ee||S&&(null==oa||12.11>oa)),tc=Da||B&&!Q,sd=!1,Pa=!1,ja,je=0,Bb,Ab,id=0,Cb=0,T=null;B?T=-0.53:Da?T=15:Fe?T=-0.7:uc&&(T=-1/3);var nd,xc=null,yc,Ac=m.changeEnd=function(a){return a.text? r(a.from.line+a.text.length-1,L(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};m.Pos=r;m.prototype={constructor:m,focus:function(){window.focus();N(this);ha(this);Ua(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,pa.hasOwnProperty(a)&&t(this,pa[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps, c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:t(null,function(a,b){var c=a.token?a:m.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;D(this)}),removeOverlay:t(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++; D(this);break}}}),indentLine:t(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");Fa(this.doc,a)&&Eb(this,a,b,c)}),indentSelection:t(null,function(a){var b=this.doc.sel;if(x(b.from,b.to))return Eb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)Eb(this,b,a)}),getTokenAt:function(a,b){var c=this.doc;a=s(c,a);for(var d=Ra(this,a.line,b),e=this.doc.mode,c=u(c,a.line),c=new db(c.text,this.options.tabSize);c.pos< a.ch&&!c.eol();){c.start=c.pos;var f=e.token(c,d)}return{start:c.start,end:c.pos,string:c.current(),className:f||null,type:f||null,state:d}},getTokenTypeAt:function(a){a=s(this.doc,a);var b=Hd(this,u(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)return b[2];for(;;){var e=c+d>>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]<a)c=e+1;else return b[2*e+2]}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?m.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(ib.hasOwnProperty(b)){var c= ib[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return Ra(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel;c=null==a?c.head:"object"==typeof a?s(this.doc,a):a?c.from:c.to;return U(this,c,b||"page")},charCoords:function(a,b){return rb(this,s(this.doc,a),b||"page")},coordsChar:function(a,b){a=ad(this,a,b||"page");return nc(this,a.left, a.top)},lineAtHeight:function(a,b){a=ad(this,{top:a,left:0},b||"page").top;return Oa(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);d=u(this.doc,a);return jc(this,u(this.doc,a),{top:0,left:0},b||"page").top+(c?d.height:0)},defaultTextHeight:function(){return sa(this.display)},defaultCharWidth:function(){return Sc(this.display)},setGutterMarker:t(null,function(a,b,c){return Ib(this,a,function(a){var e= a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Qd(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:t(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,D(b,d,d+1),Qd(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[e]))return!1;a[e]+=" "+ c}else a[e]=c;return!0})}),removeLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.match(RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:t(null,function(a,b,c){return we(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"== typeof a){if(!Fa(this.doc,a))return null;var b=a;a=u(this.doc,a);if(!a)return null}else if(b=P(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=U(this,s(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b); if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/ 2),b.style.left=h+"px");c&&(a=yb(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&$a(this,a.scrollTop),null!=a.scrollLeft&&Ba(this,a.scrollLeft))},triggerOnKeyDown:t(null,hd),execCommand:function(a){return vc[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=Hc(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:t(null,function(a,b){var c=this.doc.sel,c=c.shift||c.extend||x(c.from,c.to)?Hc(this.doc,c.head,a,b,this.options.rtlMoveVisually): 0>a?c.from:c.to;F(this.doc,c,c,a)}),deleteH:t(null,function(a,b){var c=this.doc.sel;x(c.from,c.to)?fa(this.doc,"",c.from,Hc(this.doc,c.head,a,b,!1),"+delete"):fa(this.doc,"",c.from,c.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=U(this,a,"div"),null==d?d=a.left:a.left=d,a=Bd(this,a,e,c),!a.hitSide);++f);return a},moveV:t(null,function(a,b){var c=this.doc.sel,d=U(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn); var e=Bd(this,d,a,b);"page"==b&&Gc(this,0,rb(this,e,"div").top-d.top);F(this.doc,e,e,a);c.goalColumn=d.left}),toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},hasFocus:function(){return this.state.focused},scrollTo:t(null,function(a,b){Hb(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller, b=qa;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:t(null,function(a,b){"number"==typeof a&&(a=r(a,0));b||(b=0);var c=a;a&&null==a.line||(this.curOp.scrollToPos=a?s(this.doc,a):this.doc.sel.head,this.curOp.scrollToPosMargin=b,c=U(this,this.curOp.scrollToPos));c=yb(this,c.left,c.top-b,c.right,c.bottom+b);Hb(this,c.scrollLeft,c.scrollTop)}),setSize:t(null,function(a,b){function c(a){return"number"== typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0);this.curOp.forceUpdate=!0}),operation:function(a){return qc(this,a)},refresh:t(null,function(){ta(this);Hb(this,this.doc.scrollLeft,this.doc.scrollTop);D(this)}),swapDoc:t(null,function(a){var b=this.doc;b.cm=null;Pc(this,a);ta(this);Y(this,!0);Hb(this,a.scrollLeft, a.scrollTop);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Ha(m);var pa=m.optionHandlers={},Rb=m.defaults={},Qc=m.Init={toString:function(){return"CodeMirror.Init"}};w("value","",function(a,b){a.setValue(b)},!0);w("mode",null,function(a,b){a.doc.modeOption=b;Ja(a)},!0);w("indentUnit",2,Ja,!0);w("indentWithTabs", !1);w("smartIndent",!0);w("tabSize",4,function(a){Ja(a);ta(a);D(a)},!0);w("electricChars",!0);w("rtlMoveVisually",!Ge);w("theme","default",function(a){Oc(a);La(a)},!0);w("keyMap","default",Uc);w("extraKeys",null);w("onKeyEvent",null);w("onDragEvent",null);w("lineWrapping",!1,function(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),Zb(a));Tc(a);D(a); ta(a);setTimeout(function(){$b(a)},100)},!0);w("gutters",[],function(a){Sb(a.options);La(a)},!0);w("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?bc(a.display)+"px":"0";a.refresh()},!0);w("coverGutterNextToScrollbar",!1,$b,!0);w("lineNumbers",!1,function(a){Sb(a.options);La(a)},!0);w("firstLineNumber",1,La,!0);w("lineNumberFormatter",function(a){return a},La,!0);w("showCursorWhenSelecting",!1,dc,!0);w("readOnly",!1,function(a,b){"nocursor"==b?(Vb(a),a.display.input.blur()):b||Y(a,!0)}); w("dragDrop",!0);w("cursorBlinkRate",530);w("cursorScrollMargin",0);w("cursorHeight",1);w("workTime",100);w("workDelay",100);w("flattenSpans",!0);w("pollInterval",100);w("undoDepth",40,function(a,b){a.doc.history.undoDepth=b});w("historyEventDelay",500);w("viewportMargin",10,function(a){a.refresh()},!0);w("maxHighlightLength",1E4,function(a){Ja(a);a.refresh()},!0);w("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});w("tabindex",null,function(a, b){a.display.input.tabIndex=b||""});w("autofocus",null);var Sd=m.modes={},jb=m.mimeModes={};m.defineMode=function(a,b){m.defaults.mode||"null"==a||(m.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Sd[a]=b};m.defineMIME=function(a,b){jb[a]=b};m.resolveMode=function(a){if("string"==typeof a&&jb.hasOwnProperty(a))a=jb[a];else if(a&&"string"==typeof a.name&&jb.hasOwnProperty(a.name)){var b=jb[a.name];a=Pd(b,a);a.name=b.name}else if("string"== typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return m.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};m.getMode=function(a,b){b=m.resolveMode(b);var c=Sd[b.name];if(!c)return m.getMode(a,"text/plain");c=c(a,b);if(kb.hasOwnProperty(b.name)){var d=kb[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};m.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});m.defineMIME("text/plain","null"); var kb=m.modeExtensions={};m.extendMode=function(a,b){var c=kb.hasOwnProperty(a)?kb[a]:kb[a]={};Jb(b,c)};m.defineExtension=function(a,b){m.prototype[a]=b};m.defineDocExtension=function(a,b){I.prototype[a]=b};m.defineOption=w;var Wb=[];m.defineInitHook=function(a){Wb.push(a)};var ib=m.helpers={};m.registerHelper=function(a,b,c){ib.hasOwnProperty(a)||(ib[a]=m[a]={});ib[a][b]=c};m.isWordChar=cb;m.copyState=wa;m.startState=Zc;m.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode== a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var vc=m.commands={selectAll:function(a){a.setSelection(r(a.firstLine(),0),r(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!x(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:r(b.line),"+delete"):a.replaceRange("",b,r(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",r(b,0),r(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",r(b.line, 0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(r(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(r(a.lastLine()))},goLineStart:function(a){a.extendSelection(Rd(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Rd(a,b.line),d=a.getLineHandle(c.line),e=V(d);e&&0!=e[0].level?a.extendSelection(c):(d=Math.max(0,d.text.search(/\S/)),a.extendSelection(r(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d)))},goLineEnd:function(a){a.extendSelection(De(a, a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1, "char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1, "word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line); 0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),r(b.line,b.ch-1),r(b.line,b.ch+1))},newlineAndIndent:function(a){t(a,function(){a.replaceSelection("\n","end","+input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},Z=m.keyMap={};Z.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore", Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};Z.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext", "Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};Z.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter", "Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]};Z["default"]=va?Z.macDefault:Z.pcDefault;Z.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp", "Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};m.lookupKey=ab;m.isModifierKey=od;m.keyName=pd;m.fromTextArea=function(a,b){function c(){a.value=l.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=d==a||null!= a.getAttribute("autofocus")&&d==document.body}if(a.form&&(v(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){c();f.submit=g;f.submit();f.submit=h}}catch(k){}}a.style.display="none";var l=m(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);l.save=c;l.getTextArea=function(){return a};l.toTextArea=function(){c();a.parentNode.removeChild(l.getWrapperElement());a.style.display="";a.form&&(aa(a.form,"submit",c),"function"==typeof a.form.submit&& (a.form.submit=g))};return l};db.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a= this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=xa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue},indentation:function(){return xa(this.string, null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};m.StringStream=db;m.TextMarker=ga;Ha(ga);ga.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm, b=a&&!a.curOp;b&&za(a);if(ba(this,"clear")){var c=this.find();c&&M(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=gb(f.markedSpans,this);null!=g.to&&(d=P(f));for(var h=f,k=f.markedSpans,l=g,n=void 0,m=0;m<k.length;++m)k[m]!=l&&(n||(n=[])).push(k[m]);h.markedSpans=n;null!=g.from?c=P(f):this.collapsed&&!ia(this.doc,f)&&a&&R(f,sa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=$(a.doc,this.lines[e]),g=mb(a.doc, f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&D(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&yd(a));b&&Aa(a)}};ga.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=gb(d.markedSpans,this);if(null!=e.from||null!=e.to)d=P(d),null!=e.from&&(a=r(d,e.from)),null!=e.to&&(b=r(d,e.to))}return"bookmark"==this.type?a:a&&{from:a,to:b}}; ga.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=u(this.doc,a.line);ge(b,c);if(a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(a=b.display.lineDiv.firstChild;a;a=a.nextSibling)if(a.lineObj==c){a.offsetHeight!=c.height&&R(c,a.offsetHeight);break}qc(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}};ga.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp; b.maybeHiddenMarkers&&-1!=ca(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ga.prototype.detachLine=function(a){this.lines.splice(ca(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};m.SharedTextMarker=fb;Ha(fb);fb.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear(); M(this,"clear")}};fb.prototype.find=function(){return this.primary.find()};var Kb=m.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Ha(Kb);Kb.prototype.clear=Fd(function(){var a=this.line.widgets,b=P(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);a=Qa(this.cm,this.line)<this.cm.doc.scrollTop;R(this.line,Math.max(0,this.line.height-tb(this)));a&&Gc(this.cm,0,-this.height); D(this.cm,b,b+1)}});Kb.prototype.changed=Fd(function(){var a=this.height;this.height=null;if(a=tb(this)-a)R(this.line,this.line.height+a),a=P(this.line),D(this.cm,a,a+1)});var Ga=m.Line=function(a,b,c){this.text=a;Ed(this,b);this.height=c?c(this):1};Ha(Ga);var Jd={},Jc=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;Mb.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Dd(f); M(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};hb.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize(); if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(c=[],this.collapse(c),this.children=[new Mb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize(); if(a<=g){f.insertInner(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new Mb(a),f.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new hb(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=ca(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new hb(a.children),c.parent= a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};var He=0,I=m.Doc=function(a,b,c){if(!(this instanceof I))return new I(a,b,c);null==c&&(c=0);hb.call(this,[new Mb([new Ga("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=Nb(); this.cleanGeneration=1;this.frontier=c;c=r(c,0);this.sel={from:c,to:c,head:c,anchor:c,shift:!1,extend:!1,goalColumn:null};this.id=++He;this.modeOption=b;"string"==typeof a&&(a=ka(a));Fc(this,{from:c,to:c,text:a},null,{head:c,anchor:c})};I.prototype=Pd(hb.prototype,{constructor:I,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a, b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Kc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:function(a){var b=r(this.first,0),c=this.first+this.size-1;Ca(this,{from:b,to:r(c,u(this,c).text.length),text:ka(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=s(this,b);c=c?s(this,c):b;fa(this,a,b,c,d)},getRange:function(a,b,c){a=Ec(this,s(this,a),s(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&& a.text},setLine:function(a,b){Fa(this,a)&&fa(this,b,r(a,0),s(this,r(a)))},removeLine:function(a){a?fa(this,"",s(this,r(a-1)),s(this,r(a))):fa(this,"",r(0,0),s(this,r(1,0)))},getLineHandle:function(a){if(Fa(this,a))return u(this,a)},getLineNumber:function(a){return P(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=u(this,a));return $(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return s(this, a)},getCursor:function(a){var b=this.sel;return ma(null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from)},somethingSelected:function(){return!x(this.sel.head,this.sel.anchor)},setCursor:Ta(function(a,b,c){a=s(this,"number"==typeof a?r(a,b||0):a);c?F(this,a):ea(this,a,a)}),setSelection:Ta(function(a,b,c){ea(this,s(this,a),s(this,b||a),c)}),extendSelection:Ta(function(a,b,c){F(this,s(this,a),b&&s(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to, a)},replaceSelection:function(a,b,c){Ca(this,{from:this.sel.from,to:this.sel.to,text:ka(a),origin:c},b||"around")},undo:Ta(function(){vd(this,"undo")}),redo:Ta(function(){vd(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=Nb(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){this.history.lastOp= this.history.lastOrigin=null;return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ob(this.history.done),undone:Ob(this.history.undone)}},setHistory:function(a){var b=this.history=Nb(this.history.maxGeneration);b.done=a.done.slice(0);b.undone=a.undone.slice(0)},markText:function(a,b,c){return eb(this,s(this,a),s(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget: b),insertLeft:b&&b.insertLeft};a=s(this,a);return eb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=s(this,a);var b=[],c=u(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d= d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return s(this,r(c,b))},indexFromPos:function(a){a=s(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new I(Kc(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn}; a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new I(Kc(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];return b},unlinkDoc:function(a){a instanceof m&&(a=a.doc);if(this.linked)for(var b= 0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);break}if(a.history==this.history){var c=[a.id];Ea(a,function(a){c.push(a.id)},!0);a.history=Nb();a.history.done=Ob(this.history.done,c);a.history.undone=Ob(this.history.undone,c)}},iterLinkedDocs:function(a){Ea(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});I.prototype.eachLine=I.prototype.iter;var Ie=["iter","insert","remove","copy","getEditor"],lb;for(lb in I.prototype)I.prototype.hasOwnProperty(lb)&& 0>ca(Ie,lb)&&(m.prototype[lb]=function(a){return function(){return a.apply(this.doc,arguments)}}(I.prototype[lb]));Ha(I);m.e_stop=Ya;m.e_preventDefault=A;m.e_stopPropagation=Od;var da,xb=0;m.on=v;m.off=aa;m.signal=J;var qa=30,kd=m.Pass={toString:function(){return"CodeMirror.Pass"}};Ub.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};m.countColumn=xa;var Qb=[""],Ce=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,pc=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/; m.replaceGetRect=function(a){y=a};var qe=function(){if(Q)return!1;var a=p("div");return"draggable"in a||"dragDrop"in a}();Da?Lb=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:uc&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?Lb=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:K&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(Lb=function(a,b){if(1<b&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0; if(2<b&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var Wa,Lc,ka=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)}; m.splitLines=ka;var le=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},cd=function(){var a=p("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),na={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc", 32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};m.keyNames=na;(function(){for(var a=0;10>a;a++)na[a+48]=String(a);for(a=65;90>= a;a++)na[a]=String.fromCharCode(a);for(a=1;12>=a;a++)na[a+111]=na[a+63235]="F"+a})();var ya,ze=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr", d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,n=[],m=0,q;m<c;++m)n.push(a(b.charCodeAt(m)));for(var m=0,p="L";m<c;++m)q=n[m],"m"==q?n[m]=p:p=q;m=0;for(p="L";m<c;++m)q=n[m],"1"==q&&"r"==p?n[m]="n":f.test(q)&&(p=q,"r"==q&&(n[m]="R"));m=1;for(p=n[0];m<c-1;++m)q=n[m],"+"==q&&"1"==p&&"1"==n[m+1]?n[m]="1":","!=q||p!=n[m+1]||"1"!=p&&"n"!=p||(n[m]=p),p=q;for(m=0;m<c;++m)if(q=n[m],","==q)n[m]="N";else if("%"== q){for(p=m+1;p<c&&"%"==n[p];++p);var r=m&&"!"==n[m-1]||p<c-1&&"1"==n[p]?"1":"N";for(q=m;q<p;++q)n[q]=r;m=p-1}m=0;for(p="L";m<c;++m)q=n[m],"L"==p&&"1"==q?n[m]="L":f.test(q)&&(p=q);for(m=0;m<c;++m)if(e.test(n[m])){for(p=m+1;p<c&&e.test(n[p]);++p);q="L"==(p<c-1?n[p]:"L");r="L"==(m?n[m-1]:"L")||q?"L":"R";for(q=m;q<p;++q)n[q]=r;m=p-1}for(var p=[],s,m=0;m<c;)if(g.test(n[m])){q=m;for(++m;m<c&&g.test(n[m]);++m);p.push({from:q,to:m,level:0})}else{var t=m,r=p.length;for(++m;m<c&&"L"!=n[m];++m);for(q=t;q<m;)if(h.test(n[q])){t< q&&p.splice(r,0,{from:t,to:q,level:1});t=q;for(++q;q<m&&h.test(n[q]);++q);p.splice(r,0,{from:t,to:q,level:2});t=q}else++q;t<m&&p.splice(r,0,{from:t,to:m,level:1})}1==p[0].level&&(s=b.match(/^\s+/))&&(p[0].from=s[0].length,p.unshift({from:0,to:s[0].length,level:0}));1==L(p).level&&(s=b.match(/\s+$/))&&(L(p).to-=s[0].length,p.push({from:c-s[0].length,to:c,level:0}));p[0].level!=L(p).level&&p.push({from:c,to:c,level:p[0].level});return p}}();m.version="3.16.0";return m}();
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+jQuery(document).ready(function() {
+
+ /**
+ * Highlight the specified DOM area
+ *
+ * @param {String} selector
+ * @param {String} status
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+ function highlight(selector, status) {
+ if (status === 'success') {
+ jQuery(selector).effect("highlight", {
+ color: '#98CE90'
+ }, 3000);
+ } else {
+ jQuery(selector).effect("highlight", {
+ color: '#FFAAAA'
+ }, 3000);
+ }
+ }
+
+ var editor = CodeMirror.fromTextArea(
+ document.getElementById("configpress"), {}
+ );
+
+ jQuery('#save_config').bind('click', function(event) {
+ event.preventDefault();
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: {
+ action: 'aam',
+ sub_action: 'saveConfigpress',
+ config: editor.getValue(),
+ _ajax_nonce: aamLocal.nonce
+ },
+ success: function(response) {
+ highlight('#control_panel', response.status);
+ },
+ error: function() {
+ highlight('#control_panel', 'failure');
+ }
+ });
+ });
+
+ jQuery('#info_screen').bind('click', function(event){
+ event.preventDefault();
+ jQuery('#configpress_area').hide();
+ jQuery('#configpress_info').show();
+ jQuery(this).hide();
+ jQuery('#configpress_screen').show();
+ });
+
+ jQuery('#configpress_screen').bind('click', function(event){
+ event.preventDefault();
+ jQuery('#configpress_area').show();
+ jQuery('#configpress_info').hide();
+ jQuery(this).hide();
+ jQuery('#info_screen').show();
+ });
+});
\ No newline at end of file
--- /dev/null
+/**
+ * ======================================================================
+ * LICENSE: This file is subject to the terms and conditions defined in *
+ * file 'license.txt', which is part of this source code package. *
+ * ======================================================================
+ */
+
+jQuery(document).ready(function() {
+ jQuery('#extension_list').dataTable({
+ sDom: "<'top'f<'clear'>>t<'footer'p<'clear'>>",
+ //bProcessing : false,
+ bStateSave: true,
+ sPaginationType: "full_numbers",
+ bAutoWidth: false,
+ bSort: false,
+ oLanguage: {
+ "sSearch": "",
+ "oPaginate": {
+ "sFirst": "≪",
+ "sLast": "≫",
+ "sNext": ">",
+ "sPrevious": "<"
+ }
+ },
+ fnDrawCallback: function() {
+ jQuery('.add-license-btn').each(function() {
+ var link = jQuery(this).attr('link');
+ var extension = jQuery(this).attr('extension');
+
+ jQuery(this).bind('click', function(event) {
+ event.preventDefault();
+
+ jQuery('.license-error-list').hide();
+ //show the dialog
+ jQuery('#install_license').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '30%',
+ modal: true,
+ buttons: [
+ {
+ text: 'Purchase',
+ icons: {primary: "ui-icon-cart"},
+ click: function() {
+ window.open(link, '_blank');
+ }
+ },
+ {
+ text: 'Install',
+ icons: {primary: "ui-icon-check"},
+ click: function() {
+ var license = jQuery.trim(
+ jQuery('#license_key').val()
+ );
+
+ if (license) {
+ //add loader
+ jQuery('#install_license').append(jQuery('<div/>', {
+ 'class' : 'loading-extension'
+ }));
+
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: {
+ action: 'aam',
+ sub_action: 'installLicense',
+ extension: extension,
+ license: license,
+ _ajax_nonce: aamLocal.nonce
+ },
+ success: function(response) {
+ if (response.status === 'success') {
+ location.reload();
+ } else {
+ showErrorMessage(
+ response.reasons,
+ '#install_license .license-error-list'
+ );
+ jQuery('#license_key').effect('highlight', 2000);
+ }
+ },
+ error: function() {
+ var reasons = new Array();
+ reasons.push('Unexpected Application Error');
+ showErrorMessage(
+ reasons,
+ '#install_license .license-error-list'
+ );
+ jQuery('#license_key').effect('highlight', 2000);
+ },
+ complete: function(){
+ jQuery('.loading-extension', '#install_license').remove();
+ }
+ });
+ } else {
+ jQuery('#license_key').effect('highlight', 2000);
+ }
+ }
+ },
+ {
+ text: 'Close',
+ icons: {primary: "ui-icon-close"},
+ click: function() {
+ jQuery(this).dialog('close');
+ }
+ }
+ ]
+ });
+ });
+ });
+ jQuery('.view-license-btn').each(function() {
+ jQuery(this).bind('click', function(event) {
+ event.preventDefault();
+
+ var license = jQuery(this).attr('license');
+ var extension = jQuery(this).attr('extension');
+ var dialog = this;
+
+ jQuery('#installed_license_key').html(
+ (license ? license : 'undefined')
+ );
+ jQuery('.license-error-list').hide();
+
+ //show the dialog
+ jQuery('#update_license').dialog({
+ resizable: false,
+ height: 'auto',
+ width: '25%',
+ modal: true,
+ buttons: [
+ {
+ text: 'Remove',
+ icons: {primary: "ui-icon-trash"},
+ click: function() {
+ jQuery.ajax(aamLocal.ajaxurl, {
+ type: 'POST',
+ dataType: 'json',
+ data: {
+ action: 'aam',
+ sub_action: 'removeLicense',
+ extension: extension,
+ license: license,
+ _ajax_nonce: aamLocal.nonce
+ },
+ success: function(response) {
+ if (response.status === 'success') {
+ location.reload();
+ } else {
+ showErrorMessage(
+ response.reasons,
+ '#update_license .license-error-list'
+ );
+ jQuery(dialog).dialog('close');
+ }
+ },
+ complete: function() {
+ jQuery(dialog).dialog('close');
+ }
+ });
+ }
+ },
+ {
+ text: 'Close',
+ icons: {primary: "ui-icon-close"},
+ click: function() {
+ jQuery(this).dialog('close');
+ }
+ }
+ ]
+ });
+ });
+ });
+ }
+ });
+
+ initTooltip('#aam');
+
+});
+
+/**
+ * Initialize tooltip for selected area
+ *
+ * @param {String} selector
+ *
+ * @returns {void}
+ *
+ * @access public
+ */
+function initTooltip(selector) {
+ jQuery('[tooltip]', selector).hover(function() {
+ // Hover over code
+ var title = jQuery(this).attr('tooltip');
+ jQuery(this).data('tipText', title).removeAttr('tooltip');
+ jQuery('<div/>', {
+ 'class': 'aam-tooltip'
+ }).text(title).appendTo('body').fadeIn('slow');
+ }, function() {
+ //Hover out code
+ jQuery(this).attr('tooltip', jQuery(this).data('tipText'));
+ jQuery('.aam-tooltip').remove();
+ }).mousemove(function(e) {
+ jQuery('.aam-tooltip').css({
+ top: e.pageY + 15, //Get Y coordinates
+ left: e.pageX + 15 //Get X coordinates
+ });
+ });
+}
+
+/**
+ * Display error list
+ *
+ * @param {Array} reasons
+ *
+ * @returns void
+ */
+function showErrorMessage(reasons, container){
+ jQuery(container).empty();
+ for(var i in reasons){
+ jQuery(container).append(jQuery('<li/>').html(reasons[i]));
+ }
+ jQuery(container).show();
+}
\ No newline at end of file
--- /dev/null
+/*
+ * File: jquery.dataTables.min.js
+ * Version: 1.9.4
+ * Author: Allan Jardine (www.sprymedia.co.uk)
+ * Info: www.datatables.net
+ *
+ * Copyright 2008-2012 Allan Jardine, all rights reserved.
+ *
+ * This source file is free software, under either the GPL v2 license or a
+ * BSD style license, available at:
+ * http://datatables.net/license_gpl2
+ * http://datatables.net/license_bsd
+ *
+ * This source file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
+ */
+(function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
+c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;m(a,d,null)}function m(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),h.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var i=d.mRender?Q(d.mRender):null,f=Q(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData=
+L(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==
+h.inArray("asc",d.asSorting)&&-1!=h.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;da(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=r(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function R(a,b){var c=r(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function t(a){return r(a,"bVisible").length}
+function r(a,b){var c=[];h.map(a.aoColumns,function(a,i){a[b]&&c.push(i)});return c}function B(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var i=b[d](a);if(null!==i)return i}return"string"}function u(a,b){for(var c=b.split(","),d=[],i=0,f=a.aoColumns.length;i<f;i++)for(var g=0;g<f;g++)if(a.aoColumns[i].sName==c[g]){d.push(g);break}return d}function M(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ta(a,b,c,d){var i,f,
+g,e,w;if(b)for(i=b.length-1;0<=i;i--){var j=b[i].aTargets;h.isArray(j)||D(a,1,"aTargets must be an array of targets, not a "+typeof j);f=0;for(g=j.length;f<g;f++)if("number"===typeof j[f]&&0<=j[f]){for(;a.aoColumns.length<=j[f];)o(a);d(j[f],b[i])}else if("number"===typeof j[f]&&0>j[f])d(a.aoColumns.length+j[f],b[i]);else if("string"===typeof j[f]){e=0;for(w=a.aoColumns.length;e<w;e++)("_all"==j[f]||h(a.aoColumns[e].nTh).hasClass(j[f]))&&d(e,b[i])}}if(c){i=0;for(a=c.length;i<a;i++)d(i,c[i])}}function H(a,
+b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=a.aoData.length,i=h.extend(!0,{},j.models.oRow);i._aData=c;a.aoData.push(i);for(var f,i=0,g=a.aoColumns.length;i<g;i++)c=a.aoColumns[i],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?F(a,d,i,S(a,d,i)):F(a,d,i,v(a,d,i)),c._bAutoType&&"string"!=c.sType&&(f=v(a,d,i,"type"),null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ea(a,
+d);return d}function ua(a){var b,c,d,i,f,g,e;if(a.bDeferLoading||null===a.sAjaxSource)for(b=a.nTBody.firstChild;b;){if("TR"==b.nodeName.toUpperCase()){c=a.aoData.length;b._DT_RowIndex=c;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:b}));a.aiDisplayMaster.push(c);f=b.firstChild;for(d=0;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)F(a,c,d,h.trim(f.innerHTML)),d++;f=f.nextSibling}}b=b.nextSibling}i=T(a);d=[];b=0;for(c=i.length;b<c;b++)for(f=i[b].firstChild;f;)g=f.nodeName.toUpperCase(),("TD"==
+g||"TH"==g)&&d.push(f),f=f.nextSibling;c=0;for(i=a.aoColumns.length;c<i;c++){e=a.aoColumns[c];null===e.sTitle&&(e.sTitle=e.nTh.innerHTML);var w=e._bAutoType,o="function"===typeof e.fnRender,k=null!==e.sClass,n=e.bVisible,m,p;if(w||o||k||!n){g=0;for(b=a.aoData.length;g<b;g++)f=a.aoData[g],m=d[g*i+c],w&&"string"!=e.sType&&(p=v(a,g,c,"type"),""!==p&&(p=B(p),null===e.sType?e.sType=p:e.sType!=p&&"html"!=e.sType&&(e.sType="string"))),e.mRender?m.innerHTML=v(a,g,c,"display"):e.mData!==c&&(m.innerHTML=v(a,
+g,c,"display")),o&&(p=S(a,g,c),m.innerHTML=p,e.bUseRendered&&F(a,g,c,p)),k&&(m.className+=" "+e.sClass),n?f._anHidden[c]=null:(f._anHidden[c]=m,m.parentNode.removeChild(m)),e.fnCreatedCell&&e.fnCreatedCell.call(a.oInstance,m,v(a,g,c,"display"),f._aData,g,c)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)f=a.aoData[b],A(a,"aoRowCreatedCallback",null,[f.nTr,f._aData,b])}}function I(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function fa(a,b,c){for(var b=J(a,b),d=0,a=
+a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var i=[],f=0,g=d.length;f<g;f++)i.push(v(a,b,d[f],c));return i}function v(a,b,c,d){var i=a.aoColumns[c];if((c=i.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===i.sDefaultContent&&(D(a,0,"Requested unknown parameter "+("function"==typeof i.mData?"{mData function}":"'"+i.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),i.sDefaultContent;if(null===c&&null!==i.sDefaultContent)c=
+i.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function F(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Q(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,i){return a(b,d,i)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var f=i.split("."),g;if(""!==i){var e=0;for(g=f.length;e<g;e++){if(i=f[e].match(U)){f[e]=f[e].replace(U,"");""!==f[e]&&(a=a[f[e]]);
+g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,h=a.length;e<h;e++)g.push(b(a[e],d,f));a=i[0].substring(1,i[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function L(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var i=i.split("."),f,g,e=0;for(g=
+i.length-1;e<g;e++){if(f=i[e].match(U)){i[e]=i[e].replace(U,"");a[i[e]]=[];f=i.slice();f.splice(0,e+1);g=f.join(".");for(var h=0,j=d.length;h<j;h++)f={},b(f,d[h],g),a[i[e]].push(f);return}if(null===a[i[e]]||a[i[e]]===n)a[i[e]]={};a=a[i[e]]}a[i[i.length-1].replace(U,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ga(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,
+a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);y(a)}function ha(a,b){for(var c=-1,d=0,i=a.length;d<i;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function S(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},v(a,b,c,"display"))}function ea(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&
+(c.nTr.className=c._aData.DT_RowClass);for(var i=0,f=a.aoColumns.length;i<f;i++){var g=a.aoColumns[i];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?S(a,b,i):v(a,b,i,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[i]=null):c._anHidden[i]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,v(a,b,i,"display"),c._aData,b,i)}A(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,
+c,d;if(0!==h("th, td",a.nTHead).length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var i=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,
+c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),i.appendChild(c);h(a.nTHead).html("")[0].appendChild(i);V(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;i=l.createElement("div");i.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(i);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;i.appendChild(f);c.appendChild(i)}}if(a.oFeatures.bSort)for(b=
+0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ia(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=N(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass))}}function W(a,b,c){var d,i,f,g=[],e=[],h=a.aoColumns.length,j;c===n&&(c=!1);d=0;for(i=
+b.length;d<i;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=h-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(i=g.length;d<i;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(j=h=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+h]!==n&&g[d][f].cell==g[d+h][f].cell;)e[d+h][f]=1,h++;for(;g[d][f+j]!==n&&g[d][f].cell==g[d][f+j].cell;){for(c=0;c<h;c++)e[d+c][f+j]=1;j++}g[d][f].cell.rowSpan=h;g[d][f].cell.colSpan=j}}}function x(a){var b=
+A(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))E(a,!1);else{var c,d,b=[],i=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,y(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g=
+a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&ea(a,a.aiDisplay[g]);var j=e.nTr;if(0!==f){var o=a.asStripeClasses[i%f];e._sRowStripe!=o&&(h(j).removeClass(e._sRowStripe).addClass(o),e._sRowStripe=o)}A(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[g]]._aData,i,g]);b.push(j);i++;if(0!==c)for(e=0;e<c;e++)if(j==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&&
+(b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=t(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ja(a,f),b[i].appendChild(c);A(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);A(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],
+Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);i=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)i.appendChild(b[c]);a.nTBody.appendChild(i);null!==f&&f.appendChild(a.nTBody)}A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(E(a,!1),
+a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?O(a,a.oPreviousSearch):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(y(a),x(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),i,f,g,e,w,o,k,m=0;m<d.length;m++){f=0;g=d[m];if("<"==g){e=h("<div></div>")[0];w=d[m+
+1];if("'"==w||'"'==w){o="";for(k=2;d[m+k]!=w;)o+=d[m+k],k++;"H"==o?o=a.oClasses.sJUIHeader:"F"==o&&(o=a.oClasses.sJUIFooter);-1!=o.indexOf(".")?(w=o.split("."),e.id=w[0].substr(1,w[0].length-1),e.className=w[1]):"#"==o.charAt(0)?e.id=o.substr(1,o.length-1):e.className=o;m+=k}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)i=ya(a),f=1;else if("f"==g&&a.oFeatures.bFilter)i=za(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)i=Aa(a),f=
+1;else if("t"==g)i=Ba(a),f=1;else if("i"==g&&a.oFeatures.bInfo)i=Ca(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)i=Da(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;k=0;for(w=e.length;k<w;k++)if(g==e[k].cFeature){(i=e[k].fnInit(a))&&(f=1);break}}1==f&&null!==i&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(i),c.appendChild(i))}b.parentNode.replaceChild(a.nTableWrapper,b)}function V(a,b){var c=h(b).children("tr"),d,i,f,g,e,j,o,k,m,p;a.splice(0,a.length);
+f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(i=d.firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){k=1*i.getAttribute("colspan");m=1*i.getAttribute("rowspan");k=!k||0===k||1===k?1:k;m=!m||0===m||1===m?1:m;g=0;for(e=a[f];e[g];)g++;o=g;p=1===k?!0:!1;for(e=0;e<k;e++)for(g=0;g<m;g++)a[f+g][o+e]={cell:i,unique:p},a[f+g].nTr=d}i=i.nextSibling}}}function N(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],V(c,b)));for(var b=0,i=c.length;b<i;b++)for(var f=
+0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;E(a,!0);var b=Ea(a);ka(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,i,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:M(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",
+value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mData,c.push({name:"mDataProp_"+f,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!==
+a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){i=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<i.length;g++)c.push({name:"iSortCol_"+e,value:i[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ka(a,b){A(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho<
+a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ga(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=M(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=u(a,b.sColumns));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0,j=a.aoColumns.length;h<j;h++)e.push(i[f][d[h]]);H(a,e)}else H(a,i[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;x(a);a.bAjaxDataGet=
+!0;E(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"""));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value,
+g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&K(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function K(a,b,c){var d=a.oPreviousSearch,i=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);
+else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,i[b].sSearch,b,i[b].bRegex,i[b].bSmart,i[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;y(a);x(a);la(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=r(a,"bSearchable"),d=0,i=b.length;d<i;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var h=a.aiDisplay[g-f];b[d](a,Y(a,h,"filter",c),h)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c,
+d,i,f){if(""!==b)for(var g=0,b=ma(b,d,i,f),d=a.aiDisplay.length-1;0<=d;d--)i=Ja(v(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(i)||(a.aiDisplay.splice(d,1),g++)}function Ga(a,b,c,d,i,f){d=ma(b,d,i,f);i=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||i.sSearch.length>b.length||1==c||0!==b.indexOf(i.sSearch)){a.aiDisplay.splice(0,
+a.aiDisplay.length);la(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function la(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=r(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,i=0,f=d.length;i<f;i++)a.asDataSearch[i]=na(a,Y(a,d[i],"filter",c))}}function na(a,b){var c=b.join(" ");-1!==c.indexOf("&")&&(c=h("<div>").html(c).text());
+return c.replace(/[\n\r]/g," ")}function ma(a,b,c,d){if(c)return a=b?a.split(" "):oa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:oa(a);return RegExp(a,d?"i":"")}function Ja(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function oa(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),
+"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ka,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ka(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),i=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f?b.sInfoEmpty:b.sInfo;f!=i&&(g+=" "+b.sInfoFiltered);g+=b.sInfoPostFix;g=ja(a,g);
+null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,i,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(g)}}function ja(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),i=a.fnRecordsDisplay(),i=a.fnFormatNumber(i),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace(/_START_/g,c).replace(/_END_/g,d).replace(/_TOTAL_/g,i).replace(/_MAX_/g,f)}function ba(a){var b,c,d=a.iInitDisplayStart;
+if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{xa(a);va(a);W(a,a.aoHeader);a.nTFoot&&W(a,a.aoFooter);E(a,!0);a.oFeatures.bAutoWidth&&da(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?O(a):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),y(a),x(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ka(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource,
+c,function(c){var f=a.sAjaxDataProp!==""?Q(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();y(a);x(a)}E(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(E(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;A(a,"aoInitComplete","init",[a,b])}function pa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&
+(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,i=a.aLengthMenu;if(2==i.length&&"object"===typeof i[0]&&"object"===typeof i[1]){c=0;for(d=i[0].length;c<d;c++)b+='<option value="'+i[0][c]+'">'+i[1][c]+"</option>"}else{c=0;for(d=i.length;c<d;c++)b+='<option value="'+i[c]+'">'+i[c]+"</option>"}b+="</select>";i=l.createElement("div");a.aanFeatures.l||
+(i.id=a.sTableId+"_length");i.className=a.oClasses.sLength;i.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',i).attr("selected",!0);h("select",i).bind("change.DT",function(){var b=h(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;c<d;c++)i[c]!=this.parentNode&&h("select",i[c]).val(b);a._iDisplayLength=parseInt(b,10);y(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<
+0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;x(a)});h("select",i).attr("aria-controls",a.sTableId);return i}function y(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a,
+b,function(a){y(a);x(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){y(a);x(a)})},sName:"pagination"});return b}function qa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=
+0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else D(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+
+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function E(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,i=c.length;d<i;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),i=l.createElement("div"),f=l.createElement("div"),
+g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),o=a.nTable.getElementsByTagName("thead")[0],k=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(g);i.appendChild(a.nTable);b.appendChild(c);b.appendChild(i);d.appendChild(e);e.appendChild(o);null!==k&&(b.appendChild(f),g.appendChild(j),j.appendChild(k));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner;
+i.className=m.sScrollBody;f.className=m.sScrollFoot;g.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",i.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==k&&(j.removeAttribute("id"),j.style.marginLeft="0");d=h(a.nTable).children("caption");0<
+d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&k&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),i.style.width=q(a.oScroll.sX),null!==k&&(f.style.width=q(a.oScroll.sX)),h(i).scroll(function(){c.scrollLeft=this.scrollLeft;if(k!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(i.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:La,sName:"scrolling"});a.oScroll.bInfinite&&h(i).scroll(function(){if(!a.bDrawing&&h(this).scrollTop()!==
+0&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){qa(a,"next");y(a);x(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function La(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,i,f,g,e,j,o,k,m,p=[],n=[],l=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,R=null!==a.nTFoot?l.getElementsByTagName("table")[0]:null,r=a.oBrowser.bScrollOversize,s=function(a){k=
+a.style;k.paddingTop="0";k.paddingBottom="0";k.borderTopWidth="0";k.borderBottomWidth="0";k.height=0};h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);g=a.nTHead.getElementsByTagName("tr");e=i.getElementsByTagName("tr");null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]),o=a.nTFoot.getElementsByTagName("tr"),j=j.getElementsByTagName("tr"));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width=
+"100%");var t=N(a,i);i=0;for(f=t.length;i<f;i++)m=G(a,i),t[i].style.width=a.aoColumns[m].sWidth;null!==a.nTFoot&&C(function(a){a.style.width=""},j);a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");i=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",r&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=
+q(a.oScroll.sXInner):i==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=q(i-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>i-a.oScroll.iBarWidth&&(a.nTable.style.width=q(i))):a.nTable.style.width=q(i);i=h(a.nTable).outerWidth();C(s,e);C(function(a){p.push(q(h(a).width()))},e);C(function(a,b){a.style.width=p[b]},g);h(e).height(0);null!==a.nTFoot&&(C(s,j),C(function(a){n.push(q(h(a).width()))},j),C(function(a,b){a.style.width=n[b]},o),h(j).height(0));C(function(a,b){a.innerHTML=
+"";a.style.width=p[b]},e);null!==a.nTFoot&&C(function(a,b){a.innerHTML="";a.style.width=n[b]},j);if(h(a.nTable).outerWidth()<i){g=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?i+a.oScroll.iBarWidth:i;if(r&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(g-a.oScroll.iBarWidth);d.style.width=q(g);a.nScrollHead.style.width=q(g);null!==a.nTFoot&&(a.nScrollFoot.style.width=q(g));""===a.oScroll.sX?D(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):
+""!==a.oScroll.sXInner&&D(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),a.nScrollHead.style.width=q("100%"),null!==a.nTFoot&&(a.nScrollFoot.style.width=q("100%"));""===a.oScroll.sY&&r&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),r=""!==a.oScroll.sX&&a.nTable.offsetWidth>
+d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+r)));r=h(a.nTable).outerWidth();c.style.width=q(r);b.style.width=q(r);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(R.style.width=q(r),l.style.width=q(r),l.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function C(a,b,c){for(var d=
+0,i=0,f=b.length,g,e;i<f;){g=b[i].firstChild;for(e=c?c[i].firstChild:null;g;)1===g.nodeType&&(c?a(g,e,d):a(g,d),d++),g=g.nextSibling,e=c?e.nextSibling:null;i++}}function Ma(a,b){if(!a||null===a||""===a)return 0;b||(b=l.body);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function da(a){var b=0,c,d=0,i=a.aoColumns.length,f,e,j=h("th",a.nTHead),o=a.nTable.getAttribute("width");e=a.nTable.parentNode;for(f=0;f<i;f++)a.aoColumns[f].bVisible&&
+(d++,null!==a.aoColumns[f].sWidth&&(c=Ma(a.aoColumns[f].sWidthOrig,e),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(i==j.length&&0===b&&d==i&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=h(j[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),C(function(a){a.style.width=
+""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));j=N(a,f);for(f=d=0;f<i;f++){var k=a.aoColumns[f];k.bVisible&&null!==k.sWidthOrig&&""!==k.sWidthOrig?j[f-d].style.width=q(k.sWidthOrig):k.bVisible?j[f-d].style.width="":d++}for(f=0;f<i;f++)a.aoColumns[f].bVisible&&(d=Na(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));e.appendChild(b);
+""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<e.offsetWidth&&(b.style.width=q(e.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(e.offsetWidth):o&&(b.style.width=q(o));b.style.visibility="hidden";Oa(a,b);i=h("tbody tr:eq(0)",b).children();0===i.length&&(i=N(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=e=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=null===a.aoColumns[f].sWidthOrig?e+h(i[d]).outerWidth():
+e+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(h(i[d]).outerWidth()-h(i[d]).width())),d++);b.style.width=q(e);a.nTable.style.width=q(e)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=h(i[d]).width(),null!==e&&0<e&&(a.aoColumns[f].sWidth=q(e)),d++);i=h(b).css("width");a.nTable.style.width=-1!==i.indexOf("%")?i:q(h(b).outerWidth());b.parentNode.removeChild(b)}o&&(a.nTable.style.width=q(o))}function Oa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=q(h(b).outerWidth()-
+a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(h(b).outerWidth()))}function Na(a,b){var c=Pa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=v(a,c,b,"");return d}return J(a,c)[b]}function Pa(a,b){for(var c=-1,d=-1,i=0;i<a.aoData.length;i++){var e=v(a,i,b,"display")+"",e=e.replace(/<.*?>/g,"");e.length>c&&(c=e.length,d=i)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);
+return 48>b||57<b?a:a+"px"}function Qa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function O(a,b){var c,d,i,e,g,k,o=[],m=[],p=
+j.ext.oSort,l=a.aoData,q=a.aoColumns,G=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],i=R(a,d),e=a.aoColumns[d].sSortDataType,j.ext.afnSortData[e])if(g=j.ext.afnSortData[e].call(a.oInstance,a,d,i),g.length===l.length){i=0;for(e=l.length;i<e;i++)F(a,i,d,g[i])}else D(a,0,"Returned data sort array (col "+d+") is the wrong length");c=
+0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var r=o.length,s;c=0;for(d=l.length;c<d;c++)for(i=0;i<r;i++){s=q[o[i][0]].aDataSort;g=0;for(k=s.length;g<k;g++)e=q[s[g]].sType,e=p[(e?e:"string")+"-pre"],l[c]._aSortData[s[g]]=e?e(v(a,c,s[g],"sort")):v(a,c,s[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,e,i,f;for(c=0;c<r;c++){f=q[o[c][0]].aDataSort;d=0;for(e=f.length;d<e;d++)if(i=q[f[d]].sType,i=p[(i?i:"string")+"-"+o[c][1]](l[a]._aSortData[f[d]],l[b]._aSortData[f[d]]),0!==
+i)return i}return p["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&P(a);c=0;for(d=a.aoColumns.length;c<d;c++)e=q[c].sTitle.replace(/<.*?>/g,""),i=q[c].nTh,i.removeAttribute("aria-sort"),i.removeAttribute("aria-label"),q[c].bSortable?0<o.length&&o[0][0]==c?(i.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),i.setAttribute("aria-label",e+("asc"==(q[c].asSorting[o[0][2]+1]?q[c].asSorting[o[0][2]+1]:q[c].asSorting[0])?G.sSortAscending:G.sSortDescending))):i.setAttribute("aria-label",
+e+("asc"==q[c].asSorting[0]?G.sSortAscending:G.sSortDescending)):i.setAttribute("aria-label",e);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?K(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,y(a),x(a))}function ia(a,b,c,d){Ra(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var e=function(){var d,e;if(b.shiftKey){for(var f=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){f=!0;d=a.aaSorting[h][0];e=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[e]?
+(a.aaSorting[h][1]=a.aoColumns[d].asSorting[e],a.aaSorting[h][2]=e):a.aaSorting.splice(h,1);break}!1===f&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));O(a)};a.oFeatures.bProcessing?(E(a,!0),setTimeout(function(){e();
+a.oFeatures.bServerSide||E(a,!1)},0)):e();"function"==typeof d&&d(a)}})}function P(a){var b,c,d,e,f,g=a.aoColumns.length,j=a.oClasses;for(b=0;b<g;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);c=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;e=-1;for(d=0;d<c.length;d++)if(c[d][0]==b){f="asc"==c[d][1]?
+j.sSortAsc:j.sSortDesc;e=d;break}h(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(f=h("span."+j.sSortIcon,a.aoColumns[b].nTh),f.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),f.addClass(-1==e?a.aoColumns[b].sSortingClassJUI:"asc"==c[e][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){a=J(a);e=[];for(b=0;b<g;b++)e.push("");b=0;
+for(d=1;b<c.length;b++)j=parseInt(c[b][0],10),e[j]=f+d,3>d&&d++;f=RegExp(f+"[123]");var o;b=0;for(c=a.length;b<c;b++)j=b%g,d=a[b].className,o=e[j],j=d.replace(f,o),j!=d?a[b].className=h.trim(j):0<o.length&&-1==d.indexOf(o)&&(a[b].className=d+" "+o)}}function ra(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),
+oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);A(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Sa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=A(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=
+c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];A(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function s(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function T(a){for(var b=
+[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function J(a,b){var c=[],d,e,f,g,h,j;e=0;var o=a.aoData.length;b!==n&&(e=b,o=b+1);for(f=e;f<o;f++)if(j=a.aoData[f],null!==j.nTr){e=[];for(d=j.nTr.firstChild;d;)g=d.nodeName.toLowerCase(),("td"==g||"th"==g)&&e.push(d),d=d.nextSibling;g=d=0;for(h=a.aoColumns.length;g<h;g++)a.aoColumns[g].bVisible?c.push(e[g-d]):(c.push(j._anHidden[g]),d++)}return c}function D(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+
+a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else X.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===h.isArray(c)?h.extend(!0,a[d],c):a[d]=c);return a}function Ra(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}
+function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function A(a,b,c,d){for(var b=a[b],e=[],f=b.length-1;0<=f;f--)e.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return e}function Ua(a){var b=h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize=
+100===h("#DT_BrowserTest",b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Va(a){return function(){var b=[s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var U=/\[.*?\]$/,Wa=X.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,e=[],f=h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Wa(d)),e.push((f?"":'"'+c+'":')+d);return(f?
+"[":"{")+e+(f?"]":"}")};this.$=function(a,b){var c,d,e=[],f;d=s(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=g[k[c]].nTr)&&e.push(f)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("original"==
+b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(f=g[c].nTr)&&e.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)f=g[c].nTr,-1!==h.inArray(c,o)&&f&&e.push(f)}else D(d,1,"Unknown selection options");e=h(e);c=e.filter(a);e=e.find(a);return h([].concat(h.makeArray(c),h.makeArray(e)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],
+d,e=s(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=H(e,a[f]);if(-1==d)return c;c.push(d)}else{d=H(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=s(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=s(this[j.ext.iApiIndex]);ga(b);(a===n||a)&&x(b)};this.fnClose=
+function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?I(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ha(d.aiDisplayMaster,
+a);ha(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)y(d),x(d);return g};this.fnDestroy=function(a){var b=s(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,i,f,a=a===n?!1:a;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);if(!a){i=0;for(f=b.aoColumns.length;i<f;i++)!1===b.aoColumns[i].bVisible&&this.fnSetColumnVis(i,!0)}h(b.nTableWrapper).find("*").andSelf().unbind(".DT");
+h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];P(b);h(T(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,
+b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);i=0;for(f=b.aoData.length;i<f;i++)null!==b.aoData[i].nTr&&d.appendChild(b.aoData[i].nTr);!0===b.oFeatures.bAutoWidth&&
+(b.nTable.style.width=q(b.sDestroyWidth));if(f=b.asDestroyStripes.length){a=h(d).children("tr");for(i=0;i<f;i++)a.filter(":nth-child("+f+"n + "+i+")").addClass(b.asDestroyStripes[i])}i=0;for(f=j.settings.length;i<f;i++)j.settings[i]==b&&j.settings.splice(i,1);e=b=null};this.fnDraw=function(a){var b=s(this[j.ext.iApiIndex]);!1===a?(y(b),x(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=s(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===
+e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(K(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)try{b[c]._DT_Input!=l.activeElement&&h(b[c]._DT_Input).val(a)}catch(o){h(b[c]._DT_Input).val(a)}}}else h.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),K(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=s(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();
+"tr"===e?d=I(c,a):"td"===e&&(d=I(c,a.parentNode),b=fa(c,d,a))}return b!==n?v(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=s(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:T(b)};this.fnGetPosition=function(a){var b=s(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?I(b,a):"TD"==c||"TH"==c?(c=I(b,a.parentNode),a=fa(b,c,a),[c,R(b,a),a]):null};this.fnIsOpen=function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<
+b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e=T(d);if(-1!==h.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=t(d);"string"===typeof b?f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=s(this[j.ext.iApiIndex]);qa(c,a);
+y(c);(b===n||b)&&x(c)};this.fnSetColumnVis=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,g=d.aoColumns,h=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=t(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(m?h[e].nTr.appendChild(h[e]._anHidden[a]):h[e].nTr.insertBefore(h[e]._anHidden[a],J(d,e)[o]))}else{e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(o=J(d,e)[a],h[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible=
+b;W(d,d.aoHeader);d.nTFoot&&W(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=t(d);if(c===n||c)k(d),x(d);ra(d)}};this.fnSettings=function(){return s(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=s(this[j.ext.iApiIndex]);b.aaSorting=a;O(b)};this.fnSortListener=function(a,b,c){ia(s(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=s(this[j.ext.iApiIndex]),b="object"===typeof b?I(f,b):b;if(h.isArray(a)&&c===n){f.aoData[b]._aData=a.slice();
+for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else if(h.isPlainObject(a)&&c===n){f.aoData[b]._aData=h.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else{F(f,b,c,a);var a=v(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=S(f,b,c),g.bUseRendered&&F(f,b,c,a));null!==f.aoData[b].nTr&&(J(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=na(f,Y(f,b,"filter",r(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0};
+this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Va,_fnInitialise:ba,_fnInitComplete:$,_fnLanguageCompat:pa,_fnAddColumn:o,_fnColumnOptions:m,_fnAddData:H,_fnCreateTr:ea,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:W,_fnDraw:x,_fnReDraw:aa,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ka,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:La,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:K,_fnFilterCustom:Ia,_fnFilterColumn:Ha,
+_fnFilter:Ga,_fnBuildSearchArray:la,_fnBuildSearchRow:na,_fnFilterCreateSearch:ma,_fnDataToSearch:Ja,_fnSort:O,_fnSortAttachListener:ia,_fnSortingClasses:P,_fnFeatureHtmlPaginate:Da,_fnPageChange:qa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ka,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:E,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:R,_fnNodeToDataIndex:I,_fnVisbleColumns:t,_fnCalculateEnd:y,_fnConvertToWidth:Ma,_fnCalculateColumnWidths:da,_fnScrollingWidthAdjust:Oa,_fnGetWidestNode:Na,
+_fnGetMaxLenString:Pa,_fnStringToCss:q,_fnDetectType:B,_fnSettingsFromNode:s,_fnGetDataMaster:Z,_fnGetTrNodes:T,_fnGetTdNodes:J,_fnEscapeRegex:oa,_fnDeleteIndex:ha,_fnReOrderIndex:u,_fnColumnOrdering:M,_fnLog:D,_fnClearTable:ga,_fnSaveState:ra,_fnLoadState:Sa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=X.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"),
+b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";a=l.cookie.split(";");e=b.split(";")[0].length;f=[];if(4096<e+l.cookie.length+10){for(var j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{(g=eval("("+decodeURIComponent(k[1])+")"))&&g.iCreate&&f.push({name:k[0],time:g.iCreate})}catch(m){}}for(f.sort(function(a,b){return b.time-a.time});4096<e+l.cookie.length+10;){if(0===f.length)return;d=f.pop();l.cookie=
+d.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}l.cookie=b},_fnReadCookie:function(a){for(var b=X.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null},_fnDetectHeader:V,_fnGetUniqueThs:N,_fnScrollBarWidth:Qa,_fnApplyToChildren:C,_fnMap:p,_fnGetRowData:Y,
+_fnGetCellData:v,_fnSetCellData:F,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:L,_fnApplyColumnDefs:ta,_fnBindAction:Ra,_fnExtend:Ta,_fnCallbackReg:z,_fnCallbackFire:A,_fnJsonString:Wa,_fnRender:S,_fnNodeToColumnIndex:fa,_fnInfoMacros:ja,_fnBrowserDetect:Ua,_fnGetColumns:r};h.extend(j.ext.oApi,this.oApi);for(var sa in j.ext.oApi)sa&&(this[sa]=Va(sa));var ca=this;this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var i=!1,f=!1;if("table"!=this.nodeName.toLowerCase())D(null,0,"Attempted to initialise DataTables on a node which is not a table: "+
+this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{D(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;
+var g=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:ca.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===ca.length?ca:h(this).dataTable();e||(e={});e.oLanguage&&pa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo");p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses");
+p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses");p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g,
+e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e,"fnStateSave");p(g.oLanguage,e,"fnInfoCallback");z(g,"aoDrawCallback",e.fnDrawCallback,"user");
+z(g,"aoServerParams",e.fnServerParams,"user");z(g,"aoStateSaveParams",e.fnStateSaveParams,"user");z(g,"aoStateLoadParams",e.fnStateLoadParams,"user");z(g,"aoStateLoaded",e.fnStateLoaded,"user");z(g,"aoRowCallback",e.fnRowCallback,"user");z(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(g,"aoHeaderCallback",e.fnHeaderCallback,"user");z(g,"aoFooterCallback",e.fnFooterCallback,"user");z(g,"aoInitComplete",e.fnInitComplete,"user");z(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&&
+g.oFeatures.bSort&&g.oFeatures.bSortClasses?z(g,"aoDrawCallback",P,"server_side_sort_classes"):g.oFeatures.bDeferRender&&z(g,"aoDrawCallback",P,"defer_sort_classes");e.bJQueryUI?(h.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):h.extend(g.oClasses,j.ext.oStdClasses);h(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!==g.oScroll.sY)g.oScroll.iBarWidth=Qa();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart,
+g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Sa(g,e),z(g,"aoDrawCallback",ra,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(g.oLanguage.sUrl,null,function(a){pa(a);h.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),i=!0):h.extend(!0,
+g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);b=g.asStripeClasses.length;g.asDestroyStripes=[];if(b){c=!1;d=h(this).children("tbody").children("tr:lt("+b+")");for(a=0;a<b;a++)d.hasClass(g.asStripeClasses[a])&&(c=!0,g.asDestroyStripes.push(g.asStripeClasses[a]));c&&d.removeClass(g.asStripeClasses.join(" "))}c=[];a=this.getElementsByTagName("thead");0!==a.length&&(V(g.aoHeader,a[0]),c=N(g));if(null===e.aoColumns){d=[];a=0;for(b=
+c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ta(g,e.aoColumnDefs,d,function(a,b){m(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]=
+k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}P(g);Ua(g);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live",
+"polite");g.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],V(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(g,e.aaData[a]);else ua(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===i&&ba(g)}});ca=null;return this};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."),
+e=e.split("."),k="",n="",l=0,t=e.length;l<t;l++)k+=h(m[l],3),n+=h(e[l],3);return parseInt(k,10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.4";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],
+aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,
+fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,
+bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,
+fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0,e.sError);h(k.oInstance).trigger("xhr",[k,e]);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j=
+"function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
+oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData",
+sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,
+bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,
+asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],
+oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},
+fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);h.extend(j.ext.oStdClasses,
+{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",
+sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
+sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",
+sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
+sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",
+sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'+
+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var l=h("a",j),
+k=l[0],l=l[1];e.oApi._fnBindAction(k,{action:"previous"},n);e.oApi._fnBindAction(l,{action:"next"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",l.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),l.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k,l=0,n=j.length;l<n;l++)if(k=j[l].firstChild)k.className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k=k.nextSibling,
+k.className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=e.oClasses,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+
+l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var t=h("a",j),k=t[0],l=t[1],r=t[2],t=t[3];e.oApi._fnBindAction(k,{action:"first"},n);e.oApi._fnBindAction(l,{action:"previous"},n);e.oApi._fnBindAction(r,{action:"next"},n);e.oApi._fnBindAction(t,{action:"last"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",r.id=e.sTableId+"_next",t.id=e.sTableId+"_last")},
+fnUpdate:function(e,o){if(e.aanFeatures.p){var m=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(m/2),l=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),n=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,t="",r,B=e.oClasses,u,M=e.aanFeatures.p,L=function(h){e.oApi._fnBindAction(this,{page:h+r-1},function(h){e.oApi._fnPageChange(e,h.data.page);o(e);h.preventDefault()})};-1===e._iDisplayLength?n=k=r=1:l<m?(r=1,k=l):n<=k?(r=1,k=m):n>=l-k?(r=l-m+1,k=l):(r=n-Math.ceil(m/2)+1,k=r+m-1);for(m=r;m<=k;m++)t+=
+n!==m?'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButton+'">'+e.fnFormatNumber(m)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButtonActive+'">'+e.fnFormatNumber(m)+"</a>";m=0;for(k=M.length;m<k;m++)u=M[m],u.hasChildNodes()&&(h("span:eq(0)",u).html(t).children("a").each(L),u=u.getElementsByTagName("a"),u=[u[0],u[1],u[u.length-2],u[u.length-1]],h(u).removeClass(B.sPageButton+" "+B.sPageButtonActive+" "+B.sPageButtonStaticDisabled),h([u[0],u[1]]).addClass(1==n?B.sPageButtonStaticDisabled:
+B.sPageButton),h([u[2],u[3]]).addClass(0===l||n===l||-1===e._iDisplayLength?B.sPageButtonStaticDisabled:B.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<
+h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null;
+for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext};"function"===typeof define&&define.amd?define(["jquery"],L):jQuery&&!jQuery.fn.dataTable&&
+L(jQuery)})(window,document);
--- /dev/null
+/*
+ * Treeview 1.5pre - jQuery plugin to hide and show branches of a tree
+ *
+ * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
+ * http://docs.jquery.com/Plugins/Treeview
+ *
+ * Copyright (c) 2007 Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id: jquery.treeview.js 5759 2008-07-01 07:50:28Z joern.zaefferer $
+ *
+ */
+
+(function(b){b.extend(b.fn,{swapClass:function(c,a){var b=this.filter("."+c);this.filter("."+a).removeClass(a).addClass(c);b.removeClass(c).addClass(a);return this},replaceClass:function(a,b){return this.filter("."+a).removeClass(a).addClass(b).end()},hoverClass:function(a){a=a||"hover";return this.hover(function(){b(this).addClass(a)},function(){b(this).removeClass(a)})},heightToggle:function(a,b){a?this.animate({height:"toggle"},a,b):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")? "show":"hide"]();b&&b.apply(this,arguments)})},heightHide:function(a,b){a?this.animate({height:"hide"},a,b):(this.hide(),b&&this.each(b))},prepareBranches:function(b){b.prerendered||(this.filter(":last-child:not(ul)").addClass(a.last),this.filter((b.collapsed?"":"."+a.closed)+":not(."+a.open+")").find(">ul").hide());return this.filter(":has(>ul)")},applyClasses:function(c,g){this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",function(a){this==a.target&& g.apply(b(this).next())}).add(b("a",this)).hoverClass();if(!c.prerendered){this.filter(":has(>ul:hidden)").addClass(a.expandable).replaceClass(a.last,a.lastExpandable);this.not(":has(>ul:hidden)").addClass(a.collapsable).replaceClass(a.last,a.lastCollapsable);var d=this.find("div."+a.hitarea);d.length||(d=this.prepend('<div class="'+a.hitarea+'"/>').find("div."+a.hitarea));d.removeClass().addClass(a.hitarea).each(function(){var a="";b.each(b(this).parent().attr("class").split(" "),function(){a+=this+ "-hitarea "});b(this).addClass(a)})}this.find("div."+a.hitarea).click(g)},treeview:function(c){function g(c,e){function h(e){return function(){d.apply(b("div."+a.hitarea,c).filter(function(){return e?b(this).parent("."+e).length:!0}));return!1}}b("a:eq(0)",e).click(h(a.collapsable));b("a:eq(1)",e).click(h(a.expandable));b("a:eq(2)",e).click(h())}function d(){b(this).parent().find(">.hitarea").swapClass(a.collapsableHitarea,a.expandableHitarea).swapClass(a.lastCollapsableHitarea,a.lastExpandableHitarea).end().swapClass(a.collapsable, a.expandable).swapClass(a.lastCollapsable,a.lastExpandable).find(">ul").heightToggle(c.animated,c.toggle);c.unique&&b(this).parent().siblings().find(">.hitarea").replaceClass(a.collapsableHitarea,a.expandableHitarea).replaceClass(a.lastCollapsableHitarea,a.lastExpandableHitarea).end().replaceClass(a.collapsable,a.expandable).replaceClass(a.lastCollapsable,a.lastExpandable).find(">ul").heightHide(c.animated,c.toggle)}function k(){var a=[];i.each(function(c,d){a[c]=b(d).is(":has(>ul:visible)")?1:0}); b.cookie(c.cookieId,a.join(""),c.cookieOptions)}function l(){var a=b.cookie(c.cookieId);if(a){var d=a.split("");i.each(function(a,c){b(c).find(">ul")[parseInt(d[a])?"show":"hide"]()})}}c=b.extend({cookieId:"treeview"},c);if(c.toggle){var m=c.toggle;c.toggle=function(){return m.apply(b(this).parent()[0],arguments)}}this.data("toggler",d);this.addClass("treeview");var i=this.find("li").prepareBranches(c);switch(c.persist){case "cookie":var j=c.toggle;c.toggle=function(){k();j&&j.apply(this,arguments)}; l();break;case "location":var f=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});f.length&&(f=f.addClass("selected").parents("ul, li").add(f.next()).show(),c.prerendered&&f.filter("li").swapClass(a.collapsable,a.expandable).swapClass(a.lastCollapsable,a.lastExpandable).find(">.hitarea").swapClass(a.collapsableHitarea,a.expandableHitarea).swapClass(a.lastCollapsableHitarea,a.lastExpandableHitarea))}i.applyClasses(c,d);c.control&&(g(this,c.control),b(c.control).show()); return this}});b.treeview={};var a=b.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"}})(jQuery);
+
+(function($) {
+ var CLASSES = $.treeview.classes;
+ var proxied = $.fn.treeview;
+ $.fn.treeview = function(settings) {
+ settings = $.extend({}, settings);
+ if (settings.add) {
+ return this.trigger("add", [settings.add]);
+ }
+ if (settings.remove) {
+ return this.trigger("remove", [settings.remove]);
+ }
+ return proxied.apply(this, arguments).bind("add", function(event, branches) {
+ $(branches).prev()
+ .removeClass(CLASSES.last)
+ .removeClass(CLASSES.lastCollapsable)
+ .removeClass(CLASSES.lastExpandable)
+ .find(">.hitarea")
+ .removeClass(CLASSES.lastCollapsableHitarea)
+ .removeClass(CLASSES.lastExpandableHitarea);
+ $(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings, $(this).data("toggler"));
+ }).bind("remove", function(event, branches) {
+ var prev = $(branches).prev();
+ var parent = $(branches).parent();
+ $(branches).remove();
+ prev.filter(":last-child").addClass(CLASSES.last)
+ .filter("." + CLASSES.expandable).replaceClass(CLASSES.last, CLASSES.lastExpandable).end()
+ .find(">.hitarea").replaceClass(CLASSES.expandableHitarea, CLASSES.lastExpandableHitarea).end()
+ .filter("." + CLASSES.collapsable).replaceClass(CLASSES.last, CLASSES.lastCollapsable).end()
+ .find(">.hitarea").replaceClass(CLASSES.collapsableHitarea, CLASSES.lastCollapsableHitarea);
+ if (parent.is(":not(:has(>))") && parent[0] != this) {
+ parent.parent().removeClass(CLASSES.collapsable).removeClass(CLASSES.expandable)
+ parent.siblings(".hitarea").andSelf().remove();
+ }
+ });
+ };
+
+})(jQuery);
+
+(function($) {
+
+ function load(settings, root, child, container) {
+ function createNode(parent) {
+ var current = $("<li/>").attr("id", this.id || "").html("<span>" + this.text + "</span>").appendTo(parent);
+ if (this.classes) {
+ current.children("span").addClass(this.classes);
+ }
+ if (this.expanded) {
+ current.addClass("open");
+ }
+ if (this.hasChildren || this.children && this.children.length) {
+ var branch = $("<ul/>").appendTo(current);
+ if (this.hasChildren) {
+ current.addClass("hasChildren");
+ createNode.call({
+ classes: "placeholder",
+ text: " ",
+ children:[]
+ }, branch);
+ }
+ if (this.children && this.children.length) {
+ $.each(this.children, createNode, [branch])
+ }
+ }
+ }
+ $.ajax($.extend(true, {
+ url: settings.url,
+ dataType: "json",
+ data: {
+ root: root
+ },
+ success: function(response) {
+ child.empty();
+ $.each(response, createNode, [child]);
+ $(container).treeview({
+ add: child
+ });
+ }
+ }, settings.ajax));
+ }
+
+ var proxied = $.fn.treeview;
+ $.fn.treeview = function(settings) {
+ if (!settings.url) {
+ return proxied.apply(this, arguments);
+ }
+ var container = this;
+ if (!container.children().size())
+ load(settings, "source", this, container);
+ var userToggle = settings.toggle;
+ return proxied.call(this, $.extend({}, settings, {
+ collapsed: true,
+ toggle: function() {
+ var $this = $(this);
+ if ($this.hasClass("hasChildren")) {
+ var childList = $this.removeClass("hasChildren").find("ul");
+ load(settings, this.id, childList, container);
+ }
+ if (userToggle) {
+ userToggle.apply(this, arguments);
+ }
+ }
+ }));
+ };
+
+})(jQuery);
\ No newline at end of file
--- /dev/null
+CodeMirror.defineMode("properties", function() {
+ return {
+ token: function(stream, state) {
+ var sol = stream.sol() || state.afterSection;
+ var eol = stream.eol();
+
+ state.afterSection = false;
+
+ if (sol) {
+ if (state.nextMultiline) {
+ state.inMultiline = true;
+ state.nextMultiline = false;
+ } else {
+ state.position = "def";
+ }
+ }
+
+ if (eol && !state.nextMultiline) {
+ state.inMultiline = false;
+ state.position = "def";
+ }
+
+ if (sol) {
+ while (stream.eatSpace())
+ ;
+ }
+
+ var ch = stream.next();
+
+ if (sol && (ch === "#" || ch === "!" || ch === ";")) {
+ state.position = "comment";
+ stream.skipToEnd();
+ return "comment";
+ } else if (sol && ch === "[") {
+ state.afterSection = true;
+ stream.skipTo("]");
+ stream.eat("]");
+ return "header";
+ } else if (ch === "=" || ch === ":") {
+ state.position = "quote";
+ return null;
+ } else if (ch === "\\" && state.position === "quote") {
+ if (stream.next() !== "u") { // u = Unicode sequence \u1234
+ // Multiline value
+ state.nextMultiline = true;
+ }
+ }
+
+ return state.position;
+ },
+ startState: function() {
+ return {
+ position: "def", // Current position, "def", "quote" or "comment"
+ nextMultiline: false, // Is the next line multiline value
+ inMultiline: false, // Is the current line a multiline value
+ afterSection: false // Did we just open a section
+ };
+ }
+
+ };
+});
+
+CodeMirror.defineMIME("text/x-properties", "properties");
+CodeMirror.defineMIME("text/x-ini", "properties");
\ No newline at end of file
--- /dev/null
+=== Advanced Access Manager ===\r
+Contributors: vasyl_m\r
+Tags: security, login, access manager, access, access control, capability, role, user, post filter, category \r
+Requires at least: 3.4.2\r
+Tested up to: 3.9.1\r
+Stable tag: 2.8.3\r
+\r
+The powerful and easy-to-use tool to improve security and define access to your \r
+posts, pages and backend areas for single blog or multisite network.\r
+\r
+== Description ==\r
+\r
+**Advanced Access Manager** (aka **AAM**) is known nowadays as one of the best \r
+access control and security enhancement tool. It is easy-to-use and at the same \r
+time very powerful plugin that gives you the flexible control over your single \r
+blog or multisite network.\r
+\r
+With **AAM** you can control access to different areas of your website like posts, \r
+pages, categories, widgets or menus. The access can be defined for any user, role \r
+or visitor.\r
+\r
+Below is the list of highlighted features that has been implemented and proved in\r
+current **AAM** version:\r
+\r
+**Secure Admin Login**.\r
+Control the login process to your website. Define the number or possible login\r
+attempts, trace the failed login request's geographical location, lockout IP \r
+addresses for potential hacker attacks.\r
+\r
+**Control Access to Posts, Pages or Categories**.\r
+Restrict access to your posts, pages, custom post types of categories for any\r
+user, role or visitor. Define whether the viewer can ''see'', ''read'' or ''comment'' \r
+on any post or page. For more extended list of possible options consider to get \r
+the [AAM Plus Package](http://wpaam.com/aam-extensions/aam-plus-package/). To \r
+learn more about this feature check our \r
+[Posts and Pages Tutorial](http://wpaam.com/tutorials/posts-pages-general-overview/).\r
+\r
+**Control Access to Media Files**.\r
+Define your custom access to media files for any user, role or visitor. The feature \r
+works without any extra configurations to your server .htaccess file. Find more \r
+information about this topic in our \r
+[Tutorial](http://wpaam.com/tutorials/control-access-to-media-files/).\r
+\r
+**Manage Roles and Capabilities**.\r
+Manage the list of roles and capabilities. This feature has been designed and tested \r
+by hundreds of experienced WordPress user and developers. It gives you possibility \r
+to create, update or delete any role or capability. For security reasons, this \r
+feature is limited by default but can be easily activated. Read more about it in \r
+our [AAM Super Admin Tutorial](http://wpaam.com/tutorials/aam-super-admin/).\r
+\r
+**Track User Activity**.\r
+Track logged in user activities like when user was logged in or logged out. Explore \r
+more tracking options with [AAM Activities](http://wpaam.com/aam-extensions/aam-activities/).\r
+\r
+**Filter Backend Menu**.\r
+Control access to backend menu (including submenus). For more information check \r
+[How to Manage Admin Menu](http://wpaam.com/tutorials/how-to-manage-admin-menu/).\r
+\r
+**Filter Metaboxes and Widgets**.\r
+Filter available metaboxes or widgets for any user, role or visitor.\r
+\r
+And many, many more...\r
+\r
+The **AAM** has multi-language UI:\r
+\r
+ * English\r
+ * German (by Kolja www.Reggae-Party.de)\r
+ * Spanish (by Etruel www.netmdp.com)\r
+ * Polish (by Gustaw Lasek www.servitium.pl)\r
+ * French (by Moskito7)\r
+ * Russian (by Maxim Kernozhickii www.aeromultimedia.com)\r
+ * Persian (by Ghaem Omidi www.forum.wp-parsi.com)\r
+ * Norwegian (by Christer Berg Johannesen www.improbus.com)\r
+\r
+== Installation ==\r
+\r
+1. Upload `advanced-access-manager` folder to the `/wp-content/plugins/` directory\r
+2. Activate the plugin through the 'Plugins' menu in WordPress\r
+\r
+== Frequently Asked Questions ==\r
+\r
+= What is "Initiate URL" button, under "Metaboxes & Widgets" Tab? =\r
+\r
+Sometimes list of additional metaboxes is conditional on edit post page. Like e.g.\r
+display custom metabox "Photos" only if Post Status is Published. Access Manager\r
+initiates the list of metaboxes for each post in default status ("auto-draft").\r
+That is why you have to manually initialize the URL to the edit post page where\r
+the list of additional metaboxes can be picked by AAM.\r
+\r
+== Screenshots ==\r
+\r
+1. General view of Access Manager\r
+2. List of Metaboxes to Manage\r
+3. List of Capabilities\r
+4. Post/Page Tree View\r
+5. ConfigPress\r
+\r
+== Changelog ==\r
+\r
+= 2.8.3 =\r
+* Improved ConfigPress security (thanks to Tom Adams from security.dxw.com)\r
+* Added ConfigPress new setting control_permalink\r
+\r
+= 2.8.2 =\r
+* Fixed issue with Default acces to posts/pages for AAM Plus Package\r
+* Fixed issue with AAM Plugin Manager for lower PHP version\r
+\r
+= 2.8.1 =\r
+* Simplified the Repository internal handling\r
+* Added Development License Support\r
+\r
+= 2.8 =\r
+* Fixed issue with AAM Control Manage HTML\r
+* Fixed issue with __PHP_Incomplete_Class\r
+* Added AAM Plugin Manager Extension\r
+* Removed Deprecated ConfigPress Object from the core\r
+\r
+= 2.7.3 =\r
+* Added ConfigPress Reference Page\r
+\r
+= 2.7.2 =\r
+* Maintenance release\r
+\r
+= 2.7.1 =\r
+* Improved SSL handling\r
+* Added ConfigPress property aam.native_role_id\r
+* Fixed bug with countryCode in AAM Security Extension\r
+\r
+= 2.7 =\r
+* Fixed bug with subject managing check \r
+* Fixed bug with update hook\r
+* Fixed issue with extension activation hook\r
+* Added AAM Security Feature. First iteration\r
+* Improved CSS\r
+\r
+= 2.6 =\r
+* Fixed bug with user inheritance\r
+* Fixed bug with user restore default settings\r
+* Fixed bug with installed extension detection\r
+* Improved core extension handling\r
+* Improved subject inheritance mechanism\r
+* Removed deprecated ConfigPress Tutorial\r
+* Optimized CSS\r
+* Regenerated translation pot file\r
+\r
+= 2.5.2 =\r
+* Fixed issue with AAM Media Manager\r
+\r
+= 2.5.1 =\r
+* Extended AAM Media Manager Extension\r
+* Adjusted control_area to AAM Media Manager\r
+* Fixed issue with mb_* functions\r
+* Added Contextual Help Menu\r
+* Updated My Feature extension\r
+\r
+= 2.5 =\r
+* Fixed issue with AAM Plus Package and Multisite\r
+* Introduced Development License\r
+* Minor internal adjustment for AAM Development Community\r
+\r
+= 2.5 Beta =\r
+* Refactored Post & Pages Access List\r
+* Extended ConfigPress with Post & Pages Access List Options\r
+* Refactored internal UI hander\r
+* Fixed issue with Restore Default flag and AAM Plus Package\r
+* Added LIST Restriction for AAM Plus Package\r
+* Added ADD Restriction for AAM Plus Package\r
+* Filter list of editable roles based on current user level\r
+* Gives ability for non-admin users manage AAM if admin granted access\r
+* Removed Backup object. Replaces with Restore Default\r
+* Merged ajax handler with UI manager\r
+* Implemented Clear All Settings feature (one step closer to Import/Export)\r
+* Added Error notification for Extension page\r
+* Fixed bug with Multisite and AAM Plus Package ajax call\r
+* Regenerated language file\r
+* Fixed bug with non-existing term\r
+\r
+= 2.4 =\r
+* Added Norwegian language Norwegian (by Christer Berg Johannesen)\r
+* Localize the default Roles\r
+* Regenerated .pod file\r
+* Added AAM Media Manager Extension\r
+* Added AAM Content Manager Extension\r
+* Standardized Extension Modules\r
+* Fixed issue with Media list\r
+\r
+= 2.3 =\r
+* Added Persian translation by Ghaem Omidi\r
+* Added Inherit Capabilities From Role drop-down on Add New Role Dialog\r
+* Small Cosmetic CSS changes\r
+\r
+= 2.2.3 =\r
+* Improved Admin Menu access control\r
+* Extended ConfigPress with aam.menu.undefined setting\r
+* Fixed issue with Frontend Widget\r
+* Updated Polish Language File\r
+\r
+= 2.2.2 =\r
+* Fixed very significant issue with Role deletion\r
+* Added Unfiltered Capability checkbox\r
+* Regenerated language file\r
+* Fixed issue with language encoding\r
+* Fixed issue with Metaboxes tooltips\r
+\r
+= 2.2.1 =\r
+* Fixed the issue with Activity include\r
+\r
+= 2.2 =\r
+* Fixed issue with jQuery UI Tooltip Widget\r
+* Added AAM Warning Panel\r
+* Added Event Log Feature\r
+* Moved ConfigPress to separate Page (refactored internal handling)\r
+* Reverted back the SSL handling\r
+* Added Post Delete feature\r
+* Added Post's Restore Default Restrictions feature\r
+* Added ConfigPress Extension turn on/off setting\r
+* Russian translation by (Maxim Kernozhitskiy http://aeromultimedia.com)\r
+* Removed Migration possibility\r
+* Refactored AAM Core Console model\r
+* Increased the number of saved restriction for basic version\r
+* Simplified Undo feature\r
+\r
+= 2.1.1 =\r
+* Fixed fatal error in caching mechanism\r
+* Extended ConfigPress tutorial\r
+* Fixed error for AAM Plus Package for PHP earlier versions\r
+* Improved Admin over SSL check\r
+* Improved Taxonomy Query handling mechanism\r
+\r
+= 2.1 =\r
+* Fixed issue with Admin Menu restrictions (thanks to MikeB2B)\r
+* Added Polish Translation\r
+* Fixed issue with Widgets restriction\r
+* Improved internal User & Role handling\r
+* Implemented caching mechanism\r
+* Extended Update mechanism (remove the AAM cache after update)\r
+* Added New ConfigPress setting aam.caching (by default is FALSE)\r
+* Improved Metabox & Widgets filtering mechanism\r
+* Added French Translation (by Moskito7)\r
+* Added "My Feature" Tab\r
+* Regenerated .pot file\r
+\r
+= 2.0 =\r
+* New UI\r
+* Robust and completely new core functionality\r
+* Over 3 dozen of bug fixed and improvement during 3 alpha & beta versions\r
+* Improved Update mechanism\r
+\r
+= 1.9.1 =\r
+* Fixed bug with empty event list\r
+* Fixed bug with direct attachment access\r
+* Reverted back the default UI design\r
+* Last release of 1.x AAM Branch\r
+\r
+= 1.9 =\r
+* AAM 2.0 alpha 1 Announcement\r
+\r
+= 1.8.5 =\r
+* Added Event Manager\r
+* Added ConfigPress parameter "aam.encoding"\r
+\r
+= 1.8 =\r
+* Fixed user caching issue\r
+* Fixed issue with encoding\r
+* Clear output buffer to avoid from third party plugins issues\r
+* Notification about new release 2.0\r
+\r
+= 1.7.5 =\r
+* Accordion Fix\r
+\r
+= 1.7.3 =\r
+* Fixed reported issue #8894 to PHPSnapshot\r
+* Added Media File access control\r
+* Extended ConfigPress Tutorial\r
+\r
+= 1.7.2 =\r
+* Fixed CSS issues\r
+\r
+= 1.7.1 =\r
+* Fixed issue with cache removal query\r
+* Silenced Upgrade for release 1.7 and higher\r
+* Removed Capabilities description\r
+* Added .POT file for multi-language support\r
+* Silenced issue in updateRestriction function\r
+* Silenced the issue with phpQuery and taxonomy rendering\r
+\r
+= 1.7 =\r
+* Removed Zend Caching mechanism\r
+* Silenced the issue with array_merge in API model\r
+* Removed the ConfigPress reference\r
+* Created ConfigPress PDF Tutorial\r
+* Moved SOAP wsdl to local directory\r
+\r
+\r
+= 1.6.9.1 =\r
+* Changed the way AHM displays\r
+\r
+= 1.6.9 =\r
+* Encoding issue fixed\r
+* Removed AWM Group page\r
+* Removed .htaccess file\r
+* Fixed bug with Super Admin losing capabilities\r
+\r
+= 1.6.8.3 =\r
+* Implemented native WordPress jQuery UI include to avoid version issues\r
+\r
+= 1.6.8.2 =\r
+* Fixed JS issue with dialog destroy\r
+\r
+= 1.6.8.1 =\r
+* Fixed Javascript issue\r
+* Fixed issue with comment feature\r
+\r
+= 1.6.8 =\r
+* Extended ConfigPress\r
+* New view\r
+* Updated ConfigPress Reference Guide\r
+\r
+= 1.6.7.5 =\r
+* Implemented alternative way of Premium Upgrade\r
+* Extended ConfigPress\r
+\r
+= 1.6.7 =\r
+* New design\r
+\r
+= 1.6.6 =\r
+* Bug fixing\r
+* Maintenance work\r
+* Added Multisite importing feature\r
+\r
+= 1.6.5.2 =\r
+* Updated jQuery UI lib to 1.8.20\r
+* Minimized JavaScript\r
+* Implemented Web Service for AWM Group page\r
+* Implemented Web Service for Premium Version\r
+* Fixed bug with User Restrictions\r
+* Fixed bug with Edit Permalink\r
+* Fixed bug with Upgrade Hook\r
+* Reorganized Label Module (Preparing for Russian and Polish transactions)\r
+\r
+= 1.6.5.1 (Beta) =\r
+* Bug fixing\r
+* Removed custom error handler\r
+\r
+= 1.6.5 =\r
+* Turn off error reporting by default\r
+* More advanced Post/Taxonomy access control\r
+* Added Refresh feature for Post/Taxonomy Tree\r
+* Added Custom Capability Edit Permalink\r
+* Filtering Post's Quick Menu\r
+* Refactored JavaScript\r
+\r
+= 1.6.3 =\r
+* Added more advanced possibility to manage comments\r
+* Change Capabilities view\r
+* Added additional checking for plugin's reliability\r
+\r
+= 1.6.2 =\r
+* Few GUI changes\r
+* Added ConfigPress reference guide\r
+* Introduced Extended version\r
+* Fixed bug with UI menu ordering\r
+* Fixed bug with ConfigPress caching\r
+* Fixed bugs in filtermetabox class\r
+* Fixed bug with confirmation message in Multisite Setup\r
+\r
+= 1.6.1.3 =\r
+* Fixed issue with menu\r
+\r
+= 1.6.1.2 =\r
+* Resolved issue with chmod\r
+* Fixed issue with clearing config.ini during upgrade\r
+\r
+= 1.6.1.1 =\r
+* Fixed 2 bugs reported by jimaek\r
+\r
+= 1.6.1 =\r
+* Silenced few warnings in Access Control Class\r
+* Extended description to Manually Metabox Init feature\r
+* Added possibility to filter Frontend Widgets\r
+* Refactored the Option Page manager\r
+* Added About page\r
+\r
+= 1.6 =\r
+* Fixed bug for post__not_in\r
+* Fixed bug with Admin Panel filtering\r
+* Added Restore Default button\r
+* Added Social and Support links\r
+* Modified Error Handling feature\r
+* Modified Config Press Handling\r
+\r
+= 1.5.8 =\r
+* Fixed bug with categories\r
+* Addedd delete_capabilities parameter to Config Press\r
+\r
+= 1.5.7 =\r
+* Bug fixing\r
+* Introduced error handling\r
+* Added internal .htaccess\r
+\r
+= 1.5.6 =\r
+* Introduced _Visitor User Role\r
+* Fixed few core bugs\r
+* Implemented caching system\r
+* Improved API\r
+\r
+= 1.5.5 =\r
+* Performed code refactoring\r
+* Added Access Config\r
+* Added User Managing feature\r
+* Fixed bugs related to WP 3.3.x releases\r
+\r
+= 1.4.3 =\r
+* Emergency bug fixing\r
+\r
+= 1.4.2 =\r
+* Fixed cURL bug\r
+\r
+= 1.4.1 =\r
+* Fixed some bugs with checking algorithm\r
+* Maintained the code\r
+\r
+= 1.4 =\r
+* Added Multi-Site Support\r
+* Added Multi-Language Support\r
+* Improved checking algorithm\r
+* Improved Super Admin functionality\r
+\r
+= 1.3.1 =\r
+* Improved Super Admin functionality\r
+* Optimized main class\r
+* Improved Checking algorithm\r
+* Added ability to change User Role's Label\r
+* Added ability to Exclude Pages from Navigation\r
+* Added ability to spread Post/Category Restriction Options to all User Roles\r
+* Sorted List of Capabilities Alphabetically\r
+\r
+= 1.3 =\r
+* Change some interface button to WordPress default\r
+* Deleted General Info metabox\r
+* Improved check Access algorithm for compatibility with non standard links\r
+* Split restriction on Front-end and Back-end\r
+* Added Page Menu Filtering\r
+* Added Admin Top Menu Filtering\r
+* Added Import/Export Configuration functionality\r
+\r
+= 1.2.1 =\r
+* Fixed issue with propAttr jQuery IU incompatibility\r
+* Added filters for checkAccess and compareMenu results\r
+\r
+= 1.2 =\r
+* Fixed some notice messages reported by llucax\r
+* Added ability to sort Admin Menu\r
+* Added ability to filter Posts, Categories and Pages\r
+\r
+= 1.0 =\r
+* Fixed issue with comment editing\r
+* Implemented JavaScript error catching
\ No newline at end of file
-/*
-THEME NAME:Headway Base
-THEME URI:http://www.headwaythemes.com
-VERSION:3.7.10
-AUTHOR:Headway Themes
-AUTHOR URI:http://www.headwaythemes.com
-DESCRIPTION:Headway is a feature-packed theme with drag and drop layout editing, point and click design capabilities, powerful search engine optimization and much more. For help, you can <a href="http://support.headwaythemes.com" target="_blank">access our support</a> or go to the <a href="http://docs.headwaythemes.com/" target="_blank">Headway documentation</a>.
-LICENSE: Terms of Service
-LICENSE URI: http://headwaythemes.com/terms-of-service
-
-------------------------------------------------------------------------
-Copyright 2009-2014 Vesped Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+/*\r
+THEME NAME:Headway Base\r
+THEME URI:http://www.headwaythemes.com\r
+VERSION:3.7.10\r
+AUTHOR:Headway Themes\r
+AUTHOR URI:http://www.headwaythemes.com\r
+DESCRIPTION:Headway is a feature-packed theme with drag and drop layout editing, point and click design capabilities, powerful search engine optimization and much more. For help, you can <a href="http://support.headwaythemes.com" target="_blank">access our support</a> or go to the <a href="http://docs.headwaythemes.com/" target="_blank">Headway documentation</a>.\r
+LICENSE: Terms of Service\r
+LICENSE URI: http://headwaythemes.com/terms-of-service\r
+\r
+------------------------------------------------------------------------\r
+Copyright 2009-2014 Vesped Inc.\r
+\r
+This program is free software; you can redistribute it and/or modify\r
+it under the terms of the GNU General Public License as published by\r
+the Free Software Foundation; either version 2 of the License, or\r
+(at your option) any later version.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+GNU General Public License for more details.\r
+\r
+You should have received a copy of the GNU General Public License\r
+along with this program; if not, write to the Free Software\r
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
*/
\ No newline at end of file