From 7ecb294ae3de14b477b7b0d3746b00434f07cb53 Mon Sep 17 00:00:00 2001 From: minimus Date: Mon, 4 Nov 2013 16:54:30 +0300 Subject: [PATCH 01/18] Reorganisation of Folders Lang folder is added. --- .idea/.name | 1 + .idea/encodings.xml | 5 + .idea/misc.xml | 5 + .idea/modules.xml | 9 + .idea/scopes/scope_settings.xml | 5 + .idea/simple-ads-manager.iml | 11 + .idea/vcs.xml | 7 + .idea/workspace.xml | 261 ++++++++++++++++++ admin.class.php | 2 +- .../simple-ads-manager-be_BY.mo | Bin .../simple-ads-manager-be_BY.po | 0 .../simple-ads-manager-de_DE.mo | Bin .../simple-ads-manager-de_DE.po | 0 .../simple-ads-manager-es_ES.mo | Bin .../simple-ads-manager-es_ES.po | 0 .../simple-ads-manager-ru_RU.mo | Bin .../simple-ads-manager-ru_RU.po | 0 .../simple-ads-manager.pot | 0 18 files changed, 305 insertions(+), 1 deletion(-) create mode 100644 .idea/.name create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/simple-ads-manager.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml rename simple-ads-manager-be_BY.mo => lang/simple-ads-manager-be_BY.mo (100%) rename simple-ads-manager-be_BY.po => lang/simple-ads-manager-be_BY.po (100%) rename simple-ads-manager-de_DE.mo => lang/simple-ads-manager-de_DE.mo (100%) rename simple-ads-manager-de_DE.po => lang/simple-ads-manager-de_DE.po (100%) rename simple-ads-manager-es_ES.mo => lang/simple-ads-manager-es_ES.mo (100%) rename simple-ads-manager-es_ES.po => lang/simple-ads-manager-es_ES.po (100%) rename simple-ads-manager-ru_RU.mo => lang/simple-ads-manager-ru_RU.mo (100%) rename simple-ads-manager-ru_RU.po => lang/simple-ads-manager-ru_RU.po (100%) rename simple-ads-manager.pot => lang/simple-ads-manager.pot (100%) diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..1996db0 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +simple-ads-manager \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1162f43 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d5b6f67 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/simple-ads-manager.iml b/.idea/simple-ads-manager.iml new file mode 100644 index 0000000..ca73188 --- /dev/null +++ b/.idea/simple-ads-manager.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..6d225a1 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1383567665395 + 1383567665395 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin.class.php b/admin.class.php index cb2ee9a..6395084 100644 --- a/admin.class.php +++ b/admin.class.php @@ -18,7 +18,7 @@ public function __construct() { global $wp_version; if ( function_exists( 'load_plugin_textdomain' ) ) - load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) ); + load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/lang' ); if(!is_dir(SAM_AD_IMG)) mkdir(SAM_AD_IMG); diff --git a/simple-ads-manager-be_BY.mo b/lang/simple-ads-manager-be_BY.mo similarity index 100% rename from simple-ads-manager-be_BY.mo rename to lang/simple-ads-manager-be_BY.mo diff --git a/simple-ads-manager-be_BY.po b/lang/simple-ads-manager-be_BY.po similarity index 100% rename from simple-ads-manager-be_BY.po rename to lang/simple-ads-manager-be_BY.po diff --git a/simple-ads-manager-de_DE.mo b/lang/simple-ads-manager-de_DE.mo similarity index 100% rename from simple-ads-manager-de_DE.mo rename to lang/simple-ads-manager-de_DE.mo diff --git a/simple-ads-manager-de_DE.po b/lang/simple-ads-manager-de_DE.po similarity index 100% rename from simple-ads-manager-de_DE.po rename to lang/simple-ads-manager-de_DE.po diff --git a/simple-ads-manager-es_ES.mo b/lang/simple-ads-manager-es_ES.mo similarity index 100% rename from simple-ads-manager-es_ES.mo rename to lang/simple-ads-manager-es_ES.mo diff --git a/simple-ads-manager-es_ES.po b/lang/simple-ads-manager-es_ES.po similarity index 100% rename from simple-ads-manager-es_ES.po rename to lang/simple-ads-manager-es_ES.po diff --git a/simple-ads-manager-ru_RU.mo b/lang/simple-ads-manager-ru_RU.mo similarity index 100% rename from simple-ads-manager-ru_RU.mo rename to lang/simple-ads-manager-ru_RU.mo diff --git a/simple-ads-manager-ru_RU.po b/lang/simple-ads-manager-ru_RU.po similarity index 100% rename from simple-ads-manager-ru_RU.po rename to lang/simple-ads-manager-ru_RU.po diff --git a/simple-ads-manager.pot b/lang/simple-ads-manager.pot similarity index 100% rename from simple-ads-manager.pot rename to lang/simple-ads-manager.pot From 11ba7eb0bd555af9eb86c717552b460160c41806 Mon Sep 17 00:00:00 2001 From: minimus Date: Mon, 11 Nov 2013 18:57:17 +0300 Subject: [PATCH 02/18] Some Improvements --- .idea/codeStyleSettings.xml | 14 + .idea/webResources.xml | 22 + .idea/workspace.xml | 261 - admin.class.php | 239 +- css/sam-admin-edit.css | 39 +- css/slick.grid.css | 158 - css/slick.pager.css | 41 - css/w2ui.min.css | 2 + editor.admin.class.php | 36 +- js/sam-admin-edit.js | 557 +- js/sam-admin-edit.min.js | 4 +- js/slick/jquery.event.drag-2.0.min.js | 6 - js/slick/slick.autotooltips.js | 48 - js/slick/slick.autotooltips.min.js | 1 - js/slick/slick.cellcopymanager.js | 86 - js/slick/slick.cellcopymanager.min.js | 1 - js/slick/slick.cellrangedecorator.js | 64 - js/slick/slick.cellrangeselector.js | 112 - js/slick/slick.cellselectionmodel.js | 92 - js/slick/slick.checkboxselectcolumn.js | 154 - js/slick/slick.core.js | 424 - js/slick/slick.editors.js | 512 -- js/slick/slick.formatters.js | 55 - js/slick/slick.grid.js | 2799 ------ js/slick/slick.pager.js | 151 - js/slick/slick.rowmovemanager.js | 132 - js/slick/slick.rowselectionmodel.js | 187 - js/w2ui.js | 11151 +++++++++++++++++++++++ js/w2ui.min.js | 1 + readme.txt | 4 + 30 files changed, 11532 insertions(+), 5821 deletions(-) create mode 100644 .idea/codeStyleSettings.xml create mode 100644 .idea/webResources.xml delete mode 100644 .idea/workspace.xml delete mode 100644 css/slick.grid.css delete mode 100644 css/slick.pager.css create mode 100644 css/w2ui.min.css delete mode 100644 js/slick/jquery.event.drag-2.0.min.js delete mode 100644 js/slick/slick.autotooltips.js delete mode 100644 js/slick/slick.autotooltips.min.js delete mode 100644 js/slick/slick.cellcopymanager.js delete mode 100644 js/slick/slick.cellcopymanager.min.js delete mode 100644 js/slick/slick.cellrangedecorator.js delete mode 100644 js/slick/slick.cellrangeselector.js delete mode 100644 js/slick/slick.cellselectionmodel.js delete mode 100644 js/slick/slick.checkboxselectcolumn.js delete mode 100644 js/slick/slick.core.js delete mode 100644 js/slick/slick.editors.js delete mode 100644 js/slick/slick.formatters.js delete mode 100644 js/slick/slick.grid.js delete mode 100644 js/slick/slick.pager.js delete mode 100644 js/slick/slick.rowmovemanager.js delete mode 100644 js/slick/slick.rowselectionmodel.js create mode 100644 js/w2ui.js create mode 100644 js/w2ui.min.js diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 0000000..cab819f --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/.idea/webResources.xml b/.idea/webResources.xml new file mode 100644 index 0000000..a9bf725 --- /dev/null +++ b/.idea/webResources.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 6d225a1..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1383567665395 - 1383567665395 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/admin.class.php b/admin.class.php index 6395084..7f2f3af 100644 --- a/admin.class.php +++ b/admin.class.php @@ -18,7 +18,7 @@ public function __construct() { global $wp_version; if ( function_exists( 'load_plugin_textdomain' ) ) - load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/lang' ); + load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/lang/' ); if(!is_dir(SAM_AD_IMG)) mkdir(SAM_AD_IMG); @@ -278,11 +278,12 @@ public function help($contextualHelp, $screenId, $screen) { public function adminEditStyles() { wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui.css', false, '1.10.3'); - wp_enqueue_style('ColorPickerCSS', SAM_URL.'css/colorpicker.css'); - wp_enqueue_style('slick', SAM_URL.'css/slick.grid.css', false, '2.0'); + //wp_enqueue_style('ColorPickerCSS', SAM_URL.'css/colorpicker.css'); + //wp_enqueue_style('slick', SAM_URL.'css/slick.grid.css', false, '2.0'); wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); wp_enqueue_style('wp-pointer'); wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); } public function adminSettingsStyles() { @@ -312,6 +313,7 @@ public function adminEditScripts() { if($options['useSWF']) wp_enqueue_script('swfobject'); wp_enqueue_script('jquery'); + wp_enqueue_script('W2UI', SAM_URL . 'js/w2ui.min.js', array('jquery'), '1.3'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-effects-core'); //wp_enqueue_script('jquery-ui-mouse'); @@ -323,24 +325,23 @@ public function adminEditScripts() { wp_enqueue_script('jquery-effects-blind'); wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_script('jquery-ui-tooltip'); - /*wp_enqueue_script('jquery-ui', SAM_URL.'js/jquery-ui-1.8.9.custom.min.js', array('jquery'), '1.8.9');*/ if(file_exists(SAM_PATH.'/js/i18n/jquery.ui.datepicker-'.$lc.'.js')) wp_enqueue_script('jquery-ui-locale', SAM_URL.'js/i18n/jquery.ui.datepicker-'.$lc.'.js', array('jquery'), '1.8.9'); - wp_enqueue_script('ColorPicker', SAM_URL.'js/colorpicker.js', array('jquery')); + //wp_enqueue_script('ColorPicker', SAM_URL.'js/colorpicker.js', array('jquery')); wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); - wp_enqueue_script('jquery-event-drag', SAM_URL.'js/slick/jquery.event.drag-2.0.min.js', array('jquery'), '2.0'); - wp_enqueue_script('slick-core', SAM_URL.'js/slick/slick.core.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-checkboxes', SAM_URL.'js/slick/slick.checkboxselectcolumn.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-tooltips', SAM_URL.'js/slick/slick.autotooltips.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-cell-rd', SAM_URL.'js/slick/slick.cellrangedecorator.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-cell-rs', SAM_URL.'js/slick/slick.cellrangeselector.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-cell-cm', SAM_URL.'js/slick/slick.cellcopymanager.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-cell-sm', SAM_URL.'js/slick/slick.cellselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-row-sm', SAM_URL.'js/slick/slick.rowselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-formatters', SAM_URL.'js/slick/slick.formatters.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-editors', SAM_URL.'js/slick/slick.editors.js', array('jquery', 'jquery-ui-core'), '2.0'); - wp_enqueue_script('slick-grid', SAM_URL.'js/slick/slick.grid.js', array('jquery', 'jquery-ui-core'), '2.0'); + //('jquery-event-drag', SAM_URL.'js/slick/jquery.event.drag-2.0.min.js', array('jquery'), '2.0'); + //wp_enqueue_script('slick-core', SAM_URL.'js/slick/slick.core.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-checkboxes', SAM_URL.'js/slick/slick.checkboxselectcolumn.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-tooltips', SAM_URL.'js/slick/slick.autotooltips.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-cell-rd', SAM_URL.'js/slick/slick.cellrangedecorator.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-cell-rs', SAM_URL.'js/slick/slick.cellrangeselector.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-cell-cm', SAM_URL.'js/slick/slick.cellcopymanager.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-cell-sm', SAM_URL.'js/slick/slick.cellselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-row-sm', SAM_URL.'js/slick/slick.rowselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-formatters', SAM_URL.'js/slick/slick.formatters.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-editors', SAM_URL.'js/slick/slick.editors.js', array('jquery', 'jquery-ui-core'), '2.0'); + //wp_enqueue_script('slick-grid', SAM_URL.'js/slick/slick.grid.js', array('jquery', 'jquery-ui-core'), '2.0'); //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.2'); @@ -352,7 +353,7 @@ public function adminEditScripts() { 'zones' => array('enabled' => $pointers['zones'], 'title' => __('Name of Ads Zone', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), 'blocks' => array('enabled' => $pointers['blocks'], 'title' => __('Name of Ads Block', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use plugin\'s widgets.', SAM_DOMAIN)) )); - wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); } public function adminEditZBScripts() { @@ -519,66 +520,113 @@ public function getComboDataHandler() { } public function getStringsHandler() { - global $wpdb; + global $wpdb, $wp_taxonomies; $tTable = $wpdb->prefix . "terms"; $ttTable = $wpdb->prefix . "term_taxonomy"; $uTable = $wpdb->prefix . "users"; $umTable = $wpdb->prefix . "usermeta"; $postTable = $wpdb->prefix . "posts"; - $sql = "SELECT $tTable.term_id AS id, $tTable.name AS title, $tTable.slug - FROM $tTable - INNER JOIN $ttTable - ON $tTable.term_id = $ttTable.term_id - WHERE $ttTable.taxonomy = 'category' - ORDER BY $tTable.name;"; + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'category' + ORDER BY wt.name;"; $cats = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($cats as &$val) { + $k++; + $val['recid'] = $k; + } - $sql = "SELECT $tTable.term_id AS id, $tTable.name AS title, $tTable.slug - FROM $tTable - INNER JOIN $ttTable - ON $tTable.term_id = $ttTable.term_id - WHERE $ttTable.taxonomy = 'post_tag' - ORDER BY $tTable.name;"; + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'post_tag' + ORDER BY wt.name;"; $tags = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($tags as &$val) { + $k++; + $val['recid'] = $k; + } + + $sql = "SELECT wtt.taxonomy + FROM wp_term_taxonomy wtt + WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format') + GROUP BY wtt.taxonomy;"; + + $sql = "SELECT wt.term_id, wt.name, wt.slug, wtt.taxonomy + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format');"; + + $cTax = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($cTax as &$val) { + if(isset($wp_taxonomies[$val['taxonomy']])) $val['ctax_name'] = urldecode($wp_taxonomies[$val['taxonomy']]->labels->name); + else $val['ctax_name'] = ''; + $k++; + $val['recid'] = $k; + } $sql = "SELECT - $uTable.id, - $uTable.display_name AS title, - $uTable.user_nicename AS slug + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug FROM - $uTable - INNER JOIN $umTable - ON $uTable.id = $umTable.user_id + $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id WHERE - $umTable.meta_key = 'wp_user_level' AND - $umTable.meta_value > 1 - ORDER BY $uTable.id;"; + wum.meta_key = 'wp_user_level' AND + wum.meta_value > 1 + ORDER BY wu.id;"; $auth = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($auth as &$val) { + $k++; + $val['recid'] = $k; + } + $roleSubscriber = __('Subscriber', SAM_DOMAIN); + $roleContributor = __('Contributor', SAM_DOMAIN); + $roleAuthor = __('Author', SAM_DOMAIN); + $roleEditor = __('Editor', SAM_DOMAIN); + $roleAdministrator = __('Administrator', SAM_DOMAIN); + $roleSuperAdmin = __('Super Admin', SAM_DOMAIN); $sql = "SELECT - $uTable.id, - $uTable.display_name AS title, - $uTable.user_nicename AS slug, - (CASE $umTable.meta_value - WHEN 0 THEN '".__('Subscriber', SAM_DOMAIN)."' - WHEN 1 THEN '".__('Contributor', SAM_DOMAIN)."' - WHEN 2 THEN '".__('Author', SAM_DOMAIN)."' + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug, + (CASE wum.meta_value + WHEN 0 THEN '$roleSubscriber' + WHEN 1 THEN '$roleContributor' + WHEN 2 THEN '$roleAuthor' ELSE - IF($umTable.meta_value > 2 AND $umTable.meta_value <= 7, '".__('Editor', SAM_DOMAIN)."', - IF($umTable.meta_value > 7 AND $umTable.meta_value <= 10, '".__('Administrator', SAM_DOMAIN)."', - IF($umTable.meta_value > 10, '".__('Super Admin', SAM_DOMAIN)."', NULL) + IF(wum.meta_value > 2 AND wum.meta_value <= 7, '$roleEditor', + IF(wum.meta_value > 7 AND wum.meta_value <= 10, '$roleAdministrator', + IF(wum.meta_value > 10, '$roleSuperAdmin', NULL) ) ) END) AS role - FROM $uTable - INNER JOIN $umTable - ON $uTable.id = $umTable.user_id AND $umTable.meta_key = 'wp_user_level' - ORDER BY $uTable.id;"; + FROM $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id AND wum.meta_key = 'wp_user_level' + ORDER BY wu.id;"; $users = $wpdb->get_results($sql, ARRAY_A); + + $k = 0; + foreach($users as &$val) { + $k++; + $val['recid'] = $k; + } $args = array('public' => true, '_builtin' => false); $output = 'objects'; @@ -591,34 +639,43 @@ public function getStringsHandler() { array_push($customs, array('title' => $post_type->labels->name, 'slug' => $post_type->name)); array_push($sCustoms, $post_type->name); } + $k = 0; + foreach($customs as &$val) { + $k++; + $val['recid'] = $k; + } if(!empty($sCustoms)) $custs = ',' . implode(',', $sCustoms); else $custs = ''; $sql = "SELECT - $postTable.id, - $postTable.post_title AS title, - $postTable.post_type AS type + wp.id, + wp.post_title AS title, + wp.post_type AS type FROM - $postTable + $postTable wp WHERE - $postTable.post_status = 'publish' AND - FIND_IN_SET($postTable.post_type, 'post,page".$custs."') - ORDER BY $postTable.id;"; + wp.post_status = 'publish' AND + FIND_IN_SET(wp.post_type, 'post,page{$custs}') + ORDER BY wp.id;"; $posts = $wpdb->get_results($sql, ARRAY_A); - for($i = 0; $i < sizeof($posts); $i++) { - switch($posts[$i]['type']) { + + $k = 0; + foreach($posts as &$val) { + switch($val['type']) { case 'post': - $posts[$i]['type'] = __('Post', SAM_DOMAIN); + $val['type'] = __('Post', SAM_DOMAIN); break; case 'page': - $posts[$i]['type'] = __('Page', SAM_DOMAIN); + $val['type'] = __('Page', SAM_DOMAIN); break; default: - $posts[$i]['type'] = __('Post:', SAM_DOMAIN).' '.$posts[$i]['type']; + $val['type'] = __('Post:', SAM_DOMAIN).' '.$val['type']; break; } + $k++; + $val['recid'] = $k; } $output = array( @@ -630,40 +687,51 @@ public function getStringsHandler() { 'url' => SAM_AD_URL, 'cats' => array( 'columns' => array( - array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), + /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), array('id' => "title", 'name' => __("Category Title", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("Category Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200) + array('id' => "slug", 'name' => __("Category Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Category Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Category Slug", SAM_DOMAIN), 'size' => '40%') ), 'cats' => $cats ), 'authors' => array( 'columns' => array( - array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), + /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), array('id' => "title", 'name' => __("Display Name", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("User Name", SAM_DOMAIN), 'field' => "slug", 'width' => 200) + array('id' => "slug", 'name' => __("User Name", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '40%') ), 'authors' => $auth ), 'tags' => array( 'columns' => array( - array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), + /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), array('id' => "title", 'name' => __("Tag Title", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("Tag Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200) + array('id' => "slug", 'name' => __("Tag Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Tag Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Tag Slug", SAM_DOMAIN), 'size' => '40%') ), 'tags' => $tags ), 'customs' => array( 'columns' => array( - array('id' => "title", 'name' => __("Custom Type Title", SAM_DOMAIN), 'field' => "title", 'width' => 550), - array('id' => "slug", 'name' => __("Custom Type Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200) + /*array('id' => "title", 'name' => __("Custom Type Title", SAM_DOMAIN), 'field' => "title", 'width' => 550), + array('id' => "slug", 'name' => __("Custom Type Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ + array('field' => 'title', 'caption' => __("Custom Type Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Custom Type Slug", SAM_DOMAIN), 'size' => '50%') ), 'customs' => $customs ), 'posts' => array( 'columns' => array( - array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), - array('id' => "title", 'name' => __("Publication Title", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "type", 'name' => __("Publication Type", SAM_DOMAIN), 'field' => "type", 'width' => 200) + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Publication Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'type', 'caption' => __("Publication Type", SAM_DOMAIN), 'size' => '40%') ), 'posts' => $posts ), @@ -675,12 +743,25 @@ public function getStringsHandler() { array('columnName' => 'email', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser e-mail', SAM_DOMAIN)) ), 'columns' => array( - array('id' => 'id', 'name' => 'ID', 'field' => 'id', 'width' => 50), + /*array('id' => 'id', 'name' => 'ID', 'field' => 'id', 'width' => 50), array('id' => "title", 'name' => __("Display Name", SAM_DOMAIN), 'field' => "title", 'width' => 250), array('id' => "slug", 'name' => __("User Name", SAM_DOMAIN), 'field' => "slug", 'width' => 200), - array('id' => 'role', 'name' => __("Role", SAM_DOMAIN), 'field' => 'role', 'width' => 200) + array('id' => 'role', 'name' => __("Role", SAM_DOMAIN), 'field' => 'role', 'width' => 200)*/ + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '40%'), + array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '25%'), + array('field' => 'role', 'caption' => __("Role", SAM_DOMAIN), 'size' => '25%') ), 'users' => $users + ), + 'custom_taxes' => array( + 'taxes' => $cTax, + 'columns' => array( + //array('field' => 'recid', 'caption' => 'Record ID', 'size' => '30px'), + array('field' => 'term_id', 'caption' => __('ID', SAM_DOMAIN), 'size' => '30px'), + array('field' => 'name', 'caption' => __('Term Name', SAM_DOMAIN), 'size' => '50%'), + array('field' => 'ctax_name', 'caption' => __('Custom Taxonomy Name', SAM_DOMAIN), 'size' => '40%') + ) ) ); $charset = get_bloginfo('charset'); diff --git a/css/sam-admin-edit.css b/css/sam-admin-edit.css index d83132a..9506a75 100644 --- a/css/sam-admin-edit.css +++ b/css/sam-admin-edit.css @@ -144,45 +144,12 @@ input.button-primary, input.button-secondary, font-size: 11px !important; } -.slick-cell-checkboxsel { - background: #f0f0f0; - border-right-color: silver; - border-right-style: solid; - text-align: center; -} - #posts-grid, #x-posts-grid, #cats-grid, #x-cats-grid, #auth-grid, #x-auth-grid, #tags-grid, #x-tags-grid, #cust-grid, #x-cust-grid, -#users-grid { - border-bottom: 1px solid #DFDFDF; - border-left: 1px solid #DFDFDF; - border-right: 1px solid #DFDFDF; -} - -.cell-move-handle:hover { - background: #b6b9bd; -} - -.slick-row.selected .cell-move-handle { - background: #D5DC8D; -} - -.slick-cell.selected { - background: #F4F8FE !important; -} - -.slick-row .cell-actions { - text-align: left; -} - -.slick-row.complete { - background-color: #DFD; - color: #555; -} - -.slick-checkbox-column { - text-align: center; +#users-grid, #ctt-grid { + width: 100%; + height: 197px; } diff --git a/css/slick.grid.css b/css/slick.grid.css deleted file mode 100644 index e5ef44c..0000000 --- a/css/slick.grid.css +++ /dev/null @@ -1,158 +0,0 @@ -/* -IMPORTANT: -In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes. -No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS -classes should alter those! -*/ - -.slick-header.ui-state-default, .slick-headerrow.ui-state-default { - width: 100%; - overflow: hidden; - border-left: 0px; -} - -.slick-header-columns, .slick-headerrow-columns { - width: 999999px; - position: relative; - white-space: nowrap; - cursor: default; - overflow: hidden; -} - -.slick-header-column.ui-state-default { - position: relative; - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - height: 16px; - line-height: 16px; - margin: 0; - padding: 4px; - border-right: 1px solid silver; - border-left: 0px; - border-top: 0px; - border-bottom: 0px; - float: left; -} - -.slick-headerrow-column.ui-state-default { - padding: 4px; -} - -.slick-header-column-sorted { - font-style: italic; -} - -.slick-sort-indicator { - display: inline-block; - width: 8px; - height: 5px; - margin-left: 4px; -} - -.slick-sort-indicator-desc { - background: url(images/sort-desc.gif); -} - -.slick-sort-indicator-asc { - background: url(images/sort-asc.gif); -} - -.slick-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - cursor: col-resize; - width: 4px; - right: 0px; - top: 0; - height: 100%; -} - -.slick-sortable-placeholder { - background: silver; -} - -.grid-canvas { - position: relative; - outline: 0; -} - -.slick-row.ui-widget-content, .slick-row.ui-state-active { - position: absolute; - border: 0px; - width: 100%; -} - -.slick-cell, .slick-headerrow-column { - position: absolute; - - border: 1px solid transparent; - border-right: 1px dotted silver; - border-bottom-color: silver; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; - z-index: 1; - padding: 1px 2px 2px 1px; - margin: 0; - - white-space: nowrap; - - cursor: default; -} - -.slick-group { -} - -.slick-group-toggle { - display: inline-block; -} - -.slick-cell.highlighted { - background: lightskyblue; - background: rgba(0, 0, 255, 0.2); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - transition: all 0.5s; -} - -.slick-cell.flashing { - border: 1px solid red !important; -} - -.slick-cell.editable { - z-index: 11; - overflow: visible; - background: white; - border-color: black; - border-style: solid; -} - -.slick-cell:focus { - outline: none; -} - -.slick-reorder-proxy { - display: inline-block; - background: blue; - opacity: 0.15; - filter: alpha(opacity = 15); - cursor: move; -} - -.slick-reorder-guide { - display: inline-block; - height: 2px; - background: blue; - opacity: 0.7; - filter: alpha(opacity = 70); -} - -.slick-selection { - z-index: 10; - position: absolute; - border: 2px dashed black; -} \ No newline at end of file diff --git a/css/slick.pager.css b/css/slick.pager.css deleted file mode 100644 index e360ec6..0000000 --- a/css/slick.pager.css +++ /dev/null @@ -1,41 +0,0 @@ -.slick-pager { - width: 100%; - height: 26px; - border: 1px solid gray; - border-top: 0; - background: url('../images/header-columns-bg.gif') repeat-x center bottom; - vertical-align: middle; -} - -.slick-pager .slick-pager-status { - display: inline-block; - padding: 6px; -} - -.slick-pager .ui-icon-container { - display: inline-block; - margin: 2px; - border-color: gray; -} - -.slick-pager .slick-pager-nav { - display: inline-block; - float: left; - padding: 2px; -} - -.slick-pager .slick-pager-settings { - display: block; - float: right; - padding: 2px; -} - -.slick-pager .slick-pager-settings * { - vertical-align: middle; -} - -.slick-pager .slick-pager-settings a { - padding: 2px; - text-decoration: underline; - cursor: pointer; -} diff --git a/css/w2ui.min.css b/css/w2ui.min.css new file mode 100644 index 0000000..188411a --- /dev/null +++ b/css/w2ui.min.css @@ -0,0 +1,2 @@ +/* w2ui 1.3 (c) http://w2ui.com, vitmalina@gmail.com */ +.w2ui-reset{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-reset *{color:default;font-family:Verdana,Arial;font-size:11px;line-height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0}.w2ui-reset table{max-width:none;background-color:transparent;border-collapse:separate;border-spacing:0}.w2ui-reset input,.w2ui-reset textarea{width:auto;height:auto;vertical-align:baseline;padding:4px}.w2ui-reset select{padding:1px;height:23px}.w2ui-centered{display:table;width:100%;height:100%}.w2ui-centered>div{display:table-cell;padding:10px 20px 20px 10px;text-align:center;vertical-align:middle}input[type=text],input[type=password],select,textarea{padding:4px;border:1px solid #dfdfdf;border-radius:3px;color:#000;background-color:#fff}input[type=text]:focus,input[type=password]:focus,select:focus,textarea:focus{outline-color:#72b2ff}input[type=text]:disabled,input[type=password]:disabled,select:disabled,textarea:disabled,input[type=text][readonly],input[type=password][readonly],select[readonly],textarea[readonly]{background-color:#f1f1f1;color:#888}select{padding:2px}.w2ui-overlay{position:absolute;margin-top:6px;margin-left:-17px;display:none;z-index:1300;color:inherit;background-color:#fbfbfb;border:3px solid #777;box-shadow:0 2px 10px #999;border-radius:4px;text-align:left}.w2ui-overlay table td{color:inherit}.w2ui-overlay:before{content:"";position:absolute;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);width:10px;height:10px;border:3px solid #777;border-color:inherit;background-color:inherit;border-left:1px solid transparent;border-bottom:1px solid transparent;border-bottom-left-radius:50px;margin:-9px 0 0 32px}.w2ui-overlay.w2ui-overlay-popup{z-index:1700}.w2ui-tag{position:absolute;z-index:1300;opacity:0;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.w2ui-tag .w2ui-tag-body{background-color:rgba(60,60,60,.82);display:inline-block;position:absolute;border-radius:4px;padding:4px 10px;margin-left:10px;margin-top:0;color:#fff!important;box-shadow:1px 1px 3px #000;line-height:normal;font-size:11px;font-family:Verdana,Arial}.w2ui-tag .w2ui-tag-body:before{content:"";position:absolute;width:0;height:0;border-top:5px solid transparent;border-right:5px solid rgba(60,60,60,.82);border-bottom:5px solid transparent;margin:2px 0 0 -15px}.w2ui-tag.w2ui-tag-popup{z-index:1700}.w2ui-marker{color:#444;background-color:#FFF8B0}.w2ui-spinner{display:inline-block;background-size:100%;background-repeat:no-repeat;background-image:url(data:image/gif;base64,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)}.w2ui-icon{background-repeat:no-repeat;height:16px;width:16px;overflow:hidden;margin:2px;display:inline-block}.w2ui-icon.icon-reload{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAI/SURBVDjLjZPbS9NhHMYH+zNidtCSQrqwQtY5y2QtT2QGrTZf13TkoYFlzsWa/tzcoR3cSc2xYUlGJfzAaIRltY0N12H5I+jaOxG8De+evhtdOP1hu3hv3sPzPO/z4SsBIPnfuvG8cbBlWiEVO5OUItA0VS8oxi9EdhXo+6yV3V3UGHRvVXHNfNv6zRfNuBZVoiFcB/3LdnQ8U+Gk+bhPVKB3qUOuf6/muaQR/qwDkZ9BRFdCmMr5EPz6BN7lMYylLGgNNaKqt3K0SKDnQ7us690t3rNsxeyvaUz+8OJpzo/QNzd8WTtcaQ7WlBmPvxhx1V2Pg7oDziIBimwwf3qAGWESkVwQ7owNujk1ztvk+cg4NnAUTT4FrrjqUKHdF9jxBfXr1rgjaSk4OlMcLrnOrJ7latxbL1V2lgvlbG9MtMTrMw1r1PImtfyn1n5q47TlBLf90n5NmalMtUdKZoyQMkLKlIGLjMyYhFpmlz3nGEVmFJlRZNaf7pIaEndM24XIjCOzjX9mm2S2JsqdkMYIqbB1j5C6yWzVk7YRFTsGFu7l+4nveExIA9aMCcOJh6DIoMigyOh+o4UryRWQOtIjaJtoziM1FD0mpE4uZcTc72gBaUyYKEI6khgqINXO3saR7kM8IZUVCRDS0Ucf+xFbCReQhr97MZ51wpWxYnhpCD3zOrT4lTisr+AJqVx0Fiiyr4/vhP4VyyMFIUWNqRrV96vWKXKckBoIqWzXYcoPDrUslDJoopuEVEpIB0sR+AuErIiZ6OqMKAAAAABJRU5ErkJggg==) no-repeat center}.w2ui-icon.icon-columns{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFwSURBVBgZpcG9apNhHMbh3/ORWiztpLSrQ86gmw6egkuXjE7i5CQ0OAZxUSj0DCxiB8/A07BDBXEoKEoGbaP45n/f9im+SwhCyXUl26wiPXjy9vG9+7svpjNv2ICEJUKBZWThCGTjCEJia627ODk5e/ru5d5h3b27ezBY38jb61zHxsUsDoDDOuucZ9NzrutX50yz//rUy4zffPT/PHz+3peotmjGR6f0JqMhven5b2JuYm7C4k+YOzubhIImY9PbvrXJoloqdZCpNzJra5Wbg0qjedDUUND7+v0ni0qGnAo1QSQTWTQK0VTLNJPRkGVKAiVwAnKiqNBIQVOloBkfndKbjIb0Us1UCRkyoMQVSTR53nX0dm5vsSgDKWdKyaScyIUr825OUx2i9+XbDxbllGgElJSwRGOJpkqimYyGLFNSoin8UwqNbJp69unz8aNX3Z4iUIiIQBLRdYyefUA2VuAwsrCERHPMpWSbVWRW9Bcyl/ydiZeC0gAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-search,.w2ui-icon.icon-search-down{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAgCAYAAAB+ZAqzAAACuElEQVRYw9WXSWhTQRjHR0UKLqhFaV0OUih68GAOWjyJKypCpAoV8aIiioIICiKiB1GMtE3MYmry2moXDz1UDx7sUXHBhQpSaRVxrYpWcMO9avx/8AJh/CbznHkxdeB3Cd/8589kvuUJkWcdjCTHghUgAi6DJ+AVeAqugSQIggniXywcNBJsB70g44EHYBcYXUhTM8EFj4ZkboKqQpiqAv2GprK8o7/f75t6pjn0M3gNPmri3vtycxAZA64qDvkJ2kENqAQTQQWoBg74qth3B4y3NbZDIX4fzNfsnQtuK/YfsjFVCh4pMq3Co0Y5uMVoUGkpy8aFT5xaeSzVEo45bXdBt4LeaLq1k0RXMYJfdDfFmAuAD4zWlty4UNyZEkm19MUb2zMw8Sfp1u+IWSrcIimLnTG8/SijdU6OO5poDESdtgHZVBzUHm/amhW7zoitMTS2mNHqASPk2FDCCcLMYK6p+obmulyxfiYLA4bGKFvfSnrUvkq5+Lpk8z4yRH8r3l/X4WiqJFfspSQ0CGYZGpsMnkt6L+h31Z76hpMdeOwPQ7H0NFnssST0C8wxNDaDKb6kP06150gsHahNNlVzYheZd7HJ0BiX4VRGhpmIhRixKyZilM2M1mnTArtIUbU3/qVO0H0GvmQ4CY4C3YopYYlHjXlggNG4R33Ypi2tVtwaPeTdNMkq9pVQZQdvFPs32zbx4aAjzxhDRfIAWAeWg7VgrzsY5ht/zoNJtubKwA3LITGjSKRyW3NTwaUCmKOSMd3WHH0ZJRQZZkOP1zFKZ3CB++4+aQ6kEeksWAb2a2L7qDv49S1Q6T72MOgEXa6RGFhP3wpS/B6NOWpRs0UxFg7eqTFHjX1hscxtAz/ymEuIYi0cvgF8Y0w5Ro3dZ3M1boJkTaXEUFlug6fsdsRQWzTj0cey+N/Xb2sj5lTh2M6OAAAAAElFTkSuQmCC) no-repeat center!important;background-size:14px 12px!important;opacity:.9}.w2ui-icon.icon-add{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9W7YvBYOkhlkoqCklWChv2WyKik7blnNris72bi6dus0DLZ0TDxW1odtopDs4D8MDZuLU0kXq61CijSIIasOvv94VTUfLiB74fXngup7nvrnvJABJ/5PfLnTTdcwOj4RsdYmo5glBWP6iOtzwvIKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/ITFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa39Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0qxsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDRIqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJRCeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4BxajTWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahscNCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnnQyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-delete{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-save{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2+V7SrIM+bSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6+TwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD+UkG08+xt+4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy+YCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo+V3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG+UAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K+6kW49DKqS2DrEZCtfuI+9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2+FxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-edit{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC) no-repeat center!important}.w2ui-icon.icon-bullet-black{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABlSURBVCjPY/jPgB8yDC4FilKKDfJXZa6KNwhKYVfQkPW/63/b/+T/XA1YFchd7fqf/j/2f+N/5qtYFUhe7fif9D/sf91/BuwKhBoS/jcBpcP/M2C3gluKrYHhKhA2MEgN2pDEDgEb0f5zlvXgVgAAAABJRU5ErkJggg==) no-repeat center!important}.w2ui-icon.icon-folder{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC) no-repeat center!important}.w2ui-icon.icon-page{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAINSURBVBgZBcG/r55zGAfg6/4+z3va01NHlYgzEfE7MdCIGISFgS4Gk8ViYyM2Mdlsko4GSf8Do0FLRCIkghhYJA3aVBtEz3nP89wf11VJvPDepdd390+8Nso5nESBQoq0pfvXm9fzWf19453LF85vASqJlz748vInb517dIw6EyYBIIG49u+xi9/c9MdvR//99MPPZ7+4cP4IZhhTPbwzT2d+vGoaVRRp1rRliVvHq+cfvM3TD82+7mun0o/ceO7NT+/4/KOXjwZU1ekk0840bAZzMQ2mooqh0A72d5x/6sB9D5zYnff3PoYBoWBgFKPKqDKqjCpjKr//dcu9p489dra88cydps30KswACfNEKanSaxhlntjJ8Mv12Paie+vZ+0+oeSwwQ0Iw1xAR1CiFNJkGO4wu3ZMY1AAzBI0qSgmCNJsJUEOtJSMaCTBDLyQ0CknAGOgyTyFFiLI2awMzdEcSQgSAAKVUmAeNkxvWJWCGtVlDmgYQ0GFtgg4pNtOwbBcwQy/Rife/2yrRRVI0qYCEBly8Z+P4qMEMy7JaVw72N568e+iwhrXoECQkfH91kY7jwwXMsBx1L93ZruqrK6uuiAIdSnTIKKPLPFcvay8ww/Hh+ufeznTXu49v95IMoQG3784gYXdTqvRmqn/Wpa/ADFX58MW3L71SVU9ETgEIQQQIOOzub+fhIvwPRDgeVjWDahIAAAAASUVORK5CYII=) no-repeat center!important}.w2ui-lock{opacity:.15;filter:alpha(opacity=15);background-color:#333;position:absolute;z-index:1400;display:none}.w2ui-lock-msg{position:absolute;z-index:1400;width:200px;height:80px;padding:30px 8px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:13px;font-family:Verdana,Arial;opacity:.8;filter:alpha(opacity=15);background-color:#555;color:#fff;text-align:center;border-radius:5px;border:2px solid #444;display:none}.w2ui-lock-msg .w2ui-spinner{display:inline-block;width:24px;height:24px;margin:-3px 8px -7px -10px}.w2ui-form{position:relative;color:#000;background-color:#f5f6f7;border:1px solid silver;border-radius:3px;padding:0;overflow:hidden!important}.w2ui-form>div{position:absolute;overflow:hidden}.w2ui-form .w2ui-form-header{position:absolute;left:0;right:0;border-bottom:1px solid #99bbe8!important;overflow:hidden;color:#444;font-size:13px;text-align:center;padding:8px;background-image:-webkit-linear-gradient(#dae6f3,#c2d5ed);background-image:-moz-linear-gradient(#dae6f3,#c2d5ed);background-image:-ms-linear-gradient(#dae6f3,#c2d5ed);background-image:-o-linear-gradient(#dae6f3,#c2d5ed);background-image:linear-gradient(#dae6f3,#c2d5ed);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffdae6f3', endColorstr='#ffc2d5ed', GradientType=0);border-top-left-radius:3px;border-top-right-radius:3px}.w2ui-form .w2ui-form-toolbar{position:absolute;left:0;right:0;margin:0;padding:6px 3px;border-bottom:1px solid #d5d8d8}.w2ui-form .w2ui-form-tabs{margin:0;padding:0}.w2ui-form .w2ui-tabs{position:absolute;left:0;right:0;border-top-left-radius:3px;border-top-right-radius:3px;padding-top:5px!important;background-color:#fafafa}.w2ui-form .w2ui-tabs .w2ui-tab.active{background-color:#f5f6f7}.w2ui-form .w2ui-page{position:absolute;left:0;right:0;overflow:auto;padding:10px;border-left:1px solid inherit;border-right:1px solid inherit;background-color:inherit;border-radius:3px}.w2ui-form .w2ui-buttons{position:absolute;left:0;right:0;bottom:0;text-align:center;border-top:1px solid #d5d8d8;border-bottom:0 solid #d5d8d8;background-color:#fafafa;padding:15px 0!important;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.w2ui-form .w2ui-buttons input[type=button],.w2ui-form .w2ui-buttons button{width:80px;margin-right:5px}.w2ui-form input[type=checkbox]{margin-top:4px;margin-bottom:4px}.w2ui-group{background-color:#ebecef;margin:5px 0 10px;padding:10px 5px;border-top:1px solid #cedcea;border-bottom:1px solid #cedcea}.w2ui-label{float:left;margin-top:6px;margin-bottom:3px;width:120px;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right;min-height:20px}.w2ui-label.w2ui-span1{width:20px;float:left}.w2ui-label.w2ui-span2{width:40px;float:left}.w2ui-label.w2ui-span3{width:60px;float:left}.w2ui-label.w2ui-span4{width:80px;float:left}.w2ui-label.w2ui-span5{width:100px;float:left}.w2ui-label.w2ui-span6{width:120px;float:left}.w2ui-label.w2ui-span7{width:140px;float:left}.w2ui-label.w2ui-span8{width:160px;float:left}.w2ui-label.w2ui-span9{width:180px;float:left}.w2ui-label.w2ui-span10{width:200px;float:left}.w2ui-field{margin-bottom:3px;margin-left:128px;padding:3px;min-height:20px}.w2ui-field.w2ui-span1{margin-left:28px;float:none}.w2ui-field.w2ui-span2{margin-left:48px;float:none}.w2ui-field.w2ui-span3{margin-left:68px;float:none}.w2ui-field.w2ui-span4{margin-left:88px;float:none}.w2ui-field.w2ui-span5{margin-left:108px;float:none}.w2ui-field.w2ui-span6{margin-left:128px;float:none}.w2ui-field.w2ui-span7{margin-left:148px;float:none}.w2ui-field.w2ui-span8{margin-left:168px;float:none}.w2ui-field.w2ui-span9{margin-left:188px;float:none}.w2ui-field.w2ui-span10{margin-left:208px;float:none}.w2ui-required{position:relative}.w2ui-required::before{content:'*';position:absolute;margin-top:5px;margin-left:-9px;color:red}.w2ui-error{border:1px solid #ffa8a8!important;background-color:#fff4eb!important}.w2ui-field-helper{position:absolute;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-field-helper .w2ui-field-up{position:absolute;top:0;padding:2px 3px}.w2ui-field-helper .w2ui-field-down{position:absolute;bottom:0;padding:2px 3px}.w2ui-field-helper .arrow-up:hover{border-bottom-color:#81C6FF}.w2ui-field-helper .arrow-down:hover{border-top-color:#81C6FF}.w2ui-field-helper .arrow-up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-down{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-left{width:0;height:0;border-bottom:4px solid transparent;border-top:4px solid transparent;border-right:5px solid #777;font-size:0;line-height:0}.w2ui-field-helper .arrow-right{width:0;height:0;border-bottom:4px solid transparent;border-top:4px solid transparent;border-left:5px solid #777;font-size:0;line-height:0}.w2ui-color{padding:5px;background-color:#fff;border-radius:3px}.w2ui-color>table{table-layout:fixed;width:160px}.w2ui-color>table td{width:20px;height:20px}.w2ui-color>table td div{cursor:pointer;display:inline-block;width:16px;height:17px;padding:1px 4px;border:1px solid transparent;color:#fff;text-shadow:0 0 2px #000}.w2ui-color>table td div:hover{outline:1px solid #666;border:1px solid #fff}.w2ui-calendar{position:absolute;z-index:1600;display:none;margin:3px 0 0 -2px;padding:0;border:1px solid #aaa;border-radius:4px;box-shadow:2px 2px 8px #bbb;line-height:108%}.w2ui-calendar .w2ui-calendar-title{padding:5px 1px 6px;border-top-left-radius:4px;border-top-right-radius:4px;background-image:-webkit-linear-gradient(#e6e6e6,#c2c4c4);background-image:-moz-linear-gradient(#e6e6e6,#c2c4c4);background-image:-ms-linear-gradient(#e6e6e6,#c2c4c4);background-image:-o-linear-gradient(#e6e6e6,#c2c4c4);background-image:linear-gradient(#e6e6e6,#c2c4c4);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffc2c4c4', GradientType=0);border-bottom:1px solid #999;color:#000;text-align:center;font-weight:700}.w2ui-calendar .w2ui-calendar-previous,.w2ui-calendar .w2ui-calendar-next{width:24px;height:20px;color:#666;border:1px solid transparent;border-radius:3px;padding:2px 3px 1px 2px;margin:-4px 0 0 0;cursor:default}.w2ui-calendar .w2ui-calendar-previous:hover,.w2ui-calendar .w2ui-calendar-next:hover{border:1px solid silver;background-color:#efefef}.w2ui-calendar .w2ui-calendar-previous{float:left}.w2ui-calendar .w2ui-calendar-next{float:right}.w2ui-calendar table.w2ui-calendar-days{border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:0}.w2ui-calendar table.w2ui-calendar-days td{border:1px solid #e8e8e8;color:#000;background-color:#f4f4fe;padding:5px;cursor:default;text-align:right}.w2ui-calendar table.w2ui-calendar-days td.w2ui-saturday,.w2ui-calendar table.w2ui-calendar-days td.w2ui-sunday{border:1px solid #e8e8e8;color:#c8493b;background-color:#f4f4fe}.w2ui-calendar table.w2ui-calendar-days td.w2ui-saturday:hover,.w2ui-calendar table.w2ui-calendar-days td.w2ui-sunday:hover{border:1px solid #aaa;color:#000;background-color:#ff0}.w2ui-calendar table.w2ui-calendar-days td.w2ui-today{border:1px solid #8cb067;color:#000;background-color:#e2f7cd}.w2ui-calendar table.w2ui-calendar-days td:hover{border:1px solid #aaa;color:#000;background-color:#ff0}.w2ui-calendar table.w2ui-calendar-days td.w2ui-blocked-date{text-decoration:line-through;border:1px solid #e8e8e8;color:gray;background-color:#e8e8e8}.w2ui-calendar table.w2ui-calendar-days td.w2ui-day-empty{border:1px solid #e8e8e8;background-color:#f4f4fe}.w2ui-calendar table.w2ui-calendar-days tr.w2ui-day-title td{border:1px solid #e8e8e8;color:gray;background-color:#e8e8e8;text-align:center;padding:5px}.w2ui-list{color:inherit;position:absolute;padding:0;margin:0;min-height:25px;overflow:auto;border:1px solid silver;border-radius:3px;font-size:6px;line-height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;background-color:#fff}.w2ui-list input[type=text]{-webkit-box-shadow:none;-moz-box-shadow:none;-ms-box-shadow:none;-o-box-shadow:none;box-shadow:none}.w2ui-list ul{list-style-type:none;background-color:#000;margin:0;padding:0}.w2ui-list ul li{float:left;margin:2px 1px 0 2px;border-radius:3px;width:auto;padding:1px 5px;border:1px solid #88b0d6;background-color:#eff3f5;white-space:nowrap;cursor:default;font-family:verdana;font-size:11px;line-height:normal}.w2ui-list ul li:hover{background-color:#d0dbe1}.w2ui-list ul li:last-child{border-radius:0;border:1px solid transparent;background-color:transparent}.w2ui-list ul li:last-child input{padding:0;margin:0;outline:0;border:0}.w2ui-list ul li div{float:right;width:15px;height:16px;margin:-1px -3px 0 4px;border-radius:15px}.w2ui-list ul li div:hover{background-color:#D77F7F;color:#fff}.w2ui-list ul li div:before{position:relative;top:1px;left:4px;color:inherit;opacity:.6;text-shadow:inherit;content:'x'}.w2ui-list ul li input{width:10px;background-color:transparent}.w2ui-items{position:absolute;margin-top:6px;display:none;z-index:1600;background-color:#fff;border:3px solid #777;box-shadow:0 3px 8px #999;border-radius:4px;text-align:left}.w2ui-items:before{content:"";position:absolute;z-index:1601;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid transparent;border-bottom-color:inherit;margin:-8px 0 0 5px}.w2ui-items .w2ui-items-list{border-radius:4px;padding:3px}.w2ui-items .w2ui-empty-list{padding:5px 2px;text-align:center;color:gray}.w2ui-items ul li{display:block;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;padding:5px;cursor:pointer}.w2ui-items ul li.w2ui-item-even{color:inherit;background-color:#fff}.w2ui-items ul li.w2ui-item-odd{color:inherit;background-color:#f3f6fa}.w2ui-items ul li.w2ui-item-group{color:#444;font-weight:700;background-color:#ECEDF0;border-bottom:1px solid #D3D2D4}.w2ui-items ul li.selected{color:inherit;background-color:#b6d5ff}.w2ui-upload{position:absolute;background-color:#fff;border:1px solid silver!important;border-radius:3px;text-align:center;overflow:auto}.w2ui-upload>span:first-child{pointer-events:none;margin:0;padding:0;font-size:14px!important;color:#999}.w2ui-upload.dragover{background-color:#D9FFD5;border:1px solid #93E07D}.w2ui-upload .file-list{margin:0;padding:0;margin-bottom:6px}.w2ui-upload .file-list li{padding:2px 5px;font-family:verdana;font-size:11px;line-height:normal;float:left;display:inline-block;border:1px solid #88b0d6;background-color:#eff3f5;border-radius:3px;margin:2px 0 2px 2px;text-align:left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:default;width:auto;max-width:400px}.w2ui-upload .file-list li:hover{background-color:#d0dbe1}.w2ui-upload .file-list li>span.file-size{pointer-events:none;color:#777}.w2ui-upload .file-list li>span.file-name{pointer-events:none}.w2ui-upload .file-list li>div.file-delete{float:right;z-index:1;width:16px;height:16px;margin:-1px -4px 0 4px;border-radius:15px}.w2ui-upload .file-list li>div.file-delete:hover{background-color:#D77F7F;color:#fff}.w2ui-upload .file-list li>div.file-delete:before{position:relative;top:1px;left:5px;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-layout{overflow:hidden!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout>div{position:absolute;overflow:hidden;border:0;margin:0;padding:0;outline:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-layout>div .w2ui-panel{display:none;position:absolute;z-index:120}.w2ui-layout>div .w2ui-panel .w2ui-panel-tabs{position:absolute;left:0;top:0;right:0;z-index:2;display:none;overflow:hidden;background-color:#fafafa;padding:4px 0}.w2ui-layout>div .w2ui-panel .w2ui-panel-tabs>.w2ui-tab.active{background-color:#f5f6f7}.w2ui-layout>div .w2ui-panel .w2ui-panel-toolbar{position:absolute;left:0;top:0;right:0;z-index:2;display:none;overflow:hidden;background-color:#fafafa;border-bottom:1px solid silver;padding:4px}.w2ui-layout>div .w2ui-panel .w2ui-panel-content{position:absolute;left:0;top:0;right:0;bottom:0;z-index:1;color:inherit;background-color:#f5f6f7}.w2ui-layout>div .w2ui-resizer{display:none;position:absolute;z-index:121;background-color:transparent}.w2ui-layout>div .w2ui-resizer:hover,.w2ui-layout>div .w2ui-resizer.active{background-color:#d7e4f2}.w2ui-grid{position:relative;border:1px solid silver;border-radius:2px;overflow:hidden!important}.w2ui-grid>div{position:absolute;overflow:hidden}.w2ui-grid .w2ui-grid-header{position:absolute;border-bottom:1px solid #99bbe8!important;height:28px;overflow:hidden;color:#444;font-size:13px;text-align:center;padding:7px;background-image:-webkit-linear-gradient(#dae6f3,#c2d5ed);background-image:-moz-linear-gradient(#dae6f3,#c2d5ed);background-image:-ms-linear-gradient(#dae6f3,#c2d5ed);background-image:-o-linear-gradient(#dae6f3,#c2d5ed);background-image:linear-gradient(#dae6f3,#c2d5ed);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffdae6f3', endColorstr='#ffc2d5ed', GradientType=0);border-top-left-radius:2px;border-top-right-radius:2px}.w2ui-grid .w2ui-grid-toolbar{position:absolute;border-bottom:1px solid silver;background-color:#dee0e4;height:38px;padding:7px 3px 4px;margin:0;box-shadow:0 1px 2px #ddd}.w2ui-grid .w2ui-toolbar-search{width:160px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-all{outline:0;width:160px;border-radius:10px;line-height:100%;height:22px;border:1px solid #999;color:#000;background-color:#fff;padding:3px 18px 3px 23px;margin:0}.w2ui-grid .w2ui-toolbar-search .w2ui-search-down{position:absolute;margin-top:-7px;margin-left:6px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear{position:absolute;width:16px;height:16px;margin-top:-8px;margin-left:-20px;border-radius:15px}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear:hover{background-color:#D77F7F;color:#fff}.w2ui-grid .w2ui-toolbar-search .w2ui-search-clear:before{position:relative;top:1px;left:5px;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-grid .w2ui-grid-body{position:absolute;overflow:hidden;padding:0;background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-grid .w2ui-grid-body input,.w2ui-grid .w2ui-grid-body select,.w2ui-grid .w2ui-grid-body textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;-o-user-select:text;user-select:text}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns{overflow:hidden;position:absolute;left:0;top:0;right:0;box-shadow:0 1px 4px #ddd;height:auto}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns table{height:auto}.w2ui-grid .w2ui-grid-body .w2ui-grid-columns .w2ui-resizer{position:absolute;display:block;background-image:none;background-color:rgba(0,0,0,0);padding:0;margin:0;width:6px;height:12px;cursor:col-resize}.w2ui-grid .w2ui-grid-body .w2ui-grid-records{position:absolute;left:0;right:0;top:0;bottom:0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd{color:inherit;background-color:#fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd.w2ui-empty-record:hover{background-color:#fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even{color:inherit;background-color:#f3f6fa}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even.w2ui-empty-record:hover{background-color:#f3f6fa}.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr.w2ui-selected,.w2ui-grid .w2ui-grid-body .w2ui-grid-records table tr td.w2ui-selected{color:#000!important;background-color:#b6d5ff!important}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded{background-color:#CCDCF0!important}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded1{height:0;border-bottom:1px solid #b2bac0;background-color:#CCDCF0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded1>div{height:100%;margin:0;padding:0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded2{height:0;border-radius:0;border-bottom:1px solid #b2bac0}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-expanded2>div{height:0;border:0;transition:height .3s,opacity .3s}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more{border-top:1px solid #d6d5d7;cursor:pointer}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more>div{text-align:center;color:#777;background-color:rgba(233,237,243,.5);padding:10px 0 15px;border-top:1px solid #fff}.w2ui-grid .w2ui-grid-body .w2ui-grid-records .w2ui-load-more>div:hover{color:inherit;background-color:#e6f0ff}.w2ui-grid .w2ui-grid-body table{border-spacing:0;border-collapse:collapse;table-layout:fixed;width:1px}.w2ui-grid .w2ui-grid-body table .w2ui-head{margin:0;padding:0;border-right:1px solid #c5c5c5;border-bottom:1px solid #c5c5c5;color:#000;background-image:-webkit-linear-gradient(#f9f9f9,#e4e4e4);background-image:-moz-linear-gradient(#f9f9f9,#e4e4e4);background-image:-ms-linear-gradient(#f9f9f9,#e4e4e4);background-image:-o-linear-gradient(#f9f9f9,#e4e4e4);background-image:linear-gradient(#f9f9f9,#e4e4e4);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#ffe4e4e4', GradientType=0)}.w2ui-grid .w2ui-grid-body table .w2ui-head>div{padding:7px 3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.w2ui-grid .w2ui-grid-body table td{border-right:1px solid #d6d5d7;border-bottom:0 solid #d6d5d7;cursor:default;overflow:hidden}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data{margin:0;padding:0}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data>div{padding:3px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.w2ui-grid .w2ui-grid-body table td.w2ui-grid-data>div.flexible-record{height:auto;overflow:visible;white-space:normal}.w2ui-grid .w2ui-grid-body table td:last-child{border-right:0}.w2ui-grid .w2ui-grid-body table .w2ui-col-number{width:34px;color:#777;background-color:rgba(233,237,243,.5)}.w2ui-grid .w2ui-grid-body table .w2ui-col-number div{padding:0 7px 0 3px;text-align:right}.w2ui-grid .w2ui-grid-body table .w2ui-col-select{width:26px}.w2ui-grid .w2ui-grid-body table .w2ui-col-select div{padding:0;text-align:center;overflow:hidden}.w2ui-grid .w2ui-grid-body table .w2ui-col-select div input[type=checkbox]{margin-top:2px;position:relative}.w2ui-grid .w2ui-grid-body table .w2ui-col-expand{width:26px}.w2ui-grid .w2ui-grid-body table .w2ui-col-expand div{padding:0;text-align:center;font-weight:700}.w2ui-grid .w2ui-grid-body div.w2ui-sort-up{background:url(data:image/png;base64,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) no-repeat center right!important;height:auto!important;width:100%;overflow:hidden}.w2ui-grid .w2ui-grid-body div.w2ui-sort-down{background:url(data:image/png;base64,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) no-repeat center right!important;height:auto!important;width:100%;overflow:hidden}.w2ui-grid .w2ui-grid-body .w2ui-col-group{text-align:center}.w2ui-grid .w2ui-changed{background:url(data:image/gif;base64,R0lGODlhCgAKAJEAALAABf///wAAAAAAACH5BAEAAAIALAAAAAAKAAoAAAIPlI8Hy8mbxIsSUnup3rQAADs=) no-repeat top right}.w2ui-grid .w2ui-editable{overflow:hidden;height:100%!important;margin:0!important;padding:0!important}.w2ui-grid .w2ui-editable input{border:0;border-radius:0;margin:0;padding:4px 3px;width:100%;height:100%}.w2ui-grid .w2ui-grid-summary{position:absolute;box-shadow:0 -1px 4px #aaa}.w2ui-grid .w2ui-grid-summary table{color:inherit}.w2ui-grid .w2ui-grid-summary table .w2ui-odd{background-color:#eef5eb}.w2ui-grid .w2ui-grid-summary table .w2ui-even{background-color:#f8fff5}.w2ui-grid .w2ui-grid-footer{position:absolute;margin:0;padding:0;text-align:center;height:24px;overflow:hidden;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;-o-user-select:text;user-select:text;box-shadow:0 -1px 4px #eee;color:#444;background-color:#f8f8f8;border-top:1px solid #ddd;border-bottom-left-radius:2px;border-bottom-right-radius:2px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-left{float:left;padding-top:5px;padding-left:5px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-right{float:right;padding-top:5px;padding-right:5px}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center{padding:2px;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav{width:110px;margin:0 auto;padding:0;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav input[type=text]{padding:1px 2px 2px;border-radius:3px;width:40px;text-align:center}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav a.w2ui-footer-btn{display:inline-block;border-radius:3px;cursor:pointer;font-size:11px;line-height:16px;padding:1px 5px;width:30px;height:18px;margin-top:-1px;color:#000;background-color:transparent}.w2ui-grid .w2ui-grid-footer .w2ui-footer-center .w2ui-footer-nav a.w2ui-footer-btn:hover{color:#000;background-color:#aec8ff}.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-odd:hover,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-even:hover{background-color:inherit}.w2ui-ss .w2ui-grid-records table td{border-right-width:1px;border-bottom:1px solid #efefef}.w2ui-ss .w2ui-grid-records table tr:first-child td{border-bottom:0}.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr.w2ui-selected,.w2ui-ss .w2ui-grid-body .w2ui-grid-records table tr td.w2ui-selected{background-color:#EEF4FE!important}.w2ui-ss .w2ui-changed{background:inherit}.w2ui-ss .w2ui-grid-body .w2ui-selection{position:absolute;border:2px solid #6299DA;pointer-events:none}.w2ui-ss .w2ui-grid-body .w2ui-selection .w2ui-selection-resizer{cursor:crosshair;position:absolute;bottom:0;right:0;width:6px;height:6px;margin-right:-3px;margin-bottom:-3px;background-color:#457FC2;border:.5px solid #fff;outline:1px solid #fff;pointer-events:auto}.w2ui-overlay .w2ui-select-field{padding:8px 5px;cursor:default}.w2ui-overlay .w2ui-select-field table{font-size:11px;font-family:Verdana,Arial;border-spacing:0;border-collapse:border-collapse}.w2ui-overlay .w2ui-select-field table tr:hover{background-color:#b6d5ff}.w2ui-overlay .w2ui-select-field table td:nth-child(1){padding:3px 3px 3px 6px}.w2ui-overlay .w2ui-select-field table td:nth-child(1) input{margin:3px 2px 2px}.w2ui-overlay .w2ui-select-field table td:nth-child(2){padding:3px 15px 3px 3px}.w2ui-overlay .w2ui-col-on-off{padding:4px 0}.w2ui-overlay .w2ui-col-on-off table{border-spacing:0;border-collapse:border-collapse}.w2ui-overlay .w2ui-col-on-off table tr:hover{background-color:#b6d5ff}.w2ui-overlay .w2ui-col-on-off table td input[type=checkbox]{margin:3px 2px 2px}.w2ui-overlay .w2ui-col-on-off table td label{display:block;padding:3px 0;padding-right:10px}.w2ui-overlay .w2ui-col-on-off table td:first-child{padding:4px 0 4px 6px}.w2ui-overlay .w2ui-col-on-off table td:last-child{padding:4px 6px 4px 0}.w2ui-overlay .w2ui-grid-searches{text-align:left;padding:0;border-top:0;background-color:#f3f1d9}.w2ui-overlay .w2ui-grid-searches table{padding:4px;padding-top:8px;border-collapse:border-collapse}.w2ui-overlay .w2ui-grid-searches table td{padding:4px}.w2ui-overlay .w2ui-grid-searches table td.close-btn{width:20px;padding-right:20px}.w2ui-overlay .w2ui-grid-searches table td.close-btn input{width:25px!important}.w2ui-overlay .w2ui-grid-searches table td.caption{text-align:right;padding-right:5px;border-right:1px solid silver}.w2ui-overlay .w2ui-grid-searches table td.operator{text-align:left;padding:0 10px;padding-right:5px;border-right:1px solid silver}.w2ui-overlay .w2ui-grid-searches table td.value{padding-right:5px;padding-left:5px;background-color:#f7f6f0}.w2ui-overlay .w2ui-grid-searches table td.value input[type=text]{border-radius:3px;padding:3px;margin-right:3px;height:23px}.w2ui-overlay .w2ui-grid-searches table td.value select{padding:3px;margin-right:3px;height:23px}.w2ui-overlay .w2ui-grid-searches table td.actions{border-right:0;padding:20px 0 10px;text-align:center}.w2ui-overlay .w2ui-grid-searches table td input[type=button]{width:70px;margin:0 2px}.w2ui-popup{position:fixed;z-index:1600;overflow:hidden;font-family:Verdana,Arial;border-radius:6px;padding:0;margin:0;border:1px solid #777;background-color:#eee;box-shadow:0 0 25px #555}.w2ui-popup,.w2ui-popup *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-popup .w2ui-msg-title{padding:6px;border-radius:6px 6px 0 0;background-image:-webkit-linear-gradient(#ececec,#dfdfdf);background-image:-moz-linear-gradient(#ececec,#dfdfdf);background-image:-ms-linear-gradient(#ececec,#dfdfdf);background-image:-o-linear-gradient(#ececec,#dfdfdf);background-image:linear-gradient(#ececec,#dfdfdf);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffececec', endColorstr='#ffdfdfdf', GradientType=0);border-bottom:2px solid #bfbfbf;position:absolute;overflow:hidden;height:32px;left:0;right:0;top:0;text-overflow:ellipsis;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:move;font-size:15px;color:#555;z-index:300}.w2ui-popup .w2ui-msg-button{float:right;width:18px;height:18px;cursor:pointer;overflow:hidden;padding:0;margin:0 3px 0 0;background:url(data:image/png;base64,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) no-repeat center left;background-position:0 0;color:transparent!important;border-radius:3px;border:1px solid transparent}.w2ui-popup .w2ui-msg-close{margin-top:0;background-position:-32px 0}.w2ui-popup .w2ui-msg-close:hover{background-color:#ccc;border:1px solid #aaa}.w2ui-popup .w2ui-msg-max{background-position:-16px 0}.w2ui-popup .w2ui-msg-max:hover{background-color:#ccc;border:1px solid #aaa}.w2ui-popup .w2ui-box1,.w2ui-popup .w2ui-box2{position:absolute;left:0;right:0;top:32px;bottom:35px;z-index:100}.w2ui-popup .w2ui-msg-body{font-size:13px;line-height:130%;padding:0 7px 7px;color:#000;background-color:#eee;position:absolute;overflow:auto;width:100%;height:100%}.w2ui-popup .w2ui-popup-message{position:absolute;z-index:250;background-color:#f9f9f9;border:1px solid #999;box-shadow:0 0 15px #aaa;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;border-top:0;border-radius:0 0 6px 6px;overflow:auto}.w2ui-popup .w2ui-msg-buttons{padding:8px;border-radius:0 0 6px 6px;border-top:1px solid #d5d8d8;background-color:#f1f1f1;text-align:center;position:absolute;overflow:hidden;height:42px;left:0;right:0;bottom:0;z-index:200}.w2ui-popup .w2ui-popup-button{width:70px;margin:0 5px}.w2ui-popup .w2ui-msg-no-title{border-top-left-radius:6px;border-top-right-radius:6px;top:0!important}.w2ui-popup .w2ui-msg-no-buttons{border-bottom-left-radius:6px;border-bottom-right-radius:6px;bottom:0!important}.w2ui-sidebar{cursor:default;overflow:hidden!important;background-color:#edf1f6!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-sidebar *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box}.w2ui-sidebar>div{position:relative;overflow:hidden}.w2ui-sidebar .w2ui-sidebar-top{position:absolute;z-index:2;top:0;left:0;right:0}.w2ui-sidebar .w2ui-sidebar-bottom{position:absolute;z-index:2;bottom:0;left:0;right:0}.w2ui-sidebar .w2ui-sidebar-div{position:absolute;z-index:1;overflow:auto;top:0;bottom:0;left:0;right:0;padding:2px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-sidebar .w2ui-sidebar-div table{width:100%}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node{background-image:-webkit-linear-gradient(#edf1f6,#edf1f6);background-image:-moz-linear-gradient(#edf1f6,#edf1f6);background-image:-ms-linear-gradient(#edf1f6,#edf1f6);background-image:-o-linear-gradient(#edf1f6,#edf1f6);background-image:linear-gradient(#edf1f6,#edf1f6);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffedf1f6', endColorstr='#ffedf1f6', GradientType=0);border-top:1px solid transparent;border-bottom:1px solid transparent;margin:0;padding:1px 0}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node table{pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node td.w2ui-node-dots{color:#000;text-shadow:0 0 0 #fff;pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-caption:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span:hover,.w2ui-sidebar .w2ui-sidebar-div .w2ui-node td.w2ui-node-dots:hover{color:inherit}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node:hover{border-top:1px solid #f9f9f9;border-bottom:1px solid #f9f9f9;background-image:-webkit-linear-gradient(#d7e1ef,#d7e1ef);background-image:-moz-linear-gradient(#d7e1ef,#d7e1ef);background-image:-ms-linear-gradient(#d7e1ef,#d7e1ef);background-image:-o-linear-gradient(#d7e1ef,#d7e1ef);background-image:linear-gradient(#d7e1ef,#d7e1ef);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffd7e1ef', endColorstr='#ffd7e1ef', GradientType=0)}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image{width:22px;text-align:center;pointer-events:none}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node .w2ui-node-image>span{color:#516173!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover{background-image:-webkit-linear-gradient(#69b1e0,#4a96d3);background-image:-moz-linear-gradient(#69b1e0,#4a96d3);background-image:-ms-linear-gradient(#69b1e0,#4a96d3);background-image:-o-linear-gradient(#69b1e0,#4a96d3);background-image:linear-gradient(#69b1e0,#4a96d3);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff69b1e0', endColorstr='#ff4a96d3', GradientType=0);border-top:1px solid #5295cd;border-bottom:1px solid #2661a6}.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected td.w2ui-node-dots,.w2ui-sidebar .w2ui-sidebar-div .w2ui-selected:hover td.w2ui-node-dots{color:#fff!important;text-shadow:1px 1px 2px #666!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover{background-image:-webkit-linear-gradient(#edf1f6,#edf1f6);background-image:-moz-linear-gradient(#edf1f6,#edf1f6);background-image:-ms-linear-gradient(#edf1f6,#edf1f6);background-image:-o-linear-gradient(#edf1f6,#edf1f6);background-image:linear-gradient(#edf1f6,#edf1f6);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffedf1f6', endColorstr='#ffedf1f6', GradientType=0);border-top:1px solid transparent;border-bottom:1px solid transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-caption,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-image,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover .w2ui-node-image>span,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled td.w2ui-node-dots,.w2ui-sidebar .w2ui-sidebar-div .w2ui-disabled:hover td.w2ui-node-dots{opacity:.4;filter:alpha(opacity=15);color:#000!important;text-shadow:0 0 0 #fff!important}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-caption{white-space:nowrap;padding:5px 0 5px 3px;margin:1px 0 1px 22px;position:relative;z-index:1;font-size:12px}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group{white-space:nowrap;overflow:hidden;padding:10px 0 10px 10px;margin:0;cursor:default;color:#868b92;background-color:transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group :nth-child(1){margin-right:10px;float:right;color:transparent}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-group :nth-child(2){font-weight:400;text-transform:uppercase}.w2ui-sidebar .w2ui-sidebar-div .w2ui-node-sub{overflow:hidden}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-dots{width:18px;padding:0 0 1px 7px;text-align:center}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-dots .w2ui-expand{width:16px;margin-top:-3px;pointer-events:auto}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data{padding:1px 1px 3px}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image{padding:3px 0 0;float:left}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image>span{font-size:16px;color:#000;text-shadow:0 0 0 #fff}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-image.w2ui-icon{margin-top:3px}.w2ui-sidebar .w2ui-sidebar-div td.w2ui-node-data .w2ui-node-count{float:right;border:1px solid #9da4af;border-radius:20px;width:auto;height:18px;padding:2px 7px;margin:3px 4px -2px 0;background-color:#e7f0fc;color:#667274;box-shadow:0 0 2px #fff;text-shadow:1px 1px 1px #e6e6e6;position:relative;z-index:2}.w2ui-tabs{cursor:default;overflow:hidden!important;background-color:#fafafa;padding:3px 0;padding-bottom:0!important}.w2ui-tabs table{border-bottom:1px solid silver;padding:0 7px}.w2ui-tabs .w2ui-tab{padding:6px 20px;text-align:center;color:#000;background-color:transparent;border:1px solid silver;border-bottom:1px solid silver;white-space:nowrap;margin:1px 1px -1px 0;border-top-left-radius:4px;border-top-right-radius:4px;cursor:default}.w2ui-tabs .w2ui-tab.active{color:#000;background-color:#fff;border:1px solid silver;border-bottom:1px solid transparent}.w2ui-tabs .w2ui-tab.closable{padding:6px 28px 6px 20px}.w2ui-tabs .w2ui-tab-close{color:#555;text-shadow:1px 1px 1px #bbb;float:right;margin:6px 4px 0 0;padding:0 0 0 5px;width:16px;height:16px;opacity:.9;border:0;border-top:3px solid transparent;border-radius:9px}.w2ui-tabs .w2ui-tab-close:hover{background-color:#D77F7F;color:#fff}.w2ui-tabs .w2ui-tab-close:before{position:relative;top:-2px;left:0;opacity:.6;color:inherit;text-shadow:inherit;content:'x'}.w2ui-toolbar{margin:0;padding:2px;outline:0;background-color:#efefef;overflow:hidden!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.w2ui-toolbar .disabled{opacity:.3;filter:alpha(opacity=15)}.w2ui-toolbar table{table-layout:auto!important}.w2ui-toolbar table td{border:0!important}.w2ui-toolbar table.w2ui-button{margin:0 1px;border-radius:4px;height:24px;border:1px solid transparent;background-color:transparent}.w2ui-toolbar table.w2ui-button .w2ui-tb-image{width:16px;height:16px;padding:0;margin:3px!important;border:0!important;text-align:center}.w2ui-toolbar table.w2ui-button .w2ui-tb-image>span{font-size:16px;color:#516173}.w2ui-toolbar table.w2ui-button .w2ui-tb-caption{color:#000;padding:0 4px 0 2px}.w2ui-toolbar table.w2ui-button .w2ui-tb-down{width:12px;height:24px;display:block;background:url(data:image/png;base64,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) no-repeat center right}.w2ui-toolbar table.w2ui-button.over{border:1px solid #ccc;background-color:#eee}.w2ui-toolbar table.w2ui-button.over .w2ui-tb-caption{color:#000}.w2ui-toolbar table.w2ui-button.down{border:1px solid #aaa;background-color:#ddd}.w2ui-toolbar table.w2ui-button.down .w2ui-tb-caption{color:#666}.w2ui-toolbar table.w2ui-button.checked{border:1px solid #aaa;background-color:#fff}.w2ui-toolbar table.w2ui-button.checked .w2ui-tb-caption{color:#000}.w2ui-toolbar table.w2ui-button table{height:17px;border-radius:4px;cursor:default}.w2ui-toolbar .w2ui-break{background-image:-webkit-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-moz-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-ms-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:-o-linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);background-image:linear-gradient(top,rgba(153,153,153,.09999999999999998) 0,#999 40%,#999 60%,rgba(153,153,153,.09999999999999998) 100%);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff999999', endColorstr='#ff999999', GradientType=0);width:1px!important;height:22px;padding:0;margin:0 6px}.w2ui-overlay table.w2ui-drop-menu{width:100%;color:#000;background-color:#fff;padding:5px 0;cursor:default}.w2ui-overlay table.w2ui-drop-menu td:first-child{padding:4px 0 4px 6px}.w2ui-overlay table.w2ui-drop-menu td:last-child{padding:10px 15px 10px 5px}.w2ui-overlay table.w2ui-drop-menu tr.w2ui-selected{background-color:#d7e4f2}.w2ui-overlay table.w2ui-drop-menu tr.w2ui-selected td{color:inherit}.w2ui-overlay table.w2ui-drop-menu .w2ui-tb-image>span{font-size:16px;color:#516173;display:inline-block;padding-top:4px} diff --git a/editor.admin.class.php b/editor.admin.class.php index d1b838d..302b4f8 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -1092,7 +1092,7 @@ public function page() { '/>

-
+

@@ -1136,7 +1136,7 @@ public function page() {

-
+

@@ -1161,7 +1161,7 @@ public function page() {

-
+

@@ -1176,7 +1176,7 @@ public function page() {

-
+

@@ -1196,13 +1196,27 @@ public function page() {

-
+

+

+ > + +

+
+ +
+
+
+
+

+ +

+

> @@ -1211,7 +1225,7 @@ public function page() {

-
+

@@ -1231,7 +1245,7 @@ public function page() {

-
+

@@ -1246,7 +1260,7 @@ public function page() {

-
+

@@ -1266,7 +1280,7 @@ public function page() {

-
+

@@ -1281,7 +1295,7 @@ public function page() {

-
+

@@ -1301,7 +1315,7 @@ public function page() {

-
+

diff --git a/js/sam-admin-edit.js b/js/sam-admin-edit.js index 0ac1a8d..be69637 100644 --- a/js/sam-admin-edit.js +++ b/js/sam-admin-edit.js @@ -3,8 +3,6 @@ * @copyright 2010 */ (function ($) { - - $(document).ready(function () { $("#title").tooltip({ track: true @@ -73,11 +71,6 @@ showButtonPanel:true }); - /*var availableCats = options.cats; - var availableAuthors = options.authors; - var availableTags = options.tags; - var availableCustoms = options.customs;*/ - // Advertiser ComboGrid $('#adv_nick').combogrid({ url: ajaxurl+'?action=get_combo_data', @@ -93,419 +86,126 @@ } }); - // Posts Grid - var - postsGrid, - pgData = options.posts.posts, - pgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - pgColumns = [], - pgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - pgColumns.push(pgCheckboxSelector.getColumnDefinition()); - for (var i = 0; i < options.posts.columns.length; i++) { - options.posts.columns[i].editor = Slick.Editors.Text; - pgColumns.push(options.posts.columns[i]); - } - - postsGrid = new Slick.Grid("#posts-grid", pgData, pgColumns, pgOptions); - postsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - postsGrid.registerPlugin(pgCheckboxSelector); + function buildGrid(name, grig, vn, vi, field, gc, gr) { + //grig = $('#' + name); + //vi = $('#' + vn); + var iVal = vi.val(); + grig.w2grid({ + name: name, + show: {selectColumn: true}, + multiSelect: true, + columns: gc, + records: gr, + onSelect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onUnselect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + } + }); - var postsSelectedItems = $('#view_id').val(); - if (postsSelectedItems != '') { - var psi = postsSelectedItems.split(','), pgSI = []; - $.each(pgData, function (i, pd) { - $.each(psi, function (j, ed) { - if (ed == pd.id) pgSI.push(i); + if(null != iVal && '' != iVal) { + var arr = iVal.split(','); + + $.each(arr, function(i, val) { + $.each(gr, function(index, value) { + var iData = (field == 'id') ? value.id : value.slug; + if(iData == val) { + w2ui[name].select(value.recid); + return false; + } + else return true; + }); }); - }); - postsGrid.setSelectedRows(pgSI); + } } - postsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = postsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(pgData[row].id); - }); - $('#view_id').val(items.join(',')); - }); + // Custom Taxonomies Terms Grid + var cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'); + buildGrid('ctt-grid', cttGrid, 'view-custom-tax-terms', cttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); - // Users Grid - var - usersGrid, - ugData = options.users.users, - ugOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - ugColumns = [], - ugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - ugColumns.push(ugCheckboxSelector.getColumnDefinition()); - for(i = 0; i < options.users.columns.length; i++) ugColumns.push(options.users.columns[i]); - - usersGrid = new Slick.Grid('#users-grid', ugData, ugColumns, ugOptions); - usersGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - usersGrid.registerPlugin(ugCheckboxSelector); - - var usersSelectedItems = $('#x_view_users').val(); - if(usersSelectedItems != '') { - var usi = usersSelectedItems.split(','), ugSI = []; - $.each(ugData, function(i, ud) { - $.each(usi, function(j, ed) { - if(ed == ud.slug) ugSI.push(i); - }); - }); - usersGrid.setSelectedRows(ugSI); - } + // Posts Grid + var postsGrid = $('#posts-grid'), postsIn = $('#view_id'); + buildGrid('posts-grid', postsGrid, 'view_id', postsIn, 'id', options.posts.columns, options.posts.posts); - usersGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = usersGrid.getSelectedRows(); - $.each(sr, function(i, row) { - items.push(ugData[row].slug); - }); - $('#x_view_users').val(items.join(',')); - return false; - }); + // Users Grid + var usersGrid = $('#users-grid'), usersIn = $('#x_view_users'); + buildGrid('users-grid', usersGrid, 'x_view_users', usersIn, 'slug', options.users.columns, options.users.users); // xPosts Grid - var - xpostsGrid, - xpgColumns = [], - xpgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xpgColumns.push(xpgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.posts.columns.length; i++) xpgColumns.push(options.posts.columns[i]); - - xpostsGrid = new Slick.Grid("#x-posts-grid", pgData, xpgColumns, pgOptions); - xpostsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xpostsGrid.registerPlugin(xpgCheckboxSelector); - - var xpostsSelectedItems = $('#x_view_id').val(); - if (xpostsSelectedItems != '') { - var xpsi = xpostsSelectedItems.split(','), xpgSI = []; - $.each(pgData, function (i, pd) { - $.each(xpsi, function (j, ed) { - if (ed == pd.id) xpgSI.push(i); - }); - }); - xpostsGrid.setSelectedRows(xpgSI); - } - - xpostsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xpostsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(pgData[row].id); - }); - $('#x_view_id').val(items.join(',')); - }); + var xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'); + buildGrid('x-posts-grid', xpostsGrid, 'x_view_id', xpostsIn, 'id', options.posts.columns, options.posts.posts); // Categories Grid - var - catsGrid, - cgData = options.cats.cats, - cgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - cgColumns = [], - cgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - cgColumns.push(cgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.cats.columns.length; i++) { - options.cats.columns[i].editor = Slick.Editors.Text; - cgColumns.push(options.cats.columns[i]); - } - - catsGrid = new Slick.Grid("#cats-grid", cgData, cgColumns, cgOptions); - catsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - catsGrid.registerPlugin(cgCheckboxSelector); - - var catsSelectedItems = $('#view_cats').val(); - if (catsSelectedItems != '') { - var csi = catsSelectedItems.split(','), cgSI = []; - $.each(cgData, function (i, cd) { - $.each(csi, function (j, ed) { - if (ed == cd.slug) cgSI.push(i); - }); - }); - catsGrid.setSelectedRows(cgSI); - } - - catsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = catsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cgData[row].slug); - }); - $('#view_cats').val(items.join(',')); - }); + var catsGrid = $('#cats-grid'), catsIn = $('#view_cats'); + buildGrid('cats-grid', catsGrid, 'view_cats', catsIn, 'slug', options.cats.columns, options.cats.cats); // xCats Grid - var - xcatsGrid, - xcgColumns = [], - xcgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xcgColumns.push(xcgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.cats.columns.length; i++) xcgColumns.push(options.cats.columns[i]); - - xcatsGrid = new Slick.Grid("#x-cats-grid", cgData, xcgColumns, cgOptions); - xcatsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xcatsGrid.registerPlugin(xcgCheckboxSelector); - - var xcatsSelectedItems = $('#x_view_cats').val(); - if (xcatsSelectedItems != '') { - var xcsi = xcatsSelectedItems.split(','), xcgSI = []; - $.each(cgData, function (i, cd) { - $.each(xcsi, function (j, ed) { - if (ed == cd.slug) xcgSI.push(i); - }); - }); - xcatsGrid.setSelectedRows(xcgSI); - } - - xcatsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xcatsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cgData[row].slug); - }); - $('#x_view_cats').val(items.join(',')); - }); + var xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'); + buildGrid('x-cats-grid', xcatsGrid, 'x_view_cats', xcatsIn, 'slug', options.cats.columns, options.cats.cats); // Auth Grid - var - authGrid, - agData = options.authors.authors, - agOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - agColumns = [], - agCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - agColumns.push(agCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.authors.columns.length; i++) { - options.authors.columns[i].editor = Slick.Editors.Text; - agColumns.push(options.authors.columns[i]); - } - - authGrid = new Slick.Grid("#auth-grid", agData, agColumns, agOptions); - authGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - authGrid.registerPlugin(agCheckboxSelector); - - var authSelectedItems = $('#view_authors').val(); - if (authSelectedItems != '') { - var asi = authSelectedItems.split(','), agSI = []; - $.each(agData, function (i, cd) { - $.each(asi, function (j, ed) { - if (ed == cd.slug) agSI.push(i); - }); - }); - authGrid.setSelectedRows(agSI); - } - - authGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = authGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(agData[row].slug); - }); - $('#view_authors').val(items.join(',')); - }); + var authGrid = $('#auth-grid'), authIn = $('#view_authors'); + buildGrid('auth-grid', authGrid, 'view_authors', authIn, 'slug', options.authors.columns, options.authors.authors); // xauth Grid - var - xauthGrid, - xagColumns = [], - xagCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xagColumns.push(xagCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.authors.columns.length; i++) xagColumns.push(options.authors.columns[i]); - - xauthGrid = new Slick.Grid("#x-auth-grid", agData, xagColumns, agOptions); - xauthGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xauthGrid.registerPlugin(xagCheckboxSelector); - - var xauthSelectedItems = $('#x_view_authors').val(); - if (xauthSelectedItems != '') { - var xasi = xauthSelectedItems.split(','), xagSI = []; - $.each(agData, function (i, cd) { - $.each(xasi, function (j, ed) { - if (ed == cd.slug) xagSI.push(i); - }); - }); - xauthGrid.setSelectedRows(xagSI); - } - - xauthGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xauthGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(agData[row].slug); - }); - $('#x_view_authors').val(items.join(',')); - }); + var xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'); + buildGrid('x-auth-grid', xauthGrid, 'x_view_authors', xauthIn, 'slug', options.authors.columns, options.authors.authors); // Tags Grid - var - tagsGrid, - tgData = options.tags.tags, - tgOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - tgColumns = [], - tgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - tgColumns.push(tgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.tags.columns.length; i++) { - options.tags.columns[i].editor = Slick.Editors.Text; - tgColumns.push(options.tags.columns[i]); - } - - tagsGrid = new Slick.Grid("#tags-grid", tgData, tgColumns, tgOptions); - tagsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - tagsGrid.registerPlugin(tgCheckboxSelector); - - var tagsSelectedItems = $('#view_tags').val(); - if (tagsSelectedItems != '') { - var tsi = tagsSelectedItems.split(','), tgSI = []; - $.each(tgData, function (i, cd) { - $.each(tsi, function (j, ed) { - if (ed == cd.slug) tgSI.push(i); - }); - }); - tagsGrid.setSelectedRows(tgSI); - } - - tagsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = tagsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(tgData[row].slug); - }); - $('#view_tags').val(items.join(',')); - }); + var tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'); + buildGrid('tags-grid', tagsGrid, 'view_tags', tagsIn, 'slug', options.tags.columns, options.tags.tags); // xTags Grid - var - xtagsGrid, - xtgColumns = [], - xtgCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xtgColumns.push(xtgCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.tags.columns.length; i++) xtgColumns.push(options.tags.columns[i]); - - xtagsGrid = new Slick.Grid("#x-tags-grid", tgData, xtgColumns, tgOptions); - xtagsGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xtagsGrid.registerPlugin(xtgCheckboxSelector); - - var xtagsSelectedItems = $('#x_view_tags').val(); - if (xtagsSelectedItems != '') { - var xtsi = xtagsSelectedItems.split(','), xtgSI = []; - $.each(tgData, function (i, cd) { - $.each(xtsi, function (j, ed) { - if (ed == cd.slug) xtgSI.push(i); - }); - }); - xtagsGrid.setSelectedRows(xtgSI); - } - - xtagsGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xtagsGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(tgData[row].slug); - }); - $('#x_view_tags').val(items.join(',')); - }); + var xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'); + buildGrid('x-tags-grid', xtagsGrid, 'x_view_tags', xtagsIn, 'slug', options.tags.columns, options.tags.tags); // Customs Grid - var - custGrid, - cugData = options.customs.customs, - cugOptions = { - editable:true, - enableCellNavigation:true, - asyncEditorLoading:false, - autoEdit:false - }, - cugColumns = [], - cugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - cugColumns.push(cugCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.customs.columns.length; i++) { - options.customs.columns[i].editor = Slick.Editors.Text; - cugColumns.push(options.customs.columns[i]); - } - - custGrid = new Slick.Grid("#cust-grid", cugData, cugColumns, cugOptions); - custGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - custGrid.registerPlugin(cugCheckboxSelector); - - var custSelectedItems = $('#view_custom').val(); - if (custSelectedItems != '') { - var cusi = custSelectedItems.split(','), cugSI = []; - $.each(cugData, function (i, cd) { - $.each(cusi, function (j, ed) { - if (ed == cd.slug) cugSI.push(i); - }); - }); - custGrid.setSelectedRows(cugSI); - } - - custGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = custGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cugData[row].slug); - }); - $('#view_custom').val(items.join(',')); - }); + var custGrid = $('#cust-grid'), custIn = $('#view_custom'); + buildGrid('cust-grid', custGrid, 'view_custom', custIn, 'slug', options.customs.columns, options.customs.customs); // xCustoms Grid - var - xcustGrid, - xcugColumns = [], - xcugCheckboxSelector = new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"}); - - xcugColumns.push(xcugCheckboxSelector.getColumnDefinition()); - for (i = 0; i < options.customs.columns.length; i++) xcugColumns.push(options.customs.columns[i]); - - xcustGrid = new Slick.Grid("#x-cust-grid", cugData, xcugColumns, cugOptions); - xcustGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); - xcustGrid.registerPlugin(xcugCheckboxSelector); - - var xcustSelectedItems = $('#x_view_custom').val(); - if (xcustSelectedItems != '') { - var xcusi = xcustSelectedItems.split(','), xcugSI = []; - $.each(cugData, function (i, cd) { - $.each(xcusi, function (j, ed) { - if (ed == cd.slug) xcugSI.push(i); - }); - }); - xcustGrid.setSelectedRows(xcugSI); - } - - xcustGrid.onSelectedRowsChanged.subscribe(function (e) { - var items = [], sr = xcustGrid.getSelectedRows(); - $.each(sr, function (i, row) { - items.push(cugData[row].slug); - }); - $('#x_view_custom').val(items.join(',')); + var xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); + buildGrid('x-cust-grid', xcustGrid, 'x_view_custom', xcustIn, 'slug', options.customs.columns, options.customs.customs); + + $('#tabs').tabs({ + activate: function( event, ui ) { + var el = ui.newPanel[0].id; + if(el == 'tabs-1') { + postsGrid.w2render('posts-grid'); + } + if(el == 'tabs-2') { + if($('#rc-ctt').is(':visible')) cttGrid.w2render('ctt-grid'); + if($('#rc-xid').is(':visible')) xpostsGrid.w2render('x-posts-grid'); + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + if($('#rc-ac').is(':visible')) catsGrid.w2render('cats-grid'); + if($('#rc-xc').is(':visible')) xcatsGrid.w2render('x-cats-grid'); + if($('#rc-au').is(':visible')) authGrid.w2render('auth-grid'); + if($('#rc-xa').is(':visible')) xauthGrid.w2render('x-auth-grid'); + if($('#rc-at').is(':visible')) tagsGrid.w2render('tags-grid'); + if($('#rc-xt').is(':visible')) xtagsGrid.w2render('x-tags-grid'); + if($('#rc-cu').is(':visible')) custGrid.w2render('cust-grid'); + if($('#rc-xu').is(':visible')) xcustGrid.w2render('x-cust-grid'); + } + } }); - - $('#tabs').tabs(); - $("#add-file-button").click(function () { var curFile = options.url + $("select#files_list option:selected").val(); $("#ad_img").val(curFile); @@ -536,8 +236,9 @@ case '2': if ($('#rc-vt0').is(':visible')) $("#rc-vt0").hide('blind', {direction:'vertical'}, 500); if ($('#rc-vt2').is(':hidden')) { - $("#rc-vt2").show('blind', {direction:'vertical'}, 500); - postsGrid.invalidate(); + $("#rc-vt2").show('blind', {direction:'vertical'}, 500, function() { + postsGrid.w2render('posts-grid'); + }); } } }); @@ -548,17 +249,26 @@ if($('#custom-users').is(':visible')) $('#custom-users').hide('blind', {direction:'vertical'}, 500); } else { - if($('#custom-users').is(':hidden')) $('#custom-users').show('blind', {direction:'vertical'}, 500); + if($('#custom-users').is(':hidden')) + $('#custom-users').show('blind', {direction:'vertical'}, 500, function() { + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + }); } }); $("#ad_users_reg").click(function() { - if($('#ad_users_reg').is(':checked')) $('#x-reg-users').show('blind', {direction:'vertical'}, 500); + if($('#ad_users_reg').is(':checked')) + $('#x-reg-users').show('blind', {direction:'vertical'}, 500, function() { + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + }); else $('#x-reg-users').hide('blind', {direction:'vertical'}, 500); }); $('#x_ad_users').click(function() { - if($('#x_ad_users').is(':checked')) $('#x-view-users').show('blind', {direction:'vertical'}, 500); + if($('#x_ad_users').is(':checked')) + $('#x-view-users').show('blind', {direction:'vertical'}, 500, function() { + usersGrid.w2render('users-grid'); + }); else $('#x-view-users').hide('blind', {direction:'vertical'}, 500); }); @@ -569,15 +279,18 @@ $('#x_id').click(function () { if ($('#x_id').is(':checked')) { - $('#rc-xid').show('blind', {direction:'vertical'}, 500); - xpostsGrid.invalidate(); + $('#rc-xid').show('blind', {direction:'vertical'}, 500, function() { + xpostsGrid.w2render('x-posts-grid'); + }); } else $('#rc-xid').hide('blind', {direction:'vertical'}, 500); }); $('#ad_cats').click(function () { if ($('#ad_cats').is(':checked')) { - $('#rc-ac').show('blind', {direction:'vertical'}, 500); + $('#rc-ac').show('blind', {direction:'vertical'}, 500, function() { + catsGrid.w2render('cats-grid'); + }); $('#acw').show('blind', {direction:'vertical'}, 500); } else { @@ -587,13 +300,26 @@ }); $('#x_cats').click(function () { - if ($('#x_cats').is(':checked')) $('#rc-xc').show('blind', {direction:'vertical'}, 500); + if ($('#x_cats').is(':checked')) + $('#rc-xc').show('blind', {direction:'vertical'}, 500, function() { + xcatsGrid.w2render('x-cats-grid'); + }); else $('#rc-xc').hide('blind', {direction:'vertical'}, 500); }); + $('#ad_custom_tax_terms').click(function() { + if($('#ad_custom_tax_terms').is(':checked')) + $('#rc-ctt').show('blind', {direction: 'vertical'}, 500, function() { + cttGrid.w2render('ctt-grid'); + }); + else $('#rc-ctt').hide('blind', {direction:'vertical'}, 500); + }); + $('#ad_authors').click(function () { if ($('#ad_authors').is(':checked')) { - $('#rc-au').show('blind', {direction:'vertical'}, 500); + $('#rc-au').show('blind', {direction:'vertical'}, 500, function() { + authGrid.w2render('auth-grid'); + }); $('#aaw').show('blind', {direction:'vertical'}, 500); } else { @@ -603,13 +329,18 @@ }); $('#x_authors').click(function () { - if ($('#x_authors').is(':checked')) $('#rc-xa').show('blind', {direction:'vertical'}, 500); + if ($('#x_authors').is(':checked')) + $('#rc-xa').show('blind', {direction:'vertical'}, 500, function() { + xauthGrid.w2render('x-auth-grid'); + }); else $('#rc-xa').hide('blind', {direction:'vertical'}, 500); }); $('#ad_tags').click(function () { if ($('#ad_tags').is(':checked')) { - $('#rc-at').show('blind', {direction:'vertical'}, 500); + $('#rc-at').show('blind', {direction:'vertical'}, 500, function() { + tagsGrid.w2render('tags-grid'); + }); $('#atw').show('blind', {direction:'vertical'}, 500); } else { @@ -619,13 +350,18 @@ }); $('#x_tags').click(function () { - if ($('#x_tags').is(':checked')) $('#rc-xt').show('blind', {direction:'vertical'}, 500); + if ($('#x_tags').is(':checked')) + $('#rc-xt').show('blind', {direction:'vertical'}, 500, function() { + xtagsGrid.w2render('x-tags-grid'); + }); else $('#rc-xt').hide('blind', {direction:'vertical'}, 500); }); $('#ad_custom').click(function () { if ($('#ad_custom').is(':checked')) { - $('#rc-cu').show('blind', {direction:'vertical'}, 500); + $('#rc-cu').show('blind', {direction:'vertical'}, 500, function() { + custGrid.w2render('cust-grid'); + }); $('#cuw').show('blind', {direction:'vertical'}, 500); } else { @@ -635,7 +371,10 @@ }); $('#x_custom').click(function () { - if ($('#x_custom').is(':checked')) $('#rc-xu').show('blind', {direction:'vertical'}, 500); + if ($('#x_custom').is(':checked')) + $('#rc-xu').show('blind', {direction:'vertical'}, 500, function() { + xcustGrid.w2render('x-cust-grid'); + }); else $('#rc-xu').hide('blind', {direction:'vertical'}, 500); }); diff --git a/js/sam-admin-edit.min.js b/js/sam-admin-edit.min.js index 8107b88..1827d2e 100644 --- a/js/sam-admin-edit.min.js +++ b/js/sam-admin-edit.min.js @@ -1,5 +1,5 @@ /** * @author minimus - * @copyright 2010 - 2012 + * @copyright 2010 - 2013 */ -(function($){$(document).ready(function(){var options=$.parseJSON($.ajax({url:ajaxurl,data:{action:'get_strings'},async:false,dataType:'jsonp'}).responseText);var btnUpload=$("#upload-file-button");var status=$("#uploading");var srcHelp=$("#uploading-help");var loadImg=$('#load_img');var fileExt='';var fu=new AjaxUpload(btnUpload,{action:ajaxurl,name:'uploadfile',data:{action:'upload_ad_image'},onSubmit:function(file,ext){if(!(ext&&/^(jpg|png|jpeg|gif|swf)$/.test(ext))){status.text(options.status);return false}loadImg.show();status.text(options.uploading)},onComplete:function(file,response){status.text('');loadImg.hide();$('

').appendTo(srcHelp);if(response=="success"){$("#files").text(options.file+' '+file+' '+options.uploaded).addClass('updated').delay(3000).fadeOut(1000,function(){$(this).remove()});if($('#editor_mode').val()=='item')$("#ad_img").val(options.url+file);if($('#editor_mode').val()=='place')$("#patch_img").val(options.url+file)}else{$('#files').text(file+' '+response).addClass('error').delay(3000).fadeOut(1000,function(){$(this).remove()})}}});if($('#editor_mode').val()=='item'){$("#ad_start_date, #ad_end_date").datepicker({dateFormat:'yy-mm-dd',showButtonPanel:true});$('#adv_nick').combogrid({url:ajaxurl+'?action=get_combo_data',datatype:"json",munit:'px',alternate:true,colModel:options.users.colModel,select:function(event,ui){$('#adv_nick').val(ui.item.slug);$('#adv_name').val(ui.item.title);$('#adv_mail').val(ui.item.email);return false}});var postsGrid,pgData=options.posts.posts,pgOptions={editable:true,enableCellNavigation:true,asyncEditorLoading:false,autoEdit:false},pgColumns=[],pgCheckboxSelector=new Slick.CheckboxSelectColumn({cssClass:"slick-cell-checkboxsel"});pgColumns.push(pgCheckboxSelector.getColumnDefinition());for(var i=0;i').appendTo(ht),r=="success"?(n("#files").text(t.file+" "+i+" "+t.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),n("#editor_mode").val()=="item"&&n("#ad_img").val(t.url+i),n("#editor_mode").val()=="place"&&n("#patch_img").val(t.url+i)):n("#files").text(i+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});if(n("#editor_mode").val()=="item"){r=samPointer.ads,r.pointer="ads",n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0}),n("#adv_nick").combogrid({url:ajaxurl+"?action=get_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:t.users.colModel,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});function i(t,i,r,u,f,e,o){var s=u.val(),h;i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:e,records:o,onSelect:function(n){n.onComplete=function(){for(var e="",r=this.getSelection(),i,t,n=0;n"+r.title+"

"+r.content+"

",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:r.pointer},async:!0})}}).pointer("open"),n("#is_singular").click(function(){n("#is_singular").is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)}),n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!n("#is_singular").is(":checked")||n("#is_single").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_posttype").is(":checked")?!n("#is_singular").is(":checked")&&n("#is_single").is(":checked")&&n("#is_posttype").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_singular").attr("checked",!0):n("#is_singular").attr("checked",!1)}),n("#is_archive").click(function(){n("#is_archive").is(":checked")&&n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").attr("checked",!0)}),n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").click(function(){!n("#is_archive").is(":checked")||n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")?!n("#is_archive").is(":checked")&&n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")&&n("#is_archive").attr("checked",!0):n("#is_archive").attr("checked",!1)}),!1})})(jQuery); \ No newline at end of file diff --git a/js/slick/jquery.event.drag-2.0.min.js b/js/slick/jquery.event.drag-2.0.min.js deleted file mode 100644 index 2cb7fee..0000000 --- a/js/slick/jquery.event.drag-2.0.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * jquery.event.drag - v 2.0.0 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -;(function(f){f.fn.drag=function(b,a,d){var e=typeof b=="string"?b:"",k=f.isFunction(b)?b:f.isFunction(a)?a:null;if(e.indexOf("drag")!==0)e="drag"+e;d=(b==k?a:d)||{};return k?this.bind(e,d,k):this.trigger(e)};var i=f.event,h=i.special,c=h.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(b){var a=f.data(this,c.datakey),d=b.data||{};a.related+=1;if(!a.live&&b.selector){a.live=true;i.add(this,"draginit."+ c.livekey,c.delegate)}f.each(c.defaults,function(e){if(d[e]!==undefined)a[e]=d[e]})},remove:function(){f.data(this,c.datakey).related-=1},setup:function(){if(!f.data(this,c.datakey)){var b=f.extend({related:0},c.defaults);f.data(this,c.datakey,b);i.add(this,"mousedown",c.init,b);this.attachEvent&&this.attachEvent("ondragstart",c.dontstart)}},teardown:function(){if(!f.data(this,c.datakey).related){f.removeData(this,c.datakey);i.remove(this,"mousedown",c.init);i.remove(this,"draginit",c.delegate);c.textselect(true); this.detachEvent&&this.detachEvent("ondragstart",c.dontstart)}},init:function(b){var a=b.data,d;if(!(a.which>0&&b.which!=a.which))if(!f(b.target).is(a.not))if(!(a.handle&&!f(b.target).closest(a.handle,b.currentTarget).length)){a.propagates=1;a.interactions=[c.interaction(this,a)];a.target=b.target;a.pageX=b.pageX;a.pageY=b.pageY;a.dragging=null;d=c.hijack(b,"draginit",a);if(a.propagates){if((d=c.flatten(d))&&d.length){a.interactions=[];f.each(d,function(){a.interactions.push(c.interaction(this,a))})}a.propagates= a.interactions.length;a.drop!==false&&h.drop&&h.drop.handler(b,a);c.textselect(false);i.add(document,"mousemove mouseup",c.handler,a);return false}}},interaction:function(b,a){return{drag:b,callback:new c.callback,droppable:[],offset:f(b)[a.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(b){var a=b.data;switch(b.type){case !a.dragging&&"mousemove":if(Math.pow(b.pageX-a.pageX,2)+Math.pow(b.pageY-a.pageY,2) options.maxToolTipLength) { - text = text.substr(0, options.maxToolTipLength - 3) + "..."; - } - $(node).attr("title", text); - } else { - $(node).attr("title", ""); - } - } - } - - $.extend(this, { - "init": init, - "destroy": destroy - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.autotooltips.min.js b/js/slick/slick.autotooltips.min.js deleted file mode 100644 index 4734869..0000000 --- a/js/slick/slick.autotooltips.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.extend(true,window,{"Slick":{"AutoTooltips":AutoTooltips}});function AutoTooltips(options){var _grid;var _self=this;var _defaults={maxToolTipLength:null};function init(grid){options=$.extend(true,{},_defaults,options);_grid=grid;_grid.onMouseEnter.subscribe(handleMouseEnter)}function destroy(){_grid.onMouseEnter.unsubscribe(handleMouseEnter)}function handleMouseEnter(e,args){var cell=_grid.getCellFromEvent(e);if(cell){var node=_grid.getCellNode(cell.row,cell.cell);if($(node).innerWidth()options.maxToolTipLength){text=text.substr(0,options.maxToolTipLength-3)+"..."}$(node).attr("title",text)}else{$(node).attr("title","")}}}$.extend(this,{"init":init,"destroy":destroy})}})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellcopymanager.js b/js/slick/slick.cellcopymanager.js deleted file mode 100644 index c74018d..0000000 --- a/js/slick/slick.cellcopymanager.js +++ /dev/null @@ -1,86 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellCopyManager": CellCopyManager - } - }); - - - function CellCopyManager() { - var _grid; - var _self = this; - var _copiedRanges; - - function init(grid) { - _grid = grid; - _grid.onKeyDown.subscribe(handleKeyDown); - } - - function destroy() { - _grid.onKeyDown.unsubscribe(handleKeyDown); - } - - function handleKeyDown(e, args) { - var ranges; - if (!_grid.getEditorLock().isActive()) { - if (e.which == $.ui.keyCode.ESCAPE) { - if (_copiedRanges) { - e.preventDefault(); - clearCopySelection(); - _self.onCopyCancelled.notify({ranges: _copiedRanges}); - _copiedRanges = null; - } - } - - if (e.which == 67 && (e.ctrlKey || e.metaKey)) { - ranges = _grid.getSelectionModel().getSelectedRanges(); - if (ranges.length != 0) { - e.preventDefault(); - _copiedRanges = ranges; - markCopySelection(ranges); - _self.onCopyCells.notify({ranges: ranges}); - } - } - - if (e.which == 86 && (e.ctrlKey || e.metaKey)) { - if (_copiedRanges) { - e.preventDefault(); - clearCopySelection(); - ranges = _grid.getSelectionModel().getSelectedRanges(); - _self.onPasteCells.notify({from: _copiedRanges, to: ranges}); - _copiedRanges = null; - } - } - } - } - - function markCopySelection(ranges) { - var columns = _grid.getColumns(); - var hash = {}; - for (var i = 0; i < ranges.length; i++) { - for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { - hash[j] = {}; - for (var k = ranges[i].fromCell; k <= ranges[i].toCell; k++) { - hash[j][columns[k].id] = "copied"; - } - } - } - _grid.setCellCssStyles("copy-manager", hash); - } - - function clearCopySelection() { - _grid.removeCellCssStyles("copy-manager"); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "clearCopySelection": clearCopySelection, - - "onCopyCells": new Slick.Event(), - "onCopyCancelled": new Slick.Event(), - "onPasteCells": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellcopymanager.min.js b/js/slick/slick.cellcopymanager.min.js deleted file mode 100644 index b3fa3f9..0000000 --- a/js/slick/slick.cellcopymanager.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.extend(true,window,{"Slick":{"CellCopyManager":CellCopyManager}});function CellCopyManager(){var _grid;var _self=this;var _copiedRanges;function init(grid){_grid=grid;_grid.onKeyDown.subscribe(handleKeyDown)}function destroy(){_grid.onKeyDown.unsubscribe(handleKeyDown)}function handleKeyDown(e,args){var ranges;if(!_grid.getEditorLock().isActive()){if(e.which==$.ui.keyCode.ESCAPE){if(_copiedRanges){e.preventDefault();clearCopySelection();_self.onCopyCancelled.notify({ranges:_copiedRanges});_copiedRanges=null}}if(e.which==67&&(e.ctrlKey||e.metaKey)){ranges=_grid.getSelectionModel().getSelectedRanges();if(ranges.length!=0){e.preventDefault();_copiedRanges=ranges;markCopySelection(ranges);_self.onCopyCells.notify({ranges:ranges})}}if(e.which==86&&(e.ctrlKey||e.metaKey)){if(_copiedRanges){e.preventDefault();clearCopySelection();ranges=_grid.getSelectionModel().getSelectedRanges();_self.onPasteCells.notify({from:_copiedRanges,to:ranges});_copiedRanges=null}}}}function markCopySelection(ranges){var columns=_grid.getColumns();var hash={};for(var i=0;i", {css: options.selectionCss}) - .css("position", "absolute") - .appendTo(grid.getCanvasNode()); - } - - var from = grid.getCellNodeBox(range.fromRow, range.fromCell); - var to = grid.getCellNodeBox(range.toRow, range.toCell); - - _elem.css({ - top: from.top - 1, - left: from.left - 1, - height: to.bottom - from.top - 2, - width: to.right - from.left - 2 - }); - - return _elem; - } - - function hide() { - if (_elem) { - _elem.remove(); - _elem = null; - } - } - - $.extend(this, { - "show": show, - "hide": hide - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellrangeselector.js b/js/slick/slick.cellrangeselector.js deleted file mode 100644 index c2dee9a..0000000 --- a/js/slick/slick.cellrangeselector.js +++ /dev/null @@ -1,112 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellRangeSelector": CellRangeSelector - } - }); - - - function CellRangeSelector(options) { - var _grid; - var _canvas; - var _dragging; - var _decorator; - var _self = this; - var _defaults = { - selectionCss: { - "border": "2px dashed blue" - } - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _decorator = new Slick.CellRangeDecorator(grid, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onDragInit.subscribe(handleDragInit); - _grid.onDragStart.subscribe(handleDragStart); - _grid.onDrag.subscribe(handleDrag); - _grid.onDragEnd.subscribe(handleDragEnd); - } - - function destroy() { - _grid.onDragInit.unsubscribe(handleDragInit); - _grid.onDragStart.unsubscribe(handleDragStart); - _grid.onDrag.unsubscribe(handleDrag); - _grid.onDragEnd.unsubscribe(handleDragEnd); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { - if (_grid.canCellBeSelected(cell.row, cell.cell)) { - _dragging = true; - e.stopImmediatePropagation(); - } - } - if (!_dragging) { - return; - } - - var start = _grid.getCellFromPoint( - dd.startX - $(_canvas).offset().left, - dd.startY - $(_canvas).offset().top); - - dd.range = {start: start, end: {}}; - - return _decorator.show(new Slick.Range(start.row, start.cell)); - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - e.stopImmediatePropagation(); - - var end = _grid.getCellFromPoint( - e.pageX - $(_canvas).offset().left, - e.pageY - $(_canvas).offset().top); - - if (!_grid.canCellBeSelected(end.row, end.cell)) { - return; - } - - dd.range.end = end; - _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - - _dragging = false; - e.stopImmediatePropagation(); - - _decorator.hide(); - _self.onCellRangeSelected.notify({ - range: new Slick.Range( - dd.range.start.row, - dd.range.start.cell, - dd.range.end.row, - dd.range.end.cell - ) - }); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "onBeforeCellRangeSelected": new Slick.Event(), - "onCellRangeSelected": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.cellselectionmodel.js b/js/slick/slick.cellselectionmodel.js deleted file mode 100644 index fa91d3c..0000000 --- a/js/slick/slick.cellselectionmodel.js +++ /dev/null @@ -1,92 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellSelectionModel": CellSelectionModel - } - }); - - - function CellSelectionModel(options) { - var _grid; - var _canvas; - var _ranges = []; - var _self = this; - var _selector = new Slick.CellRangeSelector({ - "selectionCss": { - "border": "2px solid black" - } - }); - var _options; - var _defaults = { - selectActiveCell: true - }; - - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onActiveCellChanged.subscribe(handleActiveCellChange); - grid.registerPlugin(_selector); - _selector.onCellRangeSelected.subscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected); - } - - function destroy() { - _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange); - _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected); - _grid.unregisterPlugin(_selector); - } - - function removeInvalidRanges(ranges) { - var result = []; - - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) { - result.push(r); - } - } - - return result; - } - - function setSelectedRanges(ranges) { - _ranges = removeInvalidRanges(ranges); - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleBeforeCellRangeSelected(e, args) { - if (_grid.getEditorLock().isActive()) { - e.stopPropagation(); - return false; - } - } - - function handleCellRangeSelected(e, args) { - setSelectedRanges([args.range]); - } - - function handleActiveCellChange(e, args) { - if (_options.selectActiveCell) { - setSelectedRanges([new Slick.Range(args.row, args.cell)]); - } - } - - $.extend(this, { - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - - "init": init, - "destroy": destroy, - - "onSelectedRangesChanged": new Slick.Event() - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.checkboxselectcolumn.js b/js/slick/slick.checkboxselectcolumn.js deleted file mode 100644 index 4dd918f..0000000 --- a/js/slick/slick.checkboxselectcolumn.js +++ /dev/null @@ -1,154 +0,0 @@ -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CheckboxSelectColumn": CheckboxSelectColumn - } - }); - - - function CheckboxSelectColumn(options) { - var _grid; - var _self = this; - var _selectedRowsLookup = {}; - var _defaults = { - columnId: "_checkbox_selector", - cssClass: null, - toolTip: "Select/Deselect All", - width: 30 - }; - - var _options = $.extend(true, {}, _defaults, options); - - function init(grid) { - _grid = grid; - _grid.onSelectedRowsChanged.subscribe(handleSelectedRowsChanged); - _grid.onClick.subscribe(handleClick); - _grid.onHeaderClick.subscribe(handleHeaderClick); - _grid.onKeyDown.subscribe(handleKeyDown); - } - - function destroy() { - _grid.onSelectedRowsChanged.unsubscribe(handleSelectedRowsChanged); - _grid.onClick.unsubscribe(handleClick); - _grid.onHeaderClick.unsubscribe(handleHeaderClick); - _grid.onKeyDown.unsubscribe(handleKeyDown); - } - - function handleSelectedRowsChanged(e, args) { - var selectedRows = _grid.getSelectedRows(); - var lookup = {}, row, i; - for (i = 0; i < selectedRows.length; i++) { - row = selectedRows[i]; - lookup[row] = true; - if (lookup[row] !== _selectedRowsLookup[row]) { - _grid.invalidateRow(row); - delete _selectedRowsLookup[row]; - } - } - for (i in _selectedRowsLookup) { - _grid.invalidateRow(i); - } - _selectedRowsLookup = lookup; - _grid.render(); - - if (selectedRows.length == _grid.getDataLength()) { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } else { - _grid.updateColumnHeader(_options.columnId, "", _options.toolTip); - } - } - - function handleKeyDown(e, args) { - if (e.which == 32) { - if (_grid.getColumns()[args.cell].id === _options.columnId) { - // if editing, try to commit - if (!_grid.getEditorLock().isActive() || _grid.getEditorLock().commitCurrentEdit()) { - toggleRowSelection(args.row); - } - e.preventDefault(); - e.stopImmediatePropagation(); - } - } - } - - function handleClick(e, args) { - // clicking on a row select checkbox - if (_grid.getColumns()[args.cell].id === _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - toggleRowSelection(args.row); - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function toggleRowSelection(row) { - if (_selectedRowsLookup[row]) { - _grid.setSelectedRows($.grep(_grid.getSelectedRows(), function (n) { - return n != row - })); - } else { - _grid.setSelectedRows(_grid.getSelectedRows().concat(row)); - } - } - - function handleHeaderClick(e, args) { - if (args.column.id == _options.columnId && $(e.target).is(":checkbox")) { - // if editing, try to commit - if (_grid.getEditorLock().isActive() && !_grid.getEditorLock().commitCurrentEdit()) { - e.preventDefault(); - e.stopImmediatePropagation(); - return; - } - - if ($(e.target).is(":checked")) { - var rows = []; - for (var i = 0; i < _grid.getDataLength(); i++) { - rows.push(i); - } - _grid.setSelectedRows(rows); - } else { - _grid.setSelectedRows([]); - } - e.stopPropagation(); - e.stopImmediatePropagation(); - } - } - - function getColumnDefinition() { - return { - id: _options.columnId, - name: "", - toolTip: _options.toolTip, - field: "sel", - width: _options.width, - resizable: false, - sortable: false, - cssClass: _options.cssClass, - formatter: checkboxSelectionFormatter - }; - } - - function checkboxSelectionFormatter(row, cell, value, columnDef, dataContext) { - if (dataContext) { - return _selectedRowsLookup[row] - ? "" - : ""; - } - return null; - } - - $.extend(this, { - "init": init, - "destroy": destroy, - - "getColumnDefinition": getColumnDefinition - }); - } -})(jQuery); \ No newline at end of file diff --git a/js/slick/slick.core.js b/js/slick/slick.core.js deleted file mode 100644 index efb6a97..0000000 --- a/js/slick/slick.core.js +++ /dev/null @@ -1,424 +0,0 @@ -/*** - * Contains core SlickGrid classes. - * @module Core - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Event": Event, - "EventData": EventData, - "EventHandler": EventHandler, - "Range": Range, - "NonDataRow": NonDataItem, - "Group": Group, - "GroupTotals": GroupTotals, - "EditorLock": EditorLock, - - /*** - * A global singleton editor lock. - * @class GlobalEditorLock - * @static - * @constructor - */ - "GlobalEditorLock": new EditorLock() - } - }); - - /*** - * An event object for passing data to event handlers and letting them control propagation. - *

This is pretty much identical to how W3C and jQuery implement events.

- * @class EventData - * @constructor - */ - function EventData() { - var isPropagationStopped = false; - var isImmediatePropagationStopped = false; - - /*** - * Stops event from propagating up the DOM tree. - * @method stopPropagation - */ - this.stopPropagation = function () { - isPropagationStopped = true; - }; - - /*** - * Returns whether stopPropagation was called on this event object. - * @method isPropagationStopped - * @return {Boolean} - */ - this.isPropagationStopped = function () { - return isPropagationStopped; - }; - - /*** - * Prevents the rest of the handlers from being executed. - * @method stopImmediatePropagation - */ - this.stopImmediatePropagation = function () { - isImmediatePropagationStopped = true; - }; - - /*** - * Returns whether stopImmediatePropagation was called on this event object.\ - * @method isImmediatePropagationStopped - * @return {Boolean} - */ - this.isImmediatePropagationStopped = function () { - return isImmediatePropagationStopped; - } - } - - /*** - * A simple publisher-subscriber implementation. - * @class Event - * @constructor - */ - function Event() { - var handlers = []; - - /*** - * Adds an event handler to be called when the event is fired. - *

Event handler will receive two arguments - an EventData and the data - * object the event was fired with.

- * @method subscribe - * @param fn {Function} Event handler. - */ - this.subscribe = function (fn) { - handlers.push(fn); - }; - - /*** - * Removes an event handler added with subscribe(fn). - * @method unsubscribe - * @param fn {Function} Event handler to be removed. - */ - this.unsubscribe = function (fn) { - for (var i = handlers.length - 1; i >= 0; i--) { - if (handlers[i] === fn) { - handlers.splice(i, 1); - } - } - }; - - /*** - * Fires an event notifying all subscribers. - * @method notify - * @param args {Object} Additional data object to be passed to all handlers. - * @param e {EventData} - * Optional. - * An EventData object to be passed to all handlers. - * For DOM events, an existing W3C/jQuery event object can be passed in. - * @param scope {Object} - * Optional. - * The scope ("this") within which the handler will be executed. - * If not specified, the scope will be set to the Event instance. - */ - this.notify = function (args, e, scope) { - e = e || new EventData(); - scope = scope || this; - - var returnValue; - for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { - returnValue = handlers[i].call(scope, e, args); - } - - return returnValue; - }; - } - - function EventHandler() { - var handlers = []; - - this.subscribe = function (event, handler) { - handlers.push({ - event: event, - handler: handler - }); - event.subscribe(handler); - }; - - this.unsubscribe = function (event, handler) { - var i = handlers.length; - while (i--) { - if (handlers[i].event === event && - handlers[i].handler === handler) { - handlers.splice(i, 1); - event.unsubscribe(handler); - return; - } - } - }; - - this.unsubscribeAll = function () { - var i = handlers.length; - while (i--) { - handlers[i].event.unsubscribe(handlers[i].handler); - } - handlers = []; - } - } - - /*** - * A structure containing a range of cells. - * @class Range - * @constructor - * @param fromRow {Integer} Starting row. - * @param fromCell {Integer} Starting cell. - * @param toRow {Integer} Optional. Ending row. Defaults to fromRow. - * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell. - */ - function Range(fromRow, fromCell, toRow, toCell) { - if (toRow === undefined && toCell === undefined) { - toRow = fromRow; - toCell = fromCell; - } - - /*** - * @property fromRow - * @type {Integer} - */ - this.fromRow = Math.min(fromRow, toRow); - - /*** - * @property fromCell - * @type {Integer} - */ - this.fromCell = Math.min(fromCell, toCell); - - /*** - * @property toRow - * @type {Integer} - */ - this.toRow = Math.max(fromRow, toRow); - - /*** - * @property toCell - * @type {Integer} - */ - this.toCell = Math.max(fromCell, toCell); - - /*** - * Returns whether a range represents a single row. - * @method isSingleRow - * @return {Boolean} - */ - this.isSingleRow = function () { - return this.fromRow == this.toRow; - }; - - /*** - * Returns whether a range represents a single cell. - * @method isSingleCell - * @return {Boolean} - */ - this.isSingleCell = function () { - return this.fromRow == this.toRow && this.fromCell == this.toCell; - }; - - /*** - * Returns whether a range contains a given cell. - * @method contains - * @param row {Integer} - * @param cell {Integer} - * @return {Boolean} - */ - this.contains = function (row, cell) { - return row >= this.fromRow && row <= this.toRow && - cell >= this.fromCell && cell <= this.toCell; - }; - - /*** - * Returns a readable representation of a range. - * @method toString - * @return {String} - */ - this.toString = function () { - if (this.isSingleCell()) { - return "(" + this.fromRow + ":" + this.fromCell + ")"; - } - else { - return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; - } - } - } - - - /*** - * A base class that all special / non-data rows (like Group and GroupTotals) derive from. - * @class NonDataItem - * @constructor - */ - function NonDataItem() { - this.__nonDataRow = true; - } - - - /*** - * Information about a group of rows. - * @class Group - * @extends Slick.NonDataItem - * @constructor - */ - function Group() { - this.__group = true; - this.__updated = false; - - /*** - * Number of rows in the group. - * @property count - * @type {Integer} - */ - this.count = 0; - - /*** - * Grouping value. - * @property value - * @type {Object} - */ - this.value = null; - - /*** - * Formatted display value of the group. - * @property title - * @type {String} - */ - this.title = null; - - /*** - * Whether a group is collapsed. - * @property collapsed - * @type {Boolean} - */ - this.collapsed = false; - - /*** - * GroupTotals, if any. - * @property totals - * @type {GroupTotals} - */ - this.totals = null; - } - - Group.prototype = new NonDataItem(); - - /*** - * Compares two Group instances. - * @method equals - * @return {Boolean} - * @param group {Group} Group instance to compare to. - */ - Group.prototype.equals = function (group) { - return this.value === group.value && - this.count === group.count && - this.collapsed === group.collapsed; - }; - - /*** - * Information about group totals. - * An instance of GroupTotals will be created for each totals row and passed to the aggregators - * so that they can store arbitrary data in it. That data can later be accessed by group totals - * formatters during the display. - * @class GroupTotals - * @extends Slick.NonDataItem - * @constructor - */ - function GroupTotals() { - this.__groupTotals = true; - - /*** - * Parent Group. - * @param group - * @type {Group} - */ - this.group = null; - } - - GroupTotals.prototype = new NonDataItem(); - - /*** - * A locking helper to track the active edit controller and ensure that only a single controller - * can be active at a time. This prevents a whole class of state and validation synchronization - * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress - * and attempt a commit or cancel before proceeding. - * @class EditorLock - * @constructor - */ - function EditorLock() { - var activeEditController = null; - - /*** - * Returns true if a specified edit controller is active (has the edit lock). - * If the parameter is not specified, returns true if any edit controller is active. - * @method isActive - * @param editController {EditController} - * @return {Boolean} - */ - this.isActive = function (editController) { - return (editController ? activeEditController === editController : activeEditController !== null); - }; - - /*** - * Sets the specified edit controller as the active edit controller (acquire edit lock). - * If another edit controller is already active, and exception will be thrown. - * @method activate - * @param editController {EditController} edit controller acquiring the lock - */ - this.activate = function (editController) { - if (editController === activeEditController) { // already activated? - return; - } - if (activeEditController !== null) { - throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"; - } - if (!editController.commitCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"; - } - if (!editController.cancelCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()"; - } - activeEditController = editController; - }; - - /*** - * Unsets the specified edit controller as the active edit controller (release edit lock). - * If the specified edit controller is not the active one, an exception will be thrown. - * @method deactivate - * @param editController {EditController} edit controller releasing the lock - */ - this.deactivate = function (editController) { - if (activeEditController !== editController) { - throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"; - } - activeEditController = null; - }; - - /*** - * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit - * controller and returns whether the commit attempt was successful (commit may fail due to validation - * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded - * and false otherwise. If no edit controller is active, returns true. - * @method commitCurrentEdit - * @return {Boolean} - */ - this.commitCurrentEdit = function () { - return (activeEditController ? activeEditController.commitCurrentEdit() : true); - }; - - /*** - * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit - * controller and returns whether the edit was successfully cancelled. If no edit controller is - * active, returns true. - * @method cancelCurrentEdit - * @return {Boolean} - */ - this.cancelCurrentEdit = function cancelCurrentEdit() { - return (activeEditController ? activeEditController.cancelCurrentEdit() : true); - }; - } -})(jQuery); - - diff --git a/js/slick/slick.editors.js b/js/slick/slick.editors.js deleted file mode 100644 index a3666c2..0000000 --- a/js/slick/slick.editors.js +++ /dev/null @@ -1,512 +0,0 @@ -/*** - * Contains basic SlickGrid editors. - * @module Editors - * @namespace Slick - */ - -(function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Editors": { - "Text": TextEditor, - "Integer": IntegerEditor, - "Date": DateEditor, - "YesNoSelect": YesNoSelectEditor, - "Checkbox": CheckboxEditor, - "PercentComplete": PercentCompleteEditor, - "LongText": LongTextEditor - } - } - }); - - function TextEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $("") - .appendTo(args.container) - .bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }) - .focus() - .select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.getValue = function () { - return $input.val(); - }; - - this.setValue = function (val) { - $input.val(val); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field] || ""; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function IntegerEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - - $input.bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }); - - $input.appendTo(args.container); - $input.focus().select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (isNaN($input.val())) { - return { - valid: false, - msg: "Please enter a valid integer" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function DateEditor(args) { - var $input; - var defaultValue; - var scope = this; - var calendarOpen = false; - - this.init = function () { - $input = $(""); - $input.appendTo(args.container); - $input.focus().select(); - $input.datepicker({ - showOn: "button", - buttonImageOnly: true, - buttonImage: "../images/calendar.gif", - beforeShow: function () { - calendarOpen = true - }, - onClose: function () { - calendarOpen = false - } - }); - $input.width($input.width() - 18); - }; - - this.destroy = function () { - $.datepicker.dpDiv.stop(true, true); - $input.datepicker("hide"); - $input.datepicker("destroy"); - $input.remove(); - }; - - this.show = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).show(); - } - }; - - this.hide = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).hide(); - } - }; - - this.position = function (position) { - if (!calendarOpen) { - return; - } - $.datepicker.dpDiv - .css("top", position.top + 30) - .css("left", position.left); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function YesNoSelectEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - $select.val((defaultValue = item[args.column.field]) ? "yes" : "no"); - $select.select(); - }; - - this.serializeValue = function () { - return ($select.val() == "yes"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function CheckboxEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - if (defaultValue) { - $select.attr("checked", "checked"); - } else { - $select.removeAttr("checked"); - } - }; - - this.serializeValue = function () { - return $select.attr("checked"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.attr("checked") != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function PercentCompleteEditor(args) { - var $input, $picker; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - $input.width($(args.container).innerWidth() - 25); - $input.appendTo(args.container); - - $picker = $("

").appendTo(args.container); - $picker.append("
"); - - $picker.find(".editor-percentcomplete-buttons").append("

"); - - $input.focus().select(); - - $picker.find(".editor-percentcomplete-slider").slider({ - orientation: "vertical", - range: "min", - value: defaultValue, - slide: function (event, ui) { - $input.val(ui.value) - } - }); - - $picker.find(".editor-percentcomplete-buttons button").bind("click", function (e) { - $input.val($(this).attr("val")); - $picker.find(".editor-percentcomplete-slider").slider("value", $(this).attr("val")); - }) - }; - - this.destroy = function () { - $input.remove(); - $picker.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - $input.val(defaultValue = item[args.column.field]); - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ((parseInt($input.val(), 10) || 0) != defaultValue); - }; - - this.validate = function () { - if (isNaN(parseInt($input.val(), 10))) { - return { - valid: false, - msg: "Please enter a valid positive number" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - /* - * An example of a "detached" editor. - * The UI is added onto document BODY and .position(), .show() and .hide() are implemented. - * KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter. - */ - function LongTextEditor(args) { - var $input, $wrapper; - var defaultValue; - var scope = this; - - this.init = function () { - var $container = $("body"); - - $wrapper = $("
") - .appendTo($container); - - $input = $("'); + $('#_tmp_copy_data').focus(); + setTimeout(function () { + obj.paste($('#_tmp_copy_data').val()); + $('#_tmp_copy_data').remove(); + }, 50); // need timer to allow paste + } + break; + + case 88: // x - cut + if (event.ctrlKey || event.metaKey) { + setTimeout(function () { obj.delete(true); }, 100); + } + case 67: // c - copy + if (event.ctrlKey || event.metaKey) { + var text = obj.copy(); + $('body').append(''); + $('#_tmp_copy_data').focus().select(); + setTimeout(function () { $('#_tmp_copy_data').remove(); }, 50); + } + break; + } + var tmp = [187, 189]; // =- + for (var i=48; i<=90; i++) tmp.push(i); // 0-9,a-z,A-Z + if (tmp.indexOf(event.keyCode) != -1 && !event.ctrlKey && !event.metaKey && !cancel) { + if (columns.length == 0) columns.push(0); + var tmp = String.fromCharCode(event.keyCode); + if (event.keyCode == 187) tmp = '='; + if (event.keyCode == 189) tmp = '-'; + if (!event.shiftKey) tmp = tmp.toLowerCase(); + obj.editField(recid, columns[0], tmp, event); + cancel = true; + } + if (cancel) { // cancel default behaviour + if (event.preventDefault) event.preventDefault(); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + + function nextRow (ind) { + if ((ind + 1 < obj.records.length && obj.last.searchIds.length == 0) // if there are more records + || (obj.last.searchIds.length > 0 && ind < obj.last.searchIds[obj.last.searchIds.length-1])) { + ind++; + if (obj.last.searchIds.length > 0) { + while (true) { + if ($.inArray(ind, obj.last.searchIds) != -1 || ind > obj.records.length) break; + ind++; + } + } + return ind; + } else { + return null; + } + } + + function prevRow (ind) { + if ((ind > 0 && obj.last.searchIds.length == 0) // if there are more records + || (obj.last.searchIds.length > 0 && ind > obj.last.searchIds[0])) { + ind--; + if (obj.last.searchIds.length > 0) { + while (true) { + if ($.inArray(ind, obj.last.searchIds) != -1 || ind < 0) break; + ind--; + } + } + return ind; + } else { + return null; + } + } + + function nextCell (check) { + var newCheck = check + 1; + if (obj.columns.length == newCheck) return check; + if (obj.columns[newCheck].hidden) return findNext(newCheck); + return newCheck; + } + + function prevCell (check) { + var newCheck = check - 1; + if (newCheck < 0) return check; + if (obj.columns[newCheck].hidden) return findPrev(newCheck); + return newCheck; + } + + function tmpUnselect () { + if (obj.last.sel_type != 'click') return false; + if (obj.selectType != 'row') { + obj.last.sel_type = 'key'; + if (sel.length > 1) { + for (var s in sel) { + if (sel[s].recid == obj.last.sel_recid && sel[s].column == obj.last.sel_col) { + sel.splice(s, 1); + break; + } + } + obj.unselect.apply(obj, sel); + return true; + } + return false; + } else { + obj.last.sel_type = 'key'; + if (sel.length > 1) { + sel.splice(sel.indexOf(obj.records[obj.last.sel_ind].recid), 1); + obj.unselect.apply(obj, sel); + return true; + } + return false; + } + } + }, + + scrollIntoView: function (ind) { + if (typeof ind == 'undefined') { + var sel = this.getSelection(); + if (sel.length == 0) return; + ind = this.get(sel[0], true); + } + var records = $('#grid_'+ this.name +'_records'); + if (records.length == 0) return; + // if all records in view + var len = this.last.searchIds.length; + if (records.height() > this.recordHeight * (len > 0 ? len : this.records.length)) return; + if (len > 0) ind = this.last.searchIds.indexOf(ind); // if seach is applied + // scroll to correct one + var t1 = Math.floor(records[0].scrollTop / this.recordHeight); + var t2 = t1 + Math.floor(records.height() / this.recordHeight); + if (ind == t1) records.animate({ 'scrollTop': records.scrollTop() - records.height() / 1.3 }); + if (ind == t2) records.animate({ 'scrollTop': records.scrollTop() + records.height() / 1.3 }); + if (ind < t1 || ind > t2) records.animate({ 'scrollTop': (ind - 1) * this.recordHeight }); + }, + + dblClick: function (recid, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // find columns + var column = null; + if (typeof recid == 'object') { + column = recid.column; + recid = recid.recid; + } + if (typeof event == 'undefined') event = {}; + // column user clicked on + if (column == null && event.target) { + var tmp = event.target; + if (tmp.tagName != 'TD') tmp = $(tmp).parents('td')[0]; + column = parseInt($(tmp).attr('col')); + } + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'dblClick', recid: recid, column: column, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + this.selectNone(); + var col = this.columns[column]; + if (col && $.isPlainObject(col.editable)) { + this.editField(recid, column, null, event); + } else { + this.select({ recid: recid, column: column }); + this.last.selected = this.getSelection(); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + toggle: function (recid) { + var rec = this.get(recid); + if (rec.expanded === true) return this.collapse(recid); else return this.expand(recid); + }, + + expand: function (recid) { + var rec = this.get(recid); + var obj = this; + var id = w2utils.escapeId(recid); + if ($('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').length > 0) return false; + if (rec.expanded == 'none') return false; + // insert expand row + var tmp = 1 + (this.show.selectColumn ? 1 : 0); + var addClass = ''; // ($('#grid_'+this.name +'_rec_'+ w2utils.escapeId(recid)).hasClass('w2ui-odd') ? 'w2ui-odd' : 'w2ui-even'); + $('#grid_'+ this.name +'_rec_'+ id).after( + ''+ + (this.show.lineNumbers ? '' : '') + + '
'+ + ' '+ + '
'+ + ' '+ + ''); + // event before + var eventData = this.trigger({ phase: 'before', type: 'expand', target: this.name, recid: recid, + box_id: 'grid_'+ this.name +'_rec_'+ id +'_expanded', ready: ready }); + if (eventData.isCancelled === true) { + $('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').remove(); + return false; + } + // default action + $('#grid_'+ this.name +'_rec_'+ id).attr('expanded', 'yes').addClass('w2ui-expanded'); + $('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').show(); + $('#grid_'+ this.name +'_cell_'+ this.get(recid, true) +'_expand div').html('
'); + rec.expanded = true; + // check if height of expaned row > 5 then remove spinner + setTimeout(ready, 300); + function ready() { + var div1 = $('#grid_'+ obj.name +'_rec_'+ id +'_expanded'); + var div2 = $('#grid_'+ obj.name +'_rec_'+ id +'_expanded_row .w2ui-expanded1 > div'); + if (div1.height() < 5) return; + div1.css('opacity', 1); + div2.show().css('opacity', 1); + $('#grid_'+ obj.name +'_cell_'+ obj.get(recid, true) +'_expand div').html('-'); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resizeRecords(); + return true; + }, + + collapse: function (recid) { + var rec = this.get(recid); + var obj = this; + var id = w2utils.escapeId(recid); + if ($('#grid_'+ this.name +'_rec_'+ id +'_expanded_row').length == 0) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'collapse', target: this.name, recid: recid, + box_id: 'grid_'+ this.name +'_rec_'+ id +'_expanded' }); + if (eventData.isCancelled === true) return false; + // default action + $('#grid_'+ this.name +'_rec_'+ id).removeAttr('expanded').removeClass('w2ui-expanded'); + $('#grid_'+ this.name +'_rec_'+ id +'_expanded').css('opacity', 0); + $('#grid_'+ this.name +'_cell_'+ this.get(recid, true) +'_expand div').html('+'); + setTimeout(function () { + $('#grid_'+ obj.name +'_rec_'+ id +'_expanded').height('0px'); + setTimeout(function () { + $('#grid_'+ obj.name +'_rec_'+ id +'_expanded_row').remove(); + delete rec.expanded; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resizeRecords(); + }, 300); + }, 200); + return true; + }, + + sort: function (field, direction, multiField) { // if no params - clears sort + // event before + var eventData = this.trigger({ phase: 'before', type: 'sort', target: this.name, field: field, direction: direction, multiField: multiField }); + if (eventData.isCancelled === true) return false; + // check if needed to quit + if (typeof field != 'undefined') { + // default action + var sortIndex = this.sortData.length; + for (var s in this.sortData) { + if (this.sortData[s].field == field) { sortIndex = s; break; } + } + if (typeof direction == 'undefined' || direction == null) { + if (typeof this.sortData[sortIndex] == 'undefined') { + direction = 'asc'; + } else { + switch (String(this.sortData[sortIndex].direction)) { + case 'asc' : direction = 'desc'; break; + case 'desc' : direction = 'asc'; break; + default : direction = 'asc'; break; + } + } + } + if (this.multiSort === false) { this.sortData = []; sortIndex = 0; } + if (multiField != true) { this.sortData = []; sortIndex = 0; } + // set new sort + if (typeof this.sortData[sortIndex] == 'undefined') this.sortData[sortIndex] = {}; + this.sortData[sortIndex].field = field; + this.sortData[sortIndex].direction = direction; + } else { + this.sortData = []; + } + // if local + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (!url) { + this.localSort(); + if (this.searchData.length > 0) this.localSearch(true); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + } else { + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.last.xhr_offset = 0; + this.reload(); + } + }, + + copy: function () { + var sel = this.getSelection(); + if (sel.length == 0) return ''; + var text = ''; + if (typeof sel[0] == 'object') { // cell copy + // find min/max column + var minCol = sel[0].column; + var maxCol = sel[0].column; + var recs = []; + for (var s in sel) { + if (sel[s].column < minCol) minCol = sel[s].column; + if (sel[s].column > maxCol) maxCol = sel[s].column; + if (recs.indexOf(sel[s].index) == -1) recs.push(sel[s].index); + } + recs.sort(); + for (var r in recs) { + var ind = recs[r]; + for (var c = minCol; c <= maxCol; c++) { + var col = this.columns[c]; + if (col.hidden === true) continue; + text += w2utils.stripTags(this.getCellHTML(ind, c)) + '\t'; + } + text = text.substr(0, text.length-1); // remove last \t + text += '\n'; + } + } else { // row copy + for (var s in sel) { + var ind = this.get(sel[s], true); + for (var c in this.columns) { + var col = this.columns[c]; + if (col.hidden === true) continue; + text += w2utils.stripTags(this.getCellHTML(ind, c)) + '\t'; + } + text = text.substr(0, text.length-1); // remove last \t + text += '\n'; + } + } + text = text.substr(0, text.length - 1); + // before event + var eventData = this.trigger({ phase: 'before', type: 'copy', target: this.name, text: text }); + if (eventData.isCancelled === true) return ''; + text = eventData.text; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return text; + }, + + paste: function (text) { + var sel = this.getSelection(); + var ind = this.get(sel[0].recid, true); + var col = sel[0].column; + // before event + var eventData = this.trigger({ phase: 'before', type: 'paste', target: this.name, text: text, index: ind, column: col }); + if (eventData.isCancelled === true) return; + text = eventData.text; + // default action + if (this.selectType == 'row' || sel.length == 0) { + console.log('ERROR: You can paste only if grid.selectType = \'cell\' and when at least one cell selected.'); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return; + } + var newSel = []; + var text = text.split('\n'); + for (var t in text) { + var tmp = text[t].split('\t'); + var cnt = 0; + var rec = this.records[ind]; + var cols = []; + for (var dt in tmp) { + if (!this.columns[col + cnt]) continue; + var field = this.columns[col + cnt].field; + rec.changed = true; + rec.changes = rec.changes || {}; + rec.changes[field] = tmp[dt]; + cols.push(col + cnt); + cnt++; + } + for (var c in cols) newSel.push({ recid: rec.recid, column: cols[c] }); + ind++; + } + this.selectNone(); + this.select.apply(this, newSel); + this.refresh(); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // ================================================== + // --- Common functions + + resize: function () { + var obj = this; + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // make sure the box is right + if (!this.box || $(this.box).attr('name') != this.name) return; + // determine new width and height + $(this.box).find('> div') + .css('width', $(this.box).width()) + .css('height', $(this.box).height()); + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // resize + obj.resizeBoxes(); + obj.resizeRecords(); + // init editable + // $('#grid_'+ obj.name + '_records .w2ui-editable input').each(function (index, el) { + // var column = obj.columns[$(el).attr('column')]; + // if (column && column.editable) $(el).w2field(column.editable); + // }); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + refresh: function () { + var obj = this; + var time = (new Date()).getTime(); + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (this.total <= 0 && !url && this.searchData.length == 0) { + this.total = this.records.length; + this.buffered = this.total; + } + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + this.toolbar.disable('edit', 'delete'); + if (!this.box) return; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'refresh' }); + if (eventData.isCancelled === true) return false; + // -- header + if (this.show.header) { + $('#grid_'+ this.name +'_header').html(this.header +' ').show(); + } else { + $('#grid_'+ this.name +'_header').hide(); + } + // -- toolbar + if (this.show.toolbar) { + // if select-collumn is checked - no toolbar refresh + if (this.toolbar && this.toolbar.get('column-on-off') && this.toolbar.get('column-on-off').checked) { + // no action + } else { + $('#grid_'+ this.name +'_toolbar').show(); + // refresh toolbar only once + if (typeof this.toolbar == 'object') { + this.toolbar.refresh(); + var tmp = $('#grid_'+ obj.name +'_search_all'); + tmp.val(this.last.search); + } + } + } else { + $('#grid_'+ this.name +'_toolbar').hide(); + } + // -- make sure search is closed + this.searchClose(); + // search placeholder + var searchEl = $('#grid_'+ obj.name +'_search_all'); + if (this.searches.length == 0) { + this.last.field = 'all'; + } + if (!this.multiSearch && this.last.field == 'all' && this.searches.length > 0) { + this.last.field = this.searches[0].field; + this.last.caption = this.searches[0].caption; + } + for (var s in this.searches) { + if (this.searches[s].field == this.last.field) this.last.caption = this.searches[s].caption; + } + if (this.last.multi) { + searchEl.attr('placeholder', '[' + w2utils.lang('Multiple Fields') + ']'); + } else { + searchEl.attr('placeholder', this.last.caption); + } + + // focus search if last searched + if (this._focus_when_refreshed === true) { + clearTimeout(obj._focus_timer); + obj._focus_timer = setTimeout(function () { + if (searchEl.length > 0) { searchEl[0].focus(); } + delete obj._focus_when_refreshed; + delete obj._focus_timer; + }, 600); // need time to render + } + + // -- separate summary + var tmp = this.find({ summary: true }, true); + if (tmp.length > 0) { + for (var t in tmp) this.summary.push(this.records[tmp[t]]); + for (var t=tmp.length-1; t>=0; t--) this.records.splice(tmp[t], 1); + this.total = this.total - tmp.length; + this.buffered = this.buffered - tmp.length; + } + + // -- body + var bodyHTML = ''; + bodyHTML += '
'+ + this.getRecordsHTML() + + '
'+ + '
'+ + ' '+ this.getColumnsHTML() +'
'+ + '
'; // Columns need to be after to be able to overlap + $('#grid_'+ this.name +'_body').html(bodyHTML); + // show summary records + if (this.summary.length > 0) { + $('#grid_'+ this.name +'_summary').html(this.getSummaryHTML()).show(); + } else { + $('#grid_'+ this.name +'_summary').hide(); + } + // -- footer + if (this.show.footer) { + $('#grid_'+ this.name +'_footer').html(this.getFooterHTML()).show(); + } else { + $('#grid_'+ this.name +'_footer').hide(); + } + // select last selected record + if (this.last.selected.length > 0) for (var s in this.last.selected) { + if (this.get(this.last.selected[s]) != null) { + this.select(this.get(this.last.selected[s]).recid); + } + } + // show/hide clear search link + if (this.searchData.length > 0) { + $('#grid_'+ this.name +'_searchClear').show(); + } else { + $('#grid_'+ this.name +'_searchClear').hide(); + } + // all selected? + $('#grid_'+ this.name +'_check_all').prop('checked', true); + if ($('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]').length != 0 && + $('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]').length == $('#grid_'+ this.name +'_records').find('.grid_select_check[type=checkbox]:checked').length) { + $('#grid_'+ this.name +'_check_all').prop('checked', true); + } else { + $('#grid_'+ this.name +'_check_all').prop("checked", false); + } + // show number of selected + this.status(); + // collapse all records + var rows = obj.find({ expanded: true }, true); + for (var r in rows) obj.records[rows[r]].expanded = false; + // mark selection + setTimeout(function () { + var str = $.trim($('#grid_'+ obj.name +'_search_all').val()); + if (str != '') $(obj.box).find('.w2ui-grid-data > div').w2marker(str); + }, 50); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + obj.addRange('selection'); + setTimeout(function () { obj.resize(); obj.scroll(); }, 1); // allow to render first + return (new Date()).getTime() - time; + }, + + render: function (box) { + var obj = this; + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('#grid_'+ this.name +'_body').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-grid') + .html(''); + } + this.box = box; + } + if (!this.box) return; + if (this.last.sortData == null) this.last.sortData = this.sortData; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'render', box: box }); + if (eventData.isCancelled === true) return false; + // insert Elements + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-grid') + .html('
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ' '+ + '
'); + if (this.selectType != 'row') $(this.box).addClass('w2ui-ss'); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // init toolbar + this.initToolbar(); + if (this.toolbar != null) this.toolbar.render($('#grid_'+ this.name +'_toolbar')[0]); + // init footer + $('#grid_'+ this.name +'_footer').html(this.getFooterHTML()); + // refresh + this.refresh(); // show empty grid (need it) + this.reload(); + + // init mouse events for mouse selection + $(this.box).on('mousedown', mouseStart); + $(this.box).on('selectstart', function () { return false; }); // fixes chrome cursror bug + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // attach to resize event + if ($('.w2ui-layout').length == 0) { // if there is layout, it will send a resize event + this.tmp_resize = function (event) { w2ui[obj.name].resize(); } + $(window).off('resize', this.tmp_resize).on('resize', this.tmp_resize); + } + return (new Date()).getTime() - time; + + function mouseStart (event) { + if (obj.last.move && obj.last.move.type == 'expand') return; + obj.last.move = { + x : event.screenX, + y : event.screenY, + divX : 0, + divY : 0, + recid : $(event.target).parents('tr').attr('recid'), + column : (event.target.tagName == 'TD' ? $(event.target).attr('col') : $(event.target).parents('td').attr('col')), + type : 'select', + start : true + }; + $(document).on('mousemove', mouseMove); + $(document).on('mouseup', mouseStop); + } + + function mouseMove (event) { + if (!obj.last.move || obj.last.move.type != 'select') return; + obj.last.move.divX = (event.screenX - obj.last.move.x); + obj.last.move.divY = (event.screenY - obj.last.move.y); + if (Math.abs(obj.last.move.divX) <= 1 && Math.abs(obj.last.move.divY) <= 1) return; // only if moved more then 1px + if (obj.last.move.start && obj.last.move.recid) { + obj.selectNone(); + obj.last.move.start = false; + } + var newSel= []; + var recid = (event.target.tagName == 'TR' ? $(event.target).attr('recid') : $(event.target).parents('tr').attr('recid')); + if (typeof recid == 'undefined') return; + var ind1 = obj.get(obj.last.move.recid, true); + var ind2 = obj.get(recid, true); + var col1 = parseInt(obj.last.move.column); + var col2 = parseInt(event.target.tagName == 'TD' ? $(event.target).attr('col') : $(event.target).parents('td').attr('col')); + if (ind1 > ind2) { var tmp = ind1; ind1 = ind2; ind2 = tmp; } + // check if need to refresh + var tmp = 'ind1:'+ ind1 +',ind2;'+ ind2 +',col1:'+ col1 +',col2:'+ col2; + if (obj.last.move.range == tmp) return; + obj.last.move.range = tmp; + for (var i = ind1; i <= ind2; i++) { + if (obj.last.searchIds.length > 0 && obj.last.searchIds.indexOf(i) == -1) continue; + if (obj.selectType != 'row') { + if (col1 > col2) { var tmp = col1; col1 = col2; col2 = tmp; } + var tmp = []; + for (var c = col1; c <= col2; c++) { + if (obj.columns[c].hidden) continue; + newSel.push({ recid: obj.records[i].recid, column: parseInt(c) }); + } + } else { + newSel.push(obj.records[i].recid); + } + } + if (obj.selectType != 'row') { + var sel = obj.getSelection(); + // add more items + var tmp = []; + for (var ns in newSel) { + var flag = false; + for (var s in sel) if (newSel[ns].recid == sel[s].recid && newSel[ns].column == sel[s].column) flag = true; + if (!flag) tmp.push({ recid: newSel[ns].recid, column: newSel[ns].column }); + } + obj.select.apply(obj, tmp); + // remove items + var tmp = []; + for (var s in sel) { + var flag = false; + for (var ns in newSel) if (newSel[ns].recid == sel[s].recid && newSel[ns].column == sel[s].column) flag = true; + if (!flag) tmp.push({ recid: sel[s].recid, column: sel[s].column }); + } + obj.unselect.apply(obj, tmp); + } else { + if (obj.multiSelect) { + var sel = obj.getSelection(); + for (var ns in newSel) if (sel.indexOf(newSel[ns]) == -1) obj.select(newSel[ns]); // add more items + for (var s in sel) if (newSel.indexOf(sel[s]) == -1) obj.unselect(sel[s]); // remove items + } + } + } + + function mouseStop (event) { + if (!obj.last.move || obj.last.move.type != 'select') return; + delete obj.last.move; + $(document).off('mousemove', mouseMove); + $(document).off('mouseup', mouseStop); + } + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'destroy' }); + if (eventData.isCancelled === true) return false; + // remove events + $(window).off('resize', this.tmp_resize); + // clean up + if (typeof this.toolbar == 'object' && this.toolbar.destroy) this.toolbar.destroy(); + if ($(this.box).find('#grid_'+ this.name +'_body').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-grid') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // =========================================== + // --- Internal Functions + + initColumnOnOff: function () { + if (!this.show.toolbarColumns) return; + var obj = this; + var col_html = '
'+ + ''; + for (var c in this.columns) { + var col = this.columns[c]; + col_html += ''+ + ''+ + ''+ + ''; + } + col_html += ''; + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url) { + col_html += + ''; + } + col_html += ''+ + ''; + col_html += "
'+ + ' '+ + ''+ + ' '+ + '
'+ + '
'+ + ' '+ w2utils.lang('Skip') +' '+ w2utils.lang('Records')+ + '
'+ + '
'+ + '
'+ w2utils.lang('Toggle Line Numbers') +'
'+ + '
'+ + '
'+ w2utils.lang('Reset Column Size') + '
'+ + '
"; + this.toolbar.get('column-on-off').html = col_html; + }, + + columnOnOff: function (el, event, field, value) { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'columnOnOff', checkbox: el, field: field, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // regular processing + var obj = this; + // collapse expanded rows + for (var r in this.records) { + if (this.records[r].expanded === true) this.records[r].expanded = false + } + // show/hide + var hide = true; + if (field == 'line-numbers') { + this.show.lineNumbers = !this.show.lineNumbers; + this.refresh(); + } else if (field == 'skip') { + if (!w2utils.isInt(value)) value = 0; + obj.skip(value); + } else if (field == 'resize') { + // restore sizes + for (var c in this.columns) { + if (typeof this.columns[c].sizeOriginal != 'undefined') { + this.columns[c].size = this.columns[c].sizeOriginal; + } + } + this.initResize(); + this.resize(); + } else { + var col = this.getColumn(field); + if (col.hidden) { + $(el).prop('checked', true); + this.showColumn(col.field); + } else { + $(el).prop('checked', false); + this.hideColumn(col.field); + } + hide = false; + } + this.initColumnOnOff(); + if (hide) { + setTimeout(function () { + $().w2overlay(); + obj.toolbar.uncheck('column-on-off'); + }, 100); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + initToolbar: function () { + // -- if toolbar is true + if (typeof this.toolbar['render'] == 'undefined') { + var tmp_items = this.toolbar.items; + this.toolbar.items = []; + this.toolbar = $().w2toolbar($.extend(true, {}, this.toolbar, { name: this.name +'_toolbar', owner: this })); + + // ============================================= + // ------ Toolbar Generic buttons + + if (this.show.toolbarReload) { + this.toolbar.items.push($.extend(true, {}, this.buttons['reload'])); + } + if (this.show.toolbarColumns) { + this.toolbar.items.push($.extend(true, {}, this.buttons['columns'])); + this.initColumnOnOff(); + } + if (this.show.toolbarReload || this.show.toolbarColumn) { + this.toolbar.items.push({ type: 'break', id: 'break0' }); + } + if (this.show.toolbarSearch) { + var html = + ''; + this.toolbar.items.push({ type: 'html', id: 'search', html: html }); + if (this.multiSearch && this.searches.length > 0) { + this.toolbar.items.push($.extend(true, {}, this.buttons['search-go'])); + } + } + if (this.show.toolbarSearch && (this.show.toolbarAdd || this.show.toolbarEdit || this.show.toolbarDelete || this.show.toolbarSave)) { + this.toolbar.items.push({ type: 'break', id: 'break1' }); + } + if (this.show.toolbarAdd) { + this.toolbar.items.push($.extend(true, {}, this.buttons['add'])); + } + if (this.show.toolbarEdit) { + this.toolbar.items.push($.extend(true, {}, this.buttons['edit'])); + } + if (this.show.toolbarDelete) { + this.toolbar.items.push($.extend(true, {}, this.buttons['delete'])); + } + if (this.show.toolbarSave) { + if (this.show.toolbarAdd || this.show.toolbarDelete || this.show.toolbarEdit) { + this.toolbar.items.push({ type: 'break', id: 'break2' }); + } + this.toolbar.items.push($.extend(true, {}, this.buttons['save'])); + } + // add original buttons + for (var i in tmp_items) this.toolbar.items.push(tmp_items[i]); + + // ============================================= + // ------ Toolbar onClick processing + + var obj = this; + this.toolbar.on('click', function (event) { + var eventData = obj.trigger({ phase: 'before', type: 'toolbar', target: event.target, originalEvent: event }); + if (eventData.isCancelled === true) return false; + var id = event.target; + switch (id) { + case 'reload': + var eventData2 = obj.trigger({ phase: 'before', type: 'reload', target: obj.name }); + if (eventData2.isCancelled === true) return false; + var url = (typeof obj.url != 'object' ? obj.url : obj.url.get); + if (url) { + obj.clear(true); + } else { + obj.last.scrollTop = 0; + obj.last.scrollLeft = 0; + obj.last.range_start= null; + obj.last.range_end = null; + } + obj.reload(); + obj.trigger($.extend(eventData2, { phase: 'after' })); + break; + case 'column-on-off': + for (var c in obj.columns) { + if (obj.columns[c].hidden) { + $("#grid_"+ obj.name +"_column_"+ c + "_check").prop("checked", false); + } else { + $("#grid_"+ obj.name +"_column_"+ c + "_check").prop('checked', true); + } + } + obj.initResize(); + obj.resize(); + break; + case 'search-advanced': + var tb = this; + var it = this.get(id); + if (it.checked) { + obj.searchClose(); + setTimeout(function () { tb.uncheck(id); }, 1); + } else { + obj.searchOpen(); + event.originalEvent.stopPropagation(); + function tmp_close() { tb.uncheck(id); $(document).off('click', 'body', tmp_close); } + $(document).on('click', 'body', tmp_close); + } + break; + case 'add': + // events + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'add', recid: null }); + obj.trigger($.extend(eventData, { phase: 'after' })); + break; + case 'edit': + var sel = obj.getSelection(); + var recid = null; + if (sel.length == 1) recid = sel[0]; + // events + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'edit', recid: recid }); + obj.trigger($.extend(eventData, { phase: 'after' })); + break; + case 'delete': + obj.delete(); + break; + case 'save': + obj.save(); + break; + } + // no default action + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + } + return; + }, + + initSearches: function () { + var obj = this; + // init searches + for (var s in this.searches) { + var search = this.searches[s]; + var sdata = this.getSearchData(search.field); + // init types + switch (String(search.type).toLowerCase()) { + case 'alphaNumeric': + case 'text': + $('#grid_'+ this.name +'_operator_'+s).val('begins with'); + break; + + case 'int': + case 'float': + case 'hex': + case 'money': + case 'date': + $('#grid_'+ this.name +'_field_'+s).w2field('clear').w2field(search.type); + $('#grid_'+ this.name +'_field2_'+s).w2field('clear').w2field(search.type); + break; + + case 'list': + // build options + var options = ''; + for (var i in search.items) { + if ($.isPlainObject(search.items[i])) { + var val = search.items[i].id; + var txt = search.items[i].text; + if (typeof val == 'undefined' && typeof search.items[i].value != 'undefined') val = search.items[i].value; + if (typeof txt == 'undefined' && typeof search.items[i].caption != 'undefined') txt = search.items[i].caption; + if (val == null) val = ''; + options += ''; + } else { + options += ''; + } + } + $('#grid_'+ this.name +'_field_'+s).html(options); + break; + } + if (sdata != null) { + $('#grid_'+ this.name +'_operator_'+ s).val(sdata.operator).trigger('change'); + if (!$.isArray(sdata.value)) { + if (typeof sdata.value != 'udefined') $('#grid_'+ this.name +'_field_'+ s).val(sdata.value).trigger('change'); + } else { + if (sdata.operator == 'in') { + $('#grid_'+ this.name +'_field_'+ s).val(sdata.value).trigger('change'); + } else { + $('#grid_'+ this.name +'_field_'+ s).val(sdata.value[0]).trigger('change'); + $('#grid_'+ this.name +'_field2_'+ s).val(sdata.value[1]).trigger('change'); + } + } + } + } + // add on change event + $('#w2ui-overlay .w2ui-grid-searches *[rel=search]').on('keypress', function (evnt) { + if (evnt.keyCode == 13) { obj.search(); } + }); + }, + + initResize: function () { + var obj = this; + //if (obj.resizing === true) return; + $(this.box).find('.w2ui-resizer') + .off('click') + .on('click', function (event) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); + }) + .off('mousedown') + .on('mousedown', function (event) { + if (!event) event = window.event; + if (!window.addEventListener) { window.document.attachEvent('onselectstart', function() { return false; } ); } + obj.resizing = true; + obj.last.tmp = { + x : event.screenX, + y : event.screenY, + gx : event.screenX, + gy : event.screenY, + col : parseInt($(this).attr('name')) + }; + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); + // fix sizes + for (var c in obj.columns) { + if (typeof obj.columns[c].sizeOriginal == 'undefined') obj.columns[c].sizeOriginal = obj.columns[c].size; + obj.columns[c].size = obj.columns[c].sizeCalculated; + } + var eventData = { phase: 'before', type: 'columnResize', target: obj.name, column: obj.last.tmp.col, field: obj.columns[obj.last.tmp.col].field }; + eventData = obj.trigger($.extend(eventData, { resizeBy: 0, originalEvent: event })); + // set move event + var mouseMove = function (event) { + if (obj.resizing != true) return; + if (!event) event = window.event; + // event before + eventData = obj.trigger($.extend(eventData, { resizeBy: (event.screenX - obj.last.tmp.gx), originalEvent: event })); + if (eventData.isCancelled === true) { eventData.isCancelled = false; return; } + // default action + obj.last.tmp.x = (event.screenX - obj.last.tmp.x); + obj.last.tmp.y = (event.screenY - obj.last.tmp.y); + obj.columns[obj.last.tmp.col].size = (parseInt(obj.columns[obj.last.tmp.col].size) + obj.last.tmp.x) + 'px'; + obj.resizeRecords(); + // reset + obj.last.tmp.x = event.screenX; + obj.last.tmp.y = event.screenY; + } + var mouseUp = function (event) { + delete obj.resizing; + $(document).off('mousemove', 'body'); + $(document).off('mouseup', 'body'); + obj.resizeRecords(); + // event before + obj.trigger($.extend(eventData, { phase: 'after', originalEvent: event })); + } + $(document).on('mousemove', 'body', mouseMove); + $(document).on('mouseup', 'body', mouseUp); + }) + .each(function (index, el) { + var td = $(el).parent(); + $(el).css({ + "height" : '25px', + "margin-left" : (td.width() - 3) + 'px' + }) + }); + }, + + resizeBoxes: function () { + // elements + var main = $(this.box).find('> div'); + var header = $('#grid_'+ this.name +'_header'); + var toolbar = $('#grid_'+ this.name +'_toolbar'); + var summary = $('#grid_'+ this.name +'_summary'); + var footer = $('#grid_'+ this.name +'_footer'); + var body = $('#grid_'+ this.name +'_body'); + var columns = $('#grid_'+ this.name +'_columns'); + var records = $('#grid_'+ this.name +'_records'); + + if (this.show.header) { + header.css({ + top: '0px', + left: '0px', + right: '0px' + }); + } + + if (this.show.toolbar) { + toolbar.css({ + top: ( 0 + (this.show.header ? w2utils.getSize(header, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + } + if (this.show.footer) { + footer.css({ + bottom: '0px', + left: '0px', + right: '0px' + }); + } + if (this.summary.length > 0) { + summary.css({ + bottom: ( 0 + (this.show.footer ? w2utils.getSize(footer, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + } + body.css({ + top: ( 0 + (this.show.header ? w2utils.getSize(header, 'height') : 0) + (this.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) ) + 'px', + bottom: ( 0 + (this.show.footer ? w2utils.getSize(footer, 'height') : 0) + (this.summary.length > 0 ? w2utils.getSize(summary, 'height') : 0) ) + 'px', + left: '0px', + right: '0px' + }); + }, + + resizeRecords: function () { + var obj = this; + // remove empty records + $(this.box).find('.w2ui-empty-record').remove(); + // -- Calculate Column size in PX + var box = $(this.box); + var grid = $(this.box).find('> div'); + var header = $('#grid_'+ this.name +'_header'); + var toolbar = $('#grid_'+ this.name +'_toolbar'); + var summary = $('#grid_'+ this.name +'_summary'); + var footer = $('#grid_'+ this.name +'_footer'); + var body = $('#grid_'+ this.name +'_body'); + var columns = $('#grid_'+ this.name +'_columns'); + var records = $('#grid_'+ this.name +'_records'); + + // body might be expanded by data + if (!this.fixedBody) { + // allow it to render records, then resize + setTimeout(function () { + var calculatedHeight = w2utils.getSize(columns, 'height') + + w2utils.getSize($('#grid_'+ obj.name +'_records table'), 'height'); + obj.height = calculatedHeight + + w2utils.getSize(grid, '+height') + + (obj.show.header ? w2utils.getSize(header, 'height') : 0) + + (obj.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) + + (summary.css('display') != 'none' ? w2utils.getSize(summary, 'height') : 0) + + (obj.show.footer ? w2utils.getSize(footer, 'height') : 0); + grid.css('height', obj.height); + body.css('height', calculatedHeight); + box.css('height', w2utils.getSize(grid, 'height') + w2utils.getSize(box, '+height')); + }, 1); + } else { + // fixed body height + var calculatedHeight = grid.height() + - (this.show.header ? w2utils.getSize(header, 'height') : 0) + - (this.show.toolbar ? w2utils.getSize(toolbar, 'height') : 0) + - (summary.css('display') != 'none' ? w2utils.getSize(summary, 'height') : 0) + - (this.show.footer ? w2utils.getSize(footer, 'height') : 0); + body.css('height', calculatedHeight); + } + + // check overflow + var bodyOverflowX = false; + var bodyOverflowY = false; + if (body.width() < $(records).find('>table').width()) bodyOverflowX = true; + if (body.height() - columns.height() < $(records).find('>table').height() + (bodyOverflowX ? w2utils.scrollBarSize() : 0)) bodyOverflowY = true; + if (!this.fixedBody) { bodyOverflowY = false; bodyOverflowX = false; } + if (bodyOverflowX || bodyOverflowY) { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').css('width', w2utils.scrollBarSize()).show(); + records.css({ + top: ((this.columnGroups.length > 0 && this.show.columns ? 1 : 0) + w2utils.getSize(columns, 'height')) +'px', + "-webkit-overflow-scrolling": "touch", + "overflow-x": (bodyOverflowX ? 'auto' : 'hidden'), + "overflow-y": (bodyOverflowY ? 'auto' : 'hidden') }); + } else { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').hide(); + records.css({ + top: ((this.columnGroups.length > 0 && this.show.columns ? 1 : 0) + w2utils.getSize(columns, 'height')) +'px', + overflow: 'hidden' + }); + if (records.length > 0) { this.last.scrollTop = 0; this.last.scrollLeft = 0; } // if no scrollbars, always show top + } + if (this.show.emptyRecords && !bodyOverflowY) { + var max = Math.floor(records.height() / this.recordHeight) + 1; + if (this.fixedBody) { + for (var di = this.buffered; di <= max; di++) { + var html = ''; + html += ''; + if (this.show.lineNumbers) html += ''; + if (this.show.selectColumn) html += ''; + if (this.show.expandColumn) html += ''; + var j = 0; + while (true && this.columns.length > 0) { + var col = this.columns[j]; + if (col.hidden) { j++; if (typeof this.columns[j] == 'undefined') break; else continue; } + html += ''; + j++; + if (typeof this.columns[j] == 'undefined') break; + } + html += ''; + html += ''; + $('#grid_'+ this.name +'_records > table').append(html); + } + } + } + if (body.length > 0) { + var width_max = parseInt(body.width()) + - (bodyOverflowY ? w2utils.scrollBarSize() : 0) + - (this.show.lineNumbers ? 34 : 0) + - (this.show.selectColumn ? 26 : 0) + - (this.show.expandColumn ? 26 : 0); + var width_box = width_max; + var percent = 0; + // gridMinWidth processiong + var restart = false; + for (var i=0; i width_box && col.hidden !== true) { + col.hidden = true; + restart = true; + } + if (col.gridMinWidth < width_box && col.hidden === true) { + col.hidden = false; + restart = true; + } + } + } + if (restart === true) { + this.refresh(); + return; + } + // assign PX column s + for (var i=0; i 0) { + for (var i=0; i parseInt(col.max)) col.sizeCalculated = col.max + 'px'; + width_cols += parseInt(col.sizeCalculated); + } + var width_diff = parseInt(width_box) - parseInt(width_cols); + if (width_diff > 0 && percent > 0) { + var i = 0; + while (true) { + var col = this.columns[i]; + if (typeof col == 'undefined') { i = 0; continue; } + if (col.hidden || col.sizeType == 'px') { i++; continue; } + col.sizeCalculated = (parseInt(col.sizeCalculated) + 1) + 'px'; + width_diff--; + if (width_diff == 0) break; + i++; + } + } else if (width_diff > 0) { + columns.find('> table > tbody > tr:nth-child(1) td.w2ui-head-last').css('width', w2utils.scrollBarSize()).show(); + } + // resize columns + columns.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-head-last')) { + $(el).css('width', w2utils.scrollBarSize() + (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + // if there are column groups - hide first row (needed for sizing) + if (columns.find('> table > tbody > tr').length == 3) { + columns.find('> table > tbody > tr:nth-child(1) td').html('').css({ + 'height' : '0px', + 'border' : '0px', + 'padding' : '0px', + 'margin' : '0px' + }); + } + // resize records + records.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-grid-data-last')) { + $(el).css('width', (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + // resize summary + summary.find('> table > tbody > tr:nth-child(1) td').each(function (index, el) { + var ind = $(el).attr('col'); + if (typeof ind != 'undefined' && obj.columns[ind]) $(el).css('width', obj.columns[ind].sizeCalculated); + // last column + if ($(el).hasClass('w2ui-grid-data-last')) { + $(el).css('width', w2utils.scrollBarSize() + (width_diff > 0 && percent == 0 ? width_diff : 0) + 'px'); + } + }); + this.initResize(); + this.refreshRanges(); + // apply last scroll if any + if (this.last.scrollTop != '' && records.length > 0) { + columns.prop('scrollLeft', this.last.scrollLeft); + records.prop('scrollTop', this.last.scrollTop); + records.prop('scrollLeft', this.last.scrollLeft); + } + }, + + getSearchesHTML: function () { + var html = ''; + var showBtn = false; + for (var i = 0; i < this.searches.length; i++) { + var s = this.searches[i]; + if (s.hidden) continue; + var btn = ''; + if (showBtn == false) { + btn = ''; + showBtn = true; + } + if (typeof s.inTag == 'undefined') s.inTag = ''; + if (typeof s.outTag == 'undefined') s.outTag = ''; + if (typeof s.type == 'undefined') s.type = 'text'; + if (s.type == 'text') { + var operator = ''; + } + if (s.type == 'int' || s.type == 'float' || s.type == 'date') { + var operator = ''; + } + if (s.type == 'list') { + var operator = 'is '; + } + html += ''+ + ' ' + + ' ' + + ' '+ + ' ' + + ''; + } + html += ''+ + ' '+ + '
'+ btn +''+ s.caption +''+ operator +''; + + switch (s.type) { + case 'alphaNumeric': + case 'text': + html += ''; + break; + + case 'int': + case 'float': + case 'hex': + case 'money': + case 'date': + html += ''+ + ''; + break; + + case 'list': + html += ''; + break; + + } + html += s.outTag + + '
'+ + '
'+ + ' '+ + ' '+ + '
'+ + '
'; + return html; + }, + + getColumnsHTML: function () { + var obj = this; + var html = ''; + if (this.show.columnHeaders) { + if (this.columnGroups.length > 0) { + html = getColumns(true) + getGroups() + getColumns(false); + } else { + html = getColumns(true); + } + } + return html; + + function getGroups () { + var html = ''; + // add empty group at the end + if (obj.columnGroups[obj.columnGroups.length-1].caption != '') obj.columnGroups.push({ caption: '' }); + + if (obj.show.lineNumbers) { + html += ''+ + '
 
'+ + ''; + } + if (obj.show.selectColumn) { + html += ''+ + '
 
'+ + ''; + } + if (obj.show.expandColumn) { + html += ''+ + '
 
'+ + ''; + } + var ii = 0; + for (var i=0; i
'; + } + html += ''+ + resizer + + '
'+ + (col.caption == '' ? ' ' : col.caption) + + '
'+ + ''; + } else { + html += ''+ + '
'+ + (colg.caption == '' ? ' ' : colg.caption) + + '
'+ + ''; + } + ii += colg.span; + } + html += ''; + return html; + } + + function getColumns (master) { + var html = ''; + if (obj.show.lineNumbers) { + html += ''+ + '
#
'+ + ''; + } + if (obj.show.selectColumn) { + html += ''+ + '
'+ + ' '+ + '
'+ + ''; + } + if (obj.show.expandColumn) { + html += ''+ + '
 
'+ + ''; + } + var ii = 0; + var id = 0; + for (var i=0; i
'; + } + html += ''+ + resizer + + '
'+ + (col.caption == '' ? ' ' : col.caption) + + '
'+ + ''; + } + } + html += '
 
'; + html += ''; + return html; + } + }, + + getRecordsHTML: function () { + // larget number works better with chrome, smaller with FF. + if (this.buffered > 300) this.show_extra = 30; else this.show_extra = 300; + var records = $('#grid_'+ this.name +'_records'); + var limit = Math.floor(records.height() / this.recordHeight) + this.show_extra + 1; + if (!this.fixedBody) limit = this.buffered; + // always need first record for resizing purposes + var html = '' + this.getRecordHTML(-1, 0); + // first empty row with height + html += ''+ + ' '+ + ''; + for (var i = 0; i < limit; i++) { + html += this.getRecordHTML(i, i+1); + } + html += ''+ + ' '+ + ''+ + ''+ + ' '+ + ''+ + '
'; + this.last.range_start = 0; + this.last.range_end = limit; + return html; + }, + + getSummaryHTML: function () { + if (this.summary.length == 0) return; + var html = ''; + for (var i = 0; i < this.summary.length; i++) { + html += this.getRecordHTML(i, i+1, true); + } + html += '
'; + return html; + }, + + scroll: function (event) { + var time = (new Date()).getTime(); + var obj = this; + var records = $('#grid_'+ this.name +'_records'); + if (this.records.length == 0 || records.length == 0 || records.height() == 0) return; + if (this.buffered > 300) this.show_extra = 30; else this.show_extra = 300; + // need this to enable scrolling when this.limit < then a screen can fit + if (records.height() < this.buffered * this.recordHeight && records.css('overflow-y') == 'hidden') { + if (this.total > 0) this.refresh(); + return; + } + // update footer + var t1 = Math.floor(records[0].scrollTop / this.recordHeight + 1); + var t2 = Math.floor(records[0].scrollTop / this.recordHeight + 1) + Math.round(records.height() / this.recordHeight); + if (t1 > this.buffered) t1 = this.buffered; + if (t2 > this.buffered) t2 = this.buffered; + var url = (typeof this.url != 'object' ? this.url : this.url.get); + $('#grid_'+ this.name + '_footer .w2ui-footer-right').html(w2utils.formatNumber(this.offset + t1) + '-' + w2utils.formatNumber(this.offset + t2) + ' ' + w2utils.lang('of') + ' ' + w2utils.formatNumber(this.total) + + (url ? ' ('+ w2utils.lang('buffered') + ' '+ w2utils.formatNumber(this.buffered) + (this.offset > 0 ? ', skip ' + w2utils.formatNumber(this.offset) : '') + ')' : '') + ); + // only for local data source, else no extra records loaded + if (!url && (!this.fixedBody || this.total <= 300)) return; + // regular processing + var start = Math.floor(records[0].scrollTop / this.recordHeight) - this.show_extra; + var end = start + Math.floor(records.height() / this.recordHeight) + this.show_extra * 2 + 1; + // var div = start - this.last.range_start; + if (start < 1) start = 1; + if (end > this.total) end = this.total; + var tr1 = records.find('#grid_'+ this.name +'_rec_top'); + var tr2 = records.find('#grid_'+ this.name +'_rec_bottom'); + // if row is expanded + if (String(tr1.next().prop('id')).indexOf('_expanded_row') != -1) tr1.next().remove(); + if (String(tr2.prev().prop('id')).indexOf('_expanded_row') != -1) tr2.prev().remove(); + var first = parseInt(tr1.next().attr('line')); + var last = parseInt(tr2.prev().attr('line')); + //$('#log').html('buffer: '+ this.buffered +' start-end: ' + start + '-'+ end + ' ===> first-last: ' + first + '-' + last); + if (first < start || first == 1 || this.last.pull_refresh) { // scroll down + //console.log('end', end, 'last', last, 'show_extre', this.show_extra, this.last.pull_refresh); + if (end <= last + this.show_extra - 2 && end != this.total) return; + this.last.pull_refresh = false; + // remove from top + while (true) { + var tmp = records.find('#grid_'+ this.name +'_rec_top').next(); + if (tmp.attr('line') == 'bottom') break; + if (parseInt(tmp.attr('line')) < start) tmp.remove(); else break; + } + // add at bottom + var tmp = records.find('#grid_'+ this.name +'_rec_bottom').prev(); + var rec_start = tmp.attr('line'); + if (rec_start == 'top') rec_start = start; + for (var i = parseInt(rec_start) + 1; i <= end; i++) { + if (!this.records[i-1]) continue; + if (this.records[i-1].expanded === true) this.records[i-1].expanded = false; + tr2.before(this.getRecordHTML(i-1, i)); + } + markSearch(); + setTimeout(function() { obj.refreshRanges(); }, 0); + } else { // scroll up + if (start >= first - this.show_extra + 2 && start > 1) return; + // remove from bottom + while (true) { + var tmp = records.find('#grid_'+ this.name +'_rec_bottom').prev(); + if (tmp.attr('line') == 'top') break; + if (parseInt(tmp.attr('line')) > end) tmp.remove(); else break; + } + // add at top + var tmp = records.find('#grid_'+ this.name +'_rec_top').next(); + var rec_start = tmp.attr('line'); + if (rec_start == 'bottom') rec_start = end; + for (var i = parseInt(rec_start) - 1; i >= start; i--) { + if (!this.records[i-1]) continue; + if (this.records[i-1].expanded === true) this.records[i-1].expanded = false; + tr1.after(this.getRecordHTML(i-1, i)); + } + markSearch(); + setTimeout(function() { obj.refreshRanges(); }, 0); + } + // first/last row size + var h1 = (start - 1) * obj.recordHeight; + var h2 = (this.buffered - end) * obj.recordHeight; + if (h2 < 0) h2 = 0; + tr1.css('height', h1 + 'px'); + tr2.css('height', h2 + 'px'); + obj.last.range_start = start; + obj.last.range_end = end; + // load more if needed + var s = Math.floor(records[0].scrollTop / this.recordHeight); + var e = s + Math.floor(records.height() / this.recordHeight); + if (e + 10 > this.buffered && this.last.pull_more !== true && this.buffered < this.total - this.offset) { + if (this.autoLoad === true) { + this.last.pull_more = true; + this.last.xhr_offset += this.limit; + this.request('get-records'); + } else { + var more = $('#grid_'+ this.name +'_rec_more'); + if (more.css('display') == 'none') { + more.show() + .on('click', function () { + $(this).find('td').html('
'); + obj.last.pull_more = true; + obj.last.xhr_offset += obj.limit; + obj.request('get-records'); + }); + } + if (more.find('td').text().indexOf('Load') == -1) { + more.find('td').html('
Load '+ obj.limit + ' More...
'); + } + } + } + // check for grid end + if (this.buffered >= this.total - this.offset) $('#grid_'+ this.name +'_rec_more').hide(); + return; + + function markSearch() { + // mark search + if(obj.markSearchResults === false) return; + clearTimeout(obj.last.marker_timer); + obj.last.marker_timer = setTimeout(function () { + // mark all search strings + var str = []; + for (var s in obj.searchData) { + var tmp = obj.searchData[s]; + if ($.inArray(tmp.value, str) == -1) str.push(tmp.value); + } + if (str.length > 0) $(obj.box).find('.w2ui-grid-data > div').w2marker(str); + }, 50); + } + }, + + getRecordHTML: function (ind, lineNum, summary) { + var rec_html = ''; + // first record needs for resize purposes + if (ind == -1) { + rec_html += ''; + if (this.show.lineNumbers) rec_html += ''; + if (this.show.selectColumn) rec_html += ''; + if (this.show.expandColumn) rec_html += ''; + for (var i in this.columns) { + if (this.columns[i].hidden) continue; + rec_html += ''; + } + rec_html += ''; + rec_html += ''; + return rec_html; + } + // regular record + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (summary !== true) { + if (this.searchData.length > 0 && !url) { + if (ind >= this.last.searchIds.length) return ''; + ind = this.last.searchIds[ind]; + record = this.records[ind]; + } else { + if (ind >= this.records.length) return ''; + record = this.records[ind]; + } + } else { + if (ind >= this.summary.length) return ''; + record = this.summary[ind]; + } + if (!record) return ''; + var id = w2utils.escapeId(record.recid); + var isRowSelected = false; + if (record.selected && this.selectType == 'row') isRowSelected = true; + // render TR + rec_html += ''; + if (this.show.lineNumbers) { + rec_html += ''+ + (summary !== true ? '
'+ lineNum +'
' : '') + + ''; + } + if (this.show.selectColumn) { + rec_html += + ''+ + (summary !== true ? + '
'+ + ' '+ + '
' + : + '' ) + + ''; + } + if (this.show.expandColumn) { + var tmp_img = ''; + if (record.expanded === true) tmp_img = '-'; else tmp_img = '+'; + if (record.expanded == 'none') tmp_img = ''; + if (record.expanded == 'spinner') tmp_img = '
'; + rec_html += + ''+ + (summary !== true ? + '
'+ + ' '+ tmp_img +'
' + : + '' ) + + ''; + } + var col_ind = 0; + while (true) { + var col = this.columns[col_ind]; + if (col.hidden) { col_ind++; if (typeof this.columns[col_ind] == 'undefined') break; else continue; } + var isChanged = record.changed && record.changes[col.field]; + var rec_cell = this.getCellHTML(ind, col_ind, summary); + var addStyle = ''; + if (typeof col.render == 'string') { + var tmp = col.render.toLowerCase().split(':'); + if ($.inArray(tmp[0], ['number', 'int', 'float', 'money', 'percent']) != -1) addStyle = 'text-align: right'; + if ($.inArray(tmp[0], ['date']) != -1) addStyle = 'text-align: right'; + } + var isCellSelected = false; + if (record.selected && $.inArray(col_ind, record.selectedColumns) != -1) isCellSelected = true; + rec_html += ''+ + rec_cell + + ''; + col_ind++; + if (typeof this.columns[col_ind] == 'undefined') break; + } + rec_html += ''; + rec_html += ''; + // if row is expanded (buggy) + // if (record.expanded === true && $('#grid_'+ this.name +'_rec_'+ record.recid +'_expanded_row').length == 0) { + // var tmp = 1 + (this.show.selectColumn ? 1 : 0); + // rec_html += + // ''+ + // (this.show.lineNumbers ? '' : '') + + // '
'+ + // ' '+ + // '
'+ + // ' '+ + // ''; + // } + return rec_html; + }, + + getCellHTML: function (ind, col_ind, summary) { + var col = this.columns[col_ind]; + var record = (summary !== true ? this.records[ind] : this.summary[ind]); + var data = this.parseField(record, col.field); + var isChanged = record.changed && typeof record.changes[col.field] != 'undefined'; + if (isChanged) data = record.changes[col.field]; + // various renderers + if (data == null || typeof data == 'undefined') data = ''; + if (typeof col.render != 'undefined') { + if (typeof col.render == 'function') { + data = col.render.call(this, record, ind, col_ind); + if (data.length >= 4 && data.substr(0, 4) != ''; + } + if (typeof col.render == 'object') data = '
' + col.render[data] + '
'; + if (typeof col.render == 'string') { + var tmp = col.render.toLowerCase().split(':'); + var prefix = ''; + var suffix = ''; + if ($.inArray(tmp[0], ['number', 'int', 'float', 'money', 'percent']) != -1) { + if (typeof tmp[1] == 'undefined' || !w2utils.isInt(tmp[1])) tmp[1] = 0; + if (tmp[1] > 20) tmp[1] = 20; + if (tmp[1] < 0) tmp[1] = 0; + if (tmp[0] == 'money') { tmp[1] = 2; prefix = w2utils.settings.currencySymbol; } + if (tmp[0] == 'percent') { suffix = '%'; if (tmp[1] !== '0') tmp[1] = 1; } + if (tmp[0] == 'int') { tmp[1] = 0; } + // format + data = '
' + prefix + w2utils.formatNumber(Number(data).toFixed(tmp[1])) + suffix + '
'; + } + if (tmp[0] == 'date') { + if (typeof tmp[1] == 'undefined' || tmp[1] == '') tmp[1] = w2utils.settings.date_display; + data = '
' + prefix + w2utils.formatDate(data, tmp[1]) + suffix + '
'; + } + if (tmp[0] == 'age') { + data = '
' + prefix + w2utils.age(data) + suffix + '
'; + } + } + } else { + if (!this.show.recordTitles) { + var data = '
'+ data +'
'; + } else { + // title overwrite + var title = String(data).replace(/"/g, "''"); + if (typeof col.title != 'undefined') { + if (typeof col.title == 'function') title = col.title.call(this, record, ind, col_ind); + if (typeof col.title == 'string') title = col.title; + } + var data = '
'+ data +'
'; + } + } + if (data == null || typeof data == 'undefined') data = ''; + return data; + }, + + getFooterHTML: function () { + return '
'+ + ' '+ + ' '+ + ' '+ + '
'; + }, + + status: function (msg) { + if (typeof msg != 'undefined') { + $('#grid_'+ this.name +'_footer').find('.w2ui-footer-left').html(msg); + } else { + // show number of selected + var msgLeft = ''; + var sel = this.getSelection(); + if (sel.length > 0) { + msgLeft = String(sel.length).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + ' ' + w2utils.lang('selected'); + var tmp = sel[0]; + if (typeof tmp == 'object') tmp = tmp.recid + ', '+ w2utils.lang('Column') +': '+ tmp.column; + if (sel.length == 1) msgLeft = w2utils.lang('Record ID') + ': '+ tmp + ' '; + } + $('#grid_'+ this.name +'_footer .w2ui-footer-left').html(msgLeft); + // toolbar + if (sel.length == 1) this.toolbar.enable('edit'); else this.toolbar.disable('edit'); + if (sel.length >= 1) this.toolbar.enable('delete'); else this.toolbar.disable('delete'); + } + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + setTimeout(function () { w2utils.lock(box, msg, showSpinner); }, 10); + }, + + unlock: function () { + var box = this.box; + setTimeout(function () { w2utils.unlock(box); }, 25); // needed timer so if server fast, it will not flash + }, + + parseField: function (obj, field) { + var val = ''; + try { // need this to make sure no error in fields + val = obj; + var tmp = String(field).split('.'); + for (var i in tmp) { + val = val[tmp[i]]; + } + } catch (event) { + val = ''; + } + return val; + } + } + + $.extend(w2grid.prototype, w2utils.event); + w2obj.grid = w2grid; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2layout - layout widget + * - $().w2layout - jQuery wrapper + * - Dependencies: jQuery, w2utils, w2toolbar, w2tabs + * + * == NICE TO HAVE == + * - onResize for the panel + * - problem with layout.html (see in 1.3) + * - add panel title + * + ************************************************************************/ + +(function ($) { + var w2layout = function (options) { + this.box = null // DOM Element that holds the element + this.name = null; // unique name for w2ui + this.panels = []; + this.tmp = {}; + + this.padding = 1; // panel padding + this.resizer = 4; // resizer width or height + this.style = ''; + + this.onShow = null; + this.onHide = null; + this.onResizing = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null + + $.extend(true, this, w2obj.layout, options); + }; + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2layout = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2layout().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + var panels = method.panels; + var object = new w2layout(method); + $.extend(object, { handlers: [], panels: [] }); + // add defined panels panels + for (var p in panels) { + object.panels[p] = $.extend(true, {}, w2layout.prototype.panel, panels[p]); + if ($.isPlainObject(object.panels[p].tabs) || $.isArray(object.panels[p].tabs)) initTabs(object, panels[p].type); + if ($.isPlainObject(object.panels[p].toolbar) || $.isArray(object.panels[p].toolbar)) initToolbar(object, panels[p].type); + } + // add all other panels + for (var p in { 'top':'', 'left':'', 'main':'', 'preview':'', 'right':'', 'bottom':'' }) { + if (object.get(p) != null) continue; + object.panels[p] = $.extend(true, {}, w2layout.prototype.panel, { type: p, hidden: true, size: 50 }); + } + + if ($(this).length > 0) { + object.render($(this)[0]); + } + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2layout' ); + } + + function initTabs(object, panel, tabs) { + var pan = object.get(panel); + if (pan != null && typeof tabs == 'undefined') tabs = pan.tabs; + if (pan == null || tabs == null) return false; + // instanciate tabs + if ($.isArray(tabs)) tabs = { tabs: tabs }; + $().w2destroy(object.name + '_' + panel + '_tabs'); // destroy if existed + pan.tabs = $().w2tabs($.extend({}, tabs, { owner: object, name: object.name + '_' + panel + '_tabs' })); + pan.show.tabs = true; + return true; + } + + function initToolbar(object, panel, toolbar) { + var pan = object.get(panel); + if (pan != null && typeof toolbar == 'undefined') toolbar = pan.toolbar; + if (pan == null || toolbar == null) return false; + // instanciate toolbar + if ($.isArray(toolbar)) toolbar = { items: toolbar }; + $().w2destroy(object.name + '_' + panel + '_toolbar'); // destroy if existed + pan.toolbar = $().w2toolbar($.extend({}, toolbar, { owner: object, name: object.name + '_' + panel + '_toolbar' })); + pan.show.toolbar = true; + return true; + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2layout.prototype = { + // default setting for a panel + panel: { + type : null, // left, right, top, bottom + size : 100, // width or height depending on panel name + minSize : 20, + hidden : false, + resizable : false, + overflow : 'auto', + style : '', + content : '', // can be String or Object with .render(box) method + tabs : null, + toolbar : null, + width : null, // read only + height : null, // read only + show : { + toolbar : false, + tabs : false + }, + onRefresh : null, + onShow : null, + onHide : null + }, + + // alias for content + html: function (panel, data, transition) { + return this.content(panel, data, transition); + }, + + content: function (panel, data, transition) { + var obj = this; + var p = this.get(panel); + if (panel == 'css') { + $('#layout_'+ obj.name +'_panel_css').html(''); + return true; + } + if (p == null) return false; + if ($('#layout_'+ this.name + '_panel2_'+ p.type).length > 0) return false; + $('#layout_'+ this.name + '_panel_'+ p.type).scrollTop(0); + if (data == null || typeof data == 'undefined') { + return p.content; + } else { + if (data instanceof jQuery) { + console.log('ERROR: You can not pass jQuery object to w2layout.content() method'); + return false; + } + // remove foreign classes and styles + var tmp = $('#'+ 'layout_'+ this.name + '_panel_'+ panel + ' > .w2ui-panel-content'); + var panelTop = $(tmp).position().top; + tmp.attr('class', 'w2ui-panel-content'); + if (tmp.length > 0 && typeof p.style != 'undefined') tmp[0].style.cssText = p.style; + if (p.content == '') { + p.content = data; + if (!p.hidden) this.refresh(panel); + } else { + p.content = data; + if (!p.hidden) { + if (transition != null && transition != '' && typeof transition != 'undefined') { + // apply transition + var nm = 'layout_'+ this.name + '_panel_'+ p.type; + var div1 = $('#'+ nm + ' > .w2ui-panel-content'); + div1.after('
'); + var div2 = $('#'+ nm + ' > .w2ui-panel-content.new-panel'); + div1.css('top', panelTop); + div2.css('top', panelTop); + if (typeof data == 'object') { + data.box = div2[0]; // do not do .render(box); + data.render(); + } else { + div2.html(data); + } + w2utils.transition(div1[0], div2[0], transition, function () { + div1.remove(); + div2.removeClass('new-panel'); + div2.css('overflow', p.overflow); + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + }); + } else { + if (!p.hidden) this.refresh(panel); + } + } + } + } + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + return true; + }, + + load: function (panel, url, transition, onLoad) { + var obj = this; + if (panel == 'css') { + $.get(url, function (data, status, xhr) { + obj.content(panel, xhr.responseText); + if (onLoad) onLoad(); + }); + return true; + } + if (this.get(panel) != null) { + $.get(url, function (data, status, xhr) { + obj.content(panel, xhr.responseText, transition); + if (onLoad) onLoad(); + // IE Hack + if (window.navigator.userAgent.indexOf('MSIE')) setTimeout(function () { obj.resize(); }, 100); + }); + return true; + } + return false; + }, + + sizeTo: function (panel, size) { + var obj = this; + var pan = obj.get(panel); + if (pan == null) return false; + // resize + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.35s', + '-moz-transition' : '.35s', + '-ms-transition' : '.35s', + '-o-transition' : '.35s' + }); + setTimeout(function () { + obj.set(panel, { size: size }); + }, 1); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.resize(); + }, 500); + return true; + }, + + show: function (panel, immediate) { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', type: 'show', target: panel, object: this.get(panel), immediate: immediate }); + if (eventData.isCancelled === true) return false; + + var p = obj.get(panel); + if (p == null) return false; + p.hidden = false; + if (immediate === true) { + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '1' }); + if (p.resizabled) $('#layout_'+ obj.name +'_resizer_'+panel).show(); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + } else { + if (p.resizabled) $('#layout_'+ obj.name +'_resizer_'+panel).show(); + // resize + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.2s', + '-moz-transition' : '.2s', + '-ms-transition' : '.2s', + '-o-transition' : '.2s' + }); + setTimeout(function () { obj.resize(); }, 1); + // show + setTimeout(function() { + $('#layout_'+ obj.name +'_panel_'+ panel).css({ 'opacity': '1' }); + }, 250); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + }, 500); + } + return true; + }, + + hide: function (panel, immediate) { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', type: 'hide', target: panel, object: this.get(panel), immediate: immediate }); + if (eventData.isCancelled === true) return false; + + var p = obj.get(panel); + if (p == null) return false; + p.hidden = true; + if (immediate === true) { + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + $('#layout_'+ obj.name +'_resizer_'+panel).hide(); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + } else { + $('#layout_'+ obj.name +'_resizer_'+panel).hide(); + // hide + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '.2s', + '-moz-transition' : '.2s', + '-ms-transition' : '.2s', + '-o-transition' : '.2s' + }); + $('#layout_'+ obj.name +'_panel_'+panel).css({ 'opacity': '0' }); + setTimeout(function () { obj.resize(); }, 1); + // clean + setTimeout(function () { + $(obj.box).find(' > div .w2ui-panel').css({ + '-webkit-transition': '0s', + '-moz-transition' : '0s', + '-ms-transition' : '0s', + '-o-transition' : '0s' + }); + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.resize(); + }, 500); + } + return true; + }, + + toggle: function (panel, immediate) { + var p = this.get(panel); + if (p == null) return false; + if (p.hidden) return this.show(panel, immediate); else return this.hide(panel, immediate); + }, + + set: function (panel, options) { + var obj = this.get(panel, true); + if (obj == null) return false; + $.extend(this.panels[obj], options); + this.refresh(panel); + this.resize(); // resize is needed when panel size is changed + return true; + }, + + get: function (panel, returnIndex) { + var obj = null; + for (var p in this.panels) { + if (this.panels[p].type == panel) { + if (returnIndex === true) return p; else return this.panels[p]; + } + } + return null; + }, + + el: function (panel) { + var el = $('#layout_'+ this.name +'_panel_'+ panel +' .w2ui-panel-content'); + if (el.length != 1) return null; + return el[0]; + }, + + hideToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.toolbar = false; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-toolbar').hide(); + this.resize(); + }, + + showToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.toolbar = true; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-toolbar').show(); + this.resize(); + }, + + toggleToolbar: function (panel) { + var pan = this.get(panel); + if (!pan) return; + if (pan.show.toolbar) this.hideToolbar(panel); else this.showToolbar(panel); + }, + + hideTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.tabs = false; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-tabs').hide(); + this.resize(); + }, + + showTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + pan.show.tabs = true; + $('#layout_'+ this.name +'_panel_'+ panel +' > .w2ui-panel-tabs').show(); + this.resize(); + }, + + toggleTabs: function (panel) { + var pan = this.get(panel); + if (!pan) return; + if (pan.show.tabs) this.hideTabs(panel); else this.showTabs(panel); + }, + + render: function (box) { + var obj = this; + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var time = (new Date()).getTime(); + // event before + var eventData = obj.trigger({ phase: 'before', type: 'render', target: obj.name, box: box }); + if (eventData.isCancelled === true) return false; + + if (typeof box != 'undefined' && box != null) { + if ($(obj.box).find('#layout_'+ obj.name +'_panel_main').length > 0) { + $(obj.box) + .removeAttr('name') + .removeClass('w2ui-layout') + .html(''); + } + obj.box = box; + } + if (!obj.box) return false; + $(obj.box) + .attr('name', obj.name) + .addClass('w2ui-layout') + .html('
'); + if ($(obj.box).length > 0) $(obj.box)[0].style.cssText += obj.style; + // create all panels + var tmp = ['top', 'left', 'main', 'preview', 'right', 'bottom']; + for (var t in tmp) { + var pan = obj.get(tmp[t]); + var html = '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'; + $(obj.box).find(' > div').append(html); + // tabs are rendered in refresh() + } + $(obj.box).find(' > div') + .append('
drag + if (obj.tmp.resizing == 'left' && (obj.get('left').minSize - obj.tmp.resize.div_x > obj.get('left').width)) { + obj.tmp.resize.div_x = obj.get('left').minSize - obj.get('left').width; + } + if (obj.tmp.resize.type == 'left' && (obj.get('main').minSize + obj.tmp.resize.div_x > obj.get('main').width)) { + obj.tmp.resize.div_x = obj.get('main').width - obj.get('main').minSize; + } + // right panel -> drag + if (obj.tmp.resize.type == 'right' && (obj.get('right').minSize + obj.tmp.resize.div_x > obj.get('right').width)) { + obj.tmp.resize.div_x = obj.get('right').width - obj.get('right').minSize; + } + if (obj.tmp.resize.type == 'right' && (obj.get('main').minSize - obj.tmp.resize.div_x > obj.get('main').width)) { + obj.tmp.resize.div_x = obj.get('main').minSize - obj.get('main').width; + } + // top panel -> drag + if (obj.tmp.resize.type == 'top' && (obj.get('top').minSize - obj.tmp.resize.div_y > obj.get('top').height)) { + obj.tmp.resize.div_y = obj.get('top').minSize - obj.get('top').height; + } + if (obj.tmp.resize.type == 'top' && (obj.get('main').minSize + obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').height - obj.get('main').minSize; + } + // bottom panel -> drag + if (obj.tmp.resize.type == 'bottom' && (obj.get('bottom').minSize + obj.tmp.resize.div_y > obj.get('bottom').height)) { + obj.tmp.resize.div_y = obj.get('bottom').height - obj.get('bottom').minSize; + } + if (obj.tmp.resize.type == 'bottom' && (obj.get('main').minSize - obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').minSize - obj.get('main').height; + } + // preview panel -> drag + if (obj.tmp.resize.type == 'preview' && (obj.get('preview').minSize + obj.tmp.resize.div_y > obj.get('preview').height)) { + obj.tmp.resize.div_y = obj.get('preview').height - obj.get('preview').minSize; + } + if (obj.tmp.resize.type == 'preview' && (obj.get('main').minSize - obj.tmp.resize.div_y > obj.get('main').height)) { + obj.tmp.resize.div_y = obj.get('main').minSize - obj.get('main').height; + } + switch(obj.tmp.resize.type) { + case 'top': + case 'preview': + case 'bottom': + obj.tmp.resize.div_x = 0; + if (p.length > 0) p[0].style.top = (obj.tmp.resize.value + obj.tmp.resize.div_y) + 'px'; + break; + case 'left': + case 'right': + obj.tmp.resize.div_y = 0; + if (p.length > 0) p[0].style.left = (obj.tmp.resize.value + obj.tmp.resize.div_x) + 'px'; + break; + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + } + }, + + refresh: function (panel) { + var obj = this; + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (typeof panel == 'undefined') panel = null; + var time = (new Date()).getTime(); + // event before + var eventData = obj.trigger({ phase: 'before', type: 'refresh', target: (typeof panel != 'undefined' ? panel : obj.name), object: obj.get(panel) }); + if (eventData.isCancelled === true) return; + + // obj.unlock(panel); + if (panel != null && typeof panel != 'undefined') { + var p = obj.get(panel); + if (p == null) return; + // apply properties to the panel + var el = $('#layout_'+ obj.name +'_panel_'+ panel).css({ display: p.hidden ? 'none' : 'block' }); + el = el.find('.w2ui-panel-content'); + if (el.length > 0) el.css('overflow', p.overflow)[0].style.cssText += ';' + p.style; + if (p.resizable === true) { + $('#layout_'+ this.name +'_resizer_'+ panel).show(); + } else { + $('#layout_'+ this.name +'_resizer_'+ panel).hide(); + } + // insert content + if (typeof p.content == 'object' && p.content.render) { + p.content.box = $('#layout_'+ obj.name + '_panel_'+ p.type +' > .w2ui-panel-content')[0]; + p.content.render(); // do not do .render(box); + } else { + $('#layout_'+ obj.name + '_panel_'+ p.type +' > .w2ui-panel-content').html(p.content); + } + // if there are tabs and/or toolbar - render it + var tmp = $(obj.box).find('#layout_'+ obj.name + '_panel_'+ p.type +' .w2ui-panel-tabs'); + if (p.show.tabs) { + if (tmp.find('[name='+ p.tabs.name +']').length == 0 && p.tabs != null) tmp.w2render(p.tabs); else p.tabs.refresh(); + } else { + tmp.html('').removeClass('w2ui-tabs').hide(); + } + var tmp = $(obj.box).find('#layout_'+ obj.name + '_panel_'+ p.type +' .w2ui-panel-toolbar'); + if (p.show.toolbar) { + if (tmp.find('[name='+ p.toolbar.name +']').length == 0 && p.toolbar != null) tmp.w2render(p.toolbar); else p.toolbar.refresh(); + } else { + tmp.html('').removeClass('w2ui-toolbar').hide(); + } + } else { + if ($('#layout_' +obj.name +'_panel_main').length <= 0) { + obj.render(); + return; + } + obj.resize(); + // refresh all of them + for (var p in this.panels) { obj.refresh(this.panels[p].type); } + } + obj.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + resize: function () { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (!this.box) return false; + var time = (new Date()).getTime(); + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name, panel: this.tmp.resizing }); + if (eventData.isCancelled === true) return false; + if (this.padding < 0) this.padding = 0; + + // layout itself + var width = parseInt($(this.box).width()); + var height = parseInt($(this.box).height()); + $(this.box).find(' > div').css({ + width : width + 'px', + height : height + 'px' + }); + var obj = this; + // panels + var pmain = this.get('main'); + var pprev = this.get('preview'); + var pleft = this.get('left'); + var pright = this.get('right'); + var ptop = this.get('top'); + var pbottom = this.get('bottom'); + var smain = true; // main always on + var sprev = (pprev != null && pprev.hidden != true ? true : false); + var sleft = (pleft != null && pleft.hidden != true ? true : false); + var sright = (pright != null && pright.hidden != true ? true : false); + var stop = (ptop != null && ptop.hidden != true ? true : false); + var sbottom = (pbottom != null && pbottom.hidden != true ? true : false); + // calculate % + for (var p in { 'top':'', 'left':'', 'right':'', 'bottom':'', 'preview':'' }) { + var tmp = this.get(p); + var str = String(tmp.size); + if (tmp && str.substr(str.length-1) == '%') { + var tmph = height; + if (tmp.type == 'preview') { + tmph = tmph + - (ptop && !ptop.hidden ? ptop.sizeCalculated : 0) + - (pbottom && !pbottom.hidden ? pbottom.sizeCalculated : 0); + } + tmp.sizeCalculated = parseInt((tmp.type == 'left' || tmp.type == 'right' ? width : tmph) * parseFloat(tmp.size) / 100); + } else { + tmp.sizeCalculated = parseInt(tmp.size); + } + if (tmp.sizeCalculated < parseInt(tmp.minSize)) tmp.sizeCalculated = parseInt(tmp.minSize); + } + // top if any + if (ptop != null && ptop.hidden != true) { + var l = 0; + var t = 0; + var w = width; + var h = ptop.sizeCalculated; + $('#layout_'+ this.name +'_panel_top').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + ptop.width = w; + ptop.height = h; + // resizer + if (ptop.resizable) { + t = ptop.sizeCalculated - (this.padding == 0 ? this.resizer : 0); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_top').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('top', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_top').hide(); + } + // left if any + if (pleft != null && pleft.hidden != true) { + var l = 0; + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = pleft.sizeCalculated; + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0); + var e = $('#layout_'+ this.name +'_panel_left'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_left').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pleft.width = w; + pleft.height = h; + // resizer + if (pleft.resizable) { + l = pleft.sizeCalculated - (this.padding == 0 ? this.resizer : 0); + w = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_left').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ew-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('left', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_left').hide(); + $('#layout_'+ this.name +'_resizer_left').hide(); + } + // right if any + if (pright != null && pright.hidden != true) { + var l = width - pright.sizeCalculated; + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = pright.sizeCalculated; + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0); + $('#layout_'+ this.name +'_panel_right').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pright.width = w; + pright.height = h; + // resizer + if (pright.resizable) { + l = l - this.padding; + w = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_right').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ew-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('right', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_right').hide(); + } + // bottom if any + if (pbottom != null && pbottom.hidden != true) { + var l = 0; + var t = height - pbottom.sizeCalculated; + var w = width; + var h = pbottom.sizeCalculated; + $('#layout_'+ this.name +'_panel_bottom').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pbottom.width = w; + pbottom.height = h; + // resizer + if (pbottom.resizable) { + t = t - (this.padding == 0 ? 0 : this.padding); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_bottom').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('bottom', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_bottom').hide(); + } + // main - always there + var l = 0 + (sleft ? pleft.sizeCalculated + this.padding : 0); + var t = 0 + (stop ? ptop.sizeCalculated + this.padding : 0); + var w = width - (sleft ? pleft.sizeCalculated + this.padding : 0) - + (sright ? pright.sizeCalculated + this.padding: 0); + var h = height - (stop ? ptop.sizeCalculated + this.padding : 0) - + (sbottom ? pbottom.sizeCalculated + this.padding : 0) - + (sprev ? pprev.sizeCalculated + this.padding : 0); + var e = $('#layout_'+ this.name +'_panel_main'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_main').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }); + pmain.width = w; + pmain.height = h; + + // preview if any + if (pprev != null && pprev.hidden != true) { + var l = 0 + (sleft ? pleft.sizeCalculated + this.padding : 0); + var t = height - (sbottom ? pbottom.sizeCalculated + this.padding : 0) - pprev.sizeCalculated; + var w = width - (sleft ? pleft.sizeCalculated + this.padding : 0) - + (sright ? pright.sizeCalculated + this.padding : 0); + var h = pprev.sizeCalculated; + var e = $('#layout_'+ this.name +'_panel_preview'); + if (window.navigator.userAgent.indexOf('MSIE') > 0 && e.length > 0 && e[0].clientHeight < e[0].scrollHeight) w += 17; // IE hack + $('#layout_'+ this.name +'_panel_preview').css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px' + }).show(); + pprev.width = w; + pprev.height = h; + // resizer + if (pprev.resizable) { + t = t - (this.padding == 0 ? 0 : this.padding); + h = (this.resizer > this.padding ? this.resizer : this.padding); + $('#layout_'+ this.name +'_resizer_preview').show().css({ + 'display': 'block', + 'left': l + 'px', + 'top': t + 'px', + 'width': w + 'px', + 'height': h + 'px', + 'cursor': 'ns-resize' + }).bind('mousedown', function (event) { + w2ui[obj.name].tmp.events.resizeStart('preview', event); + return false; + }); + } + } else { + $('#layout_'+ this.name +'_panel_preview').hide(); + } + + // display tabs and toolbar if needed + for (var p in { 'top':'', 'left':'', 'main':'', 'preview':'', 'right':'', 'bottom':'' }) { + var pan = this.get(p); + var tmp = '#layout_'+ this.name +'_panel_'+ p +' > .w2ui-panel-'; + var height = 0; + if (pan.show.tabs) { + if (pan.tabs != null && w2ui[this.name +'_'+ p +'_tabs']) w2ui[this.name +'_'+ p +'_tabs'].resize(); + height += w2utils.getSize($(tmp + 'tabs').css({ display: 'block' }), 'height'); + } + if (pan.show.toolbar) { + if (pan.toolbar != null && w2ui[this.name +'_'+ p +'_toolbar']) w2ui[this.name +'_'+ p +'_toolbar'].resize(); + height += w2utils.getSize($(tmp + 'toolbar').css({ top: height + 'px', display: 'block' }), 'height'); + } + $(tmp + 'content').css({ display: 'block' }).css({ top: height + 'px' }); + } + // send resize to all objects + var obj = this; + clearTimeout(this._resize_timer); + this._resize_timer = setTimeout(function () { + for (var e in w2ui) { + if (typeof w2ui[e].resize == 'function') { + // sent to all none-layouts + if (w2ui[e].panels == 'undefined') w2ui[e].resize(); + // only send to nested layouts + var parent = $(w2ui[e].box).parents('.w2ui-layout'); + if (parent.length > 0 && parent.attr('name') == obj.name) w2ui[e].resize(); + } + } + }, 100); + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + if (typeof w2ui[this.name] == 'undefined') return false; + // clean up + if ($(this.box).find('#layout_'+ this.name +'_panel_main').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-layout') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + + if (this.tmp.events && this.tmp.events.resize) $(window).off('resize', this.tmp.events.resize); + if (this.tmp.events && this.tmp.events.mousemove) $(document).off('mousemove', this.tmp.events.mousemove); + if (this.tmp.events && this.tmp.events.mouseup) $(document).off('mouseup', this.tmp.events.mouseup); + + return true; + }, + + lock: function (panel, msg, showSpinner) { + if ($.inArray(String(panel), ['left', 'right', 'top', 'bottom', 'preview', 'main']) == -1) { + console.log('ERROR: First parameter needs to be the a valid panel name.'); + return; + } + var nm = '#layout_'+ this.name + '_panel_' + panel; + w2utils.lock(nm, msg, showSpinner); + }, + + unlock: function (panel) { + if ($.inArray(String(panel), ['left', 'right', 'top', 'bottom', 'preview', 'main']) == -1) { + console.log('ERROR: First parameter needs to be the a valid panel name.'); + return; + } + var nm = '#layout_'+ this.name + '_panel_' + panel; + w2utils.unlock(nm); + } + } + + $.extend(w2layout.prototype, w2utils.event); + w2obj.layout = w2layout; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2popup - popup widget + * - $().w2popup - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - when maximized, align the slide down message + * - bug: after transfer to another content, message does not work + * - transition should include title, body and buttons, not just body + * - add lock method() to lock popup content + * + ************************************************************************/ + +var w2popup = {}; + +(function ($) { + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2popup = function(method, options) { + if (typeof method == 'undefined') { + options = {}; + method = 'open'; + } + if ($.isPlainObject(method)) { + options = method; + method = 'open'; + } + method = method.toLowerCase(); + if (method == 'load' && typeof options == 'string') options = { url: options }; + if (method == 'open' && typeof options.url != 'undefined') method = 'load'; + if (typeof options == 'undefined') options = {}; + // load options from markup + var dlgOptions = {}; + if ($(this).length > 0 ) { + if ($(this).find('div[rel=title], div[rel=body], div[rel=buttons]').length > 0) { + if ($(this).find('div[rel=title]').length > 0) { + dlgOptions['title'] = $(this).find('div[rel=title]').html(); + } + if ($(this).find('div[rel=body]').length > 0) { + dlgOptions['body'] = $(this).find('div[rel=body]').html(); + dlgOptions['style'] = $(this).find('div[rel=body]')[0].style.cssText; + } + if ($(this).find('div[rel=buttons]').length > 0) { + dlgOptions['buttons'] = $(this).find('div[rel=buttons]').html(); + } + } else { + dlgOptions['title'] = ' '; + dlgOptions['body'] = $(this).html(); + } + if (parseInt($(this).css('width')) != 0) dlgOptions['width'] = parseInt($(this).css('width')); + if (parseInt($(this).css('height')) != 0) dlgOptions['height'] = parseInt($(this).css('height')); + } + // show popup + return w2popup[method]($.extend({}, dlgOptions, options)); + }; + + // ==================================================== + // -- Implementation of core functionality (SINGELTON) + + w2popup = { + defaults: { + title : '', + body : '', + buttons : '', + style : '', + color : '#000', + opacity : 0.4, + speed : 0.3, + modal : false, + maximized : false, + keyboard : true, // will close popup on esc if not modal + width : 500, + height : 300, + showClose : true, + showMax : false, + transition : null + }, + handlers : [], + onOpen : null, + onClose : null, + onMax : null, + onMin : null, + onKeydown : null, + + open: function (options) { + var obj = this; + // get old options and merge them + var old_options = $('#w2ui-popup').data('options'); + var options = $.extend({}, this.defaults, { body : '' }, old_options, options); + // if new - reset event handlers + if ($('#w2ui-popup').length == 0) { + w2popup.handlers = []; + w2popup.onMax = null; + w2popup.onMin = null; + w2popup.onOpen = null; + w2popup.onClose = null; + w2popup.onKeydown = null; + } + if (options.onOpen) w2popup.onOpen = options.onOpen; + if (options.onClose) w2popup.onClose = options.onClose; + if (options.onMax) w2popup.onMax = options.onMax; + if (options.onMin) w2popup.onMin = options.onMin; + if (options.onKeydown) w2popup.onKeydown = options.onKeydown; + + if (window.innerHeight == undefined) { + var width = document.documentElement.offsetWidth; + var height = document.documentElement.offsetHeight; + if (w2utils.engine == 'IE7') { width += 21; height += 4; } + } else { + var width = window.innerWidth; + var height = window.innerHeight; + } + if (parseInt(width) - 10 < parseInt(options.width)) options.width = parseInt(width) - 10; + if (parseInt(height) - 10 < parseInt(options.height)) options.height = parseInt(height) - 10; + var top = ((parseInt(height) - parseInt(options.height)) / 2) * 0.6; + var left = (parseInt(width) - parseInt(options.width)) / 2; + // check if message is already displayed + if ($('#w2ui-popup').length == 0) { + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'open', target: 'popup', options: options, present: false }); + if (eventData.isCancelled === true) return; + // output message + w2popup.lockScreen(options); + var msg = '
'; + if (options.title != '') { + msg +='
'+ + (options.showClose ? '
Close
' : '')+ + (options.showMax ? '
Max
' : '') + + options.title + + '
'; + } + msg += '
'; + msg += '
'+ options.body +'
'; + msg += '
'; + msg += '
'; + msg += '
'; + msg += '
'; + if (options.buttons != '') { + msg += '
'+ options.buttons +'
'; + } + msg += '
'; + $('body').append(msg); + // allow element to render + setTimeout(function () { + $('#w2ui-popup .w2ui-box2').hide(); + $('#w2ui-popup').css({ + '-webkit-transition': options.speed +'s opacity, '+ options.speed +'s -webkit-transform', + '-webkit-transform': 'scale(1)', + '-moz-transition': options.speed +'s opacity, '+ options.speed +'s -moz-transform', + '-moz-transform': 'scale(1)', + '-ms-transition': options.speed +'s opacity, '+ options.speed +'s -ms-transform', + '-ms-transform': 'scale(1)', + '-o-transition': options.speed +'s opacity, '+ options.speed +'s -o-transform', + '-o-transform': 'scale(1)', + 'opacity': '1' + }); + }, 1); + // clean transform + setTimeout(function () { + $('#w2ui-popup').css({ + '-webkit-transform': '', + '-moz-transform': '', + '-ms-transform': '', + '-o-transform': '' + }); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, options.speed * 1000); + } else { + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'open', target: 'popup', options: options, present: true }); + if (eventData.isCancelled === true) return; + // check if size changed + if (typeof old_options == 'undefined' || old_options['width'] != options['width'] || old_options['height'] != options['height']) { + $('#w2ui-panel').remove(); + w2popup.resize(options.width, options.height); + } + // show new items + var body = $('#w2ui-popup .w2ui-box2 > .w2ui-msg-body').html(options.body); + if (body.length > 0) body[0].style.cssText = options.style; + $('#w2ui-popup .w2ui-msg-buttons').html(options.buttons); + $('#w2ui-popup .w2ui-msg-title').html( + (options.showClose ? '
Close
' : '')+ + (options.showMax ? '
Max
' : '') + + options.title); + // transition + var div_old = $('#w2ui-popup .w2ui-box1')[0]; + var div_new = $('#w2ui-popup .w2ui-box2')[0]; + w2utils.transition(div_old, div_new, options.transition); + div_new.className = 'w2ui-box1'; + div_old.className = 'w2ui-box2'; + $(div_new).addClass('w2ui-current-box'); + // remove max state + $('#w2ui-popup').data('prev-size', null); + // call event onChange + setTimeout(function () { + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + } + // save new options + options._last_w2ui_name = w2utils.keyboard.active(); + w2utils.keyboard.active(null); + $('#w2ui-popup').data('options', options); + // keyboard events + if (options.keyboard) $(document).on('keydown', this.keydown); + + // initialize move + var tmp = { resizing: false }; + $('#w2ui-popup .w2ui-msg-title') + .on('mousedown', function (event) { mvStart(event); }) + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + $('#w2ui-popup .w2ui-msg-body') + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + $('#w2ui-lock') + .on('mousemove', function (event) { mvMove(event); }) + .on('mouseup', function (event) { mvStop(event); }); + + // handlers + function mvStart(event) { + if (!event) event = window.event; + if (!window.addEventListener) { window.document.attachEvent('onselectstart', function() { return false; } ); } + tmp.resizing = true; + tmp.tmp_x = event.screenX; + tmp.tmp_y = event.screenY; + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + if (event.preventDefault) event.preventDefault(); else return false; + } + + function mvMove(evnt) { + if (tmp.resizing != true) return; + if (!evnt) evnt = window.event; + tmp.tmp_div_x = (evnt.screenX - tmp.tmp_x); + tmp.tmp_div_y = (evnt.screenY - tmp.tmp_y); + $('#w2ui-popup').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-ms-transition': 'none', + '-ms-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-o-transition': 'none', + '-o-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)' + }); + $('#w2ui-panel').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)', + '-ms-transition': 'none', + '-ms-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px', + '-o-transition': 'none', + '-o-transform': 'translate('+ tmp.tmp_div_x +'px, '+ tmp.tmp_div_y +'px)' + }); + } + + function mvStop(evnt) { + if (tmp.resizing != true) return; + if (!evnt) evnt = window.event; + tmp.tmp_div_x = (evnt.screenX - tmp.tmp_x); + tmp.tmp_div_y = (evnt.screenY - tmp.tmp_y); + $('#w2ui-popup').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d(0px, 0px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate(0px, 0px)', + '-ms-transition': 'none', + '-ms-transform': 'translate(0px, 0px)', + '-o-transition': 'none', + '-o-transform': 'translate(0px, 0px)', + 'left': (parseInt($('#w2ui-popup').css('left')) + parseInt(tmp.tmp_div_x)) + 'px', + 'top': (parseInt($('#w2ui-popup').css('top')) + parseInt(tmp.tmp_div_y)) + 'px' + }); + $('#w2ui-panel').css({ + '-webkit-transition': 'none', + '-webkit-transform': 'translate3d(0px, 0px, 0px)', + '-moz-transition': 'none', + '-moz-transform': 'translate(0px, 0px)', + '-ms-transition': 'none', + '-ms-transform': 'translate(0px, 0px)', + '-o-transition': 'none', + '-o-transform': 'translate(0px, 0px)', + 'left': (parseInt($('#w2ui-panel').css('left')) + parseInt(tmp.tmp_div_x)) + 'px', + 'top': (parseInt($('#w2ui-panel').css('top')) + parseInt(tmp.tmp_div_y)) + 'px' + }); + tmp.resizing = false; + } + return this; + }, + + keydown: function (event) { + var options = $('#w2ui-popup').data('options'); + if (!options.keyboard) return; + // trigger event + var eventData = w2popup.trigger({ phase: 'before', type: 'keydown', target: 'popup', options: options, object: w2popup, originalEvent: event }); + if (eventData.isCancelled === true) return; + // default behavior + switch (event.keyCode) { + case 27: + event.preventDefault(); + if ($('#w2ui-popup .w2ui-popup-message').length > 0) w2popup.message(); else w2popup.close(); + break; + } + // event after + w2popup.trigger($.extend(eventData, { phase: 'after'})); + }, + + close: function (options) { + var obj = this; + var options = $.extend({}, $('#w2ui-popup').data('options'), options); + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'close', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + $('#w2ui-popup, #w2ui-panel').css({ + '-webkit-transition': options.speed +'s opacity, '+ options.speed +'s -webkit-transform', + '-webkit-transform': 'scale(0.9)', + '-moz-transition': options.speed +'s opacity, '+ options.speed +'s -moz-transform', + '-moz-transform': 'scale(0.9)', + '-ms-transition': options.speed +'s opacity, '+ options.speed +'s -ms-transform', + '-ms-transform': 'scale(0.9)', + '-o-transition': options.speed +'s opacity, '+ options.speed +'s -o-transform', + '-o-transform': 'scale(0.9)', + 'opacity': '0' + }); + w2popup.unlockScreen(); + setTimeout(function () { + $('#w2ui-popup').remove(); + $('#w2ui-panel').remove(); + // event after + obj.trigger($.extend(eventData, { phase: 'after'})); + }, options.speed * 1000); + // restore active + w2utils.keyboard.active(options._last_w2ui_name); + // remove keyboard events + if (options.keyboard) $(document).off('keydown', this.keydown); + }, + + toggle: function () { + var options = $('#w2ui-popup').data('options'); + if (options.maximized === true) w2popup.min(); else w2popup.max(); + }, + + max: function () { + var obj = this; + var options = $('#w2ui-popup').data('options'); + if (options.maximized === true) return; + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'max', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + options.maximized = true; + options.prevSize = $('#w2ui-popup').css('width')+':'+$('#w2ui-popup').css('height'); + $('#w2ui-popup').data('options', options); + // do resize + w2popup.resize(10000, 10000, function () { + obj.trigger($.extend(eventData, { phase: 'after'})); + }); + }, + + min: function () { + var obj = this; + var options = $('#w2ui-popup').data('options'); + if (options.maximized !== true) return; + var size = options.prevSize.split(':'); + // trigger event + var eventData = this.trigger({ phase: 'before', type: 'min', target: 'popup', options: options }); + if (eventData.isCancelled === true) return; + // default behavior + options.maximized = false; + options.prevSize = null; + $('#w2ui-popup').data('options', options); + // do resize + w2popup.resize(size[0], size[1], function () { + obj.trigger($.extend(eventData, { phase: 'after'})); + }); + }, + + get: function () { + return $('#w2ui-popup').data('options'); + }, + + set: function (options) { + w2popup.open(options); + }, + + clear: function() { + $('#w2ui-popup .w2ui-msg-title').html(''); + $('#w2ui-popup .w2ui-msg-body').html(''); + $('#w2ui-popup .w2ui-msg-buttons').html(''); + }, + + reset: function () { + w2popup.open(w2popup.defaults); + }, + + load: function (options) { + if (String(options.url) == 'undefined') { + console.log('ERROR: The url parameter is empty.'); + return; + } + var tmp = String(options.url).split('#'); + var url = tmp[0]; + var selector = tmp[1]; + if (String(options) == 'undefined') options = {}; + // load url + var html = $('#w2ui-popup').data(url); + if (typeof html != 'undefined' && html != null) { + popup(html, selector); + } else { + $.get(url, function (data, status, obj) { + popup(obj.responseText, selector); + $('#w2ui-popup').data(url, obj.responseText); // remember for possible future purposes + }); + } + function popup(html, selector) { + delete options.url; + $('body').append(''); + if (typeof selector != 'undefined' && $('#w2ui-tmp #'+selector).length > 0) { + $('#w2ui-tmp #'+ selector).w2popup(options); + } else { + $('#w2ui-tmp > div').w2popup(options); + } + // link styles + if ($('#w2ui-tmp > style').length > 0) { + var style = $('
').append($('#w2ui-tmp > style').clone()).html(); + if ($('#w2ui-popup #div-style').length == 0) { + $('#w2ui-ppopup').append('
'); + } + $('#w2ui-popup #div-style').html(style); + } + $('#w2ui-tmp').remove(); + } + }, + + message: function (options) { + $().w2tag(); // hide all tags + if (!options) options = { width: 200, height: 100 }; + if (parseInt(options.width) < 10) options.width = 10; + if (parseInt(options.height) < 10) options.height = 10; + if (typeof options.hideOnClick == 'undefined') options.hideOnClick = false; + + var head = $('#w2ui-popup .w2ui-msg-title'); + if ($('#w2ui-popup .w2ui-popup-message').length == 0) { + var pwidth = parseInt($('#w2ui-popup').width()); + $('#w2ui-popup .w2ui-box1') + .before(''); + $('#w2ui-popup .w2ui-popup-message').data('options', options); + } else { + if (typeof options.width == 'undefined') options.width = w2utils.getSize($('#w2ui-popup .w2ui-popup-message'), 'width'); + if (typeof options.height == 'undefined') options.height = w2utils.getSize($('#w2ui-popup .w2ui-popup-message'), 'height'); + } + var display = $('#w2ui-popup .w2ui-popup-message').css('display'); + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-moz-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-ms-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)'), + '-o-transform': (display == 'none' ? 'translateY(-'+ options.height + 'px)': 'translateY(0px)') + }); + if (display == 'none') { + $('#w2ui-popup .w2ui-popup-message').show().html(options.html); + setTimeout(function() { + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transition': '0s', '-moz-transition': '0s', '-ms-transition': '0s', '-o-transition': '0s', + 'z-Index': 1500 + }); // has to be on top of lock + w2popup.lock(); + if (typeof options.onOpen == 'function') options.onOpen(); + }, 300); + } else { + $('#w2ui-popup .w2ui-popup-message').css('z-Index', 250); + var options = $('#w2ui-popup .w2ui-popup-message').data('options'); + $('#w2ui-popup .w2ui-popup-message').remove(); + w2popup.unlock(); + if (typeof options.onClose == 'function') options.onClose(); + } + // timer needs to animation + setTimeout(function () { + $('#w2ui-popup .w2ui-popup-message').css({ + '-webkit-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-moz-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-ms-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)'), + '-o-transform': (display == 'none' ? 'translateY(0px)': 'translateY(-'+ options.height +'px)') + }); + }, 1); + }, + + lock: function (msg, showSpinner) { + w2utils.lock($('#w2ui-popup'), msg, showSpinner); + }, + + unlock: function () { + w2utils.unlock($('#w2ui-popup')); + }, + + // --- INTERNAL FUNCTIONS + + lockScreen: function (options) { + if ($('#w2ui-lock').length > 0) return false; + if (typeof options == 'undefined') options = $('#w2ui-popup').data('options'); + if (typeof options == 'undefined') options = {}; + options = $.extend({}, w2popup.defaults, options); + // show element + $('body').append('
'); + // lock screen + setTimeout(function () { + $('#w2ui-lock').css({ + '-webkit-transition': options.speed +'s opacity', + '-moz-transition': options.speed +'s opacity', + '-ms-transition': options.speed +'s opacity', + '-o-transition': options.speed +'s opacity', + 'opacity': options.opacity + }); + }, 1); + // add events + if (options.modal == true) { + $('#w2ui-lock').on('mousedown', function () { + $('#w2ui-lock').css({ + '-webkit-transition': '.1s', + '-moz-transition': '.1s', + '-ms-transition': '.1s', + '-o-transition': '.1s', + 'opacity': '0.6' + }); + if (window.getSelection) window.getSelection().removeAllRanges(); + }); + $('#w2ui-lock').on('mouseup', function () { + setTimeout(function () { + $('#w2ui-lock').css({ + '-webkit-transition': '.1s', + '-moz-transition': '.1s', + '-ms-transition': '.1s', + '-o-transition': '.1s', + 'opacity': options.opacity + }); + }, 100); + if (window.getSelection) window.getSelection().removeAllRanges(); + }); + } else { + $('#w2ui-lock').on('mouseup', function () { w2popup.close(); }); + } + return true; + }, + + unlockScreen: function () { + if ($('#w2ui-lock').length == 0) return false; + var options = $.extend({}, $('#w2ui-popup').data('options'), options); + $('#w2ui-lock').css({ + '-webkit-transition': options.speed +'s opacity', + '-moz-transition': options.speed +'s opacity', + '-ms-transition': options.speed +'s opacity', + '-o-transition': options.speed +'s opacity', + 'opacity': 0 + }); + setTimeout(function () { + $('#w2ui-lock').remove(); + }, options.speed * 1000); + return true; + }, + + resize: function (width, height, callBack) { + var options = $('#w2ui-popup').data('options'); + // calculate new position + if (parseInt($(window).width()) - 10 < parseInt(width)) width = parseInt($(window).width()) - 10; + if (parseInt($(window).height()) - 10 < parseInt(height)) height = parseInt($(window).height()) - 10; + var top = ((parseInt($(window).height()) - parseInt(height)) / 2) * 0.8; + var left = (parseInt($(window).width()) - parseInt(width)) / 2; + // resize there + $('#w2ui-popup').css({ + '-webkit-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-moz-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-ms-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + '-o-transition': options.speed + 's width, '+ options.speed + 's height, '+ options.speed + 's left, '+ options.speed + 's top', + 'top': top, + 'left': left, + 'width': width, + 'height': height + }); + if (typeof callBack == 'function') { + setTimeout(function () { + callBack(); + }, options.speed * 1000); + } + } + } + + // merge in event handling + $.extend(w2popup, w2utils.event); + +})(jQuery); + +// ============================================ +// --- Common dialogs + +var w2alert = function (msg, title, callBack) { + if (typeof title == 'undefined') title = w2utils.lang('Notification'); + if (jQuery('#w2ui-popup').length > 0) { + w2popup.message({ + width : 400, + height : 150, + html : '
'+ + '
'+ msg +'
'+ + '
'+ + '
'+ + ' '+ + '
', + onClose : function () { + if (typeof callBack == 'function') callBack(); + } + }); + } else { + w2popup.open({ + width : 450, + height : 200, + showMax : false, + title : title, + body : '
' + msg +'
', + buttons : '', + onClose : function () { + if (typeof callBack == 'function') callBack(); + } + }); + } +}; + +var w2confirm = function (msg, title, callBack) { + if (typeof callBack == 'undefined' || typeof title == 'function') { + callBack = title; + title = w2utils.lang('Confirmation'); + } + if (typeof title == 'undefined') { + title = w2utils.lang('Confirmation'); + } + if (jQuery('#w2ui-popup').length > 0) { + w2popup.message({ + width : 400, + height : 150, + html : '
'+ + '
'+ msg +'
'+ + '
'+ + '
'+ + ' '+ + ' '+ + '
', + onOpen: function () { + jQuery('#w2ui-popup .w2ui-popup-message .w2ui-popup-button').on('click', function (event) { + w2popup.message(); + if (typeof callBack == 'function') callBack(event.target.id); + }); + }, + onKeydown: function (event) { + switch (event.originalEvent.keyCode) { + case 13: // enter + if (typeof callBack == 'function') callBack('Yes'); + w2popup.message(); + break + case 27: // esc + if (typeof callBack == 'function') callBack('No'); + w2popup.message(); + break + } + } + }); + } else { + w2popup.open({ + width : 450, + height : 200, + title : title, + modal : true, + showClose : false, + body : '
' + msg +'
', + buttons : ''+ + '', + onOpen: function (event) { + event.onComplete = function () { + jQuery('#w2ui-popup .w2ui-popup-button').on('click', function (event) { + w2popup.close(); + if (typeof callBack == 'function') callBack(event.target.id); + }); + } + }, + onKeydown: function (event) { + switch (event.originalEvent.keyCode) { + case 13: // enter + if (typeof callBack == 'function') callBack('Yes'); + w2popup.close(); + break + case 27: // esc + if (typeof callBack == 'function') callBack('No'); + w2popup.close(); + break + } + } + }); + } +}; + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2tabs - tabs widget + * - $().w2tabs - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - tabs might not work in chromium apps, need bind() + * - on overflow display << >> + * - individual tab onClick (possibly other events) are not working + * + ************************************************************************/ + +(function ($) { + var w2tabs = function (options) { + this.box = null; // DOM Element that holds the element + this.name = null; // unique name for w2ui + this.active = null; + this.tabs = []; + this.right = ''; + this.style = ''; + this.onClick = null; + this.onClose = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + + $.extend(true, this, w2obj.tabs, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2tabs = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2tabs().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // extend tabs + var tabs = method.tabs; + var object = new w2tabs(method); + $.extend(object, { tabs: [], handlers: [] }); + for (var i in tabs) { object.tabs[i] = $.extend({}, w2tabs.prototype.tab, tabs[i]); } + if ($(this).length != 0) { + object.render($(this)[0]); + } + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2tabs' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2tabs.prototype = { + tab : { + id : null, // commnad to be sent to all event handlers + text : '', + hidden : false, + disabled : false, + closable : false, + hint : '', + onClick : null, + onRefresh : null, + onClose : null + }, + + add: function (tab) { + return this.insert(null, tab); + }, + + insert: function (id, tab) { + if (!$.isArray(tab)) tab = [tab]; + // assume it is array + for (var r in tab) { + // checks + if (String(tab[r].id) == 'undefined') { + console.log('ERROR: The parameter "id" is required but not supplied. (obj: '+ this.name +')'); + return; + } + var unique = true; + for (var i in this.tabs) { if (this.tabs[i].id == tab[r].id) { unique = false; break; } } + if (!unique) { + console.log('ERROR: The parameter "id='+ tab[r].id +'" is not unique within the current tabs. (obj: '+ this.name +')'); + return; + } + if (!w2utils.isAlphaNumeric(tab[r].id)) { + console.log('ERROR: The parameter "id='+ tab[r].id +'" must be alpha-numeric + "-_". (obj: '+ this.name +')'); + return; + } + // add tab + var tab = $.extend({}, tab, tab[r]); + if (id == null || typeof id == 'undefined') { + this.tabs.push(tab); + } else { + var middle = this.get(id, true); + this.tabs = this.tabs.slice(0, middle).concat([tab], this.tabs.slice(middle)); + } + this.refresh(tab[r].id); + } + }, + + remove: function (id) { + var removed = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab) return false; + removed++; + // remove from array + this.tabs.splice(this.get(tab.id, true), 1); + // remove from screen + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)).remove(); + } + return removed; + }, + + select: function (id) { + if (this.get(id) == null || this.active == id) return false; + this.active = id; + this.refresh(); + return true; + }, + + set: function (id, tab) { + var index = this.get(id, true); + if (index == null) return false; + $.extend(this.tabs[index], tab); + this.refresh(id); + return true; + }, + + get: function (id, returnIndex) { + if (arguments.length == 0) { + var all = []; + for (var i = 0; i < this.tabs.length; i++) if (this.tabs[i].id != null) all.push(this.tabs[i].id); + return all; + } + for (var i in this.tabs) { + if (this.tabs[i].id == id) { + if (returnIndex === true) return i; else return this.tabs[i]; + } + } + return null; + }, + + show: function () { + var shown = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.hidden === false) continue; + tab.hidden = false; + this.refresh(tab.id); + shown++; + } + return shown; + }, + + hide: function () { + var hidden = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.hidden === true) continue; + tab.hidden = true; + this.refresh(tab.id); + hidden++; + } + return hidden; + }, + + enable: function (id) { + var enabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.disabled === false) continue; + tab.disabled = false; + this.refresh(tab.id); + enabled++; + } + return enabled; + }, + + disable: function (id) { + var disabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tab = this.get(arguments[a]); + if (!tab || tab.disabled === true) continue; + tab.disabled = true; + this.refresh(tab.id); + disabled++; + } + return disabled; + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (String(id) == 'undefined') { + // refresh all + for (var i in this.tabs) this.refresh(this.tabs[i].id); + } + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name), object: this.get(id) }); + if (eventData.isCancelled === true) return false; + // create or refresh only one item + var tab = this.get(id); + if (tab == null) return; + if (typeof tab.caption != 'undefined') tab.text = tab.caption; + + var jq_el = $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)); + var tabHTML = (tab.closable ? '
' : '') + + '
' + tab.text + '
'; + if (jq_el.length == 0) { + // does not exist - create it + var addStyle = ''; + if (tab.hidden) { addStyle += 'display: none;'; } + if (tab.disabled) { addStyle += 'opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);'; } + html = ''+ tabHTML + ''; + if (this.get(id, true) != this.tabs.length-1 && $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))+1].id)).length > 0) { + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))+1].id)).before(html); + } else { + $(this.box).find('#tabs_'+ this.name +'_right').before(html); + } + } else { + // refresh + jq_el.html(tabHTML); + if (tab.hidden) { jq_el.css('display', 'none'); } + else { jq_el.css('display', ''); } + if (tab.disabled) { jq_el.css({ 'opacity': '0.2', '-moz-opacity': '0.2', '-webkit-opacity': '0.2', '-o-opacity': '0.2', 'filter': 'alpha(opacity=20)' }); } + else { jq_el.css({ 'opacity': '1', '-moz-opacity': '1', '-webkit-opacity': '1', '-o-opacity': '1', 'filter': 'alpha(opacity=100)' }); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + render: function (box) { + var time = (new Date()).getTime(); + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + // default action + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + if (String(box) != 'undefined' && box != null) { + if ($(this.box).find('> table #tabs_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-tabs') + .html(''); + } + this.box = box; + } + if (!this.box) return; + // render all buttons + var html = ''+ + ' '+ + '
'+ this.right +'
'; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-tabs') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + return (new Date()).getTime() - time; + }, + + resize: function () { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // empty function + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> table #tabs_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-tabs') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // =================================================== + // -- Internal Event Handlers + + click: function (id, event) { + var tab = this.get(id); + if (tab == null || tab.disabled) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: id, object: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active) +' .w2ui-tab').removeClass('active'); + this.active = tab.id; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(id); + }, + + animateClose: function(id, event) { + var tab = this.get(id); + if (tab == null || tab.disabled) return false; + // event before + var eventData = this.trigger({ phase: 'before', type: 'close', target: id, object: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default action + var obj = this; + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)).css({ + '-webkit-transition': '.2s', + '-moz-transition': '2s', + '-ms-transition': '.2s', + '-o-transition': '.2s', + opacity: '0' }); + setTimeout(function () { + var width = $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)).width(); + $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)) + .html('
') + setTimeout(function () { + $(obj.box).find('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id)).find(':first-child').css({ 'width': '0px' }); + }, 50); + }, 200); + setTimeout(function () { + obj.remove(id); + }, 450); + // event before + this.trigger($.extend(eventData, { phase: 'after' })); + this.refresh(); + }, + + animateInsert: function(id, tab) { + if (this.get(id) == null) return; + if (!$.isPlainObject(tab)) return; + // check for unique + var unique = true; + for (var i in this.tabs) { if (this.tabs[i].id == tab.id) { unique = false; break; } } + if (!unique) { + console.log('ERROR: The parameter "id='+ tab.id +'" is not unique within the current tabs. (obj: '+ this.name +')'); + return; + } + // insert simple div + var jq_el = $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(tab.id)); + if (jq_el.length != 0) return; // already exists + // measure width + if (typeof tab.caption != 'undefined') tab.text = tab.caption; + var tmp = '
'+ + ''+ + '
'+ + (tab.closable ? '
' : '') + + '
'+ tab.text +'
'+ + '
'+ + '
'; + $('body').append(tmp); + // create dummy element + tabHTML = '
 
'; + var addStyle = ''; + if (tab.hidden) { addStyle += 'display: none;'; } + if (tab.disabled) { addStyle += 'opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);'; } + html = ''+ tabHTML +''; + if (this.get(id, true) != this.tabs.length && $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))].id)).length > 0) { + $(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.tabs[parseInt(this.get(id, true))].id)).before(html); + } else { + $(this.box).find('#tabs_'+ this.name +'_right').before(html); + } + // -- move + var obj = this; + setTimeout(function () { + var width = $('#_tmp_simple_tab').width(); + $('#_tmp_tabs').remove(); + $('#tabs_'+ obj.name +'_tab_'+ w2utils.escapeId(tab.id) +' > div').css('width', width+'px'); + }, 1); + setTimeout(function () { + // insert for real + obj.insert(id, tab); + }, 200); + } + } + + $.extend(w2tabs.prototype, w2utils.event); + w2obj.tabs = w2tabs; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2toolbar - toolbar widget + * - $().w2toolbar - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - on overflow display << >> + * + ************************************************************************/ + +(function ($) { + var w2toolbar = function (options) { + this.box = null, // DOM Element that holds the element + this.name = null, // unique name for w2ui + this.items = [], + this.right = '', // HTML text on the right of toolbar + this.onClick = null, + this.onRender = null, + this.onRefresh = null, + this.onResize = null, + this.onDestroy = null + + $.extend(true, this, w2obj.toolbar, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2toolbar = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2toolbar().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + var items = method.items; + // extend items + var object = new w2toolbar(method); + $.extend(object, { items: [], handlers: [] }); + + for (var i in items) { object.items[i] = $.extend({}, w2toolbar.prototype.item, items[i]); } + if ($(this).length != 0) { + object.render($(this)[0]); + } + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2toolbar' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2toolbar.prototype = { + item: { + id : null, // commnad to be sent to all event handlers + type : 'button', // button, check, radio, drop, menu, break, html, spacer + text : '', + html : '', + img : null, + icon : null, + hidden : false, + disabled: false, + checked : false, // used for radio buttons + arrow : true, // arrow down for drop/menu types + hint : '', + group : null, // used for radio buttons + items : null, // for type menu it is an array of items in the menu + onClick : null + }, + + add: function (items) { + this.insert(null, items); + }, + + insert: function (id, items) { + if (!$.isArray(items)) items = [items]; + for (var o in items) { + // checks + if (typeof items[o].type == 'undefined') { + console.log('ERROR: The parameter "type" is required but not supplied in w2toolbar.add() method.'); + return; + } + if ($.inArray(String(items[o].type), ['button', 'check', 'radio', 'drop', 'menu', 'break', 'html', 'spacer']) == -1) { + console.log('ERROR: The parameter "type" should be one of the following [button, check, radio, drop, menu, break, html, spacer] '+ + 'in w2toolbar.add() method.'); + return; + } + if (typeof items[o].id == 'undefined') { + console.log('ERROR: The parameter "id" is required but not supplied in w2toolbar.add() method.'); + return; + } + var unique = true; + for (var i = 0; i < this.items.length; i++) { if (this.items[i].id == items[o].id) { unique = false; return; } } + if (!unique) { + console.log('ERROR: The parameter "id" is not unique within the current toolbar.'); + return; + } + if (!w2utils.isAlphaNumeric(items[o].id)) { + console.log('ERROR: The parameter "id" must be alpha-numeric + "-_".'); + return; + } + // add item + var it = $.extend({}, w2toolbar.prototype.item, items[o]); + if (id == null || typeof id == 'undefined') { + this.items.push(it); + } else { + var middle = this.get(id, true); + this.items = this.items.slice(0, middle).concat([it], this.items.slice(middle)); + } + this.refresh(it.id); + } + }, + + remove: function (id) { + var removed = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + removed++; + // remove from screen + $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id)).remove(); + // remove from array + var ind = this.get(it.id, true); + if (ind) this.items.splice(ind, 1); + } + return removed; + }, + + set: function (id, item) { + var index = this.get(id, true); + if (index == null) return false; + $.extend(this.items[index], item); + this.refresh(id); + return true; + }, + + get: function (id, returnIndex) { + if (arguments.length == 0) { + var all = []; + for (var i = 0; i < this.items.length; i++) if (this.items[i].id != null) all.push(this.items[i].id); + return all; + } + for (var i = 0; i < this.items.length; i++) { + if (this.items[i].id == id) { + if (returnIndex === true) return i; else return this.items[i]; + } + } + return null; + }, + + show: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.hidden = false; + this.refresh(it.id); + } + return items; + }, + + hide: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.hidden = true; + this.refresh(it.id); + } + return items; + }, + + enable: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.disabled = false; + this.refresh(it.id); + } + return items; + }, + + disable: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.disabled = true; + this.refresh(it.id); + } + return items; + }, + + check: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.checked = true; + this.refresh(it.id); + } + return items; + }, + + uncheck: function (id) { + var items = 0; + for (var a = 0; a < arguments.length; a++) { + var it = this.get(arguments[a]); + if (!it) continue; + items++; + it.checked = false; + this.refresh(it.id); + } + return items; + }, + + render: function (box) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('> table #tb_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-toolbar') + .html(''); + } + this.box = box; + } + if (!this.box) return; + // render all buttons + var html = ''+ + ''; + for (var i = 0; i < this.items.length; i++) { + var it = this.items[i]; + if (typeof it.id == 'undefined' || it.id == null) it.id = "item_" + i; + if (it == null) continue; + if (it.type == 'spacer') { + html += ''; + } else { + html += ''; + } + } + html += ''; + html += ''+ + '
'+ this.getItemHTML(it) + + ''+ this.right +'
'; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-toolbar') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name), item: this.get(id) }); + if (eventData.isCancelled === true) return false; + + if (typeof id == 'undefined') { + // refresh all + for (var i = 0; i < this.items.length; i++) { + var it = this.items[i]; + if (typeof it.id == 'undefined' || it.id == null) it.id = "item_" + i; + this.refresh(it.id); + } + } + // create or refresh only one item + var it = this.get(id); + if (it == null) return; + + var el = $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id)); + var html = this.getItemHTML(it); + if (el.length == 0) { + // does not exist - create it + if (it.type == 'spacer') { + html = ''; + } else { + html = ''+ html + + ''; + } + if (this.get(id, true) == this.items.length-1) { + $(this.box).find('#tb_'+ this.name +'_right').before(html); + } else { + $(this.box).find('#tb_'+ this.name +'_item_'+ w2utils.escapeId(this.items[parseInt(this.get(id, true))+1].id)).before(html); + } + } else { + // refresh + el.html(html); + if (it.hidden) { el.css('display', 'none'); } else { el.css('display', ''); } + if (it.disabled) { el.addClass('disabled'); } else { el.removeClass('disabled'); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + resize: function () { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + + // empty function + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> table #tb_'+ this.name + '_right').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-toolbar') + .html(''); + } + $(this.box).html(''); + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + // ======================================== + // --- Internal Functions + + getItemHTML: function (item) { + var html = ''; + + if (typeof item.caption != 'undefined') item.text = item.caption; + if (typeof item.hint == 'undefined') item.hint = ''; + if (typeof item.text == 'undefined') item.text = ''; + + switch (item.type) { + case 'menu': + case 'button': + case 'check': + case 'radio': + case 'drop': + var img = ' '; + if (item.img) img = '
'; + if (item.icon) img = '
'; + html += ''+ + '
'+ + ' '+ + ' ' + + img + + (item.text != '' ? '' : '') + + (((item.type == 'drop' || item.type == 'menu') && item.arrow !== false) ? + '' : '') + + '
'+ item.text +'   
'+ + '
'; + break; + + case 'break': + html += ''+ + ' '+ + '
 
'; + break; + + case 'html': + html += ''+ + ' '+ + '
' + item.html + '
'; + break; + } + + var newHTML = ''; + if (typeof item.onRender == 'function') newHTML = item.onRender.call(this, item.id, html); + if (typeof this.onRender == 'function') newHTML = this.onRender(item.id, html); + if (newHTML != '' && typeof newHTML != 'undefined') html = newHTML; + return html; + }, + + menuClick: function (id, menu_index, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var obj = this; + var it = this.get(id); + if (it && !it.disabled) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: (typeof id != 'undefined' ? id : this.name), item: this.get(id), + subItem: (typeof menu_index != 'undefined' && this.get(id) ? this.get(id).items[menu_index] : null), originalEvent: event }); + if (eventData.isCancelled === true) return false; + + // normal processing + + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + } + }, + + click: function (id, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var obj = this; + var it = this.get(id); + if (it && !it.disabled) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'click', target: (typeof id != 'undefined' ? id : this.name), + item: this.get(id), originalEvent: event }); + if (eventData.isCancelled === true) return false; + + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('down'); + + if (it.type == 'radio') { + for (var i = 0; i < this.items.length; i++) { + var itt = this.items[i]; + if (itt == null || itt.id == it.id || itt.type != 'radio') continue; + if (itt.group == it.group && itt.checked) { + itt.checked = false; + this.refresh(itt.id); + } + } + it.checked = true; + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } + + if (it.type == 'drop' || it.type == 'menu') { + if (it.checked) { + // if it was already checked, second click will hide it + it.checked = false; + } else { + // show overlay + setTimeout(function () { + var el = $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id)); + if (!$.isPlainObject(it.overlay)) it.overlay = {}; + if (it.type == 'drop') { + el.w2overlay(it.html, $.extend({ left: (el.width() - 50) / 2, top: 3 }, it.overlay)); + } + if (it.type == 'menu') { + el.w2menu(it.items, $.extend({ left: (el.width() - 50) / 2, top: 3 }, it.overlay, { + select: function (item, event, index) { obj.menuClick(it.id, index, event); } + })); + } + // window.click to hide it + $(document).on('click', hideDrop); + function hideDrop() { + it.checked = false; + if (it.checked) { + $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } else { + $('#tb_'+ obj.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('checked'); + } + obj.refresh(it.id); + $(document).off('click', hideDrop); + } + }, 1); + } + } + + if (it.type == 'check' || it.type == 'drop' || it.type == 'menu') { + it.checked = !it.checked; + if (it.checked) { + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').addClass('checked'); + } else { + $('#tb_'+ this.name +'_item_'+ w2utils.escapeId(it.id) +' table.w2ui-button').removeClass('checked'); + } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + } + } + } + + $.extend(w2toolbar.prototype, w2utils.event); + w2obj.toolbar = w2toolbar; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2sidebar - sidebar widget + * - $().w2sidebar - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - return ids of all subitems + * - add find() method to find nodes by a specific criteria (I want all nodes for exampe) + * - dbl click should be like it is in grid (with timer not HTML dbl click event) + * + ************************************************************************/ + +(function ($) { + var w2sidebar = function (options) { + this.name = null; + this.box = null; + this.sidebar = null; + this.parent = null; + this.nodes = []; // Sidebar child nodes + this.menu = []; + this.selected = null; // current selected node (readonly) + this.img = null; + this.icon = null; + this.style = ''; + this.topHTML = ''; + this.bottomHTML = ''; + this.keyboard = true; + this.onClick = null; // Fire when user click on Node Text + this.onDblClick = null; // Fire when user dbl clicks + this.onContextMenu = null; + this.onMenuClick = null; // when context menu item selected + this.onExpand = null; // Fire when node Expands + this.onCollapse = null; // Fire when node Colapses + this.onKeydown = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + + $.extend(true, this, w2obj.sidebar, options); + } + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2sidebar = function(method) { + if (typeof method === 'object' || !method ) { + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2sidebar().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // extend items + var nodes = method.nodes; + var object = new w2sidebar(method); + $.extend(object, { handlers: [], nodes: [] }); + if (typeof nodes != 'undefined') { + object.add(object, nodes); + } + if ($(this).length != 0) { + object.render($(this)[0]); + } + object.sidebar = object; + // register new object + w2ui[object.name] = object; + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2sidebar' ); + } + }; + + // ==================================================== + // -- Implementation of core functionality + + w2sidebar.prototype = { + + node: { + id : null, + text : '', + count : '', + img : null, + icon : null, + nodes : [], + style : '', + selected : false, + expanded : false, + hidden : false, + disabled : false, + group : false, // if true, it will build as a group + plus : false, // if true, plus will be shown even if there is no sub nodes + // events + onClick : null, + onDblClick : null, + onContextMenu : null, + onExpand : null, + onCollapse : null, + // internal + parent : null, // node object + sidebar : null + }, + + add: function (parent, nodes) { + if (arguments.length == 1) { + // need to be in reverse order + nodes = arguments[0]; + parent = this; + } + if (typeof parent == 'string') parent = this.get(parent); + return this.insert(parent, null, nodes); + }, + + insert: function (parent, before, nodes) { + if (arguments.length == 2) { + // need to be in reverse order + nodes = arguments[1]; + before = arguments[0]; + var ind = this.get(before); + if (ind == null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because cannot find node "'+ before +'" to insert before.'); + return null; + } + parent = this.get(before).parent; + } + if (typeof parent == 'string') parent = this.get(parent); + if (!$.isArray(nodes)) nodes = [nodes]; + for (var o in nodes) { + if (typeof nodes[o].id == 'undefined') { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because it has no id.'); + continue; + } + if (this.get(this, nodes[o].id) != null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node with id='+ nodes[o].id +' (text: '+ txt + ') because another node with the same id already exists.'); + continue; + } + var tmp = $.extend({}, w2sidebar.prototype.node, nodes[o]); + tmp.sidebar= this; + tmp.parent = parent; + var nd = tmp.nodes; + tmp.nodes = []; // very important to re-init empty nodes array + if (before == null) { // append to the end + parent.nodes.push(tmp); + } else { + var ind = this.get(parent, before, true); + if (ind == null) { + var txt = (nodes[o].caption != 'undefined' ? nodes[o].caption : nodes[o].text); + console.log('ERROR: Cannot insert node "'+ txt +'" because cannot find node "'+ before +'" to insert before.'); + return null; + } + parent.nodes.splice(ind, 0, tmp); + } + if (typeof nd != 'undefined' && nd.length > 0) { this.insert(tmp, null, nd); } + } + this.refresh(parent.id); + return tmp; + }, + + remove: function () { // multiple arguments + var deleted = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + var ind = this.get(tmp.parent, arguments[a], true); + if (ind == null) continue; + tmp.parent.nodes.splice(ind, 1); + deleted++; + } + if (deleted > 0 && arguments.length == 1) this.refresh(tmp.parent.id); else this.refresh(); + return deleted; + }, + + set: function (parent, id, node) { + if (arguments.length == 2) { + // need to be in reverse order + node = id; + id = parent; + parent = this; + } + // searches all nested nodes + this._tmp = null; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].id == id) { + // make sure nodes inserted correctly + var nodes = node.nodes; + $.extend(parent.nodes[i], node, { nodes: [] }); + if (typeof nodes != 'undefined') { + this.add(parent.nodes[i], nodes); + } + this.refresh(id); + return true; + } else { + this._tmp = this.set(parent.nodes[i], id, node); + if (this._tmp) return true; + } + } + return false; + }, + + get: function (parent, id, returnIndex) { // can be just called get(id) or get(id, true) + if (arguments.length == 1 || (arguments.length == 2 && id === true) ) { + // need to be in reverse order + returnIndex = id; + id = parent; + parent = this; + } + // searches all nested nodes + this._tmp = null; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].id == id) { + if (returnIndex === true) return i; else return parent.nodes[i]; + } else { + this._tmp = this.get(parent.nodes[i], id, returnIndex); + if (this._tmp || this._tmp === 0) return this._tmp; + } + } + return this._tmp; + }, + + hide: function () { // multiple arguments + var hidden = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.hidden = true; + hidden++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return hidden; + }, + + show: function () { + var shown = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.hidden = false; + shown++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return shown; + }, + + disable: function () { // multiple arguments + var disabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.disabled = true; + if (tmp.selected) this.unselect(tmp.id); + disabled++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return disabled; + }, + + enable: function () { // multiple arguments + var enabled = 0; + for (var a = 0; a < arguments.length; a++) { + var tmp = this.get(arguments[a]); + if (tmp == null) continue; + tmp.disabled = false; + enabled++; + } + if (arguments.length == 1) this.refresh(arguments[0]); else this.refresh(); + return enabled; + }, + + select: function (id) { + if (this.selected == id) return false; + this.unselect(this.selected); + var new_node = this.get(id); + if (!new_node) return false; + $(this.box).find('#node_'+ w2utils.escapeId(id)) + .addClass('w2ui-selected') + .find('.w2ui-icon').addClass('w2ui-icon-selected'); + new_node.selected = true; + this.selected = id; + }, + + unselect: function (id) { + var current = this.get(id); + if (!current) return false; + current.selected = false; + $(this.box).find('#node_'+ w2utils.escapeId(id)) + .removeClass('w2ui-selected') + .find('.w2ui-icon').removeClass('w2ui-icon-selected'); + if (this.selected == id) this.selected = null; + return true; + }, + + toggle: function(id) { + var nd = this.get(id); + if (nd == null) return; + if (nd.plus) { + this.set(id, { plus: false }); + this.expand(id); + this.refresh(id); + return; + } + if (nd.nodes.length == 0) return; + if (this.get(id).expanded) this.collapse(id); else this.expand(id); + }, + + collapse: function (id) { + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'collapse', target: id, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#node_'+ w2utils.escapeId(id) +'_sub').slideUp('fast'); + $(this.box).find('#node_'+ w2utils.escapeId(id) +' .w2ui-node-dots:first-child').html('
+
'); + nd.expanded = false; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + collapseAll: function (parent) { + if (typeof parent == 'undefined') parent = this; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].expanded === true) parent.nodes[i].expanded = false; + if (parent.nodes[i].nodes && parent.nodes[i].nodes.length > 0) this.collapseAll(parent.nodes[i]); + } + this.refresh(parent.id); + }, + + expand: function (id) { + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'expand', target: id, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('#node_'+ w2utils.escapeId(id) +'_sub').slideDown('fast'); + $(this.box).find('#node_'+ w2utils.escapeId(id) +' .w2ui-node-dots:first-child').html('
-
'); + nd.expanded = true; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + expandAll: function (parent) { + if (typeof parent == 'undefined') parent = this; + if (typeof parent == 'string') parent = this.get(parent); + if (parent.nodes == null) return null; + for (var i=0; i < parent.nodes.length; i++) { + if (parent.nodes[i].expanded === false) parent.nodes[i].expanded = true; + if (parent.nodes[i].nodes && parent.nodes[i].nodes.length > 0) this.collapseAll(parent.nodes[i]); + } + this.refresh(parent.id); + }, + + expandParents: function (id) { + var node = this.get(id); + if (node == null) return; + if (node.parent) { + node.parent.expanded = true; + this.expandParents(node.parent.id); + } + this.refresh(id); + }, + + click: function (id, event) { + var obj = this; + var nd = this.get(id); + if (nd == null) return; + var old = this.selected; + if (nd.disabled || nd.group) return; // should click event if already selected + // move selected first + $(obj.box).find('#node_'+ w2utils.escapeId(old)).removeClass('w2ui-selected').find('.w2ui-icon').removeClass('w2ui-icon-selected'); + $(obj.box).find('#node_'+ w2utils.escapeId(id)).addClass('w2ui-selected').find('.w2ui-icon').addClass('w2ui-icon-selected'); + // need timeout to allow rendering + setTimeout(function () { + // event before + var eventData = obj.trigger({ phase: 'before', type: 'click', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) { + // restore selection + $(obj.box).find('#node_'+ w2utils.escapeId(id)).removeClass('w2ui-selected').find('.w2ui-icon').removeClass('w2ui-icon-selected'); + $(obj.box).find('#node_'+ w2utils.escapeId(old)).addClass('w2ui-selected').find('.w2ui-icon').addClass('w2ui-icon-selected'); + return false; + } + // default action + if (old != null) obj.get(old).selected = false; + obj.get(id).selected = true; + obj.selected = id; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + }, + + keydown: function (event) { + var obj = this; + var nd = obj.get(obj.selected); + if (!nd || obj.keyboard !== true) return; + // trigger event + var eventData = obj.trigger({ phase: 'before', type: 'keydown', target: obj.name, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default behaviour + if (event.keyCode == 13 || event.keyCode == 32) { // enter or space + if (nd.nodes.length > 0) obj.toggle(obj.selected); + } + if (event.keyCode == 37) { // left + if (nd.nodes.length > 0) { + obj.collapse(obj.selected); + } else { + // collapse parent + if (nd.parent && !nd.parent.disabled && !nd.parent.group) { + obj.collapse(nd.parent.id); + obj.click(nd.parent.id); + setTimeout(function () { obj.scrollIntoView(); }, 50); + } + } + } + if (event.keyCode == 39) { // right + if (nd.nodes.length > 0) obj.expand(obj.selected); + } + if (event.keyCode == 38) { // up + var tmp = prev(nd); + if (tmp != null) { obj.click(tmp.id, event); setTimeout(function () { obj.scrollIntoView(); }, 50); } + } + if (event.keyCode == 40) { // down + var tmp = next(nd); + if (tmp != null) { obj.click(tmp.id, event); setTimeout(function () { obj.scrollIntoView(); }, 50); } + } + // cancel event if needed + if ($.inArray(event.keyCode, [13, 32, 37, 38, 39, 40]) != -1) { + if (event.preventDefault) event.preventDefault(); + if (event.stopPropagation) event.stopPropagation(); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + return; + + function next (node, noSubs) { + if (node == null) return null; + var parent = node.parent; + var ind = obj.get(node.id, true); + var nextNode = null; + // jump inside + if (node.expanded && node.nodes.length > 0 && noSubs !== true) { + var t = node.nodes[0]; + if (!t.disabled && !t.group) nextNode = t; else nextNode = next(t); + } else { + if (parent && ind + 1 < parent.nodes.length) { + nextNode = parent.nodes[ind + 1]; + } else { + nextNode = next(parent, true); // jump to the parent + } + } + if (nextNode != null && (nextNode.disabled || nextNode.group)) nextNode = next(nextNode); + return nextNode; + } + + function prev (node) { + if (node == null) return null; + var parent = node.parent; + var ind = obj.get(node.id, true); + var prevNode = null; + var noSubs = false; + if (ind > 0) { + prevNode = parent.nodes[ind - 1]; + // jump inside parents last node + if (prevNode.expanded && prevNode.nodes.length > 0) { + var t = prevNode.nodes[prevNode.nodes.length - 1]; + if (!t.disabled && !t.group) prevNode = t; else prevNode = prev(t); + } + } else { + prevNode = parent; // jump to the parent + noSubs = true; + } + if (prevNode != null && (prevNode.disabled || prevNode.group)) prevNode = prev(prevNode); + return prevNode; + } + }, + + scrollIntoView: function (id) { + if (typeof id == 'undefined') id = this.selected; + var nd = this.get(id); + if (nd == null) return; + var body = $(this.box).find('.w2ui-sidebar-div'); + var item = $(this.box).find('#node_'+ w2utils.escapeId(id)); + var offset = item.offset().top - body.offset().top; + if (offset + item.height() > body.height()) { + body.animate({ 'scrollTop': body.scrollTop() + body.height() / 1.3 }); + } + if (offset <= 0) { + body.animate({ 'scrollTop': body.scrollTop() - body.height() / 1.3 }); + } + }, + + dblClick: function (id, event) { + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + var nd = this.get(id); + // event before + var eventData = this.trigger({ phase: 'before', type: 'dblClick', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + if (nd.nodes.length > 0) this.toggle(id); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + contextMenu: function (id, event) { + var obj = this; + var nd = obj.get(id); + if (id != obj.selected) obj.click(id); + // need timeout to allow click to finish first + setTimeout(function () { + // event before + var eventData = obj.trigger({ phase: 'before', type: 'contextMenu', target: id, originalEvent: event, object: nd }); + if (eventData.isCancelled === true) return false; + // default action + if (nd.group || nd.disabled) return; + if (obj.menu.length > 0) { + $(obj.box).find('#node_'+ w2utils.escapeId(id)) + .w2menu(obj.menu, { + left: (event ? event.offsetX || event.pageX : 50) - 25, + select: function (item, event, index) { obj.menuClick(id, index, event); } + } + ); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 1); + }, + + menuClick: function (itemId, index, event) { + var obj = this; + // event before + var eventData = obj.trigger({ phase: 'before', type: 'menuClick', target: itemId, originalEvent: event, menuIndex: index, menuItem: obj.menu[index] }); + if (eventData.isCancelled === true) return false; + // default action + // -- empty + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, + + render: function (box) { + // event before + var eventData = this.trigger({ phase: 'before', type: 'render', target: this.name, box: box }); + if (eventData.isCancelled === true) return false; + // default action + if (typeof box != 'undefined' && box != null) { + if ($(this.box).find('> div > div.w2ui-sidebar-div').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-sidebar') + .html(''); + } + this.box = box; + } + if (!this.box) return; + $(this.box) + .attr('name', this.name) + .addClass('w2ui-reset w2ui-sidebar') + .html('
'+ + '
' + + '
'+ + '
'+ + '
' + ); + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + // adjust top and bottom + if (this.topHTML != '') { + $(this.box).find('.w2ui-sidebar-top').html(this.topHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('top', $(this.box).find('.w2ui-sidebar-top').height() + 'px'); + } + if (this.bottomHTML != '') { + $(this.box).find('.w2ui-sidebar-bottom').html(this.bottomHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('bottom', $(this.box).find('.w2ui-sidebar-bottom').height() + 'px'); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // --- + this.refresh(); + }, + + refresh: function (id) { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'refresh', target: (typeof id != 'undefined' ? id : this.name) }); + if (eventData.isCancelled === true) return false; + // adjust top and bottom + if (this.topHTML != '') { + $(this.box).find('.w2ui-sidebar-top').html(this.topHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('top', $(this.box).find('.w2ui-sidebar-top').height() + 'px'); + } + if (this.bottomHTML != '') { + $(this.box).find('.w2ui-sidebar-bottom').html(this.bottomHTML); + $(this.box).find('.w2ui-sidebar-div') + .css('bottom', $(this.box).find('.w2ui-sidebar-bottom').height() + 'px'); + } + // default action + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + var obj = this; + if (typeof id == 'undefined') { + var node = this; + var nm = '.w2ui-sidebar-div'; + } else { + var node = this.get(id); + if (node == null) return; + var nm = '#node_'+ w2utils.escapeId(node.id) + '_sub'; + } + if (node != this) { + var tmp = '#node_'+ w2utils.escapeId(node.id); + var nodeHTML = getNodeHTML(node); + $(this.box).find(tmp).before(''); + $(this.box).find(tmp).remove(); + $(this.box).find(nm).remove(); + $('#sidebar_'+ this.name + '_tmp').before(nodeHTML); + $('#sidebar_'+ this.name + '_tmp').remove(); + } + // refresh sub nodes + $(this.box).find(nm).html(''); + for (var i=0; i < node.nodes.length; i++) { + var nodeHTML = getNodeHTML(node.nodes[i]); + $(this.box).find(nm).append(nodeHTML); + if (node.nodes[i].nodes.length != 0) { this.refresh(node.nodes[i].id); } + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + + function getNodeHTML(nd) { + var html = ''; + var img = nd.img; + if (img == null) img = this.img; + var icon = nd.icon; + if (icon == null) icon = this.icon; + // -- find out level + var tmp = nd.parent; + var level = 0; + while (tmp && tmp.parent != null) { + if (tmp.group) level--; + tmp = tmp.parent; + level++; + } + if (typeof nd.caption != 'undefined') nd.text = nd.caption; + if (nd.group) { + html = + '
'+ + ' '+ (!nd.hidden && nd.expanded ? w2utils.lang('Hide') : w2utils.lang('Show')) +''+ + ' '+ nd.text +''+ + '
'+ + '
'; + } else { + if (nd.selected && !nd.disabled) obj.selected = nd.id; + var tmp = ''; + if (img) tmp = '
'; + if (icon) tmp = '
'; + html = + '
'+ + ''+ + ''+ + ''+ + '
'+ + '
' + (nd.nodes.length > 0 ? (nd.expanded ? '-' : '+') : (nd.plus ? '+' : '')) + '
' + + '
'+ + tmp + + (nd.count !== '' ? '
'+ nd.count +'
' : '') + + '
'+ nd.text +'
'+ + '
'+ + '
'+ + '
'; + } + return html; + } + }, + + resize: function () { + var time = (new Date()).getTime(); + if (window.getSelection) window.getSelection().removeAllRanges(); // clear selection + // event before + var eventData = this.trigger({ phase: 'before', type: 'resize', target: this.name }); + if (eventData.isCancelled === true) return false; + // default action + $(this.box).css('overflow', 'hidden'); // container should have no overflow + //$(this.box).find('.w2ui-sidebar-div').css('overflow', 'hidden'); + $(this.box).find('> div').css({ + width : $(this.box).width() + 'px', + height : $(this.box).height() + 'px' + }); + //$(this.box).find('.w2ui-sidebar-div').css('overflow', 'auto'); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return (new Date()).getTime() - time; + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', type: 'destroy', target: this.name }); + if (eventData.isCancelled === true) return false; + // clean up + if ($(this.box).find('> div > div.w2ui-sidebar-div').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-sidebar') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + w2utils.lock(box, msg, showSpinner); + }, + + unlock: function () { + w2utils.unlock(this.box); + } + } + + $.extend(w2sidebar.prototype, w2utils.event); + w2obj.sidebar = w2sidebar; +})(jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2field - various field controls + * - $().w2field - jQuery wrapper + * - Dependencies: jQuery, w2utils + * + * == NICE TO HAVE == + * - select - for select, list - for drop down (needs this in grid) + * - enum add events: onLoad, onRequest, onCompare, onSelect, onDelete, onClick for already selected elements + * - upload (regular files) + * - enum - refresh happens on each key press even if not needed (for speed) + * - BUG with prefix/postfix and arrows (test in different contexts) + * - multiple date selection + * - rewrire everythin in objects (w2ftext, w2fenum, w2fdate) + * - render calendar to the div + * + ************************************************************************/ + +(function ($) { + + /* SINGELTON PATTERN */ + + var w2field = new (function () { + this.customTypes = []; + }); + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2field = function(method) { + // Method calling logic + if (w2field[method]) { + return w2field[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object') { + return w2field.init.apply( this, arguments ); + } else if ( typeof method === 'string') { + return w2field.init.apply( this, [{ type: method }] ); + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2field'); + } + }; + + $.extend(w2field, { + // CONTEXT: this - is jQuery object + init: function (options) { + var obj = w2field; + return $(this).each(function (field, index) { + // Check for Custom Types + if (typeof w2field.customTypes[options.type.toLowerCase()] == 'function') { + w2field.customTypes[options.type.toLowerCase()].call(this, options); + return; + } + // Common Types + var tp = options.type.toLowerCase(); + switch (tp) { + + case 'clear': // removes any previous field type + $(this) + .off('focus') + .off('blur') + .off('keypress') + .off('keydown') + .off('change') + .removeData(); // removes all attached data + if ($(this).prev().hasClass('w2ui-list')) { // if enum + $(this).prev().remove(); + $(this).removeAttr('tabindex').css('border-color', '').show(); + } + if ($(this).prev().hasClass('w2ui-upload')) { // if upload + $(this).prev().remove(); + $(this).removeAttr('tabindex').css('border-color', '').show(); + } + if ($(this).prev().hasClass('w2ui-field-helper')) { // helpers + $(this).css('padding-left', $(this).css('padding-top')); + $(this).prev().remove(); + } + if ($(this).next().hasClass('w2ui-field-helper')) { // helpers + $(this).css('padding-right', $(this).css('padding-top')); + $(this).next().remove(); + } + if ($(this).next().hasClass('w2ui-field-helper')) { // helpers + $(this).next().remove(); + } + break; + + case 'text': + case 'int': + case 'float': + case 'money': + case 'alphanumeric': + case 'hex': + var el = this; + var defaults = { + min : null, + max : null, + arrows : false, + keyboard: true, + suffix : '', + prefix : '' + } + options = $.extend({}, defaults, options); + if (['text', 'alphanumeric', 'hex'].indexOf(tp) != -1) { + options.arrows = false; + options.keyboard = false; + } + // init events + $(this) + .data('options', options) + .on('keypress', function (event) { // keyCode & charCode differ in FireFox + if (event.metaKey || event.ctrlKey || event.altKey || (event.charCode != event.keyCode && event.keyCode > 0)) return; + if (event.keyCode == 13) $(this).change(); + var ch = String.fromCharCode(event.charCode); + if (!checkType(ch, true)) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + return false; + } + }) + .on('keydown', function (event, extra) { + if (!options.keyboard) return; + var cancel = false; + var v = $(el).val(); + if (!checkType(v)) v = options.min || 0; else v = parseFloat(v); + var key = event.keyCode || extra.keyCode; + var inc = 1; + if (event.ctrlKey || event.metaKey) inc = 10; + switch (key) { + case 38: // up + $(el).val((v + inc <= options.max || options.max == null ? v + inc : options.max)).change(); + if (tp == 'money') $(el).val( Number($(el).val()).toFixed(2) ); + cancel = true; + break; + case 40: // down + $(el).val((v - inc >= options.min || options.min == null ? v - inc : options.min)).change(); + if (tp == 'money') $(el).val( Number($(el).val()).toFixed(2) ); + cancel = true; + break; + } + if (cancel) { + event.preventDefault(); + // set cursor to the end + setTimeout(function () { el.setSelectionRange(el.value.length, el.value.length); }, 0); + } + }) + .on('change', function (event) { + // check max/min + var v = $(el).val(); + var cancel = false; + if (options.min != null && v != '' && v < options.min) { $(el).val(options.min).change(); cancel = true; } + if (options.max != null && v != '' && v > options.max) { $(el).val(options.max).change(); cancel = true; } + if (cancel) { + event.stopPropagation(); + event.preventDefault(); + return false; + } + // check validity + if (this.value != '' && !checkType(this.value)) $(this).val(options.min != null ? options.min : ''); + }); + if ($(this).val() == '' && options.min != null) $(this).val(options.min); + if (options.prefix != '') { + $(this).before( + '
'+ + options.prefix + + '
'); + var helper = $(this).prev(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : $(this).css('padding-left'), + 'padding-right' : 0, + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px', + 'margin-left' : 0, + 'margin-right' : 0 + }) + .on('click', function () { + $(this).next().focus(); + }); + $(this).css('padding-left', (helper.width() + parseInt($(this).css('padding-left')) + 5) + 'px'); + } + var pr = parseInt($(this).css('padding-right')); + if (options.arrows != '') { + $(this).after( + '
 '+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'); + var height = w2utils.getSize(this, 'height'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'height' : ($(this).height() + parseInt($(this).css('padding-top')) + parseInt($(this).css('padding-bottom')) ) + 'px', + 'padding' : '0px', + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : '0px', + 'border-left' : '1px solid silver' + }) + .css('margin-left', '-'+ (helper.width() + parseInt($(this).css('margin-right')) + 12) + 'px') + .on('mousedown', function (event) { + var btn = this; + var evt = event; + $('body').on('mouseup', tmp); + $('body').data('_field_update_timer', setTimeout(update, 700)); + update(false); + // timer function + function tmp() { + clearTimeout($('body').data('_field_update_timer')); + $('body').off('mouseup', tmp); + } + // update function + function update(notimer) { + $(el).focus().trigger($.Event("keydown"), { + keyCode : ($(evt.target).attr('type') == 'up' ? 38 : 40) + }); + if (notimer !== false) $('body').data('_field_update_timer', setTimeout(update, 60)); + }; + }); + pr += helper.width() + 12; + $(this).css('padding-right', pr + 'px'); + } + if (options.suffix != '') { + $(this).after( + '
'+ + options.suffix + + '
'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : '3px', + 'padding-right' : $(this).css('padding-right'), + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px' + }) + .on('click', function () { + $(this).prev().focus(); + }); + helper.css('margin-left', '-'+ (helper.width() + parseInt($(this).css('padding-right')) + 5) + 'px'); + pr += helper.width() + 3; + $(this).css('padding-right', pr + 'px'); + } + + function checkType(ch, loose) { + switch (tp) { + case 'int': + if (loose && ['-'].indexOf(ch) != -1) return true; + return w2utils.isInt(ch); + break; + case 'float': + if (loose && ['-','.'].indexOf(ch) != -1) return true; + return w2utils.isFloat(ch); + break; + case 'money': + if (loose && ['-','.','$','€','£','¥'].indexOf(ch) != -1) return true; + return w2utils.isMoney(ch); + break; + case 'hex': + return w2utils.isHex(ch); + break; + case 'alphanumeric': + return w2utils.isAlphaNumeric(ch); + break; + } + return true; + } + break; + + case 'date': + var obj = this; + var defaults = { + format : w2utils.settings.date_format, // date format + start : '', // start of selectable range + end : '', // end of selectable range + blocked : {}, // {'4/11/2011': 'yes'} + colored : {} // {'4/11/2011': 'red:white'} + } + options = $.extend({}, defaults, options); + // -- insert div for calendar + $(this) // remove transtion needed for functionality + .css( { 'transition': 'none', '-webkit-transition': 'none', '-moz-transition': 'none', '-ms-transition': 'none', '-o-transition': 'none' }) + .data("options", options) + .on('focus', function () { + var top = parseFloat($(obj).offset().top) + parseFloat(obj.offsetHeight); + var left = parseFloat($(obj).offset().left); + clearInterval($(obj).data('mtimer')); + $('#global_calendar_div').remove(); + $('body').append('
'+ + '
'); + $('#global_calendar_div') + .html($().w2field('calendar_get', obj.value, options)) + .css({ + left: left + 'px', + top: top + 'px' + }) + .data('el', obj) + .show(); + var max = $(window).width() + $(document).scrollLeft() - 1; + if (left + $('#global_calendar_div').width() > max) { + $('#global_calendar_div').css('left', (max - $('#global_calendar_div').width()) + 'px'); + } + // monitors + var mtimer = setInterval(function () { + var max = $(window).width() + $(document).scrollLeft() - 1; + var left = $(obj).offset().left; + if (left + $('#global_calendar_div').width() > max) left = max - $('#global_calendar_div').width(); + // monitor if moved + if ($('#global_calendar_div').data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + $('#global_calendar_div').css({ + '-webkit-transition': '.2s', + left: left + 'px', + top : ($(obj).offset().top + obj.offsetHeight) + 'px' + }).data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + } + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval(mtimer); + $('#global_calendar_div').remove(); + return; + } + }, 100); + $(obj).data('mtimer', mtimer); + }) + .on('blur', function (event) { + // trim empty spaces + $(obj).val($.trim($(obj).val())); + // check if date is valid + if ($.trim($(obj).val()) != '' && !w2utils.isDate($(obj).val(), options.format)) { + $(this).w2tag(w2utils.lang('Not a valid date') + ': '+ options.format); + } + clearInterval($(obj).data('mtimer')); + $('#global_calendar_div').remove(); + }) + .on('keypress', function (event) { + var obj = this; + setTimeout(function () { + $('#global_calendar_div').html( $().w2field('calendar_get', obj.value, options) ); + }, 10); + }); + setTimeout(function () { + // if it is unix time - convert to readable date + if (w2utils.isInt(obj.value)) obj.value = w2utils.formatDate(obj.value, options.format); + }, 1); + break; + + case 'time': + break; + + case 'datetime': + break; + + case 'color': + var obj = this; + var defaults = { + prefix : '#', + suffix : '
' + } + options = $.extend({}, defaults, options); + // -- insert div for color + $(this) + .attr('maxlength', 6) + .on('focus', function () { + var top = parseFloat($(obj).offset().top) + parseFloat(obj.offsetHeight); + var left = parseFloat($(obj).offset().left); + clearInterval($(obj).data('mtimer')); + $('#global_color_div').remove(); + $('body').append('
'+ + '
'); + $('#global_color_div') + .html($().w2field('getColorHTML', obj.value)) + .css({ + left: left + 'px', + top: top + 'px' + }) + .data('el', obj) + .show(); + var max = $(window).width() + $(document).scrollLeft() - 1; + if (left + $('#global_color_div').width() > max) { + $('#global_color_div').css('left', (max - $('#global_color_div').width()) + 'px'); + } + // monitors + var mtimer = setInterval(function () { + var max = $(window).width() + $(document).scrollLeft() - 1; + var left = $(obj).offset().left; + if (left + $('#global_color_div').width() > max) left = max - $('#global_color_div').width(); + // monitor if moved + if ($('#global_color_div').data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + $('#global_color_div').css({ + '-webkit-transition': '.2s', + left: left + 'px', + top : ($(obj).offset().top + obj.offsetHeight) + 'px' + }).data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + } + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval(mtimer); + $('#global_color_div').remove(); + return; + } + }, 100); + $(obj).data('mtimer', mtimer); + }) + .on('click', function () { + $(this).trigger('focus'); + }) + .on('blur', function (event) { + // trim empty spaces + $(obj).val($.trim($(obj).val())); + clearInterval($(obj).data('mtimer')); + $('#global_color_div').remove(); + }) + .on('keydown', function (event) { // need this for cut/paster + if (event.keyCode == 86 && (event.ctrlKey || event.metaKey)) { + var obj = this; + $(this).prop('maxlength', 7); + setTimeout(function () { + var val = $(obj).val(); + if (val.substr(0, 1) == '#') val = val.substr(1); + if (!w2utils.isHex(val)) val = ''; + $(obj).val(val).prop('maxlength', 6).change(); + }, 20); + } + }) + .on('keyup', function (event) { + if (event.keyCode == 86 && (event.ctrlKey || event.metaKey)) $(this).prop('maxlength', 6); + }) + .on('keypress', function (event) { // keyCode & charCode differ in FireFox + if (event.keyCode == 13) $(this).change(); + //if (event.ct) + var ch = String.fromCharCode(event.charCode); + if (!w2utils.isHex(ch, true)) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + return false; + } + }) + .on('change', function (event) { + var color = '#' + $(this).val(); + if ($(this).val().length != 6 && $(this).val().length != 3) color = ''; + $(this).next().find('div').css('background-color', color); + }); + if (options.prefix != '') { + $(this).before( + '
'+ + options.prefix + + '
'); + var helper = $(this).prev(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : $(this).css('padding-left'), + 'padding-right' : 0, + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px', + 'margin-left' : 0, + 'margin-right' : 0 + }) + .on('click', function () { + $(this).next().focus(); + }); + $(this).css('padding-left', (helper.width() + parseInt($(this).css('padding-left')) + 2) + 'px'); + } + if (options.suffix != '') { + $(this).after( + '
'+ + options.suffix + + '
'); + var helper = $(this).next(); + helper + .css({ + 'color' : $(this).css('color'), + 'font-family' : $(this).css('font-family'), + 'font-size' : $(this).css('font-size'), + 'padding-top' : $(this).css('padding-top'), + 'padding-bottom': $(this).css('padding-bottom'), + 'padding-left' : '3px', + 'padding-right' : $(this).css('padding-right'), + 'margin-top' : (parseInt($(this).css('margin-top')) + 1) + 'px', + 'margin-bottom' : (parseInt($(this).css('margin-bottom')) + 1) + 'px' + }) + .on('click', function () { + $(this).prev().focus(); + }); + helper.css('margin-left', '-'+ (helper.width() + parseInt($(this).css('padding-right')) + 4) + 'px'); + var pr = helper.width() + parseInt($(this).css('padding-right')) + 4; + $(this).css('padding-right', pr + 'px'); + // set color to current + helper.find('div').css('background-color', '#' + $(obj).val()); + } + break; + + case 'select': + case 'list': + if (this.tagName != 'SELECT') { + console.log('ERROR: You can only apply $().w2field(\'list\') to a SELECT element'); + return; + } + var defaults = { + url : '', + items : [], + value : null, + showNone : true + }; + var obj = this; + var settings = $.extend({}, defaults, options); + $(obj).data('settings', settings); + // define refresh method + obj.refresh = function () { + var settings = $(obj).data('settings'); + var html = ''; + var items = w2field.cleanItems(settings.items); + // build options + if (settings.showNone) html = ''; + for (var i in items) { + if (!settings.showNone && settings.value == null) settings.value = items[i].id; + html += ''; + } + $(obj).html(html); + $(obj).val(settings.value); + if ($(obj).val() != settings.value) $(obj).change(); + } + // pull from server + if (settings.url != '' ) { + $.ajax({ + type : 'GET', + dataType : 'text', + url : settings.url, + complete: function (xhr, status) { + if (status == 'success') { + var data = $.parseJSON(xhr.responseText); + var settings = $(obj).data('settings'); + settings.items = w2field.cleanItems(data.items); + $(obj).data('settings', settings); + obj.refresh(); + } + } + }); + } else { // refresh local + obj.refresh(); + } + break; + + case 'enum': + if (this.tagName != 'INPUT') { + console.log('ERROR: You can only apply $().w2field(\'enum\') to an INPUT element'); + return; + } + var defaults = { + url : '', + items : [], + selected : [], // preselected items + max : 0, // maximum number of items that can be selected 0 for unlim + maxHeight : 172, // max height for input control to grow + showAll : false, // if true then show selected item in drop down + match : 'begins with', // ['begins with', 'contains'] + render : null, // render(item, selected) + maxCache : 500, // number items to cache + onShow : null, // when overlay is shown onShow(settings) + onHide : null, // when overlay is hidden onHide(settings) + onAdd : null, // onAdd(item, settings) + onRemove : null, // onRemove(index, settings) + onItemOver : null, + onItemOut : null, + onItemClick : null + } + var obj = this; + var settings = $.extend({}, defaults, options); + + // normalize items and selected + settings.items = w2field.cleanItems(settings.items); + settings.selected = w2field.cleanItems(settings.selected); + + $(this).data('selected', settings.selected); + $(this).css({ + 'padding' : '0px', + 'border-color' : 'transparent', + 'background-color' : 'transparent', + 'outline' : 'none' + }); + + // add item to selected + this.add = function (item) { + if ($(this).attr('readonly')) return; + var selected = $(this).data('selected'); + var settings = $(this).data('settings'); + if (typeof settings.onAdd == 'function') { + var cancel = settings.onAdd(item, settings); + if (cancel === false) return; + } + if (!$.isArray(selected)) selected = []; + if (settings.max != 0 && settings.max <= selected.length) { + // if max reached, replace last + selected.splice(selected.length - 1, 1); + } + selected.push(item); + $(this).data('last_del', null); + $(this).trigger('change'); + } + + this.remove = function (index) { + var settings = $(this).data('settings'); + if (typeof settings.onRemove == 'function') { + var cancel = settings.onRemove(index, settings); + if (cancel === false) return; + } + if ($(this).attr('readonly')) return; + $(this).data('selected').splice(index, 1); + $(this).parent().find('[title=Remove][index='+ index +']').remove(); + this.refresh(); + w2field.list_render.call(this); + $(this).trigger('change'); + } + + this.show = function () { + if ($(this).attr('readonly')) return; + var settings = $(this).data('settings'); + // insert global div + if ($('#w2ui-global-items').length == 0) { + $('body').append('
'); + } else { + // ignore second click + return; + } + var div = $('#w2ui-global-items'); + div.css({ + display : 'block', + left : ($(obj).offset().left) + 'px', + top : ($(obj).offset().top + obj.offsetHeight + 3) + 'px' + }) + .width(w2utils.getSize(obj, 'width')) + .data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + + // show drop content + w2field.list_render.call(obj); + + // monitors + var monitor = function () { + var div = $('#w2ui-global-items'); + // monitor if destroyed + if ($(obj).length == 0 || ($(obj).offset().left == 0 && $(obj).offset().top == 0)) { + clearInterval($(obj).data('mtimer')); + hide(); + return; + } + // monitor if moved + if (div.data('position') != ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)) { + div.css({ + '-webkit-transition': '.2s', + left: ($(obj).offset().left) + 'px', + top : ($(obj).offset().top + obj.offsetHeight + 3) + 'px' + }) + .data('position', ($(obj).offset().left) + 'x' + ($(obj).offset().top + obj.offsetHeight)); + // if moved then resize + setTimeout(function () { + w2field.list_render.call(obj, $(obj).data('last_search')); + }, 200); + } + if (div.length > 0) $(obj).data('mtimer', setTimeout(monitor, 100)); + }; + $(obj).data('mtimer', setTimeout(monitor, 100)); + // onShow + if (typeof settings.onShow == 'function') settings.onShow.call(this, settings); + } + + this.hide = function () { + var settings = $(this).data('settings'); + clearTimeout($(obj).data('mtimer')); + $('#w2ui-global-items').remove(); + // onShow + if (typeof settings.onHide == 'function') settings.onHide.call(this, settings); + } + + // render controls with all items in it + this.refresh = function () { + var obj = this; + // remove all items + $($(this).data('div')).remove(); + // rebuild it + var margin = 'margin-top: ' + $(this).css('margin-top') + '; ' + + 'margin-bottom: ' + $(this).css('margin-bottom') + '; ' + + 'margin-left: ' + $(this).css('margin-left') + '; ' + + 'margin-right: ' + $(this).css('margin-right') + '; '+ + 'width: ' + (w2utils.getSize(this, 'width') + - parseInt($(this).css('margin-left')) + - parseInt($(this).css('margin-right'))) + 'px; '; + var html = '
'+ + '
    '; + var selected = $(this).data('selected'); + for (var s in selected) { + html += '
  • '+ + '
      
    '+ + selected[s].text + + '
  • '; + } + html += '
  • '+ + ' '+ + '
  • '+ + '
'+ + '
'; + $(this).before(html); + + var div = $(this).prev()[0]; + $(this).data('div', div); + // click on item + $(div).find('li') + .data('mouse', 'out') + .on('click', function (event) { + if ($(event.target).hasClass('nomouse')) return; + if (event.target.title == w2utils.lang('Remove')) { + obj.remove($(event.target).attr('index')); + return; + } + event.stopPropagation(); + if (typeof settings.onItemClick == 'function') settings.onItemClick.call(this, settings); + }) + .on('mouseover', function (event) { + var tmp = event.target; + if (tmp.tagName != 'LI') tmp = tmp.parentNode; + if ($(tmp).hasClass('nomouse')) return; + if ($(tmp).data('mouse') == 'out') { + if (typeof settings.onItemOver == 'function') settings.onItemOver.call(this, settings); + } + $(tmp).data('mouse', 'over'); + }) + .on('mouseout', function (event) { + var tmp = event.target; + if (tmp.tagName != 'LI') tmp = tmp.parentNode; + if ($(tmp).hasClass('nomouse')) return; + $(tmp).data('mouse', 'leaving'); + setTimeout(function () { + if ($(tmp).data('mouse') == 'leaving') { + $(tmp).data('mouse', 'out'); + if (typeof settings.onItemOut == 'function') settings.onItemOut.call(this, settings); + } + }, 0); + }); + $(div) // click on item + .on('click', function (event) { + $(this).find('input').focus(); + }) + .find('input') + .on('focus', function (event) { + $(div).css({ 'outline': 'auto 5px -webkit-focus-ring-color', 'outline-offset': '-2px' }); + obj.show(); + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }) + .on('blur', function (event) { + $(div).css('outline', 'none'); + obj.hide(); + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }); + // adjust height + obj.resize(); + } + this.resize = function () { + var settings = $(this).data('settings'); + var div = $(this).prev(); + var cntHeight = $(div).find('>div').height(); //w2utils.getSize(div, 'height'); + if (cntHeight < 23) cntHeight = 23; + if (cntHeight > settings.maxHeight) cntHeight = settings.maxHeight; + $(div).height(cntHeight + (cntHeight % 23 == 0 ? 0 : 23 - cntHeight % 23) ); + if (div.length > 0) div[0].scrollTop = 1000; + $(this).height(cntHeight); + } + // init control + $(this).data('settings', settings).attr('tabindex', -1); + obj.refresh(); + break; + + case 'upload': + if (this.tagName != 'INPUT') { + console.log('ERROR: You can only apply $().w2field(\'upload\') to an INPUT element'); + return; + } + // init defaults + var defaults = { + url : '', // not yet implemented + base64 : true, // if true max file size is 20mb (only tru for now) + hint : w2utils.lang('Attach files by dragging and dropping or Click to Select'), + max : 0, // max number of files, 0 - unlim + maxSize : 0, // max size of all files, 0 - unlim + maxFileSize : 0, // max size of a single file, 0 -unlim + onAdd : null, + onRemove : null, + onItemClick : null, + onItemDblClick : null, + onItemOver : null, + onItemOut : null, + onProgress : null, // not yet implemented + onComplete : null // not yet implemented + } + var obj = this; + var settings = $.extend({}, defaults, options); + if (settings.base64 === true) { + if (settings.maxSize == 0) settings.maxSize = 20 * 1024 * 1024; // 20mb + if (settings.maxFileSize == 0) settings.maxFileSize = 20 * 1024 * 1024; // 20mb + } + var selected = settings.selected; + delete settings.selected; + if (!$.isArray(selected)) selected = []; + $(this).data('selected', selected).data('settings', settings).attr('tabindex', -1); + w2field.upload_init.call(this); + + this.refresh = function () { + var obj = this; + var div = $(this).data('div'); + var settings = $(this).data('settings'); + var selected = $(this).data('selected'); + $(div).find('li').remove(); + $(div).find('> span:first-child').css('line-height', ($(div).height() - w2utils.getSize(div, '+height') - 8) + 'px'); + for (var s in selected) { + var file = selected[s]; + // add li element + var cnt = $(div).find('.file-list li').length; + $(div).find('> span:first-child').remove(); + $(div).find('.file-list').append('
  • ' + + '
      
    ' + + ' ' + file.name + '' + + ' - ' + w2utils.size(file.size) + ''+ + '
  • '); + var li = $(div).find('.file-list #file-' + cnt); + var previewHTML = ""; + if ((/image/i).test(file.type)) { // image + previewHTML = '
    '+ + ' '+ + '
    '; + } + var td1 = 'style="padding: 3px; text-align: right; color: #777;"'; + var td2 = 'style="padding: 3px"'; + previewHTML += '
    '+ + ' '+ + ' '+ + ' '+ + ' '+ + ' '+ + '
    Name:'+ file.name +'
    Size:'+ w2utils.size(file.size) +'
    Type:' + + ' '+ file.type +''+ + '
    Modified:'+ w2utils.date(file.modified) +'
    '+ + '
    '; + li.data('file', file) + .on('click', function (event) { + if (typeof settings.onItemClick == 'function') { + var ret = settings.onItemClick.call(obj, $(this).data('file')); + if (ret === false) return; + } + if (!$(event.target).hasClass('file-delete')) event.stopPropagation(); + }) + .on('dblclick', function (event) { + if (typeof settings.onItemDblClick == 'function') { + var ret = settings.onItemDblClick.call(obj, $(this).data('file')); + if (ret === false) return; + } + event.stopPropagation(); + if (document.selection) document.selection.empty(); else document.defaultView.getSelection().removeAllRanges(); + }) + .on('mouseover', function (event) { + if (typeof settings.onItemOver == 'function') { + var ret = settings.onItemOver.call(obj, $(this).data('file')); + if (ret === false) return; + } + var file = $(this).data('file'); + $(this).w2overlay( + previewHTML.replace('##FILE##', (file.content ? 'data:'+ file.type +';base64,'+ file.content : '')), + { top: -4 } + ); + }) + .on('mouseout', function () { + if (typeof settings.onItemOut == 'function') { + var ret = settings.onItemOut.call(obj, $(this).data('file')); + if (ret === false) return; + } + $(this).w2overlay(); + }); + } + } + this.refresh(); + break; + + case 'slider': + // for future reference + break; + + default: + console.log('ERROR: w2field does not recognize "'+ options.type + '" field type.'); + break; + } + }); + }, + + // ****************************************************** + // -- Implementation + + addType: function (type, handler) { + w2field.customTypes[String(type).toLowerCase()] = handler; + }, + + cleanItems: function (items) { + var newItems = []; + for (var i in items) { + var id = ''; + var text = ''; + var opt = items[i]; + if (opt == null) continue; + if ($.isPlainObject(items)) { + id = i; + text = opt; + } else { + if (typeof opt == 'object') { + if (typeof opt.id != 'undefined') id = opt.id; + if (typeof opt.value != 'undefined') id = opt.value; + if (typeof opt.txt != 'undefined') text = opt.txt; + if (typeof opt.text != 'undefined') text = opt.text; + } + if (typeof opt == 'string') { + if (String(opt) == '') continue; + id = opt; + text = opt; + opt = {}; + } + } + if (w2utils.isInt(id)) id = parseInt(id); + if (w2utils.isFloat(id)) id = parseFloat(id); + newItems.push($.extend({}, opt, { id: id, text: text })); + } + return newItems; + }, + + // ****************************************************** + // -- Upload + + upload_init: function () { + var obj = this; // this -> input element + var settings = $(this).data('settings'); + // create drop area if needed + var el = $(obj).prev(); + if (el.length > 0 && el[0].tagName == 'DIV' && el.hasClass('w2ui-upload')) el.remove(); + // rebuild it + var margin = 'margin-top: ' + $(obj).css('margin-top') + '; ' + + 'margin-bottom: ' + $(obj).css('margin-bottom') + '; ' + + 'margin-left: ' + $(obj).css('margin-left') + '; ' + + 'margin-right: ' + $(obj).css('margin-right') + '; '+ + 'width: ' + (w2utils.getSize(obj, 'width') + - parseInt($(obj).css('margin-left')) + - parseInt($(obj).css('margin-right'))) + 'px; '+ + 'height: ' + (w2utils.getSize(obj, 'height') + - parseInt($(obj).css('margin-top')) + - parseInt($(obj).css('margin-bottom'))) + 'px; '; + var html = + '
    '+ + ' '+ settings.hint +''+ + '
      '+ + ' '+ + '
      '; + $(obj) + .css({ + 'display1' : 'none', + 'border-color' : 'transparent' + }) + .before(html); + $(obj).data('div', $(obj).prev()[0]); + var div = $(obj).data('div'); + // if user selects files through input control + $(div).find('.file-input') + .off('change') + .on('change', function () { + if (typeof this.files !== "undefined") { + for (var i = 0, l = this.files.length; i < l; i++) { + w2field.upload_add.call(obj, this.files[i]); + } + } + }); + + // if user clicks drop zone + $(div) + .off('click') + .on('click', function (event) { + $(div).w2tag(); + if (event.target.tagName == 'LI' || $(event.target).hasClass('file-size')) { + return; + } + if ($(event.target).hasClass('file-delete')) { + w2field.upload_remove.call(obj, event.target.parentNode); + return; + } + if (event.target.tagName != 'INPUT') { + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var cnt = 0; + for (var s in selected) { cnt++; } + if (cnt < settings.max || settings.max == 0) $(div).find('.file-input').click(); + } + }) + .off('dragenter') + .on('dragenter', function (event) { + $(div).addClass('dragover'); + }) + .off('dragleave') + .on('dragleave', function (event) { + $(div).removeClass('dragover'); + }) + .off('drop') + .on('drop', function (event) { + $(div).removeClass('dragover'); + var files = event.originalEvent.dataTransfer.files; + for (var i=0, l=files.length; i input element + var div = $(obj).data('div'); + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var newItem = { + name : file.name, + type : file.type, + modified : file.lastModifiedDate, + size : file.size, + content : null + }; + var size = 0; + var cnt = 0; + for (var s in selected) { size += selected[s].size; cnt++; } + // check params + if (settings.maxFileSize != 0 && newItem.size > settings.maxFileSize) { + var err = 'Maximum file size is '+ w2utils.size(settings.maxFileSize); + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (settings.maxSize != 0 && size + newItem.size > settings.maxSize) { + var err = 'Maximum total size is '+ w2utils.size(settings.maxFileSize); + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (settings.max != 0 && cnt >= settings.max) { + var err = 'Maximum number of files is '+ settings.max; + $(div).w2tag(err); + console.log('ERROR: '+ err); + return; + } + if (typeof settings.onAdd == 'function') { + var ret = settings.onAdd.call(obj, newItem); + if (ret === false) return; + } + selected.push(newItem); + // read file as base64 + if (typeof FileReader !== "undefined" && settings.base64 === true) { + var reader = new FileReader(); + // need a closure + reader.onload = (function () { + return function (event) { + var fl = event.target.result; + var ind = fl.indexOf(','); + newItem.content = fl.substr(ind+1); + obj.refresh(); + $(obj).trigger('change'); + }; + })(); + reader.readAsDataURL(file); + } else { + obj.refresh(); + $(obj).trigger('change'); + } + }, + + upload_remove: function (li) { + var obj = this; // this -> input element + var div = $(obj).data('div'); + var settings = $(obj).data('settings'); + var selected = $(obj).data('selected'); + var file = $(li).data('file'); + // run event + if (typeof settings.onRemove == 'function') { + var ret = settings.onRemove.call(obj, file); + if (ret === false) return false; + } + // remove from selected + for (var i = selected.length - 1; i >= 0; i--) { + if (selected[i].name == file.name && selected[i].size == file.size) { + selected.splice(i, 1); + } + } + $(li).fadeOut('fast'); + setTimeout(function () { + $(li).remove(); + // if all files remoted + if (selected.length == 0) { + $(div).prepend(''+ settings.hint +''); + } + obj.refresh(); + $(obj).trigger('change'); + }, 300); + }, + + // ****************************************************** + // -- Enum + + list_render: function (search) { + var obj = this; + var div = $('#w2ui-global-items'); + var settings = $(this).data('settings'); + var items = settings.items; + var selected = $(this).data('selected'); + if (div.length == 0) return; // if it is hidden + + // build overall html + if (typeof search == 'undefined') { + var html = ''; + html += '
      '; + div.html(html); + search = ''; + } + $(this).data('last_search', search); + if (typeof $(obj).data('last_index') == 'undefined' || $(obj).data('last_index') == null) $(obj).data('last_index', 0); + + // pull items from url + if (typeof settings.last_total == 'undefined') settings.last_total = -1; + if (typeof settings.last_search_len == 'undefined') settings.last_search_len = 0; + if (typeof settings.last_search_match == 'undefined') settings.last_search_match = -1; + if (settings.url != '' && ( + (items.length == 0 && settings.last_total != 0) + || (search.length > settings.last_search_len && settings.last_total > settings.maxCache) + || (search.length < settings.last_search_match && search.length != settings.last_search_len) + ) + ) { + var match = false; + if (settings.last_total < settings.maxCache) match = true; + $.ajax({ + type : 'GET', + dataType : 'text', + url : settings.url, + data : { + search : search, + max : settings.maxCache + }, + complete: function (xhr, status) { + settings.last_total = 0; + if (status == 'success') { + var data = $.parseJSON(xhr.responseText); + if (match == false && data.total < settings.maxCache) { settings.last_search_match = search.length; } + settings.last_search_len = search.length; + settings.last_total = data.total + settings.items = data.items; + w2field.list_render.call(obj, search); + } + } + }); + } + + // build items + var i = 0; + var ihtml = '
        '; + // get ids of all selected items + var ids = []; + for (var a in selected) ids.push(w2utils.isInt(selected[a].id) ? parseInt(selected[a].id) : String(selected[a].id)) + // build list + var group = ''; + for (var a in items) { + var id = items[a].id; + var txt = items[a].text; + // if already selected + if ($.inArray(w2utils.isInt(id) ? parseInt(id) : String(id), ids) != -1 && settings.showAll !== true) continue; + // check match with search + var txt1 = String(search).toLowerCase(); + var txt2 = txt.toLowerCase(); + var match = (txt1.length <= txt2.length && txt2.substr(0, txt1.length) == txt1); + if (settings.match.toLowerCase() == 'contains' && txt2.indexOf(txt1) != -1) match = true; + if (match) { + if (typeof settings['render'] == 'function') { + txt = settings['render'](items[a], selected); + } + if (txt !== false) { + // render group if needed + if (typeof items[a].group != 'undefined' && items[a].group != group) { + group = items[a].group; + ihtml += '
      • '+ group +'
      • '; + } + // render item + ihtml += '\n
      • '+ + txt +'
      • '; + if (i == $(obj).data('last_index')) $(obj).data('last_item', items[a]); + i++; + } + } + } + ihtml += '
      '; + if (i == 0) { + ihtml = '
      '+ w2utils.lang('No items found') +'
      '; + var noItems = true; + } + div.find('.w2ui-items-list').html(ihtml); + $(this).data('last_max', i-1); + + // scroll selected into view + if (div.find('li.selected').length > 0) div.find('li.selected')[0].scrollIntoView(false); + + // if menu goes off screen - add scrollbar + div.css({ '-webkit-transition': '0s', height : 'auto' }); + var max_height = parseInt($(document).height()) - parseInt(div.offset().top) - 8; + if (parseInt(div.height()) > max_height) { + div.css({ + height : (max_height - 5) + 'px', + overflow: 'show' + }); + $(div).find('.w2ui-items-list').css({ + height : (max_height - 15) + 'px', + overflow: 'auto' + }); + } + + // add events + $(div) + .off('mousedown') + .on('mousedown', function (event) { + var target = event.target; + if (target.tagName != "LI") target = $(target).parents('li'); + var id = $(target).attr('index'); + if (!id) return; + var item = settings.items[id]; + if (typeof id == 'undefined') { if (event.preventDefault) event.preventDefault(); else return false; } + obj.add(item); + $(obj).data('last_index', 0); + obj.refresh(); + w2field.list_render.call(obj, ''); + } + ); + $(obj).prev().find('li > input') + .val(search) + .css('max-width', ($(div).width() - 25) + 'px') + .width(((search.length + 2) * 6) + 'px') + .focus() + .on('click', function (event) { + if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; + }) + .off('keyup') + .on('keyup', function (event) { + var inp = this; + setTimeout(function () { + var curr = $(obj).data('last_index'); + switch (event.keyCode) { + case 38: // up + curr--; + if (curr < 0) curr = 0; + $(obj).data('last_index', curr); + if (event.preventDefault) event.preventDefault(); + break; + case 40: // down + curr++; + if (curr > $(obj).data('last_max')) curr = $(obj).data('last_max'); + $(obj).data('last_index', curr); + if (event.preventDefault) event.preventDefault(); + break; + case 13: // enter + if (typeof $(obj).data('last_item') == 'undefined' || $(obj).data('last_item') == null || noItems === true) break; + var selected = $(obj).data('selected'); + obj.add($(obj).data('last_item')); + // select next + if (curr > $(obj).data('last_max') - 1) curr = $(obj).data('last_max')-1; + $(obj).data('last_index', curr); + $(obj).data('last_item', null); + // refrech + $(inp).val(''); + obj.refresh(); + if (event.preventDefault) event.preventDefault(); + break; + case 8: // backspace + if (String(inp.value) == '') { + if (typeof $(obj).data('last_del') == 'undefined' || $(obj).data('last_del') == null) { + // mark for deletion + var selected = $(obj).data('selected'); + if (!$.isArray(selected)) selected = []; + $(obj).data('last_del', selected.length-1); + // refrech + obj.refresh(); + } else { + // delete marked one + var selected = $(obj).data('selected'); + obj.remove(selected.length - 1); + } + } + break; + default: + $(obj).data('last_index', 0); + $(obj).data('last_del', null); + break; + } + // adjust height + obj.resize(); + + // refresh menu + if (!(event.keyCode == 8 && String(inp.value) == '')) { + $(obj).prev().find('li').css('opacity', '1'); + $(obj).data('last_del', null); + } + if ($.inArray(event.keyCode, [16,91,37,39]) == -1) { // command and shift keys and arrows + w2field.list_render.call(obj, inp.value); + } + }, 10); + }) + }, + + // ****************************************************** + // -- Calendar + + calendar_get: function (date, options) { + var td = new Date(); + var today = (Number(td.getMonth())+1) + '/' + td.getDate() + '/' + (String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900); + if (String(date) == '' || String(date) == 'undefined') date = w2utils.formatDate(today, options.format); + if (!w2utils.isDate(date, options.format)) date = w2utils.formatDate(today, options.format); + // format date + var tmp = date.replace(/-/g, '/').replace(/\./g, '/').toLowerCase().split('/'); + var tmp2 = options.format.replace(/-/g, '/').replace(/\./g, '/').toLowerCase(); + var dt = new Date(); + if (tmp2 == 'mm/dd/yyyy') dt = new Date(tmp[0] + '/' + tmp[1] + '/' + tmp[2]); + if (tmp2 == 'm/d/yyyy') dt = new Date(tmp[0] + '/' + tmp[1] + '/' + tmp[2]); + if (tmp2 == 'dd/mm/yyyy') dt = new Date(tmp[1] + '/' + tmp[0] + '/' + tmp[2]); + if (tmp2 == 'd/m/yyyy') dt = new Date(tmp[1] + '/' + tmp[0] + '/' + tmp[2]); + if (tmp2 == 'yyyy/dd/mm') dt = new Date(tmp[2] + '/' + tmp[1] + '/' + tmp[0]); + if (tmp2 == 'yyyy/d/m') dt = new Date(tmp[2] + '/' + tmp[1] + '/' + tmp[0]); + if (tmp2 == 'yyyy/mm/dd') dt = new Date(tmp[1] + '/' + tmp[2] + '/' + tmp[0]); + if (tmp2 == 'yyyy/m/d') dt = new Date(tmp[1] + '/' + tmp[2] + '/' + tmp[0]); + var html = '' + + ''+ + // ''+ + '
      '+ $().w2field('calendar_month', (dt.getMonth() + 1), dt.getFullYear(), options) +'
      '; + return html; + }, + + calendar_next: function(month_year) { + var tmp = String(month_year).split('/'); + var month = tmp[0]; + var year = tmp[1]; + if (parseInt(month) < 12) { + month = parseInt(month) + 1; + } else { + month = 1; + year = parseInt(year) + 1; + } + var options = $($('#global_calendar_div.w2ui-calendar').data('el')).data('options'); + $('#global_calendar_div.w2ui-calendar').html( $().w2field('calendar_get', w2utils.formatDate(month+'/1/'+year, options.format), options) ); + }, + + calendar_previous: function(month_year) { + var tmp = String(month_year).split('/'); + var month = tmp[0]; + var year = tmp[1]; + if (parseInt(month) > 1) { + month = parseInt(month) - 1; + } else { + month = 12; + year = parseInt(year) - 1; + } + var options = $($('#global_calendar_div.w2ui-calendar').data('el')).data('options'); + $('#global_calendar_div.w2ui-calendar').html( $().w2field('calendar_get', w2utils.formatDate(month+'/1/'+year, options.format), options) ); + }, + + calendar_month: function(month, year, options) { + var td = new Date(); + var months = w2utils.settings.fullmonths; + var days = w2utils.settings.fulldays; + var daysCount = ['31', '28', '31', '30', '31', '30', '31', '31', '30', '31', '30', '31']; + var today = (Number(td.getMonth())+1) + '/' + td.getDate() + '/' + (String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900); + + year = Number(year); + month = Number(month); + if (year === null || year === '') year = String(td.getYear()).length > 3 ? td.getYear() : td.getYear() + 1900; + if (month === null || month === '') month = Number(td.getMonth())+1; + if (month > 12) { month = month - 12; year++; } + if (month < 1 || month == 0) { month = month + 12; year--; } + if (year/4 == Math.floor(year/4)) { daysCount[1] = '29'; } else { daysCount[1] = '28'; } + if (year == null) { year = td.getYear(); } + if (month == null) { month = td.getMonth()-1; } + + // start with the required date + var td = new Date(); + td.setDate(1); + td.setMonth(month-1); + td.setYear(year); + var weekDay = td.getDay(); + var tabDays = w2utils.settings.shortdays; + var dayTitle = ''; + for ( var i = 0, len = tabDays.length; i < len; i++) { + dayTitle += '' + tabDays[i] + ''; + } + var html = + '
      '+ + '
      <-
      '+ + '
      ->
      '+ + months[month-1] +', '+ year + + '
      '+ + ''+ + ' ' + dayTitle + ''+ + ' '; + + var day = 1; + for (var ci=1; ci<43; ci++) { + if (weekDay == 0 && ci == 1) { + for (var ti=0; ti<6; ti++) html += ''; + ci += 6; + } else { + if (ci < weekDay || day > daysCount[month-1]) { + html += ''; + if ((ci)%7 == 0) html += ''; + continue; + } + } + var dt = month + '/' + day + '/' + year; + + var className = ''; + if (ci % 7 == 6) className = 'w2ui-saturday'; + if (ci % 7 == 0) className = 'w2ui-sunday'; + if (dt == today) className += ' w2ui-today'; + + var dspDay = day; + var col = ''; + var bgcol = ''; + var blocked = ''; + if (options.colored) if (options.colored[dt] != undefined) { // if there is predefined colors for dates + tmp = options.colored[dt].split(':'); + bgcol = 'background-color: ' + tmp[0] + ';'; + col = 'color: ' + tmp[1] + ';'; + } + var noSelect = false; + // enable range + if (options.start || options.end) { + var start = new Date(options.start); + var end = new Date(options.end); + var current = new Date(dt); + if (current < start || current > end) { + blocked = ' w2ui-blocked-date'; + noSelect = true; + } + } + // block predefined dates + if (options.blocked && $.inArray(dt, options.blocked) != -1) { + blocked = ' w2ui-blocked-date'; + noSelect = true; + } + html += ''; + day++; + } + html += '
        
      '; + if (ci % 7 == 0 || (weekDay == 0 && ci == 1)) html += '
      '; + return html; + }, + + getColorHTML: function (color) { + var html = '
      '+ + ''; + var colors = [ + ['000000', '444444', '666666', '999999', 'CCCCCC', 'EEEEEE', 'F3F3F3', 'FFFFFF'], + ['FF011B', 'FF9838', 'FFFD59', '01FD55', '00FFFE', '0424F3', '9B24F4', 'FF21F5'], + ['F4CCCC', 'FCE5CD', 'FFF2CC', 'D9EAD3', 'D0E0E3', 'CFE2F3', 'D9D1E9', 'EAD1DC'], + ['EA9899', 'F9CB9C', 'FEE599', 'B6D7A8', 'A2C4C9', '9FC5E8', 'B4A7D6', 'D5A6BD'], + ['E06666', 'F6B26B', 'FED966', '93C47D', '76A5AF', '6FA8DC', '8E7CC3', 'C27BA0'], + ['CC0814', 'E69138', 'F1C232', '6AA84F', '45818E', '3D85C6', '674EA7', 'A54D79'], + ['99050C', 'B45F17', 'BF901F', '37761D', '124F5C', '0A5394', '351C75', '741B47'], + ['660205', '783F0B', '7F6011', '274E12', '0C343D', '063762', '20124D', '4C1030'] + ]; + for (var i=0; i<8; i++) { + html += ''; + for (var j=0; j<8; j++) { + html += ''; + } + html += ''; + if (i < 2) html += ''; + } + html += '
      '+ + '
      '+ + ' '+ (color == colors[i][j] ? '•' : ' ')+ + '
      '+ + '
      '; + return html; + } + }); + + w2obj.field = w2field; + +}) (jQuery); + +/************************************************************************ + * Library: Web 2.0 UI for jQuery (using prototypical inheritance) + * - Following objects defined + * - w2form - form widget + * - $().w2form - jQuery wrapper + * - Dependencies: jQuery, w2utils, w2fields, w2tabs, w2toolbar, w2alert + * + * == NICE TO HAVE == + * - refresh(field) - would refresh only one field + * - include delta on save + * + ************************************************************************/ + + +(function ($) { + var w2form = function(options) { + // public properties + this.name = null; + this.header = ''; + this.box = null; // HTML element that hold this element + this.url = ''; + this.formURL = ''; // url where to get form HTML + this.formHTML = ''; // form HTML (might be loaded from the url) + this.page = 0; // current page + this.recid = 0; // can be null or 0 + this.fields = []; + this.actions = {}; + this.record = {}; + this.original = {}; + this.postData = {}; + this.toolbar = {}; // if not empty, then it is toolbar + this.tabs = {}; // if not empty, then it is tabs object + + this.style = ''; + this.focus = 0; // focus first or other element + this.msgNotJSON = w2utils.lang('Return data is not in JSON format.'); + this.msgRefresh = w2utils.lang('Refreshing...'); + this.msgSaving = w2utils.lang('Saving...'); + + // events + this.onRequest = null; + this.onLoad = null; + this.onValidate = null; + this.onSubmit = null; + this.onSave = null; + this.onChange = null; + this.onRender = null; + this.onRefresh = null; + this.onResize = null; + this.onDestroy = null; + this.onAction = null; + this.onToolbar = null; + this.onError = null; + + // internal + this.isGenerated = false; + this.last = { + xhr : null // jquery xhr requests + } + + $.extend(true, this, w2obj.form, options); + }; + + // ==================================================== + // -- Registers as a jQuery plugin + + $.fn.w2form = function(method) { + if (typeof method === 'object' || !method ) { + var obj = this; + // check required parameters + if (!method || typeof method.name == 'undefined') { + console.log('ERROR: The parameter "name" is required but not supplied in $().w2form().'); + return; + } + if (typeof w2ui[method.name] != 'undefined') { + console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+ method.name +').'); + return; + } + if (!w2utils.isAlphaNumeric(method.name)) { + console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '); + return; + } + // remember items + var record = method.record; + var original = method.original; + var fields = method.fields; + var toolbar = method.toolbar; + var tabs = method.tabs; + // extend items + var object = new w2form(method); + $.extend(object, { record: {}, original: {}, fields: [], tabs: {}, toolbar: {}, handlers: [] }); + if ($.isArray(tabs)) { + $.extend(true, object.tabs, { tabs: [] }); + for (var t in tabs) { + var tmp = tabs[t]; + if (typeof tmp == 'object') object.tabs.tabs.push(tmp); else object.tabs.tabs.push({ id: tmp, caption: tmp }); + } + } else { + $.extend(true, object.tabs, tabs); + } + $.extend(true, object.toolbar, toolbar); + // reassign variables + for (var p in fields) object.fields[p] = $.extend(true, {}, fields[p]); + for (var p in record) { + if ($.isPlainObject(record[p])) { + object.record[p] = $.extend(true, {}, record[p]); + } else { + object.record[p] = record[p]; + } + } + for (var p in original) { + if ($.isPlainObject(original[p])) { + object.original[p] = $.extend(true, {}, original[p]); + } else { + object.original[p] = original[p]; + } + } + if (obj.length > 0) object.box = obj[0]; + // render if necessary + if (object.formURL != '') { + $.get(object.formURL, function (data) { + object.formHTML = data; + object.isGenerated = true; + if ($(object.box).length != 0 || data.length != 0) { + $(object.box).html(data); + object.render(object.box); + } + }); + } else if (object.formHTML != '') { + // it is already loaded into formHTML + } else if ($(this).length != 0 && $.trim($(this).html()) != '') { + object.formHTML = $(this).html(); + } else { // try to generate it + object.formHTML = object.generateHTML(); + } + // register new object + w2ui[object.name] = object; + // render if not loaded from url + if (object.formURL == '') { + if (String(object.formHTML).indexOf('w2ui-page') == -1) { + object.formHTML = '
      '+ object.formHTML +'
      '; + } + $(object.box).html(object.formHTML); + object.isGenerated = true; + object.render(object.box); + } + return object; + + } else if (w2ui[$(this).attr('name')]) { + var obj = w2ui[$(this).attr('name')]; + obj[method].apply(obj, Array.prototype.slice.call(arguments, 1)); + return this; + } else { + console.log('ERROR: Method ' + method + ' does not exist on jQuery.w2form'); + } + } + + // ==================================================== + // -- Implementation of core functionality + + w2form.prototype = { + + get: function (field, returnIndex) { + for (var f in this.fields) { + if (this.fields[f].name == field) { + if (returnIndex === true) return f; else return this.fields[f]; + } + } + return null; + }, + + set: function (field, obj) { + for (var f in this.fields) { + if (this.fields[f].name == field) { + $.extend(this.fields[f] , obj); + this.refresh(); + return true; + } + } + return false; + }, + + reload: function (callBack) { + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url && this.recid != 0) { + //this.clear(); + this.request(callBack); + } else { + this.refresh(); + if (typeof callBack == 'function') callBack(); + } + }, + + clear: function () { + this.recid = 0; + this.record = {}; + // clear all enum fields + for (var f in this.fields) { + var field = this.fields[f]; + } + $().w2tag(); + this.refresh(); + }, + + error: function (msg) { + var obj = this; + // let the management of the error outside of the grid + var eventData = this.trigger({ target: this.name, type: 'error', message: msg , xhr: this.last.xhr }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack(); + return false; + } + // need a time out because message might be already up) + setTimeout(function () { w2alert(msg, 'Error'); }, 1); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + validate: function (showErrors) { + if (typeof showErrors == 'undefined') showErrors = true; + // validate before saving + var errors = []; + for (var f in this.fields) { + var field = this.fields[f]; + if (this.record[field.name] == null) this.record[field.name] = ''; + switch (field.type) { + case 'int': + if (this.record[field.name] && !w2utils.isInt(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not an integer') }); + } + break; + case 'float': + if (this.record[field.name] && !w2utils.isFloat(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a float') }); + } + break; + case 'money': + if (this.record[field.name] && !w2utils.isMoney(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not in money format') }); + } + break; + case 'hex': + if (this.record[field.name] && !w2utils.isHex(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a hex number') }); + } + break; + case 'email': + if (this.record[field.name] && !w2utils.isEmail(this.record[field.name])) { + errors.push({ field: field, error: w2utils.lang('Not a valid email') }); + } + break; + case 'checkbox': + // convert true/false + if (this.record[field.name] == true) this.record[field.name] = 1; else this.record[field.name] = 0; + break; + case 'date': + // format date before submit + if (this.record[field.name] && !w2utils.isDate(this.record[field.name], field.options.format)) { + errors.push({ field: field, error: w2utils.lang('Not a valid date') + ': ' + field.options.format }); + } else { + // convert to universal timestamp with time zone + //var d = new Date(this.record[field.name]); + //var tz = (d.getTimezoneOffset() > 0 ? '+' : '-') + Math.floor(d.getTimezoneOffset()/60) + ':' + (d.getTimezoneOffset() % 60); + //this.record[field.name] = d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + ' ' + // + d.getHours() + ':' + d.getSeconds() + ':' + d.getMilliseconds() + tz; + //this.record[field.name + '_unix'] = Math.round(d.getTime() / 1000); + //this.record[field.name] = w2utils.formatDate(this.record[field.name], 'mm/dd/yyyy'); + } + break; + case 'select': + case 'list': + break; + case 'enum': + break; + } + // === check required - if field is '0' it should be considered not empty + var val = this.record[field.name]; + if ( field.required && (val === '' || ($.isArray(val) && val.length == 0)) ) { + errors.push({ field: field, error: w2utils.lang('Required field') }); + } + if ( field.equalto && this.record[field.name]!=this.record[field.equalto] ) { + errors.push({ field: field, error: w2utils.lang('Field should be equal to ')+field.equalto }); + } + } + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'validate', errors: errors }); + if (eventData.isCancelled === true) return errors; + // show error + if (showErrors) for (var e in eventData.errors) { + var err = eventData.errors[e]; + $(err.field.el).w2tag(err.error, { "class": 'w2ui-error' }); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + return errors; + }, + + request: function (postData, callBack) { // if (1) param then it is call back if (2) then postData and callBack + var obj = this; + // check for multiple params + if (typeof postData == 'function') { + callBack = postData; + postData = null; + } + if (typeof postData == 'undefined' || postData == null) postData = {}; + if (!this.url || (typeof this.url == 'object' && !this.url.get)) return; + if (this.recid == null || typeof this.recid == 'undefined') this.recid = 0; + // build parameters list + var params = {}; + // add list params + params['cmd'] = 'get-record'; + params['name'] = this.name; + params['recid'] = this.recid; + // append other params + $.extend(params, this.postData); + $.extend(params, postData); + // event before + var eventData = this.trigger({ phase: 'before', type: 'request', target: this.name, url: this.url, postData: params }); + if (eventData.isCancelled === true) { if (typeof callBack == 'function') callBack({ status: 'error', message: 'Request aborted.' }); return false; } + // default action + this.record = {}; + this.original = {}; + // call server to get data + this.lock(this.msgRefresh); + var url = eventData.url; + if (typeof eventData.url == 'object' && eventData.url.get) url = eventData.url.get; + if (this.last.xhr) try { this.last.xhr.abort(); } catch (e) {}; + this.last.xhr = $.ajax({ + type : 'GET', + url : url, + data : String($.param(eventData.postData, false)).replace(/%5B/g, '[').replace(/%5D/g, ']'), + dataType : 'text', + complete : function (xhr, status) { + obj.unlock(); + // event before + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'load', xhr: xhr, status: status }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Request aborted.' }); + return false; + } + // parse server response + var responseText = obj.last.xhr.responseText; + if (status != 'error') { + // default action + if (typeof responseText != 'undefined' && responseText != '') { + var data; + // check if the onLoad handler has not already parsed the data + if (typeof responseText == "object") { + data = responseText; + } else { + // $.parseJSON or $.getJSON did not work because it expect perfect JSON data - where everything is in double quotes + try { eval('data = '+ responseText); } catch (e) { } + } + if (typeof data == 'undefined') { + data = { + status : 'error', + message : obj.msgNotJSON, + responseText : responseText + } + } + if (data['status'] == 'error') { + obj.error(data['message']); + } else { + obj.record = $.extend({}, data.record); + obj.original = $.extend({}, data.record); + } + } + } else { + obj.error('AJAX Error ' + xhr.status + ': '+ xhr.statusText); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.refresh(); + // call back + if (typeof callBack == 'function') callBack(data); + } + }); + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + submit: function (postData, callBack) { + return this.save(postData, callBack); + }, + + save: function (postData, callBack) { + var obj = this; + // check for multiple params + if (typeof postData == 'function') { + callBack = postData; + postData = null; + } + // validation + var errors = obj.validate(true); + if (errors.length !== 0) { + obj.goto(errors[0].field.page); + return; + } + // submit save + if (typeof postData == 'undefined' || postData == null) postData = {}; + if (!obj.url || (typeof obj.url == 'object' && !obj.url.save)) { + console.log("ERROR: Form cannot be saved because no url is defined."); + return; + } + obj.lock(obj.msgSaving + ' '); + // need timer to allow to lock + setTimeout(function () { + // build parameters list + var params = {}; + // add list params + params['cmd'] = 'save-record'; + params['name'] = obj.name; + params['recid'] = obj.recid; + // append other params + $.extend(params, obj.postData); + $.extend(params, postData); + params.record = $.extend(true, {}, obj.record); + // convert before submitting + for (var f in obj.fields) { + var field = obj.fields[f]; + switch (String(field.type).toLowerCase()) { + case 'date': // to yyyy-mm-dd format + var dt = params.record[field.name]; + if (field.options.format.toLowerCase() == 'dd/mm/yyyy' || field.options.format.toLowerCase() == 'dd-mm-yyyy' + || field.options.format.toLowerCase() == 'dd.mm.yyyy') { + var tmp = dt.replace(/-/g, '/').replace(/\./g, '/').split('/'); + var dt = new Date(tmp[2] + '-' + tmp[1] + '-' + tmp[0]); + } + params.record[field.name] = w2utils.formatDate(dt, 'yyyy-mm-dd'); + break; + } + } + // event before + var eventData = obj.trigger({ phase: 'before', type: 'submit', target: obj.name, url: obj.url, postData: params }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Saving aborted.' }); + return false; + } + // default action + var url = eventData.url; + if (typeof eventData.url == 'object' && eventData.url.save) url = eventData.url.save; + if (obj.last.xhr) try { obj.last.xhr.abort(); } catch (e) {}; + obj.last.xhr = $.ajax({ + type : (w2utils.settings.RESTfull ? (obj.recid == 0 ? 'POST' : 'PUT') : 'POST'), + url : url, + data : String($.param(eventData.postData, false)).replace(/%5B/g, '[').replace(/%5D/g, ']'), + dataType : 'text', + xhr : function() { + var xhr = new window.XMLHttpRequest(); + // upload + xhr.upload.addEventListener("progress", function(evt) { + if (evt.lengthComputable) { + var percent = Math.round(evt.loaded / evt.total * 100); + $('#'+ obj.name + '_progress').text(''+ percent + '%'); + } + }, false); + return xhr; + }, + complete : function (xhr, status) { + obj.unlock(); + + // event before + var eventData = obj.trigger({ phase: 'before', target: obj.name, type: 'save', xhr: xhr, status: status }); + if (eventData.isCancelled === true) { + if (typeof callBack == 'function') callBack({ status: 'error', message: 'Saving aborted.' }); + return false; + } + // parse server response + var responseText = xhr.responseText; + if (status != 'error') { + // default action + if (typeof responseText != 'undefined' && responseText != '') { + var data; + // check if the onLoad handler has not already parsed the data + if (typeof responseText == "object") { + data = responseText; + } else { + // $.parseJSON or $.getJSON did not work because it expect perfect JSON data - where everything is in double quotes + try { eval('data = '+ responseText); } catch (e) { } + } + if (typeof data == 'undefined') { + data = { + status : 'error', + message : obj.msgNotJSON, + responseText : responseText + } + } + if (data['status'] == 'error') { + obj.error(data['message']); + } else { + obj.original = $.extend({}, obj.record); + } + } + } else { + obj.error('AJAX Error ' + xhr.status + ': '+ xhr.statusText); + } + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + obj.refresh(); + // call back + if (typeof callBack == 'function') callBack(data); + } + }); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }, 50); + }, + + lock: function (msg, showSpinner) { + var box = $(this.box).find('> div:first-child'); + w2utils.lock(box, msg, showSpinner); + }, + + unlock: function () { + var obj = this; + setTimeout(function () { w2utils.unlock(obj.box); }, 25); // needed timer so if server fast, it will not flash + }, + + goto: function (page) { + if (typeof page != 'undefined') this.page = page; + // if it was auto size, resize it + if ($(this.box).data('auto-size') === true) $(this.box).height(0); + this.refresh(); + }, + + generateHTML: function () { + var pages = []; // array for each page + for (var f in this.fields) { + var html = ''; + var field = this.fields[f]; + if (typeof field.html == 'undefined') field.html = {}; + field.html = $.extend(true, { caption: '', span: 6, attr: '', text: '', page: 0 }, field.html); + if (field.html.caption == '') field.html.caption = field.name; + var input = ''; + if (field.type == 'list') input = ''; + if (field.type == 'checkbox') input = ''; + if (field.type == 'textarea') input = ''; + html += '\n
      '+ field.html.caption +':
      '+ + '\n
      '+ + input + field.html.text + + '
      '; + if (typeof pages[field.html.page] == 'undefined') pages[field.html.page] = '
      '; + pages[field.html.page] += html; + } + for (var p in pages) pages[p] += '\n
      '; + // buttons if any + var buttons = ''; + if (!$.isEmptyObject(this.actions)) { + buttons += '\n
      '; + for (var a in this.actions) { + buttons += '\n '; + } + buttons += '\n
      '; + } + return pages.join('') + buttons; + }, + + action: function (action, event) { + // event before + var eventData = this.trigger({ phase: 'before', target: action, type: 'action', originalEvent: event }); + if (eventData.isCancelled === true) return false; + // default actions + if (typeof (this.actions[action]) == 'function') { + this.actions[action].call(this, event); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + }, + + resize: function () { + var obj = this; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'resize' }); + if (eventData.isCancelled === true) return false; + // default behaviour + var main = $(this.box).find('> div'); + var header = $(this.box).find('> div .w2ui-form-header'); + var toolbar = $(this.box).find('> div .w2ui-form-toolbar'); + var tabs = $(this.box).find('> div .w2ui-form-tabs'); + var page = $(this.box).find('> div .w2ui-page'); + var cpage = $(this.box).find('> div .w2ui-page.page-'+ this.page); + var dpage = $(this.box).find('> div .w2ui-page.page-'+ this.page + ' > div'); + var buttons = $(this.box).find('> div .w2ui-buttons'); + // if no height, calculate it + resizeElements(); + if (parseInt($(this.box).height()) == 0 || $(this.box).data('auto-size') === true) { + $(this.box).height( + (header.length > 0 ? w2utils.getSize(header, 'height') : 0) + + (this.tabs.tabs.length > 0 ? w2utils.getSize(tabs, 'height') : 0) + + (this.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') : 0) + + (page.length > 0 ? w2utils.getSize(dpage, 'height') + w2utils.getSize(cpage, '+height') + 12 : 0) + // why 12 ??? + (buttons.length > 0 ? w2utils.getSize(buttons, 'height') : 0) + ); + $(this.box).data('auto-size', true); + } + resizeElements(); + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + + function resizeElements() { + // resize elements + main.width($(obj.box).width()).height($(obj.box).height()); + toolbar.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0)); + tabs.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0) + + (obj.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') : 0)); + page.css('top', (obj.header != '' ? w2utils.getSize(header, 'height') : 0) + + (obj.toolbar.items.length > 0 ? w2utils.getSize(toolbar, 'height') + 5 : 0) + + (obj.tabs.tabs.length > 0 ? w2utils.getSize(tabs, 'height') + 5 : 0)); + page.css('bottom', (buttons.length > 0 ? w2utils.getSize(buttons, 'height') : 0)); + } + }, + + refresh: function () { + var obj = this; + if (!this.box) return; + if (!this.isGenerated || typeof $(this.box).html() == 'undefined') return; + // update what page field belongs + $(this.box).find('input, textarea, select').each(function (index, el) { + var name = (typeof $(el).attr('name') != 'undefined' ? $(el).attr('name') : $(el).attr('id')); + var field = obj.get(name); + if (field) { + // find page + var div = $(el).parents('.w2ui-page'); + if (div.length > 0) { + for (var i = 0; i < 100; i++) { + if (div.hasClass('page-'+i)) { field.page = i; break; } + } + } + } + }); + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'refresh', page: this.page }) + if (eventData.isCancelled === true) return false; + // default action + $(this.box).find('.w2ui-page').hide(); + $(this.box).find('.w2ui-page.page-' + this.page).show(); + $(this.box).find('.w2ui-form-header').html(this.header); + // refresh tabs if needed + if (typeof this.tabs == 'object' && this.tabs.tabs.length > 0) { + $('#form_'+ this.name +'_tabs').show(); + this.tabs.active = this.tabs.tabs[this.page].id; + this.tabs.refresh(); + } else { + $('#form_'+ this.name +'_tabs').hide(); + } + // refresh tabs if needed + if (typeof this.toolbar == 'object' && this.toolbar.items.length > 0) { + $('#form_'+ this.name +'_toolbar').show(); + this.toolbar.refresh(); + } else { + $('#form_'+ this.name +'_toolbar').hide(); + } + // refresh values of all fields + for (var f in this.fields) { + var field = this.fields[f]; + field.el = $(this.box).find('[name="'+ String(field.name).replace(/\\/g, '\\\\') +'"]')[0]; + if (typeof field.el == 'undefined') { + console.log('ERROR: Cannot associate field "'+ field.name + '" with html control. Make sure html control exists with the same name.'); + //return; + } + if (field.el) field.el.id = field.name; + $(field.el).off('change').on('change', function () { + var value_new = this.value; + var value_previous = obj.record[this.name] ? obj.record[this.name] : ''; + var field = obj.get(this.name); + if ((field.type == 'enum' || field.type == 'upload') && $(this).data('selected')) { + var new_arr = $(this).data('selected'); + var cur_arr = obj.record[this.name]; + var value_new = []; + var value_previous = []; + if ($.isArray(new_arr)) for (var i in new_arr) value_new[i] = $.extend(true, {}, new_arr[i]); // clone array + if ($.isArray(cur_arr)) for (var i in cur_arr) value_previous[i] = $.extend(true, {}, cur_arr[i]); // clone array + } + // event before + var eventData = obj.trigger({ phase: 'before', target: this.name, type: 'change', value_new: value_new, value_previous: value_previous }); + if (eventData.isCancelled === true) { + $(this).val(obj.record[this.name]); // return previous value + return false; + } + // default action + var val = this.value; + if (this.type == 'checkbox') val = this.checked ? true : false; + if (this.type == 'radio') val = this.checked ? true : false; + if (field.type == 'enum') val = value_new; + if (field.type == 'upload') val = value_new; + obj.record[this.name] = val; + // event after + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + if (field.required) { + $(field.el).parent().addClass('w2ui-required'); + } else { + $(field.el).parent().removeClass('w2ui-required'); + } + } + // attach actions on buttons + $(this.box).find('button, input[type=button]').each(function (index, el) { + $(el).off('click').on('click', function (event) { + var action = this.value; + if (this.name) action = this.name; + if (this.id) action = this.id; + obj.action(action, event); + }); + }); + // init controls with record + for (var f in this.fields) { + var field = this.fields[f]; + var value = (typeof this.record[field.name] != 'undefined' ? this.record[field.name] : ''); + if (!field.el) continue; + switch (String(field.type).toLowerCase()) { + case 'email': + case 'text': + case 'textarea': + field.el.value = value; + break; + case 'date': + if (!field.options) field.options = {}; + if (!field.options.format) field.options.format = w2utils.settings.date_format; + field.el.value = value; + this.record[field.name] = value; + $(field.el).w2field($.extend({}, field.options, { type: 'date' })); + break; + case 'int': + field.el.value = value; + $(field.el).w2field('int'); + break; + case 'float': + field.el.value = value; + $(field.el).w2field('float'); + break; + case 'money': + field.el.value = value; + $(field.el).w2field('money'); + break; + case 'hex': + field.el.value = value; + $(field.el).w2field('hex'); + break; + case 'alphanumeric': + field.el.value = value; + $(field.el).w2field('alphaNumeric'); + break; + case 'checkbox': + if (this.record[field.name] == true || this.record[field.name] == 1 || this.record[field.name] == 't') { + $(field.el).prop('checked', true); + } else { + $(field.el).prop('checked', false); + } + break; + case 'password': + // hide passwords + field.el.value = value; + break; + case 'select': + case 'list': + $(field.el).w2field($.extend({}, field.options, { type: 'list', value: value })); + break; + case 'enum': + if (typeof field.options == 'undefined' || (typeof field.options.url == 'undefined' && typeof field.options.items == 'undefined')) { + console.log("ERROR: (w2form."+ obj.name +") the field "+ field.name +" defined as enum but not field.options.url or field.options.items provided."); + break; + } + // normalize value + this.record[field.name] = w2obj.field.cleanItems(value); + value = this.record[field.name]; + $(field.el).w2field( $.extend({}, field.options, { type: 'enum', selected: value }) ); + break; + case 'upload': + $(field.el).w2field($.extend({}, field.options, { type: 'upload', selected: value })); + break; + default: + console.log('ERROR: field type "'+ field.type +'" is not recognized.'); + break; + } + } + // wrap pages in div + var tmp = $(this.box).find('.w2ui-page'); + for (var i = 0; i < tmp.length; i++) { + if ($(tmp[i]).find('> *').length > 1) $(tmp[i]).wrapInner('
      '); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + this.resize(); + }, + + render: function (box) { + var obj = this; + if (typeof box == 'object') { + // remove from previous box + if ($(this.box).find('#form_'+ this.name +'_tabs').length > 0) { + $(this.box).removeAttr('name') + .removeClass('w2ui-reset w2ui-form') + .html(''); + } + this.box = box; + } + if (!this.isGenerated) return; + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'render', box: (typeof box != 'undefined' ? box : this.box) }); + if (eventData.isCancelled === true) return false; + // default actions + var html = '
      ' + + (this.header != '' ? '
      ' + this.header + '
      ' : '') + + '
      ' + + '
      ' + + this.formHTML + + '
      '; + $(this.box).attr('name', this.name) + .addClass('w2ui-reset w2ui-form') + .html(html); + if ($(this.box).length > 0) $(this.box)[0].style.cssText += this.style; + + // init toolbar regardless it is defined or not + if (typeof this.toolbar['render'] == 'undefined') { + this.toolbar = $().w2toolbar($.extend({}, this.toolbar, { name: this.name +'_toolbar', owner: this })); + this.toolbar.on('click', function (event) { + var eventData = obj.trigger({ phase: 'before', type: 'toolbar', target: event.target, originalEvent: event }); + if (eventData.isCancelled === true) return false; + // no default action + obj.trigger($.extend(eventData, { phase: 'after' })); + }); + } + if (typeof this.toolbar == 'object' && typeof this.toolbar.render == 'function') { + this.toolbar.render($('#form_'+ this.name +'_toolbar')[0]); + } + // init tabs regardless it is defined or not + if (typeof this.tabs['render'] == 'undefined') { + this.tabs = $().w2tabs($.extend({}, this.tabs, { name: this.name +'_tabs', owner: this })); + this.tabs.on('click', function (event) { + obj.goto(this.get(event.target, true)); + }); + } + if (typeof this.tabs == 'object' && typeof this.tabs.render == 'function') { + this.tabs.render($('#form_'+ this.name +'_tabs')[0]); + } + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + // after render actions + this.resize(); + var url = (typeof this.url != 'object' ? this.url : this.url.get); + if (url && this.recid != 0) { + this.request(); + } else { + this.refresh(); + } + // attach to resize event + if ($('.w2ui-layout').length == 0) { // if there is layout, it will send a resize event + this.tmp_resize = function (event) { w2ui[obj.name].resize(); } + $(window).off('resize', 'body').on('resize', 'body', this.tmp_resize); + } + setTimeout(function () { obj.resize(); obj.refresh(); }, 150); // need timer because resize is on timer + // focus on load + function focusEl() { + var inputs = $(obj.box).find('input, select, textarea'); + if (inputs.length > obj.focus) inputs[obj.focus].focus(); + } + if (this.focus >= 0) setTimeout(focusEl, 500); // need timeout to allow form to render + }, + + destroy: function () { + // event before + var eventData = this.trigger({ phase: 'before', target: this.name, type: 'destroy' }); + if (eventData.isCancelled === true) return false; + // clean up + if (typeof this.toolbar == 'object' && this.toolbar.destroy) this.toolbar.destroy(); + if (typeof this.tabs == 'object' && this.tabs.destroy) this.tabs.destroy(); + if ($(this.box).find('#form_'+ this.name +'_tabs').length > 0) { + $(this.box) + .removeAttr('name') + .removeClass('w2ui-reset w2ui-form') + .html(''); + } + delete w2ui[this.name]; + // event after + this.trigger($.extend(eventData, { phase: 'after' })); + $(window).off('resize', 'body') + } + } + + $.extend(w2form.prototype, w2utils.event); + w2obj.form = w2form; +})(jQuery); diff --git a/js/w2ui.min.js b/js/w2ui.min.js new file mode 100644 index 0000000..2135cb1 --- /dev/null +++ b/js/w2ui.min.js @@ -0,0 +1 @@ +var w2ui=w2ui||{},w2obj=w2obj||{},w2utils=function(n){function nt(n){var t=/^[-]?[0-9]+$/;return t.test(n)}function tt(n){var t=new RegExp(w2utils.settings.float);return t.test(n)}function d(n){var t=new RegExp(w2utils.settings.currency);return t.test(n)}function w(n){var t=/^[a-fA-F0-9]+$/;return t.test(n)}function b(n){var t=/^[a-zA-Z0-9_-]+$/;return t.test(n)}function k(n){var t=/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return t.test(n)}function et(n,t,i){if(!n)return!1;t||(t=w2utils.settings.date_format);var r=n.replace(/-/g,"/").replace(/\./g,"/").toLowerCase().split("/"),o=t.replace(/-/g,"/").replace(/\./g,"/").toLowerCase(),s="Invalid Date",u,f,e;return(o=="mm/dd/yyyy"&&(u=r[0],f=r[1],e=r[2]),o=="m/d/yyyy"&&(u=r[0],f=r[1],e=r[2]),o=="dd/mm/yyyy"&&(u=r[1],f=r[0],e=r[2]),o=="d/m/yyyy"&&(u=r[1],f=r[0],e=r[2]),o=="yyyy/dd/mm"&&(u=r[2],f=r[1],e=r[0]),o=="yyyy/d/m"&&(u=r[2],f=r[1],e=r[0]),o=="yyyy/mm/dd"&&(u=r[1],f=r[2],e=r[0]),o=="yyyy/m/d"&&(u=r[1],f=r[2],e=r[0]),s=new Date(u+"/"+f+"/"+e),typeof u=="undefined")?!1:s=="Invalid Date"?!1:s.getMonth()+1!=u||s.getDate()!=f||s.getFullYear()!=e?!1:i===!0?s:!0}function ot(t){var r,i;return String(t)=="undefined"?!1:(t=t.toUpperCase(),r=t.indexOf("PM")>=0||t.indexOf("AM")>=0?12:23,t=n.trim(t.replace("AM","")),t=n.trim(t.replace("PM","")),i=t.split(":"),i.length!=2)?!1:i[0]==""||parseInt(i[0])<0||parseInt(i[0])>r||!this.isInt(i[0])?!1:i[1]==""||parseInt(i[1])<0||parseInt(i[1])>59||!this.isInt(i[1])?!1:!0}function st(n){var f,i;if(n==""||typeof n=="undefined"||n==null||(w2utils.isInt(n)&&(n=Number(n)),f=new Date(n),w2utils.isInt(n)&&(f=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(f=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(f=new Date(i[2],Number(i[0])-1,i[1])),f=="Invalid Time"))return"";var e=new Date,t=(e.getTime()-f.getTime())/1e3,r="",u="";return t<60?(r=Math.floor(t),u="sec",t<0&&(r=0,u="sec")):t<3600?(r=Math.floor(t/60),u="min"):t<86400?(r=Math.floor(t/3600),u="hour"):t<2592e3?(r=Math.floor(t/86400),u="day"):t<31104e3?(r=Math.floor(t/259200)/10,u="month"):t>=31104e3&&(r=Math.floor(t/3110400)/10,u="year"),r+" "+u+(r>1?"s":"")}function ft(n){var o=w2utils.settings.shortmonths,t,i,f,r;if(n==""||typeof n=="undefined"||n==null||(w2utils.isInt(n)&&(n=Number(n)),t=new Date(n),w2utils.isInt(n)&&(t=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(t=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(t=new Date(i[2],Number(i[0])-1,i[1])),t=="Invalid Date"))return"";f=new Date,r=new Date,r.setTime(r.getTime()-864e5);var u=o[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear(),h=o[f.getMonth()]+" "+f.getDate()+", "+f.getFullYear(),c=o[r.getMonth()]+" "+r.getDate()+", "+r.getFullYear(),l=t.getHours()-(t.getHours()>12?12:0)+":"+(t.getMinutes()<10?"0":"")+t.getMinutes()+" "+(t.getHours()>=12?"pm":"am"),s=t.getHours()-(t.getHours()>12?12:0)+":"+(t.getMinutes()<10?"0":"")+t.getMinutes()+":"+(t.getSeconds()<10?"0":"")+t.getSeconds()+" "+(t.getHours()>=12?"pm":"am"),e=u;return u==h&&(e=l),u==c&&(e=w2utils.lang("Yesterday")),''+e+""}function it(n){if(!w2utils.isFloat(n)||n=="")return"";if(n=parseFloat(n),n==0)return 0;var i=["Bt","KB","MB","GB","TB"],t=parseInt(Math.floor(Math.log(n)/Math.log(1024)));return(Math.floor(n/Math.pow(1024,t)*10)/10).toFixed(t==0?0:1)+" "+i[t]}function rt(n){var t="";return(w2utils.isFloat(n)||w2utils.isInt(n)||w2utils.isMoney(n))&&(t=String(n).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")),t}function ut(n,t){var s=w2utils.settings.shortmonths,o=w2utils.settings.fullmonths,r,i;if((typeof t=="undefined"&&(t=this.settings.date_format),typeof n=="undefined"||n==""||n==null)||(r=new Date(n),w2utils.isInt(n)&&(r=new Date(Number(n))),i=String(n).split("-"),i.length==3&&(r=new Date(i[0],Number(i[1])-1,i[2])),i=String(n).split("/"),i.length==3&&(r=new Date(i[2],Number(i[0])-1,i[1])),r=="Invalid Date"))return"";var f=r.getFullYear(),u=r.getMonth(),e=r.getDate();return t.toLowerCase().replace("month",w2utils.settings.fullmonths[u]).replace("mon",w2utils.settings.shortmonths[u]).replace(/yyyy/g,f).replace(/yyy/g,f).replace(/yy/g,String(f).substr(2)).replace(/(^|[^a-z$])y/g,"$1"+f).replace(/mm/g,(u+1<10?"0":"")+(u+1)).replace(/dd/g,(e<10?"0":"")+e).replace(/(^|[^a-z$])m/g,"$1"+(u+1)).replace(/(^|[^a-z$])d/g,"$1"+e)}function e(n,t){var h=w2utils.settings.shortmonths,s=w2utils.settings.fullmonths,i;if((typeof t=="undefined"&&(t=this.settings.time_format),typeof n=="undefined"||n==""||n==null)||(i=new Date(n),w2utils.isInt(n)&&(i=new Date(Number(n))),i=="Invalid Date"))return"";var e="am",u=i.getHours(),o=i.getHours(),r=i.getMinutes(),f=i.getSeconds();return r<10&&(r="0"+r),f<10&&(f="0"+f),(t.indexOf("am")!=-1||t.indexOf("pm")!=-1)&&(u>=12&&(e="pm"),u>12&&(u=u-12)),t.toLowerCase().replace("am",e).replace("pm",e).replace("hh",u).replace("h24",o).replace("mm",r).replace("mi",r).replace("ss",f).replace(/(^|[^a-z$])h/g,"$1"+u).replace(/(^|[^a-z$])m/g,"$1"+r).replace(/(^|[^a-z$])s/g,"$1"+f)}function o(n,t){var i;return i=typeof t!="string"?[this.settings.date_format,this.settings.time_format]:t.split("|"),this.formatDate(n,i[0])+" "+this.formatTime(n,i[1])}function s(t){if(t==null)return t;switch(typeof t){case"string":t=n.trim(String(t).replace(/(<([^>]+)>)/ig,""));break;case"object":for(var i in t)t[i]=this.stripTags(t[i])}return t}function f(n){if(n==null)return n;switch(typeof n){case"string":n=String(n).replace(/&/g,"&").replace(/>/g,">").replace(/\|\/? {}\\])/g,"\\$1")}function r(n){function l(n){for(var n=String(n).replace(/\r\n/g,"\n"),i="",t,r=0;r127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i}var e="",s,f,u,h,c,o,r,i=0,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=l(n);i>2,c=(s&3)<<4|f>>4,o=(f&15)<<2|u>>6,r=u&63,isNaN(f)?o=r=64:isNaN(u)&&(r=64),e=e+t.charAt(h)+t.charAt(c)+t.charAt(o)+t.charAt(r);return e}function u(n){function l(n){for(var u="",t=0,i=0,f=0,r=0;t191&&i<224?(r=n.charCodeAt(t+1),u+=String.fromCharCode((i&31)<<6|r&63),t+=2):(r=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),u+=String.fromCharCode((i&15)<<12|(r&63)<<6|c3&63),t+=3);return u}var t="",s,o,c,h,f,r,e,i=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,o=(f&15)<<4|r>>2,c=(r&3)<<6|e,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(o)),e!=64&&(t=t+String.fromCharCode(c));return t=l(t)}function v(t,i,r,u){function f(n,t,i){var r=!!window.webkitURL;return r||typeof i=="undefined"||(t=i),";"+n+": "+t+"; -webkit-"+n+": "+t+"; -moz-"+n+": "+t+"; -ms-"+n+": "+t+"; -o-"+n+": "+t+";"}var o=n(t).width(),s=n(t).height(),e=.5;if(!t||!i){console.log("ERROR: Cannot do transition when one of the divs is null");return}t.parentNode.style.cssText+=f("perspective","700px")+"; overflow: hidden;",t.style.cssText+="; position: absolute; z-index: 1019; "+f("backface-visibility","hidden"),i.style.cssText+="; position: absolute; z-index: 1020; "+f("backface-visibility","hidden");switch(r){case"slide-left":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d("+o+"px, 0, 0)","translate("+o+"px, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+";"+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+";"+f("transform","translate3d(-"+o+"px, 0, 0)","translate(-"+o+"px, 0)")},1);break;case"slide-right":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(-"+o+"px, 0, 0)","translate(-"+o+"px, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0px, 0, 0)","translate(0px, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d("+o+"px, 0, 0)","translate("+o+"px, 0)")},1);break;case"slide-down":t.style.cssText+="overflow: hidden; z-index: 1; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; z-index: 0; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, "+s+"px, 0)","translate(0, "+s+"px)")},1);break;case"slide-up":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, "+s+"px, 0)","translate(0, "+s+"px)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")},1);break;case"flip-left":t.style.cssText+="overflow: hidden; "+f("-transform","rotateY(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateY(-180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(180deg)")},1);break;case"flip-right":t.style.cssText+="overflow: hidden; "+f("transform","rotateY(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateY(180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateY(-180deg)")},1);break;case"flip-down":t.style.cssText+="overflow: hidden; "+f("transform","rotateX(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateX(180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(-180deg)")},1);break;case"flip-up":t.style.cssText+="overflow: hidden; "+f("transform","rotateX(0deg)"),i.style.cssText+="overflow: hidden; "+f("transform","rotateX(-180deg)"),n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(0deg)"),t.style.cssText+=f("transition",e+"s")+"; "+f("transform","rotateX(180deg)")},1);break;case"pop-in":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; "+f("transform","scale(.8)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; "+f("transform","scale(1)")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")+";"},1);break;case"pop-out":t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; "+f("transform","scale(1)")+"; opacity: 1;",i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")+"; "+f("transform","scale(1.7)")+"; opacity: 0;"},1);break;default:t.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)"),i.style.cssText+="overflow: hidden; "+f("transform","translate3d(0, 0, 0)","translate(0, 0)")+"; opacity: 0;",n(i).show(),window.setTimeout(function(){i.style.cssText+=f("transition",e+"s")+"; opacity: 1;",t.style.cssText+=f("transition",e+"s")},1)}setTimeout(function(){r=="slide-down"&&(n(t).css("z-index","1019"),n(i).css("z-index","1020")),i&&n(i).css({opacity:"1","-webkit-transition":"","-moz-transition":"","-ms-transition":"","-o-transition":"","-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"","-webkit-backface-visibility":"","-moz-backface-visibility":"","-ms-backface-visibility":"","-o-backface-visibility":""}),t&&(n(t).css({opacity:"1","-webkit-transition":"","-moz-transition":"","-ms-transition":"","-o-transition":"","-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"","-webkit-backface-visibility":"","-moz-backface-visibility":"","-ms-backface-visibility":"","-o-backface-visibility":""}),t.parentNode&&n(t.parentNode).css({"-webkit-perspective":"","-moz-perspective":"","-ms-perspective":"","-o-perspective":""})),typeof u=="function"&&u()},e*1e3)}function y(t,i,r){i||i==0||(i=""),w2utils.unlock(t),n(t).find(">:first-child").before('
      '),setTimeout(function(){var f=n(t).find(".w2ui-lock"),u=n(t).find(".w2ui-lock-msg");f.data("old_opacity",f.css("opacity")).css("opacity","0").show(),u.data("old_opacity",u.css("opacity")).css("opacity","0").show(),setTimeout(function(){var f=n(t).find(".w2ui-lock"),u=n(t).find(".w2ui-lock-msg"),o=(n(t).width()-w2utils.getSize(u,"width"))/2,e=(n(t).height()*.9-w2utils.getSize(u,"height"))/2;f.css({opacity:f.data("old_opacity"),left:"0px",top:"0px",width:"100%",height:"100%"}),i||u.css({"background-color":"transparent",border:"0px"}),r===!0&&(i='
      "+i),u.html(i).css({opacity:u.data("old_opacity"),left:o+"px",top:e+"px"})},10)},10),n().w2tag()}function p(t){n(t).find(".w2ui-lock").remove(),n(t).find(".w2ui-lock-msg").remove()}function a(t,i){var f={left:parseInt(n(t).css("border-left-width"))||0,right:parseInt(n(t).css("border-right-width"))||0,top:parseInt(n(t).css("border-top-width"))||0,bottom:parseInt(n(t).css("border-bottom-width"))||0},u={left:parseInt(n(t).css("margin-left"))||0,right:parseInt(n(t).css("margin-right"))||0,top:parseInt(n(t).css("margin-top"))||0,bottom:parseInt(n(t).css("margin-bottom"))||0},r={left:parseInt(n(t).css("padding-left"))||0,right:parseInt(n(t).css("padding-right"))||0,top:parseInt(n(t).css("padding-top"))||0,bottom:parseInt(n(t).css("padding-bottom"))||0};switch(i){case"top":return f.top+u.top+r.top;case"bottom":return f.bottom+u.bottom+r.bottom;case"left":return f.left+u.left+r.left;case"right":return f.right+u.right+r.right;case"width":return f.left+f.right+u.left+u.right+r.left+r.right+parseInt(n(t).width());case"height":return f.top+f.bottom+u.top+u.bottom+r.top+r.bottom+parseInt(n(t).height());case"+width":return f.left+f.right+u.left+u.right+r.left+r.right;case"+height":return f.top+f.bottom+u.top+u.bottom+r.top+r.bottom}return 0}function h(n){var t=this.settings.phrases[n];return typeof t=="undefined"?n:t}function c(t){t||(t="en-us"),t.length==5&&(t="locale/"+t+".json"),n.ajax({url:t,type:"GET",dataType:"JSON",async:!1,cache:!1,success:function(t){w2utils.settings=n.extend(!0,w2utils.settings,t)},error:function(){console.log("ERROR: Cannot load locale "+t)}})}function l(){if(t.scrollBarSize)return t.scrollBarSize;var i='
      \t
      1
      ';return n("body").append(i),t.scrollBarSize=100-n("#_scrollbar_width > div").width(),n("#_scrollbar_width").remove(),String(navigator.userAgent).indexOf("MSIE")>=0&&(t.scrollBarSize=t.scrollBarSize/2),t.scrollBarSize}var t={};return{settings:{locale:"en-us",date_format:"m/d/yyyy",date_display:"Mon d, yyyy",time_format:"hh:mi pm",currency:"^[$€£¥]?[-]?[0-9]*[.]?[0-9]+$",currencySymbol:"$",float:"^[-]?[0-9]*[.]?[0-9]+$",shortmonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullmonths:["January","February","March","April","May","June","July","August","September","October","November","December"],shortdays:["M","T","W","T","F","S","S"],fulldays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],RESTfull:!1,phrases:{}},isInt:nt,isFloat:tt,isMoney:d,isHex:w,isAlphaNumeric:b,isEmail:k,isDate:et,isTime:ot,age:st,date:ft,size:it,formatNumber:rt,formatDate:ut,formatTime:e,formatDateTime:o,stripTags:s,encodeTags:f,escapeId:i,base64encode:r,base64decode:u,transition:v,lock:y,unlock:p,lang:h,locale:c,getSize:a,scrollBarSize:l}}(jQuery),w2popup,w2alert,w2confirm;w2utils.event={on:function(n,t){if(jQuery.isPlainObject(n)||(n={type:n}),n=jQuery.extend({type:null,execute:"before",target:null,onComplete:null},n),typeof n.type=="undefined"){console.log("ERROR: You must specify event type when calling .on() method of "+this.name);return}if(typeof t=="undefined"){console.log("ERROR: You must specify event handler function when calling .on() method of "+this.name);return}this.handlers.push({event:n,handler:t})},off:function(n,t){var r,u,i;if(jQuery.isPlainObject(n)||(n={type:n}),n=jQuery.extend({},{type:null,execute:"before",target:null,onComplete:null},n),typeof n.type=="undefined"){console.log("ERROR: You must specify event type when calling .off() method of "+this.name);return}typeof t=="undefined"&&(t=null),r=[];for(u in this.handlers)i=this.handlers[u],(i.event.type==n.type||n.type=="*")&&(i.event.target==n.target||n.target==null)&&(i.handler==t||t==null)||r.push(i);this.handlers=r},trigger:function(n){var n=jQuery.extend({type:null,phase:"before",target:null,isStopped:!1,isCancelled:!1},n,{preventDefault:function(){this.isCancelled=!0},stopPropagation:function(){this.isStopped=!0}}),e,t,r,i,f;for(typeof n.target=="undefined"&&(n.target=null),e=this.handlers.length-1;e>=0;e--)if(t=this.handlers[e],(t.event.type==n.type||t.event.type=="*")&&(t.event.target==n.target||t.event.target==null)&&(t.event.execute==n.phase||t.event.execute=="*"||t.event.phase=="*")&&(n=jQuery.extend({},t.event,n),r=[],i=RegExp(/\((.*?)\)/).exec(t.handler),i&&(r=i[1].split(/\s*,\s*/)),r.length==2?t.handler.call(this,n.target,n):t.handler.call(this,n),n.isStopped===!0||n.stop===!0))return n;if(f="on"+n.type.substr(0,1).toUpperCase()+n.type.substr(1),n.phase=="before"&&typeof this[f]=="function"){var u=this[f],r=[],i=RegExp(/\((.*?)\)/).exec(u);if(i&&(r=i[1].split(/\s*,\s*/)),r.length==2?u.call(this,n.target,n):u.call(this,n),n.isStopped===!0||n.stop===!0)return n}if(typeof n.object!="undefined"&&n.object!=null&&n.phase=="before"&&typeof n.object[f]=="function"){var u=n.object[f],r=[],i=RegExp(/\((.*?)\)/).exec(u);if(i&&(r=i[1].split(/\s*,\s*/)),r.length==2?u.call(this,n.target,n):u.call(this,n),n.isStopped===!0||n.stop===!0)return n}return n.phase=="after"&&n.onComplete!=null&&n.onComplete.call(this,n),n}},w2utils.keyboard=function(n){function f(){jQuery(document).on("keydown",e);jQuery(document).on("mousedown",o)}function e(n){var i=n.target.tagName;jQuery.inArray(i,["INPUT","SELECT","TEXTAREA"])==-1&&jQuery(n.target).prop("contenteditable")!="true"&&t&&w2ui[t]&&typeof w2ui[t].keydown=="function"&&w2ui[t].keydown.call(w2ui[t],n)}function o(n){var r=n.target.tagName,i=jQuery(n.target).parents(".w2ui-reset");i.length>0&&(t=i.attr("name"))}function i(n){if(typeof n=="undefined")return t;t=n}function r(){t=null}function u(){}var t=null;return n.active=i,n.clear=r,n.register=u,f(),n}({}),function(n){n.fn.w2render=function(t){n(this).length>0&&(typeof t=="string"&&w2ui[t]&&w2ui[t].render(n(this)[0]),typeof t=="object"&&t.render(n(this)[0]))},n.fn.w2destroy=function(n){!n&&this.length>0&&(n=this.attr("name")),typeof n=="string"&&w2ui[n]&&w2ui[n].destroy(),typeof n=="object"&&n.destroy()},n.fn.w2marker=function(t){return t==""||typeof t=="undefined"?n(this).each(function(n,t){t.innerHTML=t.innerHTML.replace(/\(.*)\<\/span\>/ig,"$1")}):n(this).each(function(n,i){var f,r,u;typeof t=="string"&&(t=[t]),i.innerHTML=i.innerHTML.replace(/\(.*)\<\/span\>/ig,"$1");for(f in t)r=t[f],typeof r!="string"&&(r=String(r)),r=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").replace(/&/g,"&").replace(//g,"<"),u=new RegExp(r+"(?!([^<]+)?>)","gi"),i.innerHTML=i.innerHTML.replace(u,function(n){return''+n+""})})},n.fn.w2tag=function(t,i){if(n.isPlainObject(i)||(i={}),n.isPlainObject(i.css)||(i.css={}),typeof i["class"]=="undefined"&&(i["class"]=""),n(this).length==0){n(".w2ui-tag").each(function(t,i){var r=n(i).data("options");typeof r=="undefined"&&(r={}),n(n(i).data("taged-el")).removeClass(r["class"]),clearInterval(n(i).data("timer")),n(i).remove()});return}return n(this).each(function(r,u){var h=u.id,f=w2utils.escapeId(u.id),s,o;if(t==""||t==null||typeof t=="undefined")n("#w2ui-tag-"+f).css("opacity",0),setTimeout(function(){clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove()},300);else{clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove(),n("body").append('
      0?"w2ui-tag-popup":"")+'" \tstyle="">
      '),s=setInterval(function(){if(n(u).length==0||n(u).offset().left==0&&n(u).offset().top==0){clearInterval(n("#w2ui-tag-"+f).data("timer")),e();return}n("#w2ui-tag-"+f).data("position")!=n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top&&n("#w2ui-tag-"+f).css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s",left:n(u).offset().left+u.offsetWidth+"px",top:n(u).offset().top+"px"}).data("position",n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top)},100),setTimeout(function(){n(u).offset()&&(n("#w2ui-tag-"+f).css({opacity:"1",left:n(u).offset().left+u.offsetWidth+"px",top:n(u).offset().top+"px"}).html('
      '+t+"
      ").data("text",t).data("taged-el",u).data("options",i).data("position",n(u).offset().left+u.offsetWidth+"x"+n(u).offset().top).data("timer",s),n(u).off("keypress",e).on("keypress",e).off("change",e).on("change",e).css(i.css).addClass(i["class"]),typeof i.onShow=="function"&&i.onShow())},1),o="",n(u).length>0&&(o=n(u)[0].style.cssText);function e(){n("#w2ui-tag-"+f).length<=0||(clearInterval(n("#w2ui-tag-"+f).data("timer")),n("#w2ui-tag-"+f).remove(),n(u).off("keypress",e).removeClass(i["class"]),n(u).length>0&&(n(u)[0].style.cssText=o),typeof i.onHide=="function"&&i.onHide())}}})},n.fn.w2overlay=function(t,i){function e(){var t;(typeof i.onHide=="function"&&(t=i.onHide()),t!==!1)&&(n("#w2ui-overlay").remove(),n(document).off("click",e))}function o(){n(document).on("click",e);if(n("#w2ui-overlay > div").length>0){var u=n("#w2ui-overlay > div").height(),r=n("#w2ui-overlay> div").width(),t=window.innerHeight-n("#w2ui-overlay > div").offset().top-7;u>t&&n("#w2ui-overlay> div").height(t).width(r+w2utils.scrollBarSize()).css({"overflow-y":"auto"}),r=n("#w2ui-overlay> div").width(),t=window.innerWidth-n("#w2ui-overlay > div").offset().left-7,r>t&&n("#w2ui-overlay> div").width(t).css({"overflow-x":"auto"}),typeof i.onShow=="function"&&i.onShow()}}var u,f,r;if(n.isPlainObject(i)||(i={}),n.isPlainObject(i.css)||(i.css={}),this.length==0||t==""||typeof t=="undefined")return e(),n(this);n("#w2ui-overlay").length>0&&n(document).click(),n("body").append('
      0?"w2ui-overlay-popup":"")+'">\t
      '),u=this,r=n("#w2ui-overlay div"),r.css(i.css).html(t),typeof i["class"]!="undefined"&&r.addClass(i["class"]),typeof i.top=="undefined"&&(i.top=0),typeof i.left=="undefined"&&(i.left=0),typeof i.width=="undefined"&&(i.width=100),typeof i.height=="undefined"&&(i.height=0),f=r.css("background-color"),r=n("#w2ui-overlay"),typeof f!="undefined"&&f!="rgba(0, 0, 0, 0)"&&f!="transparent"&&r.css("background-color",f);r.css({display:"none",left:n(u).offset().left+i.left+"px",top:n(u).offset().top+w2utils.getSize(n(u),"height")+3+i.top+"px","min-width":i.width?i.width:"auto","min-height":i.height?i.height:"auto"}).fadeIn("fast").data("position",n(u).offset().left+"x"+(n(u).offset().top+u.offsetHeight)).on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0});return setTimeout(o,0),n(this)},n.fn.w2menu=function(t,i){function r(){for(var f='',n,i,u,r=0;r ",n.img&&(u=''),n.icon&&(u=''),f+=""+u+"\t";return f+="
      "+n.text+"
      "}return(typeof i.select=="undefined"&&typeof i.onSelect=="function"&&(i.select=i.onSelect),typeof i.select!="function")?(console.log("ERROR: options.select is required to be a function, not "+typeof i.select+" in $().w2menu(menu, options)"),n(this)):n.isArray(t)?(n.fn.w2menuHandler=function(n,r){i.select(t[r],n,r)},n(this).w2overlay(r(),i)):(console.log("ERROR: first parameter should be an array of objects or strings in $().w2menu(menu, options)"),n(this))}}(jQuery),function($){var w2grid=function(n){this.name=null,this.box=null,this.header="",this.url="",this.columns=[],this.columnGroups=[],this.records=[],this.summary=[],this.searches=[],this.searchData=[],this.sortData=[],this.postData={},this.toolbar={},this.show={header:!1,toolbar:!1,footer:!1,columnHeaders:!0,lineNumbers:!1,expandColumn:!1,selectColumn:!1,emptyRecords:!0,toolbarReload:!0,toolbarColumns:!0,toolbarSearch:!0,toolbarAdd:!1,toolbarEdit:!1,toolbarDelete:!1,toolbarSave:!1,selectionBorder:!0,recordTitles:!0},this.autoLoad=!0,this.fixedBody=!0,this.recordHeight=24,this.keyboard=!0,this.selectType="row",this.multiSearch=!0,this.multiSelect=!0,this.multiSort=!0,this.markSearchResults=!0,this.total=0,this.buffered=0,this.limit=100,this.offset=0,this.style="",this.ranges=[],this.onAdd=null,this.onEdit=null,this.onRequest=null,this.onLoad=null,this.onDelete=null,this.onDeleted=null,this.onSave=null,this.onSaved=null,this.onSelect=null,this.onUnselect=null,this.onClick=null,this.onDblClick=null,this.onColumnClick=null,this.onColumnResize=null,this.onSort=null,this.onSearch=null,this.onChange=null,this.onExpand=null,this.onCollapse=null,this.onError=null,this.onKeydown=null,this.onToolbar=null,this.onColumnOnOff=null,this.onCopy=null,this.onPaste=null,this.onSelectionExtend=null,this.onEditField=null,this.onRender=null,this.onRefresh=null,this.onReload=null,this.onResize=null,this.onDestroy=null,this.last={field:"all",caption:w2utils.lang("All Fields"),logic:"OR",search:"",searchIds:[],multi:!1,scrollTop:0,scrollLeft:0,selected:[],sortData:null,sortCount:0,xhr:null,range_start:null,range_end:null,sel_ind:null,sel_col:null,sel_type:null},this.isIOS=navigator.userAgent.toLowerCase().indexOf("iphone")!=-1||navigator.userAgent.toLowerCase().indexOf("ipod")!=-1||navigator.userAgent.toLowerCase().indexOf("ipad")!=-1?!0:!1,$.extend(!0,this,w2obj.grid,n)};$.fn.w2grid=function(n){var i,u,a,r,e,o,s;if(typeof n!="object"&&n){if(w2ui[$(this).attr("name")])return s=w2ui[$(this).attr("name")],s[n].apply(s,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+n+" does not exist on jQuery.w2grid")}else{if(!n||typeof n.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2grid().');return}if(typeof w2ui[n.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+n.name+").");return}if(!w2utils.isAlphaNumeric(n.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}var h=n.columns,l=n.columnGroups,f=n.records,c=n.searches,y=n.searchData,v=n.sortData,w=n.postData,p=n.toolbar,t=new w2grid(n);$.extend(t,{postData:{},records:[],columns:[],searches:[],toolbar:{},sortData:[],searchData:[],handlers:[]}),t.onExpand!=null&&(t.show.expandColumn=!0),$.extend(!0,t.toolbar,p);for(i in h)t.columns[i]=$.extend(!0,{},h[i]);for(i in l)t.columnGroups[i]=$.extend(!0,{},l[i]);for(i in c)t.searches[i]=$.extend(!0,{},c[i]);for(i in y)t.searchData[i]=$.extend(!0,{},y[i]);for(i in v)t.sortData[i]=$.extend(!0,{},v[i]);t.postData=$.extend(!0,{},w);for(u in f){if(f[u].recid==null||typeof f[u].recid=="undefined"){console.log("ERROR: Cannot add records without recid. (obj: "+t.name+")");return}t.records[u]=$.extend(!0,{},f[u])}t.records.length>0&&(t.buffered=t.records.length);for(a in t.columns)(r=t.columns[a],typeof r.searchable!="undefined"&&t.getSearch(r.field)==null)&&(e=r.searchable,o="",r.searchable===!0&&(e="text",o='size="20"'),t.addSearch({field:r.field,caption:r.caption,type:e,attr:o}));return t.initToolbar(),$(this).length!=0&&t.render($(this)[0]),w2ui[t.name]=t,t}},w2grid.prototype={msgDelete:w2utils.lang("Are you sure you want to delete selected records?"),msgNotJSON:w2utils.lang("Returned data is not in valid JSON format."),msgRefresh:w2utils.lang("Refreshing..."),buttons:{reload:{type:"button",id:"reload",img:"icon-reload",hint:w2utils.lang("Reload data in the list")},columns:{type:"drop",id:"column-on-off",img:"icon-columns",hint:w2utils.lang("Show/hide columns"),arrow:!1,html:""},search:{type:"html",id:"search",html:'
      "},"search-go":{type:"check",id:"search-advanced",caption:w2utils.lang("Search..."),hint:w2utils.lang("Open Search Fields")},add:{type:"button",id:"add",caption:w2utils.lang("Add New"),hint:w2utils.lang("Add new record"),img:"icon-add"},edit:{type:"button",id:"edit",caption:w2utils.lang("Edit"),hint:w2utils.lang("Edit selected record"),img:"icon-edit",disabled:!0},"delete":{type:"button",id:"delete",caption:w2utils.lang("Delete"),hint:w2utils.lang("Delete selected records"),img:"icon-delete",disabled:!0},save:{type:"button",id:"save",caption:w2utils.lang("Save"),hint:w2utils.lang("Save changed records"),img:"icon-save"}},add:function(n){var i,t,r;$.isArray(n)||(n=[n]),i=0;for(t in n){if(n[t].recid==null||typeof n[t].recid=="undefined"){console.log("ERROR: Cannot add record without recid. (obj: "+this.name+")");continue}this.records.push(n[t]),i++}return this.buffered=this.records.length,r=typeof this.url!="object"?this.url:this.url.get,r||(this.localSort(),this.localSearch()),this.refresh(),i},find:function(n,t){var f,i,u,r,e;for((typeof n=="undefined"||n==null)&&(n={}),f=[],i=0;i0&&!o)for(f in this.last.searchIds)this.last.searchIds[f]==r&&(r=f);$(u).replaceWith(this.getRecordHTML(r,s))}}return!0},get:function(n,t){for(var i=0;i=0;n--)this.records[n].recid==arguments[t]&&(this.records.splice(n,1),r++);return i=typeof this.url!="object"?this.url:this.url.get,i||(this.buffered=this.records.length,this.localSort(),this.localSearch()),this.refresh(),r},addColumn:function(n,t){var r=0,i;arguments.length==1?(t=n,n=this.columns.length):(typeof n=="string"&&(n=this.getColumn(n,!0)),n===null&&(n=this.columns.length)),$.isArray(t)||(t=[t]);for(i in t)this.columns.splice(n,0,t[i]),n++,r++;return this.initColumnOnOff(),this.refresh(),r},removeColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&(this.columns.splice(n,1),i++);return this.initColumnOnOff(),this.refresh(),i},getColumn:function(n,t){for(var i=0;i=0;n--)this.columns[n].field==arguments[t]&&(this.columns[n].hidden=!this.columns[n].hidden,i++);return this.refresh(),i},showColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&this.columns[n].hidden!==!1&&(this.columns[n].hidden=!1,i++);return this.refresh(),i},hideColumn:function(){for(var i=0,n,t=0;t=0;n--)this.columns[n].field==arguments[t]&&this.columns[n].hidden!==!0&&(this.columns[n].hidden=!0,i++);return this.refresh(),i},addSearch:function(n,t){var r=0,i;arguments.length==1?(t=n,n=this.searches.length):(typeof n=="string"&&(n=this.getSearch(n,!0)),n===null&&(n=this.searches.length)),$.isArray(t)||(t=[t]);for(i in t)this.searches.splice(n,0,t[i]),n++,r++;return this.searchClose(),r},removeSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&(this.searches.splice(n,1),i++);return this.searchClose(),i},getSearch:function(n,t){for(var i=0;i=0;n--)this.searches[n].field==arguments[t]&&(this.searches[n].hidden=!this.searches[n].hidden,i++);return this.searchClose(),i},showSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&this.searches[n].hidden!==!1&&(this.searches[n].hidden=!1,i++);return this.searchClose(),i},hideSearch:function(){for(var i=0,n,t=0;t=0;n--)this.searches[n].field==arguments[t]&&this.searches[n].hidden!==!0&&(this.searches[n].hidden=!0,i++);return this.searchClose(),i},getSearchData:function(n){for(var t in this.searchData)if(this.searchData[t].field==n)return this.searchData[t];return null},localSort:function(n){var r=typeof this.url!="object"?this.url:this.url.get,i,t;if(r){console.log("ERROR: grid.localSort can only be used on local data source, grid.url should be empty.");return}if(!$.isEmptyObject(this.sortData))return i=+new Date,t=this,this.records.sort(function(n,i){var e=0,f,r,u;for(f in t.sortData)if(r=n[t.sortData[f].field],u=i[t.sortData[f].field],String(t.sortData[f].field).indexOf(".")!=-1&&(r=t.parseField(n,t.sortData[f].field),u=t.parseField(i,t.sortData[f].field)),typeof r=="string"&&(r=$.trim(r.toLowerCase())),typeof u=="string"&&(u=$.trim(u.toLowerCase())),r>u&&(e=t.sortData[f].direction=="asc"?1:-1),r0&&!a){this.total=0;for(l in this.records){s=this.records[l],u=0;for(v in this.searchData)if(i=this.searchData[v],t=this.getSearch(i.field),i!=null){t==null&&(t={field:i.field,type:i.type}),f=String(c.parseField(s,t.field)).toLowerCase(),typeof i.value!="undefined"&&($.isArray(i.value)?(r=i.value[0],e=i.value[1]):r=String(i.value).toLowerCase());switch(i.operator){case"is":s[t.field]==i.value&&u++,t.type=="date"&&(o=new Date(Number(f)),f=+new Date(o.getFullYear(),o.getMonth(),o.getDate()),r=Number(r),e=Number(f)+864e5,r>=f&&r<=e&&u++);break;case"between":t.type=="int"&&parseInt(s[t.field])>=parseInt(r)&&parseInt(s[t.field])<=parseInt(e)&&u++,t.type=="float"&&parseFloat(s[t.field])>=parseFloat(r)&&parseFloat(s[t.field])<=parseFloat(e)&&u++,t.type=="date"&&(o=new Date(Number(e)),e=+new Date(o.getFullYear(),o.getMonth(),o.getDate()),e=Number(e)+864e5,f>=r&&f=0&&u++;break;case"ends with":f.indexOf(r)==f.length-r.length&&u++}}(this.last.logic=="OR"&&u!=0||this.last.logic=="AND"&&u==this.searchData.length)&&this.last.searchIds.push(parseInt(l))}this.total=this.last.searchIds.length}return this.buffered=this.total,h=+new Date-h,n!==!0&&setTimeout(function(){c.status("Search took "+h/1e3+" sec")},10),h},getRangeData:function(n,t){var o=this.get(n[0].recid,!0),c=this.get(n[1].recid,!0),s=n[0].column,h=n[1].column,r=[],u,f,i,e;if(s==h)for(u=o;u<=c;u++)f=this.records[u],e=f[this.columns[s].field]||null,t!==!0?r.push(e):r.push({data:e,column:s,index:u,record:f});else if(o==c)for(f=this.records[o],i=s;i<=h;i++)e=f[this.columns[i].field]||null,t!==!0?r.push(e):r.push({data:e,column:i,index:o,record:f});else for(u=o;u<=c;u++)for(f=this.records[u],r.push([]),i=s;i<=h;i++)e=f[this.columns[i].field],t!==!0?r[r.length-1].push(e):r[r.length-1].push({data:e,column:i,index:u,record:f});return r},addRange:function(n){var o=0,t,u,e,f,s;if(this.selectType=="row")return o;$.isArray(n)||(n=[n]);for(t in n){if(typeof n[t]!="object"&&(n[t]={name:"selection"}),n[t].name=="selection"){if(this.show.selectionBorder===!1)continue;if(u=this.getSelection(),u.length==0){this.removeRange(n[t].name);continue}else var i=u[0],r=u[u.length-1],c=$("#grid_"+this.name+"_rec_"+i.recid+" td[col="+i.column+"]"),h=$("#grid_"+this.name+"_rec_"+r.recid+" td[col="+r.column+"]")}else var i=n[t].range[0],r=n[t].range[1],c=$("#grid_"+this.name+"_rec_"+i.recid+" td[col="+i.column+"]"),h=$("#grid_"+this.name+"_rec_"+r.recid+" td[col="+r.column+"]");if(i){e={name:n[t].name,range:[{recid:i.recid,column:i.column},{recid:r.recid,column:r.column}],style:n[t].style||""},f=!1;for(s in this.ranges)if(this.ranges[s].name==n[t].name){f=t;break}f!==!1?this.ranges[f]=e:this.ranges.push(e),o++}}return this.refreshRanges(),o},removeRange:function(){for(var r=0,i,n,t=0;t=0;n--)this.ranges[n].name==i&&(this.ranges.splice(n,1),r++);return r},refreshRanges:function(){function l(t){var i=n.getSelection();n.last.move={type:"expand",x:t.screenX,y:t.screenY,divX:0,divY:0,recid:i[0].recid,column:i[0].column,originalRange:[{recid:i[0].recid,column:i[0].column},{recid:i[i.length-1].recid,column:i[i.length-1].column}],newRange:[{recid:i[0].recid,column:i[0].column},{recid:i[i.length-1].recid,column:i[i.length-1].column}]};$(document).off("mousemove",f).on("mousemove",f);$(document).off("mouseup",e).on("mouseup",e)}function f(t){var r=n.last.move,e,o,u,f;if(r&&r.type=="expand"&&(r.divX=t.screenX-r.x,r.divY=t.screenY-r.y,u=t.originalEvent.target,u.tagName!="TD"&&(u=$(u).parents("td")[0]),typeof $(u).attr("col")!="undefined"&&(o=parseInt($(u).attr("col"))),u=$(u).parents("tr")[0],e=$(u).attr("recid"),r.newRange[1].recid!=e||r.newRange[1].column!=o)){if(f=$.extend({},r.newRange),r.newRange=[{recid:r.recid,column:r.column},{recid:e,column:o}],i=n.trigger($.extend(i,{originalRange:r.originalRange,newRange:r.newRange})),i.isCancelled===!0){r.newRange=f,i.newRange=f;return}n.removeRange("grid-selection-expand"),n.addRange({name:"grid-selection-expand",range:i.newRange,style:"background-color: rgba(100,100,100,0.1); border: 2px dotted rgba(100,100,100,0.5);"})}}function e(){n.removeRange("grid-selection-expand"),delete n.last.move,$(document).off("mousemove",f),$(document).off("mouseup",e),n.trigger($.extend(i,{phase:"after"}))}var n=this,a=+new Date,o=$("#grid_"+this.name+"_records"),c,i;for(c in this.ranges){var t=this.ranges[c],h=t.range[0],s=t.range[1],r=$("#grid_"+this.name+"_rec_"+h.recid+" td[col="+h.column+"]"),u=$("#grid_"+this.name+"_rec_"+s.recid+" td[col="+s.column+"]");$("#grid_"+this.name+"_"+t.name).length==0?o.append('
      '+(t.name=="selection"?'
      ':"")+"
      "):$("#grid_"+this.name+"_"+t.name).attr("style",t.style),r.length>0&&u.length>0&&$("#grid_"+this.name+"_"+t.name).css({left:r.position().left-1+o.scrollLeft()+"px",top:r.position().top-1+o.scrollTop()+"px",width:u.position().left-r.position().left+u.width()+3+"px",height:u.position().top-r.position().top+u.height()+3+"px"})}$(this.box).find("#grid_"+this.name+"_resizer").off("mousedown").on("mousedown",l);return i={phase:"before",type:"selectionExtend",target:n.name,originalRange:null,newRange:null},+new Date-a},select:function(){for(var s=0,r,o,e,f,u,i=0;i td[col="+r+"]").addClass("w2ui-selected"),s++,n.selected&&($("#grid_"+this.name+"_rec_"+w2utils.escapeId(t)).data("selected","yes"),$("#grid_"+this.name+"_cell_"+h+"_select_check").prop("checked",!0))}this.trigger($.extend(u,{phase:"after"}))}}return $("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),this.addRange("selection"),s},unselect:function(){for(var s=0,f,i,h,o,r,e,t=0;t td[col="+i+"]").removeClass("w2ui-selected"),s++,r.length==0&&(n.selected=!1,$("#grid_"+this.name+"_rec_"+w2utils.escapeId(u)).removeData("selected"),$("#grid_"+this.name+"_cell_"+c+"_select_check").prop("checked",!1))}this.trigger($.extend(e,{phase:"after"}))}}return $("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),this.addRange("selection"),s},selectAll:function(){var r,n,u,f,t,i;if(this.multiSelect!==!1&&(r=this.trigger({phase:"before",type:"select",target:this.name,all:!0}),r.isCancelled!==!0)){n=[];for(u in this.columns)n.push(parseInt(u));if(f=typeof this.url!="object"?this.url:this.url.get,f)this.selectType=="row"?this.set({selected:!0}):this.set({selected:!0,selectedColumns:n.slice()}),this.refresh();else if(this.searchData.length==0)this.set({selected:!0}),this.selectType=="row"?this.set({selected:!0}):this.set({selected:!0,selectedColumns:n.slice()});else{for(t=0;t=1?this.toolbar.enable("delete"):this.toolbar.disable("delete"),this.addRange("selection"),this.trigger($.extend(r,{phase:"after"}))}},selectNone:function(){var f=this.trigger({phase:"before",type:"unselect",target:this.name,all:!0}),r,n,t,i,u;if(f.isCancelled!==!0){this.last.selected=[];for(r in this.records)if(n=this.records[r],n.selected===!0&&(n.selected=!1,t=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(n.recid)),t.removeClass("w2ui-selected").removeData("selected"),$("#grid_"+this.name+"_cell_"+r+"_select_check").prop("checked",!1),this.selectType!="row")){i=n.selectedColumns;for(u in i)t.find(" > td[col="+i[u]+"]").removeClass("w2ui-selected");n.selectedColumns=[]}this.toolbar.disable("edit","delete"),this.removeRange("selection"),this.trigger($.extend(f,{phase:"after"}))}},getSelection:function(n){var t,i,r,u,f;if(this.selectType=="row"){t=this.find({selected:!0},!0),i=[];for(r in t)n===!0?i.push(t[r]):i.push(this.records[t[r]].recid);return i}t=this.find({selected:!0},!0),i=[];for(r in t){u=this.records[t[r]];for(f in u.selectedColumns)i.push({recid:u.recid,index:parseInt(t[r]),column:u.selectedColumns[f]})}return i},search:function(n,t){var it=this,nt=typeof this.url!="object"?this.url:this.url.get,u=[],v=this.last.multi,a=this.last.logic,g=this.last.field,p=this.last.search,f,d,h,s,c,r,o,k,b,i,y;if(arguments.length==0){p="";for(f in this.searches){var i=this.searches[f],l=$("#grid_"+this.name+"_operator_"+f).val(),e=$("#grid_"+this.name+"_field_"+f).val(),w=$("#grid_"+this.name+"_field2_"+f).val();if(e!=""&&e!=null||typeof w!="undefined"&&w!=""){r={field:i.field,type:i.type,operator:l},l=="between"?$.extend(r,{value:[e,w]}):l=="in"?$.extend(r,{value:e.split(",")}):$.extend(r,{value:e});try{i.type=="date"&&l=="between"&&(r.value[0]=w2utils.isDate(e,w2utils.settings.date_format,!0).getTime(),r.value[1]=w2utils.isDate(w,w2utils.settings.date_format,!0).getTime()),i.type=="date"&&l=="is"&&(r.value=w2utils.isDate(e,w2utils.settings.date_format,!0).getTime())}catch(tt){}u.push(r)}}u.length>0&&!nt?(v=!0,a="AND"):(v=!0,a="AND")}if(typeof n=="string"&&(g=n,p=t,v=!1,a="OR",typeof t!="undefined"))if(n.toLowerCase()=="all")if(this.searches.length>0)for(f in this.searches)i=this.searches[f],(i.type=="text"||i.type=="int"&&w2utils.isInt(t)||i.type=="float"&&w2utils.isFloat(t)||i.type=="money"&&w2utils.isMoney(t)||i.type=="hex"&&w2utils.isHex(t)||i.type=="date"&&w2utils.isDate(t)||i.type=="alphaNumeric"&&w2utils.isAlphaNumeric(t))&&(r={field:i.field,type:i.type,operator:i.type=="text"?"contains":"is",value:t},u.push(r)),i.type=="int"&&String(t).indexOf("-")!=-1&&(c=String(t).split("-"),r={field:i.field,type:i.type,operator:"between",value:[c[0],c[1]]},u.push(r));else for(d in this.columns)r={field:this.columns[d].field,type:"text",operator:"contains",value:t},u.push(r);else if(i=this.getSearch(n),i==null&&(i={field:n,type:"text"}),i.field==n&&(this.last.caption=i.caption),t!=""){if(h="contains",s=t,w2utils.isInt(t)&&(h="is",s=t),i.type=="int"&&t!=""&&(String(t).indexOf("-")!=-1&&(r=t.split("-"),r.length==2&&(h="between",s=[parseInt(r[0]),parseInt(r[1])])),String(t).indexOf(",")!=-1)){r=t.split(","),h="in",s=[];for(c in r)s.push(r[c])}r={field:i.field,type:i.type,operator:h,value:s},u.push(r)}if($.isArray(n)){o="AND",typeof t=="string"&&(o=t.toUpperCase(),o!="OR"&&o!="AND"&&(o="AND")),p="",v=!0,a=o;for(k in n)b=n[k],i=this.getSearch(b.field),i==null&&(i={type:"text",operator:"contains"}),u.push($.extend(!0,{},i,b))}(y=this.trigger({phase:"before",type:"search",target:this.name,searchData:u,searchField:n?n:"multi",searchValue:t?t:"multi"}),y.isCancelled!==!0)&&(this.searchData=y.searchData,this.last.field=g,this.last.search=p,this.last.multi=v,this.last.logic=a,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.searchClose(),this.set({expanded:!1}),nt?(this.last.xhr_offset=0,this.reload()):(this.localSearch(),this.refresh()),this.trigger($.extend(y,{phase:"after"})))},searchOpen:function(){if(this.box&&this.searches.length!=0){var n=this;$("#tb_"+this.name+"_toolbar_item_search-advanced").w2overlay(this.getSearchesHTML(),{left:-10,"class":"w2ui-grid-searches",onShow:function(){n.last.logic=="OR"&&(n.searchData=[]),n.initSearches(),$("#w2ui-overlay .w2ui-grid-searches").data("grid-name",n.name);var t=$("#w2ui-overlay .w2ui-grid-searches *[rel=search]");t.length>0&&t[0].focus()}})}},searchClose:function(){this.box&&this.searches.length!=0&&(this.toolbar&&this.toolbar.uncheck("search-advanced"),$("#w2ui-overlay .w2ui-grid-searches").length>0&&$().w2overlay())},searchShowFields:function(n){var r,i,t;for(typeof n=="undefined"&&(n=$("#grid_"+this.name+"_search_all")),r='
      ',i=-1;i"}r+="
      "+t.caption+"
      ",$(n).w2overlay(r,{left:-15,top:7})},searchReset:function(n){var t=this.trigger({phase:"before",type:"search",target:this.name,searchData:[]});t.isCancelled!==!0&&(this.searchData=[],this.last.search="",this.last.logic="OR",this.last.multi&&(this.multiSearch?(this.last.field="all",this.last.caption=w2utils.lang("All Fields")):(this.last.field=this.searches[0].field,this.last.caption=this.searches[0].caption)),this.last.multi=!1,this.last.xhr_offset=0,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.searchClose(),n||this.reload(),this.trigger($.extend(t,{phase:"after"})))},clear:function(n){this.offset=0,this.total=0,this.buffered=0,this.records=[],this.summary=[],this.last.scrollTop=0,this.last.scrollLeft=0,this.last.range_start=null,this.last.range_end=null,this.last.xhr_offset=0,n||this.refresh()},reset:function(n){this.offset=0,this.last.scrollTop=0,this.last.scrollLeft=0,this.last.selected=[],this.last.range_start=null,this.last.range_end=null,this.last.xhr_offset=0,this.searchReset(n),this.last.sortData!=null&&(this.sortData=this.last.sortData),this.set({selected:!1,expanded:!1},!0),n||this.refresh()},skip:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t?(this.offset=parseInt(n),(this.offset<0||!w2utils.isInt(this.offset))&&(this.offset=0),this.offset>this.total&&(this.offset=this.total-this.limit),this.records=[],this.buffered=0,this.last.xhr_offset=0,this.last.pull_more=!0,this.last.scrollTop=0,this.last.scrollLeft=0,$("#grid_"+this.name+"_records").prop("scrollTop",0),this.initColumnOnOff(),this.reload()):console.log("ERROR: grid.skip() can only be called when you have remote data source.")},load:function(n,t){if(typeof n=="undefined"){console.log('ERROR: You need to provide url argument when calling .load() method of "'+this.name+'" object.');return}this.request("get-records",{},n,t)},reload:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t?(this.last.xhr_offset>0&&this.last.xhr_offset div"),o.type=="enum"&&console.log("ERROR: Grid's inline editing does not support enum field type."),(o.type=="list"||o.type=="select")&&console.log("ERROR: Grid's inline editing does not support list/select field type."),typeof o.inTag=="undefined"&&(o.inTag=""),typeof o.outTag=="undefined"&&(o.outTag=""),typeof o.style=="undefined"&&(o.style=""),typeof o.items=="undefined"&&(o.items=[]),h=f.changed&&f.changes[e.field]?w2utils.stripTags(f.changes[e.field]):w2utils.stripTags(f[e.field]),(h==null||typeof h=="undefined")&&(h=""),typeof i!="undefined"&&i!=null&&(h=i),v=typeof e.style!="undefined"?e.style+";":"",$.inArray(e.render,["number","int","float","money","percent"])!=-1&&(v+="text-align: right;"),c.addClass("w2ui-editable").html('"+o.outTag);c.find("input").w2field(o.type).on("blur",function(){if(u.parseField(f,e.field)!=this.value){var r=u.trigger({phase:"before",type:"change",target:u.name,input_id:this.id,recid:n,column:t,value_new:this.value,value_previous:f.changes?f.changes[e.field]:u.parseField(f,e.field),value_original:u.parseField(f,e.field)});r.isCancelled===!0||(f.changed=!0,f.changes=f.changes||{},f.changes[e.field]=r.value_new,u.trigger($.extend(r,{phase:"after"})))}else f.changes&&delete f.changes[e.field],$.isEmptyObject(f.changes)&&delete f.changes;$(a).replaceWith(u.getRecordHTML(s,a.attr("line")))}).on("keydown",function(i){function a(n){var t=n+1;return u.columns.length==t?n:u.columns[t].hidden?a(t):t}function v(n){var t=n-1;return t<0?n:u.columns[t].hidden?v(t):t}function c(n){var t=n+1;return u.records.length==t?n:t}function l(n){var t=n-1;return t<0?n:t}var o=!1,r,h;switch(i.keyCode){case 9:o=!0,r=i.shiftKey?v(t):a(t),r!=t&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:n,column:r})):u.editField(n,r,null,i)},1));break;case 13:o=!0,r=i.shiftKey?l(s):c(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 38:o=!0,r=l(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 40:o=!0,r=c(s),r!=s&&(this.blur(),setTimeout(function(){u.selectType!="row"?(u.selectNone(),u.select({recid:u.records[r].recid,column:t})):u.editField(u.records[r].recid,t,null,i)},1));break;case 27:h=f.changed&&f.changes[e.field]?f.changes[e.field]:u.parseField(f,e.field),this.value=typeof h!="undefined"?h:"",this.blur(),setTimeout(function(){u.select({recid:n,column:t})},1)}o&&i.preventDefault&&i.preventDefault()});typeof i=="undefined"||i==null?c.find("input").focus():c.find("input").val("").focus().val(i),u.trigger($.extend(l,{phase:"after"}))}},"delete":function(n){var o=this,f=this.trigger({phase:"before",target:this.name,type:"delete",force:n}),t,e,u,r,i;if(f.isCancelled===!0)return!1;if(n=f.force,t=this.getSelection(),t.length!=0){if(this.msgDelete!=""&&!n){w2confirm(o.msgDelete,w2utils.lang("Delete Confirmation"),function(n){n=="Yes"&&w2ui[o.name].delete(!0)});return}if(e=typeof this.url!="object"?this.url:this.url.remove,e)this.request("delete-records");else if(typeof t[0]!="object")this.remove.apply(this,t);else{for(u in t)r=this.columns[t[u].column].field,i=this.get(t[u].recid,!0),i!=null&&r!="recid"&&(this.records[i][r]="",this.records[i].changed&&(this.records[i].changes[r]=""));this.refresh()}this.trigger($.extend(f,{phase:"after"}))}},click:function(n,t){var g=+new Date,i=null,b,c,nt,f,r,p,y,a,h,s,v,u,tt,e,k,o;if(typeof n=="object"&&(i=n.column,n=n.recid),w2utils.isInt(n)&&(n=parseInt(n)),typeof t=="undefined"&&(t={}),g-parseInt(this.last.click_time)<250&&t.type=="click"){this.dblClick(n,t);return}if(this.last.click_time=g,i==null&&t.target&&(u=t.target,u.tagName!="TD"&&(u=$(u).parents("td")[0]),typeof $(u).attr("col")!="undefined"&&(i=parseInt($(u).attr("col")))),b=this.trigger({phase:"before",target:this.name,type:"click",recid:n,column:i,originalEvent:t}),b.isCancelled===!0)return!1;c=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(n)).parents("tr"),c.length>0&&String(c.attr("id")).indexOf("expanded_row")!=-1&&(nt=c.parents(".w2ui-grid").attr("name"),w2ui[nt].selectNone(),c.parents(".w2ui-grid").find(".w2ui-expanded-row .w2ui-grid").each(function(n,t){var i=$(t).attr("name");w2ui[i]&&w2ui[i].selectNone()})),$(this.box).find(".w2ui-expanded-row .w2ui-grid").each(function(n,t){var i=$(t).attr("name");w2ui[i]&&w2ui[i].selectNone()}),f=this,r=this.getSelection(),$("#grid_"+this.name+"_check_all").prop("checked",!1);var d=this.get(n,!0),l=this.records[d],w=[];if(f.last.sel_ind=d,f.last.sel_col=i,f.last.sel_recid=n,f.last.sel_type="click",t.shiftKey&&r.length>0){if(r[0].recid)for(h=this.get(r[0].recid,!0),s=this.get(n,!0),i>r[0].column?(p=r[0].column,y=i):(p=i,y=r[0].column),a=p;a<=y;a++)w.push(a);else h=this.get(r[0],!0),s=this.get(n,!0);for(v=[],h>s&&(u=h,h=s,s=u),tt=typeof this.url!="object"?this.url:this.url.get,e=h;e<=s;e++)if(!(this.searchData.length>0)||tt||$.inArray(e,this.last.searchIds)!=-1)if(this.selectType=="row")v.push(this.records[e].recid);else for(k in w)v.push({recid:this.records[e].recid,column:w[k]});this.select.apply(this,v)}else(t.ctrlKey||t.shiftKey||t.metaKey)&&this.multiSelect||this.showSelectColumn?(o=l.selected,this.selectType!="row"&&$.inArray(i,l.selectedColumns)==-1&&(o=!1),o===!0?this.unselect({recid:n,column:i}):this.select({recid:l.recid,column:i}),setTimeout(function(){window.getSelection&&window.getSelection().removeAllRanges()},10)):(o=l.selected,this.selectType!="row"&&$.inArray(i,l.selectedColumns)==-1&&(o=!1),r.length>300?this.selectNone():this.unselect.apply(this,r),o===!0?this.unselect({recid:n,column:i}):this.select({recid:n,column:i}));this.status(),f.last.selected=this.getSelection(),f.initResize(),this.trigger($.extend(b,{phase:"after"}))},columnClick:function(n,t){var i=this.trigger({phase:"before",type:"columnClick",target:this.name,field:n,originalEvent:t});if(i.isCancelled===!0)return!1;this.sort(n,null,t&&(t.ctrlKey||t.metaKey)?!0:!1),this.trigger($.extend(i,{phase:"after"}))},keydown:function(n){function st(n){if(n+10&&n0)for(;;){if($.inArray(n,t.last.searchIds)!=-1||n>t.records.length)break;n++}return n}return null}function ht(n){if(n>0&&t.last.searchIds.length==0||t.last.searchIds.length>0&&n>t.last.searchIds[0]){if(n--,t.last.searchIds.length>0)for(;;){if($.inArray(n,t.last.searchIds)!=-1||n<0)break;n--}return n}return null}function et(n){var i=n+1;return t.columns.length==i?n:t.columns[i].hidden?findNext(i):i}function ot(n){var i=n-1;return i<0?n:t.columns[i].hidden?findPrev(i):i}function g(){if(t.last.sel_type!="click")return!1;if(t.selectType!="row"){if(t.last.sel_type="key",i.length>1){for(var n in i)if(i[n].recid==t.last.sel_recid&&i[n].column==t.last.sel_col){i.splice(n,1);break}return t.unselect.apply(t,i),!0}return!1}return(t.last.sel_type="key",i.length>1)?(i.splice(i.indexOf(t.records[t.last.sel_ind].recid),1),t.unselect.apply(t,i),!0):!1}var t=this,it,b,i,c,y,d,a,v,h,l,f,o,rt,e,u;if(t.keyboard===!0){if(it=t.trigger({phase:"before",type:"keydown",target:t.name,originalEvent:n}),it.isCancelled===!0)return!1;if(i=t.getSelection(),i.length!=0){var ct=$("#grid_"+t.name+"_records"),f=i[0],r=[],ft=i[i.length-1];if(typeof f=="object"){for(f=i[0].recid,r=[],b=0;;){if(!i[b]||i[b].recid!=f)break;r.push(i[b].column),b++}ft=i[i.length-1].recid}var p=t.get(f,!0),w=t.get(ft,!0),ut=t.get(f),k=$("#grid_"+t.name+"_rec_"+w2utils.escapeId(t.records[p].recid)),s=!1;switch(n.keyCode){case 8:case 46:t.delete(),s=!0,n.stopPropagation();break;case 27:i=t.getSelection(),t.selectNone(),i.length>0&&(typeof i[0]=="object"?t.select({recid:i[0].recid,column:i[0].column}):t.select(i[0])),s=!0;break;case 13:case 32:r.length==0&&r.push(0),t.editField(f,r[0],null,n),s=!0;break;case 65:if(!n.metaKey&&!n.ctrlKey)break;t.selectAll(),s=!0;break;case 70:if(!n.metaKey&&!n.ctrlKey)break;$("#grid_"+t.name+"_search_all").focus(),s=!0;break;case 13:if(this.selectType=="row"){if(k.length<=0||t.show.expandColumn!==!0)break;t.toggle(f,n),s=!0}else r.length==0&&r.push(0),t.editField(f,r[0],null,n),s=!0;break;case 37:if(l=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(t.records[p].recid)).parents("tr"),l.length>0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.prev().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].set(f,{expanded:!1}),w2ui[o].collapse(f),w2ui[o].click(f),s=!0;break}if(this.selectType=="row"){if(k.length<=0||ut.expanded!==!0)break;t.set(f,{expanded:!1},!0),t.collapse(f,n)}else if(c=ot(r[0]),c!=r[0])if(n.shiftKey){if(g())return;var u=[],tt=[],nt=[];if(r.indexOf(this.last.sel_col)==0&&r.length>1)for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),nt.push({recid:i[e].recid,column:r[r.length-1]});else for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),tt.push({recid:i[e].recid,column:c});t.unselect.apply(t,nt),t.select.apply(t,tt)}else t.click({recid:f,column:c},n);else if(!n.shiftKey)for(h=1;h1)for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),nt.push({recid:i[e].recid,column:r[0]});else for(e in i)u.indexOf(i[e].recid)==-1&&u.push(i[e].recid),tt.push({recid:i[e].recid,column:a});t.unselect.apply(t,nt),t.select.apply(t,tt)}else t.click({recid:f,column:a},n);else if(!n.shiftKey)for(h=0;h0&&w2ui[y.attr("name")])){t.selectNone(),o=y.attr("name"),d=w2ui[o].records,w2utils.keyboard.active(o),w2ui[o].click(d[d.length-1].recid),s=!0;break}if(n.shiftKey){if(g())return;if(t.selectType=="row")t.last.sel_ind>c&&t.last.sel_ind!=w?t.unselect(t.records[w].recid):t.select(t.records[c].recid);else if(t.last.sel_ind>c&&t.last.sel_ind!=w){c=w,u=[];for(v in r)u.push({recid:t.records[c].recid,column:r[v]});t.unselect.apply(t,u)}else{u=[];for(v in r)u.push({recid:t.records[c].recid,column:r[v]});t.select.apply(t,u)}}else t.selectNone(),t.click({recid:t.records[c].recid,column:r[0]},n);t.scrollIntoView(c),n.preventDefault&&n.preventDefault()}else{if(!n.shiftKey)for(h=1;h0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.prev().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].click(f),s=!0;break}}break;case 40:if(k.length<=0)break;if(t.records[w].expanded&&(y=$("#grid_"+this.name+"_rec_"+w2utils.escapeId(t.records[w].recid)+"_expanded_row").find(".w2ui-grid"),y.length>0&&w2ui[y.attr("name")])){t.selectNone(),o=y.attr("name"),d=w2ui[o].records,w2utils.keyboard.active(o),w2ui[o].click(d[0].recid),s=!0;break}if(a=st(w),a!=null){if(n.shiftKey){if(g())return;if(t.selectType=="row")this.last.sel_ind0&&String(l.attr("id")).indexOf("expanded_row")!=-1){f=l.next().attr("recid"),o=l.parents(".w2ui-grid").attr("name"),t.selectNone(),w2utils.keyboard.active(o),w2ui[o].click(f),s=!0;break}}break;case 86:(n.ctrlKey||n.metaKey)&&($("body").append(''),$("#_tmp_copy_data").focus(),setTimeout(function(){t.paste($("#_tmp_copy_data").val()),$("#_tmp_copy_data").remove()},50));break;case 88:(n.ctrlKey||n.metaKey)&&setTimeout(function(){t.delete(!0)},100);case 67:(n.ctrlKey||n.metaKey)&&(rt=t.copy(),$("body").append('"),$("#_tmp_copy_data").focus().select(),setTimeout(function(){$("#_tmp_copy_data").remove()},50))}for(u=[187,189],e=48;e<=90;e++)u.push(e);u.indexOf(n.keyCode)==-1||n.ctrlKey||n.metaKey||s||(r.length==0&&r.push(0),u=String.fromCharCode(n.keyCode),n.keyCode==187&&(u="="),n.keyCode==189&&(u="-"),n.shiftKey||(u=u.toLowerCase()),t.editField(f,r[0],u,n),s=!0),s&&n.preventDefault&&n.preventDefault(),t.trigger($.extend(it,{phase:"after"}))}}},scrollIntoView:function(n){var f,t,r,i,u;if(typeof n=="undefined"){if(f=this.getSelection(),f.length==0)return;n=this.get(f[0],!0)}(t=$("#grid_"+this.name+"_records"),t.length!=0)&&((r=this.last.searchIds.length,t.height()>this.recordHeight*(r>0?r:this.records.length))||(r>0&&(n=this.last.searchIds.indexOf(n)),i=Math.floor(t[0].scrollTop/this.recordHeight),u=i+Math.floor(t.height()/this.recordHeight),n==i&&t.animate({scrollTop:t.scrollTop()-t.height()/1.3}),n==u&&t.animate({scrollTop:t.scrollTop()+t.height()/1.3}),(nu)&&t.animate({scrollTop:(n-1)*this.recordHeight})))},dblClick:function(n,t){var i,r,f,u;if(window.getSelection&&window.getSelection().removeAllRanges(),i=null,typeof n=="object"&&(i=n.column,n=n.recid),typeof t=="undefined"&&(t={}),i==null&&t.target&&(r=t.target,r.tagName!="TD"&&(r=$(r).parents("td")[0]),i=parseInt($(r).attr("col"))),f=this.trigger({phase:"before",target:this.name,type:"dblClick",recid:n,column:i,originalEvent:t}),f.isCancelled===!0)return!1;this.selectNone(),u=this.columns[i],u&&$.isPlainObject(u.editable)?this.editField(n,i,null,t):(this.select({recid:n,column:i}),this.last.selected=this.getSelection()),this.trigger($.extend(f,{phase:"after"}))},toggle:function(n){var t=this.get(n);return t.expanded===!0?this.collapse(n):this.expand(n)},expand:function(n){function u(){var r=$("#grid_"+i.name+"_rec_"+t+"_expanded"),u=$("#grid_"+i.name+"_rec_"+t+"_expanded_row .w2ui-expanded1 > div");r.height()<5||(r.css("opacity",1),u.show().css("opacity",1),$("#grid_"+i.name+"_cell_"+i.get(n,!0)+"_expand div").html("-"))}var e=this.get(n),i=this,t=w2utils.escapeId(n),o,f,r;return $("#grid_"+this.name+"_rec_"+t+"_expanded_row").length>0?!1:e.expanded=="none"?!1:(o=1+(this.show.selectColumn?1:0),f="",$("#grid_"+this.name+"_rec_"+t).after(''+(this.show.lineNumbers?'':"")+'\t
      \t\t\t
      \t'),r=this.trigger({phase:"before",type:"expand",target:this.name,recid:n,box_id:"grid_"+this.name+"_rec_"+t+"_expanded",ready:u}),r.isCancelled===!0)?($("#grid_"+this.name+"_rec_"+t+"_expanded_row").remove(),!1):($("#grid_"+this.name+"_rec_"+t).attr("expanded","yes").addClass("w2ui-expanded"),$("#grid_"+this.name+"_rec_"+t+"_expanded_row").show(),$("#grid_"+this.name+"_cell_"+this.get(n,!0)+"_expand div").html('
      '),e.expanded=!0,setTimeout(u,300),this.trigger($.extend(r,{phase:"after"})),this.resizeRecords(),!0)},collapse:function(n){var u=this.get(n),i=this,t=w2utils.escapeId(n),r;return $("#grid_"+this.name+"_rec_"+t+"_expanded_row").length==0?!1:(r=this.trigger({phase:"before",type:"collapse",target:this.name,recid:n,box_id:"grid_"+this.name+"_rec_"+t+"_expanded"}),r.isCancelled===!0)?!1:($("#grid_"+this.name+"_rec_"+t).removeAttr("expanded").removeClass("w2ui-expanded"),$("#grid_"+this.name+"_rec_"+t+"_expanded").css("opacity",0),$("#grid_"+this.name+"_cell_"+this.get(n,!0)+"_expand div").html("+"),setTimeout(function(){$("#grid_"+i.name+"_rec_"+t+"_expanded").height("0px"),setTimeout(function(){$("#grid_"+i.name+"_rec_"+t+"_expanded_row").remove(),delete u.expanded,i.trigger($.extend(r,{phase:"after"})),i.resizeRecords()},300)},200),!0)},sort:function(n,t,i){var f=this.trigger({phase:"before",type:"sort",target:this.name,field:n,direction:t,multiField:i}),r,u,e;if(f.isCancelled===!0)return!1;if(typeof n!="undefined"){r=this.sortData.length;for(u in this.sortData)if(this.sortData[u].field==n){r=u;break}if(typeof t=="undefined"||t==null)if(typeof this.sortData[r]=="undefined")t="asc";else switch(String(this.sortData[r].direction)){case"asc":t="desc";break;case"desc":t="asc";break;default:t="asc"}this.multiSort===!1&&(this.sortData=[],r=0),i!=!0&&(this.sortData=[],r=0),typeof this.sortData[r]=="undefined"&&(this.sortData[r]={}),this.sortData[r].field=n,this.sortData[r].direction=t}else this.sortData=[];e=typeof this.url!="object"?this.url:this.url.get,e?(this.trigger($.extend(f,{phase:"after"})),this.last.xhr_offset=0,this.reload()):(this.localSort(),this.searchData.length>0&&this.localSearch(!0),this.trigger($.extend(f,{phase:"after"})),this.refresh())},copy:function(){var t=this.getSelection(),n,c,i,f,r,o,e;if(t.length==0)return"";if(n="",typeof t[0]=="object"){var s=t[0].column,h=t[0].column,u=[];for(i in t)t[i].columnh&&(h=t[i].column),u.indexOf(t[i].index)==-1&&u.push(t[i].index);u.sort();for(c in u){for(f=u[c],r=s;r<=h;r++)(o=this.columns[r],o.hidden!==!0)&&(n+=w2utils.stripTags(this.getCellHTML(f,r))+"\t");n=n.substr(0,n.length-1),n+="\n"}}else for(i in t){f=this.get(t[i],!0);for(r in this.columns)(o=this.columns[r],o.hidden!==!0)&&(n+=w2utils.stripTags(this.getCellHTML(f,r))+"\t");n=n.substr(0,n.length-1),n+="\n"}return(n=n.substr(0,n.length-1),e=this.trigger({phase:"before",type:"copy",target:this.name,text:n}),e.isCancelled===!0)?"":(n=e.text,this.trigger($.extend(e,{phase:"after"})),n)},paste:function(n){var e=this.getSelection(),o=this.get(e[0].recid,!0),u=e[0].column,i=this.trigger({phase:"before",type:"paste",target:this.name,text:n,index:o,column:u}),s,n,a,l,c,h;if(i.isCancelled!==!0){if(n=i.text,this.selectType=="row"||e.length==0){console.log("ERROR: You can paste only if grid.selectType = 'cell' and when at least one cell selected."),this.trigger($.extend(i,{phase:"after"}));return}s=[],n=n.split("\n");for(a in n){var v=n[a].split("\t"),r=0,t=this.records[o],f=[];for(l in v)this.columns[u+r]&&(c=this.columns[u+r].field,t.changed=!0,t.changes=t.changes||{},t.changes[c]=v[l],f.push(u+r),r++);for(h in f)s.push({recid:t.recid,column:f[h]});o++}this.selectNone(),this.select.apply(this,s),this.refresh(),this.trigger($.extend(i,{phase:"after"}))}},resize:function(){var t=this,i=+new Date,n;if(window.getSelection&&window.getSelection().removeAllRanges(),this.box&&$(this.box).attr("name")==this.name)return($(this.box).find("> div").css("width",$(this.box).width()).css("height",$(this.box).height()),n=this.trigger({phase:"before",type:"resize",target:this.name}),n.isCancelled===!0)?!1:(t.resizeBoxes(),t.resizeRecords(),this.trigger($.extend(n,{phase:"after"})),+new Date-i)},refresh:function(){var n=this,h=+new Date,c=typeof this.url!="object"?this.url:this.url.get,o,u,t,r,f,i,e,s;if(this.total<=0&&!c&&this.searchData.length==0&&(this.total=this.records.length,this.buffered=this.total),window.getSelection&&window.getSelection().removeAllRanges(),this.toolbar.disable("edit","delete"),this.box){if(o=this.trigger({phase:"before",target:this.name,type:"refresh"}),o.isCancelled===!0)return!1;this.show.header?$("#grid_"+this.name+"_header").html(this.header+" ").show():$("#grid_"+this.name+"_header").hide(),this.show.toolbar?this.toolbar&&this.toolbar.get("column-on-off")&&this.toolbar.get("column-on-off").checked||($("#grid_"+this.name+"_toolbar").show(),typeof this.toolbar=="object"&&(this.toolbar.refresh(),t=$("#grid_"+n.name+"_search_all"),t.val(this.last.search))):$("#grid_"+this.name+"_toolbar").hide(),this.searchClose(),u=$("#grid_"+n.name+"_search_all"),this.searches.length==0&&(this.last.field="all"),!this.multiSearch&&this.last.field=="all"&&this.searches.length>0&&(this.last.field=this.searches[0].field,this.last.caption=this.searches[0].caption);for(i in this.searches)this.searches[i].field==this.last.field&&(this.last.caption=this.searches[i].caption);if(this.last.multi?u.attr("placeholder","["+w2utils.lang("Multiple Fields")+"]"):u.attr("placeholder",this.last.caption),this._focus_when_refreshed===!0&&(clearTimeout(n._focus_timer),n._focus_timer=setTimeout(function(){u.length>0&&u[0].focus(),delete n._focus_when_refreshed,delete n._focus_timer},600)),t=this.find({summary:!0},!0),t.length>0){for(r in t)this.summary.push(this.records[t[r]]);for(r=t.length-1;r>=0;r--)this.records.splice(t[r],1);this.total=this.total-t.length,this.buffered=this.buffered-t.length}if(f="",f+='
      "+this.getRecordsHTML()+'
      \t'+this.getColumnsHTML()+"
      ",$("#grid_"+this.name+"_body").html(f),this.summary.length>0?$("#grid_"+this.name+"_summary").html(this.getSummaryHTML()).show():$("#grid_"+this.name+"_summary").hide(),this.show.footer?$("#grid_"+this.name+"_footer").html(this.getFooterHTML()).show():$("#grid_"+this.name+"_footer").hide(),this.last.selected.length>0)for(i in this.last.selected)this.get(this.last.selected[i])!=null&&this.select(this.get(this.last.selected[i]).recid);this.searchData.length>0?$("#grid_"+this.name+"_searchClear").show():$("#grid_"+this.name+"_searchClear").hide(),$("#grid_"+this.name+"_check_all").prop("checked",!0),$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length!=0&&$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]").length==$("#grid_"+this.name+"_records").find(".grid_select_check[type=checkbox]:checked").length?$("#grid_"+this.name+"_check_all").prop("checked",!0):$("#grid_"+this.name+"_check_all").prop("checked",!1),this.status(),e=n.find({expanded:!0},!0);for(s in e)n.records[e[s]].expanded=!1;return setTimeout(function(){var t=$.trim($("#grid_"+n.name+"_search_all").val());t!=""&&$(n.box).find(".w2ui-grid-data > div").w2marker(t)},50),this.trigger($.extend(o,{phase:"after"})),n.resize(),n.addRange("selection"),setTimeout(function(){n.resize(),n.scroll()},1),+new Date-h}},render:function(n){function e(n){if(!t.last.move||t.last.move.type!="expand"){t.last.move={x:n.screenX,y:n.screenY,divX:0,divY:0,recid:$(n.target).parents("tr").attr("recid"),column:n.target.tagName=="TD"?$(n.target).attr("col"):$(n.target).parents("td").attr("col"),type:"select",start:!0};$(document).on("mousemove",r);$(document).on("mouseup",u)}}function r(n){var i,y,o,v,u,s,r,e,f;if(t.last.move&&t.last.move.type=="select"&&(t.last.move.divX=n.screenX-t.last.move.x,t.last.move.divY=n.screenY-t.last.move.y,!(Math.abs(t.last.move.divX)<=1)||!(Math.abs(t.last.move.divY)<=1))&&(t.last.move.start&&t.last.move.recid&&(t.selectNone(),t.last.move.start=!1),i=[],y=n.target.tagName=="TR"?$(n.target).attr("recid"):$(n.target).parents("tr").attr("recid"),typeof y!="undefined")){var h=t.get(t.last.move.recid,!0),l=t.get(y,!0),a=parseInt(t.last.move.column),c=parseInt(n.target.tagName=="TD"?$(n.target).attr("col"):$(n.target).parents("td").attr("col"));if(h>l&&(u=h,h=l,l=u),u="ind1:"+h+",ind2;"+l+",col1:"+a+",col2:"+c,t.last.move.range!=u){for(t.last.move.range=u,o=h;o<=l;o++)if(!(t.last.searchIds.length>0)||t.last.searchIds.indexOf(o)!=-1)if(t.selectType!="row")for(a>c&&(u=a,a=c,c=u),u=[],v=a;v<=c;v++)t.columns[v].hidden||i.push({recid:t.records[o].recid,column:parseInt(v)});else i.push(t.records[o].recid);if(t.selectType!="row"){r=t.getSelection(),u=[];for(e in i){s=!1;for(f in r)i[e].recid==r[f].recid&&i[e].column==r[f].column&&(s=!0);s||u.push({recid:i[e].recid,column:i[e].column})}t.select.apply(t,u),u=[];for(f in r){s=!1;for(e in i)i[e].recid==r[f].recid&&i[e].column==r[f].column&&(s=!0);s||u.push({recid:r[f].recid,column:r[f].column})}t.unselect.apply(t,u)}else if(t.multiSelect){r=t.getSelection();for(e in i)r.indexOf(i[e])==-1&&t.select(i[e]);for(f in r)i.indexOf(r[f])==-1&&t.unselect(r[f])}}}}function u(){t.last.move&&t.last.move.type=="select"&&(delete t.last.move,$(document).off("mousemove",r),$(document).off("mouseup",u))}var t=this,f=+new Date,i;if(window.getSelection&&window.getSelection().removeAllRanges(),typeof n!="undefined"&&n!=null&&($(this.box).find("#grid_"+this.name+"_body").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-grid").html(""),this.box=n),this.box){if(this.last.sortData==null&&(this.last.sortData=this.sortData),i=this.trigger({phase:"before",target:this.name,type:"render",box:n}),i.isCancelled===!0)return!1;$(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-grid").html('
      \t
      \t
      \t
      \t
      \t
      '),this.selectType!="row"&&$(this.box).addClass("w2ui-ss"),$(this.box).length>0&&($(this.box)[0].style.cssText+=this.style),this.initToolbar(),this.toolbar!=null&&this.toolbar.render($("#grid_"+this.name+"_toolbar")[0]),$("#grid_"+this.name+"_footer").html(this.getFooterHTML()),this.refresh(),this.reload();$(this.box).on("mousedown",e);$(this.box).on("selectstart",function(){return!1});if(this.trigger($.extend(i,{phase:"after"})),$(".w2ui-layout").length==0){this.tmp_resize=function(){w2ui[t.name].resize()};$(window).off("resize",this.tmp_resize).on("resize",this.tmp_resize)}return+new Date-f}},destroy:function(){var n=this.trigger({phase:"before",target:this.name,type:"destroy"});if(n.isCancelled===!0)return!1;$(window).off("resize",this.tmp_resize),typeof this.toolbar=="object"&&this.toolbar.destroy&&this.toolbar.destroy(),$(this.box).find("#grid_"+this.name+"_body").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-grid").html(""),delete w2ui[this.name],this.trigger($.extend(n,{phase:"after"}))},initColumnOnOff:function(){var i,n,t,r,u;if(this.show.toolbarColumns){i=this,n='
      ';for(t in this.columns)r=this.columns[t],n+='";n+='',u=typeof this.url!="object"?this.url:this.url.get,u&&(n+='"),n+='",n+="
      \t\t
      \t
      \t\t'+w2utils.lang("Skip")+' "+w2utils.lang("Records")+"\t
      \t
      "+w2utils.lang("Toggle Line Numbers")+'
      \t
      "+w2utils.lang("Reset Column Size")+"
      ",this.toolbar.get("column-on-off").html=n}},columnOnOff:function(n,t,i,r){var h=this.trigger({phase:"before",target:this.name,type:"columnOnOff",checkbox:n,field:i,originalEvent:t}),o,s,e,u,f;if(h.isCancelled===!0)return!1;o=this;for(s in this.records)this.records[s].expanded===!0&&(this.records[s].expanded=!1);if(e=!0,i=="line-numbers")this.show.lineNumbers=!this.show.lineNumbers,this.refresh();else if(i=="skip")w2utils.isInt(r)||(r=0),o.skip(r);else if(i=="resize"){for(u in this.columns)typeof this.columns[u].sizeOriginal!="undefined"&&(this.columns[u].size=this.columns[u].sizeOriginal);this.initResize(),this.resize()}else f=this.getColumn(i),f.hidden?($(n).prop("checked",!0),this.showColumn(f.field)):($(n).prop("checked",!1),this.hideColumn(f.field)),e=!1;this.initColumnOnOff(),e&&setTimeout(function(){$().w2overlay(),o.toolbar.uncheck("column-on-off")},100),this.trigger($.extend(h,{phase:"after"}))},initToolbar:function(){var t,i,r,n;if(typeof this.toolbar.render=="undefined"){t=this.toolbar.items,this.toolbar.items=[],this.toolbar=$().w2toolbar($.extend(!0,{},this.toolbar,{name:this.name+"_toolbar",owner:this})),this.show.toolbarReload&&this.toolbar.items.push($.extend(!0,{},this.buttons.reload)),this.show.toolbarColumns&&(this.toolbar.items.push($.extend(!0,{},this.buttons.columns)),this.initColumnOnOff()),(this.show.toolbarReload||this.show.toolbarColumn)&&this.toolbar.items.push({type:"break",id:"break0"}),this.show.toolbarSearch&&(i='",this.toolbar.items.push({type:"html",id:"search",html:i}),this.multiSearch&&this.searches.length>0&&this.toolbar.items.push($.extend(!0,{},this.buttons["search-go"]))),this.show.toolbarSearch&&(this.show.toolbarAdd||this.show.toolbarEdit||this.show.toolbarDelete||this.show.toolbarSave)&&this.toolbar.items.push({type:"break",id:"break1"}),this.show.toolbarAdd&&this.toolbar.items.push($.extend(!0,{},this.buttons.add)),this.show.toolbarEdit&&this.toolbar.items.push($.extend(!0,{},this.buttons.edit)),this.show.toolbarDelete&&this.toolbar.items.push($.extend(!0,{},this.buttons["delete"])),this.show.toolbarSave&&((this.show.toolbarAdd||this.show.toolbarDelete||this.show.toolbarEdit)&&this.toolbar.items.push({type:"break",id:"break2"}),this.toolbar.items.push($.extend(!0,{},this.buttons.save)));for(r in t)this.toolbar.items.push(t[r]);n=this;this.toolbar.on("click",function(t){var i=n.trigger({phase:"before",type:"toolbar",target:t.target,originalEvent:t}),r,s,h,u,f,c,e,o;if(i.isCancelled===!0)return!1;r=t.target;switch(r){case"reload":if(s=n.trigger({phase:"before",type:"reload",target:n.name}),s.isCancelled===!0)return!1;h=typeof n.url!="object"?n.url:n.url.get,h?n.clear(!0):(n.last.scrollTop=0,n.last.scrollLeft=0,n.last.range_start=null,n.last.range_end=null),n.reload(),n.trigger($.extend(s,{phase:"after"}));break;case"column-on-off":for(u in n.columns)n.columns[u].hidden?$("#grid_"+n.name+"_column_"+u+"_check").prop("checked",!1):$("#grid_"+n.name+"_column_"+u+"_check").prop("checked",!0);n.initResize(),n.resize();break;case"search-advanced":if(f=this,c=this.get(r),c.checked)n.searchClose(),setTimeout(function(){f.uncheck(r)},1);else{n.searchOpen(),t.originalEvent.stopPropagation();function l(){f.uncheck(r),$(document).off("click","body",l)}$(document).on("click","body",l)}break;case"add":i=n.trigger({phase:"before",target:n.name,type:"add",recid:null}),n.trigger($.extend(i,{phase:"after"}));break;case"edit":e=n.getSelection(),o=null,e.length==1&&(o=e[0]),i=n.trigger({phase:"before",target:n.name,type:"edit",recid:o}),n.trigger($.extend(i,{phase:"after"}));break;case"delete":n.delete();break;case"save":n.save()}n.trigger($.extend(i,{phase:"after"}))})}return},initSearches:function(){var o=this,t,n,r,e,i,u,f;for(t in this.searches){n=this.searches[t],r=this.getSearchData(n.field);switch(String(n.type).toLowerCase()){case"alphaNumeric":case"text":$("#grid_"+this.name+"_operator_"+t).val("begins with");break;case"int":case"float":case"hex":case"money":case"date":$("#grid_"+this.name+"_field_"+t).w2field("clear").w2field(n.type),$("#grid_"+this.name+"_field2_"+t).w2field("clear").w2field(n.type);break;case"list":e='';for(i in n.items)$.isPlainObject(n.items[i])?(u=n.items[i].id,f=n.items[i].text,typeof u=="undefined"&&typeof n.items[i].value!="undefined"&&(u=n.items[i].value),typeof f=="undefined"&&typeof n.items[i].caption!="undefined"&&(f=n.items[i].caption),u==null&&(u=""),e+='"):e+='";$("#grid_"+this.name+"_field_"+t).html(e)}r!=null&&($("#grid_"+this.name+"_operator_"+t).val(r.operator).trigger("change"),$.isArray(r.value)?r.operator=="in"?$("#grid_"+this.name+"_field_"+t).val(r.value).trigger("change"):($("#grid_"+this.name+"_field_"+t).val(r.value[0]).trigger("change"),$("#grid_"+this.name+"_field2_"+t).val(r.value[1]).trigger("change")):typeof r.value!="udefined"&&$("#grid_"+this.name+"_field_"+t).val(r.value).trigger("change"))}$("#w2ui-overlay .w2ui-grid-searches *[rel=search]").on("keypress",function(n){n.keyCode==13&&o.search()})},initResize:function(){var n=this;$(this.box).find(".w2ui-resizer").off("click").on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,n.preventDefault&&n.preventDefault()}).off("mousedown").on("mousedown",function(t){var r,i,f,u;t||(t=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),n.resizing=!0,n.last.tmp={x:t.screenX,y:t.screenY,gx:t.screenX,gy:t.screenY,col:parseInt($(this).attr("name"))},t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,t.preventDefault&&t.preventDefault();for(r in n.columns)typeof n.columns[r].sizeOriginal=="undefined"&&(n.columns[r].sizeOriginal=n.columns[r].size),n.columns[r].size=n.columns[r].sizeCalculated;i={phase:"before",type:"columnResize",target:n.name,column:n.last.tmp.col,field:n.columns[n.last.tmp.col].field},i=n.trigger($.extend(i,{resizeBy:0,originalEvent:t})),f=function(t){if(n.resizing==!0){if(t||(t=window.event),i=n.trigger($.extend(i,{resizeBy:t.screenX-n.last.tmp.gx,originalEvent:t})),i.isCancelled===!0){i.isCancelled=!1;return}n.last.tmp.x=t.screenX-n.last.tmp.x,n.last.tmp.y=t.screenY-n.last.tmp.y,n.columns[n.last.tmp.col].size=parseInt(n.columns[n.last.tmp.col].size)+n.last.tmp.x+"px",n.resizeRecords(),n.last.tmp.x=t.screenX,n.last.tmp.y=t.screenY}},u=function(t){delete n.resizing,$(document).off("mousemove","body"),$(document).off("mouseup","body"),n.resizeRecords(),n.trigger($.extend(i,{phase:"after",originalEvent:t}))};$(document).on("mousemove","body",f);$(document).on("mouseup","body",u)}).each(function(n,t){var i=$(t).parent();$(t).css({height:"25px","margin-left":i.width()-3+"px"})})},resizeBoxes:function(){var o=$(this.box).find("> div"),n=$("#grid_"+this.name+"_header"),i=$("#grid_"+this.name+"_toolbar"),r=$("#grid_"+this.name+"_summary"),t=$("#grid_"+this.name+"_footer"),u=$("#grid_"+this.name+"_body"),e=$("#grid_"+this.name+"_columns"),f=$("#grid_"+this.name+"_records");this.show.header&&n.css({top:"0px",left:"0px",right:"0px"}),this.show.toolbar&&i.css({top:0+(this.show.header?w2utils.getSize(n,"height"):0)+"px",left:"0px",right:"0px"}),this.show.footer&&t.css({bottom:"0px",left:"0px",right:"0px"}),this.summary.length>0&&r.css({bottom:0+(this.show.footer?w2utils.getSize(t,"height"):0)+"px",left:"0px",right:"0px"}),u.css({top:0+(this.show.header?w2utils.getSize(n,"height"):0)+(this.show.toolbar?w2utils.getSize(i,"height"):0)+"px",bottom:0+(this.show.footer?w2utils.getSize(t,"height"):0)+(this.summary.length>0?w2utils.getSize(r,"height"):0)+"px",left:"0px",right:"0px"})},resizeRecords:function(){var i=this,rt,c,h,d,y,e,s,b,u,t,n;$(this.box).find(".w2ui-empty-record").remove();var g=$(this.box),v=$(this.box).find("> div"),nt=$("#grid_"+this.name+"_header"),tt=$("#grid_"+this.name+"_toolbar"),a=$("#grid_"+this.name+"_summary"),it=$("#grid_"+this.name+"_footer"),l=$("#grid_"+this.name+"_body"),r=$("#grid_"+this.name+"_columns"),f=$("#grid_"+this.name+"_records");if(this.fixedBody?(rt=v.height()-(this.show.header?w2utils.getSize(nt,"height"):0)-(this.show.toolbar?w2utils.getSize(tt,"height"):0)-(a.css("display")!="none"?w2utils.getSize(a,"height"):0)-(this.show.footer?w2utils.getSize(it,"height"):0),l.css("height",rt)):setTimeout(function(){var n=w2utils.getSize(r,"height")+w2utils.getSize($("#grid_"+i.name+"_records table"),"height");i.height=n+w2utils.getSize(v,"+height")+(i.show.header?w2utils.getSize(nt,"height"):0)+(i.show.toolbar?w2utils.getSize(tt,"height"):0)+(a.css("display")!="none"?w2utils.getSize(a,"height"):0)+(i.show.footer?w2utils.getSize(it,"height"):0),v.css("height",i.height),l.css("height",n),g.css("height",w2utils.getSize(v,"height")+w2utils.getSize(g,"+height"))},1),c=!1,h=!1,l.width()<$(f).find(">table").width()&&(c=!0),l.height()-r.height()<$(f).find(">table").height()+(c?w2utils.scrollBarSize():0)&&(h=!0),this.fixedBody||(h=!1,c=!1),c||h?(r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").css("width",w2utils.scrollBarSize()).show(),f.css({top:(this.columnGroups.length>0&&this.show.columns?1:0)+w2utils.getSize(r,"height")+"px","-webkit-overflow-scrolling":"touch","overflow-x":c?"auto":"hidden","overflow-y":h?"auto":"hidden"})):(r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").hide(),f.css({top:(this.columnGroups.length>0&&this.show.columns?1:0)+w2utils.getSize(r,"height")+"px",overflow:"hidden"}),f.length>0&&(this.last.scrollTop=0,this.last.scrollLeft=0)),this.show.emptyRecords&&!h&&(d=Math.floor(f.height()/this.recordHeight)+1,this.fixedBody))for(y=this.buffered;y<=d;y++){for(e="",e+='',this.show.lineNumbers&&(e+=''),this.show.selectColumn&&(e+=''),this.show.expandColumn&&(e+=''),s=0;!0&&this.columns.length>0;){if(n=this.columns[s],n.hidden)if(s++,typeof this.columns[s]=="undefined")break;else continue;if(e+='',s++,typeof this.columns[s]=="undefined")break}e+='',e+="",$("#grid_"+this.name+"_records > table").append(e)}if(l.length>0){var p=parseInt(l.width())-(h?w2utils.scrollBarSize():0)-(this.show.lineNumbers?34:0)-(this.show.selectColumn?26:0)-(this.show.expandColumn?26:0),k=p,o=0,w=!1;for(t=0;tk&&n.hidden!==!0&&(n.hidden=!0,w=!0),n.gridMinWidth0)for(t=0;tparseInt(n.max)&&(n.sizeCalculated=n.max+"px"),b+=parseInt(n.sizeCalculated));if(u=parseInt(k)-parseInt(b),u>0&&o>0)for(t=0;;){if(n=this.columns[t],typeof n=="undefined"){t=0;continue}if(n.hidden||n.sizeType=="px"){t++;continue}if(n.sizeCalculated=parseInt(n.sizeCalculated)+1+"px",u--,u==0)break;t++}else u>0&&r.find("> table > tbody > tr:nth-child(1) td.w2ui-head-last").css("width",w2utils.scrollBarSize()).show();r.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-head-last")&&$(t).css("width",w2utils.scrollBarSize()+(u>0&&o==0?u:0)+"px")}),r.find("> table > tbody > tr").length==3&&r.find("> table > tbody > tr:nth-child(1) td").html("").css({height:"0px",border:"0px",padding:"0px",margin:"0px"}),f.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-grid-data-last")&&$(t).css("width",(u>0&&o==0?u:0)+"px")}),a.find("> table > tbody > tr:nth-child(1) td").each(function(n,t){var r=$(t).attr("col");typeof r!="undefined"&&i.columns[r]&&$(t).css("width",i.columns[r].sizeCalculated),$(t).hasClass("w2ui-grid-data-last")&&$(t).css("width",w2utils.scrollBarSize()+(u>0&&o==0?u:0)+"px")}),this.initResize(),this.refreshRanges(),this.last.scrollTop!=""&&f.length>0&&(r.prop("scrollLeft",this.last.scrollLeft),f.prop("scrollTop",this.last.scrollTop),f.prop("scrollLeft",this.last.scrollLeft))},getSearchesHTML:function(){for(var i='',f=!1,n,u,r,t=0;t",f=!0),typeof n.inTag=="undefined"&&(n.inTag=""),typeof n.outTag=="undefined"&&(n.outTag=""),typeof n.type=="undefined"&&(n.type="text"),n.type=="text"&&(r='"),(n.type=="int"||n.type=="float"||n.type=="date")&&(r='"),n.type=="list"&&(r='is '),i+='\t\t\t\t"}return i+='\t
      '+u+''+n.caption+''+r+'';switch(n.type){case"alphaNumeric":case"text":i+='";break;case"int":case"float":case"hex":case"money":case"date":i+='";break;case"list":i+='"}i+=n.outTag+"\t
      \t\t
      \t\t\t\t\t\t
      \t
      '},getColumnsHTML:function(){function r(){var i="",u,f,t,r,e,o,s;for(n.columnGroups[n.columnGroups.length-1].caption!=""&&n.columnGroups.push({caption:""}),n.show.lineNumbers&&(i+='\t
       
      '),n.show.selectColumn&&(i+='\t
       
      '),n.show.expandColumn&&(i+='\t
       
      '),u=0,f=0;f
      '),i+='"+s+'\t
      '+(r.caption==""?" ":r.caption)+"\t
      "}else i+='\t
      '+(t.caption==""?" ":t.caption)+"\t
      ";u+=t.span}return i+=""}function t(t){var u="",f,s,r,i,c,e,o,h;for(n.show.lineNumbers&&(u+='\t
      #
      "),n.show.selectColumn&&(u+='\t
      \t\t\t
      "),n.show.expandColumn&&(u+='\t
       
      '),f=0,s=0,r=0;r
      '),u+='"+h+'\t
      '+(i.caption==""?" ":i.caption)+"\t
      ")}return u+='
       
      ',u+=""}var n=this,i="";return this.show.columnHeaders&&(i=this.columnGroups.length>0?t(!0)+r()+t(!1):t(!0)),i},getRecordsHTML:function(){var r,i,n,t;for(this.show_extra=this.buffered>300?30:300,r=$("#grid_"+this.name+"_records"),i=Math.floor(r.height()/this.recordHeight)+this.show_extra+1,this.fixedBody||(i=this.buffered),n=""+this.getRecordHTML(-1,0),n+='\t',t=0;t\t\t
      ',this.last.range_start=0,this.last.range_end=i,n},getSummaryHTML:function(){var t,n;if(this.summary.length!=0){for(t="",n=0;n0&&$(i.box).find(".w2ui-grid-data > div").w2marker(n)},50))}var nt=+new Date,i=this,t=$("#grid_"+this.name+"_records"),l,v,p,f,e,h,s,y,k,u,o,r,g,a,b,w,c;if(this.records.length!=0&&t.length!=0&&t.height()!=0){if(this.show_extra=this.buffered>300?30:300,t.height()0&&this.refresh();return}if(l=Math.floor(t[0].scrollTop/this.recordHeight+1),v=Math.floor(t[0].scrollTop/this.recordHeight+1)+Math.round(t.height()/this.recordHeight),l>this.buffered&&(l=this.buffered),v>this.buffered&&(v=this.buffered),p=typeof this.url!="object"?this.url:this.url.get,$("#grid_"+this.name+"_footer .w2ui-footer-right").html(w2utils.formatNumber(this.offset+l)+"-"+w2utils.formatNumber(this.offset+v)+" "+w2utils.lang("of")+" "+w2utils.formatNumber(this.total)+(p?" ("+w2utils.lang("buffered")+" "+w2utils.formatNumber(this.buffered)+(this.offset>0?", skip "+w2utils.formatNumber(this.offset):"")+")":"")),p||this.fixedBody&&!(this.total<=300)){if(f=Math.floor(t[0].scrollTop/this.recordHeight)-this.show_extra,e=f+Math.floor(t.height()/this.recordHeight)+this.show_extra*2+1,f<1&&(f=1),e>this.total&&(e=this.total),h=t.find("#grid_"+this.name+"_rec_top"),s=t.find("#grid_"+this.name+"_rec_bottom"),String(h.next().prop("id")).indexOf("_expanded_row")!=-1&&h.next().remove(),String(s.prev().prop("id")).indexOf("_expanded_row")!=-1&&s.prev().remove(),y=parseInt(h.next().attr("line")),k=parseInt(s.prev().attr("line")),y=y-this.show_extra+2&&f>1)return;for(;;){if(u=t.find("#grid_"+this.name+"_rec_bottom").prev(),u.attr("line")=="top")break;if(parseInt(u.attr("line"))>e)u.remove();else break}for(u=t.find("#grid_"+this.name+"_rec_top").next(),o=u.attr("line"),o=="bottom"&&(o=e),r=parseInt(o)-1;r>=f;r--)this.records[r-1]&&(this.records[r-1].expanded===!0&&(this.records[r-1].expanded=!1),h.after(this.getRecordHTML(r-1,r)));d(),setTimeout(function(){i.refreshRanges()},0)}if(g=(f-1)*i.recordHeight,a=(this.buffered-e)*i.recordHeight,a<0&&(a=0),h.css("height",g+"px"),s.css("height",a+"px"),i.last.range_start=f,i.last.range_end=e,b=Math.floor(t[0].scrollTop/this.recordHeight),w=b+Math.floor(t.height()/this.recordHeight),w+10>this.buffered&&this.last.pull_more!==!0&&this.buffered
      '),i.last.pull_more=!0,i.last.xhr_offset+=i.limit,i.request("get-records")});c.find("td").text().indexOf("Load")==-1&&c.find("td").html("
      Load "+i.limit+" More...
      ")}this.buffered>=this.total-this.offset&&$("#grid_"+this.name+"_rec_more").hide();return}}},getRecordHTML:function(n,t,i){var r="",c,a,v,o,e,u,f,s,l;if(n==-1){r+='
      ',this.show.lineNumbers&&(r+=''),this.show.selectColumn&&(r+=''),this.show.expandColumn&&(r+='');for(c in this.columns)this.columns[c].hidden||(r+='');return r+='',r+=""}if(a=typeof this.url!="object"?this.url:this.url.get,i!==!0)if(this.searchData.length>0&&!a){if(n>=this.last.searchIds.length)return"";n=this.last.searchIds[n],record=this.records[n]}else{if(n>=this.records.length)return"";record=this.records[n]}else{if(n>=this.summary.length)return"";record=this.summary[n]}if(!record)return"";for(v=w2utils.escapeId(record.recid),o=!1,record.selected&&this.selectType=="row"&&(o=!0),r+='",this.show.lineNumbers&&(r+='"),this.show.selectColumn&&(r+='"),this.show.expandColumn&&(e="",e=record.expanded===!0?"-":"+",record.expanded=="none"&&(e=""),record.expanded=="spinner"&&(e='
      '),r+='"),u=0;;){if(f=this.columns[u],f.hidden)if(u++,typeof this.columns[u]=="undefined")break;else continue;var y=record.changed&&record.changes[f.field],p=this.getCellHTML(n,u,i),h="";if(typeof f.render=="string"&&(s=f.render.toLowerCase().split(":"),$.inArray(s[0],["number","int","float","money","percent"])!=-1&&(h="text-align: right"),$.inArray(s[0],["date"])!=-1&&(h="text-align: right")),l=!1,record.selected&&$.inArray(u,record.selectedColumns)!=-1&&(l=!0),r+='",u++,typeof this.columns[u]=="undefined")break}return r+='',r+=""},getCellHTML:function(n,t,i){var f=this.columns[t],e=i!==!0?this.records[n]:this.summary[n],r=this.parseField(e,f.field),c=e.changed&&typeof e.changes[f.field]!="undefined",s;if(c&&(r=e.changes[f.field]),(r==null||typeof r=="undefined")&&(r=""),typeof f.render!="undefined"){if(typeof f.render=="function"&&(r=f.render.call(this,e,n,t),r.length>=4&&r.substr(0,4)!=""+r+"")),typeof f.render=="object"&&(r="
      "+f.render[r]+"
      "),typeof f.render=="string"){var u=f.render.toLowerCase().split(":"),h="",o="";$.inArray(u[0],["number","int","float","money","percent"])!=-1&&(typeof u[1]!="undefined"&&w2utils.isInt(u[1])||(u[1]=0),u[1]>20&&(u[1]=20),u[1]<0&&(u[1]=0),u[0]=="money"&&(u[1]=2,h=w2utils.settings.currencySymbol),u[0]=="percent"&&(o="%",u[1]!=="0"&&(u[1]=1)),u[0]=="int"&&(u[1]=0),r="
      "+h+w2utils.formatNumber(Number(r).toFixed(u[1]))+o+"
      "),u[0]=="date"&&((typeof u[1]=="undefined"||u[1]=="")&&(u[1]=w2utils.settings.date_display),r="
      "+h+w2utils.formatDate(r,u[1])+o+"
      "),u[0]=="age"&&(r="
      "+h+w2utils.age(r)+o+"
      ")}}else this.show.recordTitles?(s=String(r).replace(/"/g,"''"),typeof f.title!="undefined"&&(typeof f.title=="function"&&(s=f.title.call(this,e,n,t)),typeof f.title=="string"&&(s=f.title)),r='
      '+r+"
      "):r="
      "+r+"
      ";return(r==null||typeof r=="undefined")&&(r=""),r},getFooterHTML:function(){return'
      \t\t\t
      '},status:function(n){var r,t,i;typeof n!="undefined"?$("#grid_"+this.name+"_footer").find(".w2ui-footer-left").html(n):(r="",t=this.getSelection(),t.length>0&&(r=String(t.length).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")+" "+w2utils.lang("selected"),i=t[0],typeof i=="object"&&(i=i.recid+", "+w2utils.lang("Column")+": "+i.column),t.length==1&&(r=w2utils.lang("Record ID")+": "+i+" ")),$("#grid_"+this.name+"_footer .w2ui-footer-left").html(r),t.length==1?this.toolbar.enable("edit"):this.toolbar.disable("edit"),t.length>=1?this.toolbar.enable("delete"):this.toolbar.disable("delete"))},lock:function(n,t){var i=$(this.box).find("> div:first-child");setTimeout(function(){w2utils.lock(i,n,t)},10)},unlock:function(){var n=this.box;setTimeout(function(){w2utils.unlock(n)},25)},parseField:function(n,t){var i="",r,u;try{i=n,r=String(t).split(".");for(u in r)i=i[r[u]]}catch(f){i=""}return i}},$.extend(w2grid.prototype,w2utils.event),w2obj.grid=w2grid}(jQuery),function(n){var t=function(t){this.box=null,this.name=null,this.panels=[],this.tmp={},this.padding=1,this.resizer=4,this.style="",this.onShow=null,this.onHide=null,this.onResizing=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.layout,t)};n.fn.w2layout=function(i){function s(t,i,r){var u=t.get(i);return(u!=null&&typeof r=="undefined"&&(r=u.tabs),u==null||r==null)?!1:(n.isArray(r)&&(r={tabs:r}),n().w2destroy(t.name+"_"+i+"_tabs"),u.tabs=n().w2tabs(n.extend({},r,{owner:t,name:t.name+"_"+i+"_tabs"})),u.show.tabs=!0,!0)}function o(t,i,r){var u=t.get(i);return(u!=null&&typeof r=="undefined"&&(r=u.toolbar),u==null||r==null)?!1:(n.isArray(r)&&(r={items:r}),n().w2destroy(t.name+"_"+i+"_toolbar"),u.toolbar=n().w2toolbar(n.extend({},r,{owner:t,name:t.name+"_"+i+"_toolbar"})),u.show.toolbar=!0,!0)}var f,r,u,e;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return e=w2ui[n(this).attr("name")],e[i].apply(e,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2layout")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2layout().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}f=i.panels,r=new t(i),n.extend(r,{handlers:[],panels:[]});for(u in f)r.panels[u]=n.extend(!0,{},t.prototype.panel,f[u]),(n.isPlainObject(r.panels[u].tabs)||n.isArray(r.panels[u].tabs))&&s(r,f[u].type),(n.isPlainObject(r.panels[u].toolbar)||n.isArray(r.panels[u].toolbar))&&o(r,f[u].type);for(u in{top:"",left:"",main:"",preview:"",right:"",bottom:""})r.get(u)==null&&(r.panels[u]=n.extend(!0,{},t.prototype.panel,{type:u,hidden:!0,size:50}));return n(this).length>0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={panel:{type:null,size:100,minSize:20,hidden:!1,resizable:!1,overflow:"auto",style:"",content:"",tabs:null,toolbar:null,width:null,height:null,show:{toolbar:!1,tabs:!1},onRefresh:null,onShow:null,onHide:null},html:function(n,t,i){return this.content(n,t,i)},content:function(t,i,r){var s=this,u=this.get(t),o,h,c,e,f;return t=="css"?(n("#layout_"+s.name+"_panel_css").html(""),!0):u==null?!1:n("#layout_"+this.name+"_panel2_"+u.type).length>0?!1:(n("#layout_"+this.name+"_panel_"+u.type).scrollTop(0),i==null||typeof i=="undefined")?u.content:i instanceof jQuery?(console.log("ERROR: You can not pass jQuery object to w2layout.content() method"),!1):(o=n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-content"),h=n(o).position().top,o.attr("class","w2ui-panel-content"),o.length>0&&typeof u.style!="undefined"&&(o[0].style.cssText=u.style),u.content==""?(u.content=i,u.hidden||this.refresh(t)):(u.content=i,u.hidden||(r!=null&&r!=""&&typeof r!="undefined"?(c="layout_"+this.name+"_panel_"+u.type,e=n("#"+c+" > .w2ui-panel-content"),e.after('
      '),f=n("#"+c+" > .w2ui-panel-content.new-panel"),e.css("top",h),f.css("top",h),typeof i=="object"?(i.box=f[0],i.render()):f.html(i),w2utils.transition(e[0],f[0],r,function(){e.remove(),f.removeClass("new-panel"),f.css("overflow",u.overflow),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100)})):u.hidden||this.refresh(t))),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100),!0)},load:function(t,i,r,u){var f=this;return t=="css"?(n.get(i,function(n,i,r){f.content(t,r.responseText),u&&u()}),!0):this.get(t)!=null?(n.get(i,function(n,i,e){f.content(t,e.responseText,r),u&&u(),window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){f.resize()},100)}),!0):!1},sizeTo:function(t,i){var r=this,u=r.get(t);return u==null?!1:(n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".35s","-moz-transition":".35s","-ms-transition":".35s","-o-transition":".35s"}),setTimeout(function(){r.set(t,{size:i})},1),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.resize()},500),!0)},show:function(t,i){var r=this,f=this.trigger({phase:"before",type:"show",target:t,object:this.get(t),immediate:i}),u;return f.isCancelled===!0?!1:(u=r.get(t),u==null)?!1:(u.hidden=!1,i===!0?(n("#layout_"+r.name+"_panel_"+t).css({opacity:"1"}),u.resizabled&&n("#layout_"+r.name+"_resizer_"+t).show(),r.trigger(n.extend(f,{phase:"after"})),r.resize()):(u.resizabled&&n("#layout_"+r.name+"_resizer_"+t).show(),n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s"}),setTimeout(function(){r.resize()},1),setTimeout(function(){n("#layout_"+r.name+"_panel_"+t).css({opacity:"1"})},250),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.trigger(n.extend(f,{phase:"after"})),r.resize()},500)),!0)},hide:function(t,i){var r=this,f=this.trigger({phase:"before",type:"hide",target:t,object:this.get(t),immediate:i}),u;return f.isCancelled===!0?!1:(u=r.get(t),u==null)?!1:(u.hidden=!0,i===!0?(n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),n("#layout_"+r.name+"_resizer_"+t).hide(),r.trigger(n.extend(f,{phase:"after"})),r.resize()):(n("#layout_"+r.name+"_resizer_"+t).hide(),n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":".2s","-moz-transition":".2s","-ms-transition":".2s","-o-transition":".2s"}),n("#layout_"+r.name+"_panel_"+t).css({opacity:"0"}),setTimeout(function(){r.resize()},1),setTimeout(function(){n(r.box).find(" > div .w2ui-panel").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s"}),r.trigger(n.extend(f,{phase:"after"})),r.resize()},500)),!0)},toggle:function(n,t){var i=this.get(n);return i==null?!1:i.hidden?this.show(n,t):this.hide(n,t)},set:function(t,i){var r=this.get(t,!0);return r==null?!1:(n.extend(this.panels[r],i),this.refresh(t),this.resize(),!0)},get:function(n,t){var r=null,i;for(i in this.panels)if(this.panels[i].type==n)return t===!0?i:this.panels[i];return null},el:function(t){var i=n("#layout_"+this.name+"_panel_"+t+" .w2ui-panel-content");return i.length!=1?null:i[0]},hideToolbar:function(t){var i=this.get(t);i&&(i.show.toolbar=!1,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-toolbar").hide(),this.resize())},showToolbar:function(t){var i=this.get(t);i&&(i.show.toolbar=!0,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-toolbar").show(),this.resize())},toggleToolbar:function(n){var t=this.get(n);t&&(t.show.toolbar?this.hideToolbar(n):this.showToolbar(n))},hideTabs:function(t){var i=this.get(t);i&&(i.show.tabs=!1,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-tabs").hide(),this.resize())},showTabs:function(t){var i=this.get(t);i&&(i.show.tabs=!0,n("#layout_"+this.name+"_panel_"+t+" > .w2ui-panel-tabs").show(),this.resize())},toggleTabs:function(n){var t=this.get(n);t&&(t.show.tabs?this.hideTabs(n):this.showTabs(n))},render:function(t){function a(){i.tmp.events={resize:function(){w2ui[i.name].resize()},resizeStart:c,mousemove:h,mouseup:s};n(window).on("resize",i.tmp.events.resize);n(document).on("mousemove",i.tmp.events.mousemove);n(document).on("mouseup",i.tmp.events.mouseup)}function c(t,r){i.box&&(r||(r=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),i.tmp.resize={type:t,x:r.screenX,y:r.screenY,div_x:0,div_y:0,value:0},(t=="left"||t=="right")&&(i.tmp.resize.value=parseInt(n("#layout_"+i.name+"_resizer_"+t)[0].style.left)),(t=="top"||t=="preview"||t=="bottom")&&(i.tmp.resize.value=parseInt(n("#layout_"+i.name+"_resizer_"+t)[0].style.top)))}function s(t){var u,f;if(i.box&&(t||(t=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),typeof i.tmp.resize!="undefined")){if(i.tmp.div_x!=0||i.tmp.resize.div_y!=0){var e=i.get("top"),o=i.get("bottom"),r=i.get(i.tmp.resize.type),h=parseInt(n(i.box).height()),c=parseInt(n(i.box).width()),s=String(r.size);switch(i.tmp.resize.type){case"top":u=parseInt(r.sizeCalculated)+i.tmp.resize.div_y,f=0;break;case"bottom":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_y,f=0;break;case"preview":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_y,f=(e&&!e.hidden?e.sizeCalculated:0)+(o&&!o.hidden?o.sizeCalculated:0);break;case"left":u=parseInt(r.sizeCalculated)+i.tmp.resize.div_x,f=0;break;case"right":u=parseInt(r.sizeCalculated)-i.tmp.resize.div_x,f=0}r.size=s.substr(s.length-1)=="%"?Math.floor(u*100/(r.type=="left"||r.type=="right"?c:h-f)*100)/100+"%":u,i.resize()}n("#layout_"+i.name+"_resizer_"+i.tmp.resize.type).removeClass("active"),delete i.tmp.resize}}function h(t){var f,u,r;if(i.box&&(t||(t=window.event),typeof i.tmp.resize!="undefined")){if(f=i.get(i.tmp.resize.type),u=i.trigger({phase:"before",type:"resizing",target:i.tmp.resize.type,object:f,originalEvent:t}),u.isCancelled===!0)return!1;r=n("#layout_"+i.name+"_resizer_"+i.tmp.resize.type),r.hasClass("active")||r.addClass("active"),i.tmp.resize.div_x=t.screenX-i.tmp.resize.x,i.tmp.resize.div_y=t.screenY-i.tmp.resize.y,i.tmp.resizing=="left"&&i.get("left").minSize-i.tmp.resize.div_x>i.get("left").width&&(i.tmp.resize.div_x=i.get("left").minSize-i.get("left").width),i.tmp.resize.type=="left"&&i.get("main").minSize+i.tmp.resize.div_x>i.get("main").width&&(i.tmp.resize.div_x=i.get("main").width-i.get("main").minSize),i.tmp.resize.type=="right"&&i.get("right").minSize+i.tmp.resize.div_x>i.get("right").width&&(i.tmp.resize.div_x=i.get("right").width-i.get("right").minSize),i.tmp.resize.type=="right"&&i.get("main").minSize-i.tmp.resize.div_x>i.get("main").width&&(i.tmp.resize.div_x=i.get("main").minSize-i.get("main").width),i.tmp.resize.type=="top"&&i.get("top").minSize-i.tmp.resize.div_y>i.get("top").height&&(i.tmp.resize.div_y=i.get("top").minSize-i.get("top").height),i.tmp.resize.type=="top"&&i.get("main").minSize+i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").height-i.get("main").minSize),i.tmp.resize.type=="bottom"&&i.get("bottom").minSize+i.tmp.resize.div_y>i.get("bottom").height&&(i.tmp.resize.div_y=i.get("bottom").height-i.get("bottom").minSize),i.tmp.resize.type=="bottom"&&i.get("main").minSize-i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").minSize-i.get("main").height),i.tmp.resize.type=="preview"&&i.get("preview").minSize+i.tmp.resize.div_y>i.get("preview").height&&(i.tmp.resize.div_y=i.get("preview").height-i.get("preview").minSize),i.tmp.resize.type=="preview"&&i.get("main").minSize-i.tmp.resize.div_y>i.get("main").height&&(i.tmp.resize.div_y=i.get("main").minSize-i.get("main").height);switch(i.tmp.resize.type){case"top":case"preview":case"bottom":i.tmp.resize.div_x=0,r.length>0&&(r[0].style.top=i.tmp.resize.value+i.tmp.resize.div_y+"px");break;case"left":case"right":i.tmp.resize.div_y=0,r.length>0&&(r[0].style.left=i.tmp.resize.value+i.tmp.resize.div_x+"px")}i.trigger(n.extend(u,{phase:"after"}))}}var i=this,o,f,r,u,l,e;if((window.getSelection&&window.getSelection().removeAllRanges(),o=+new Date,f=i.trigger({phase:"before",type:"render",target:i.name,box:t}),f.isCancelled===!0)||(typeof t!="undefined"&&t!=null&&(n(i.box).find("#layout_"+i.name+"_panel_main").length>0&&n(i.box).removeAttr("name").removeClass("w2ui-layout").html(""),i.box=t),!i.box))return!1;n(i.box).attr("name",i.name).addClass("w2ui-layout").html("
      "),n(i.box).length>0&&(n(i.box)[0].style.cssText+=i.style),r=["top","left","main","preview","right","bottom"];for(u in r)l=i.get(r[u]),e='
      \t
      \t
      \t
      ',n(i.box).find(" > div").append(e);return n(i.box).find(" > div").append('
      0&&(f.css("overflow",i.overflow)[0].style.cssText+=";"+i.style),i.resizable===!0?n("#layout_"+this.name+"_resizer_"+t).show():n("#layout_"+this.name+"_resizer_"+t).hide(),typeof i.content=="object"&&i.content.render?(i.content.box=n("#layout_"+r.name+"_panel_"+i.type+" > .w2ui-panel-content")[0],i.content.render()):n("#layout_"+r.name+"_panel_"+i.type+" > .w2ui-panel-content").html(i.content),u=n(r.box).find("#layout_"+r.name+"_panel_"+i.type+" .w2ui-panel-tabs"),i.show.tabs?u.find("[name="+i.tabs.name+"]").length==0&&i.tabs!=null?u.w2render(i.tabs):i.tabs.refresh():u.html("").removeClass("w2ui-tabs").hide(),u=n(r.box).find("#layout_"+r.name+"_panel_"+i.type+" .w2ui-panel-toolbar"),i.show.toolbar?u.find("[name="+i.toolbar.name+"]").length==0&&i.toolbar!=null?u.w2render(i.toolbar):i.toolbar.refresh():u.html("").removeClass("w2ui-toolbar").hide()}else{if(n("#layout_"+r.name+"_panel_main").length<=0){r.render();return}r.resize();for(i in this.panels)r.refresh(this.panels[i].type)}return r.trigger(n.extend(e,{phase:"after"})),+new Date-o}},resize:function(){var ut,nt,y,h,u,tt,b,a,p;if((window.getSelection&&window.getSelection().removeAllRanges(),!this.box)||(ut=+new Date,nt=this.trigger({phase:"before",type:"resize",target:this.name,panel:this.tmp.resizing}),nt.isCancelled===!0))return!1;this.padding<0&&(this.padding=0),y=parseInt(n(this.box).width()),h=parseInt(n(this.box).height()),n(this.box).find(" > div").css({width:y+"px",height:h+"px"});var p=this,it=this.get("main"),l=this.get("preview"),s=this.get("left"),c=this.get("right"),r=this.get("top"),f=this.get("bottom"),et=!0,ft=l!=null&&l.hidden!=!0?!0:!1,d=s!=null&&s.hidden!=!0?!0:!1,rt=c!=null&&c.hidden!=!0?!0:!1,w=r!=null&&r.hidden!=!0?!0:!1,g=f!=null&&f.hidden!=!0?!0:!1;for(a in{top:"",left:"",right:"",bottom:"",preview:""})u=this.get(a),tt=String(u.size),u&&tt.substr(tt.length-1)=="%"?(b=h,u.type=="preview"&&(b=b-(r&&!r.hidden?r.sizeCalculated:0)-(f&&!f.hidden?f.sizeCalculated:0)),u.sizeCalculated=parseInt((u.type=="left"||u.type=="right"?y:b)*parseFloat(u.size)/100)):u.sizeCalculated=parseInt(u.size),u.sizeCalculatedthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_top").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("top",n),!1}))}else n("#layout_"+this.name+"_panel_top").hide();if(s!=null&&s.hidden!=!0){var o=0,e=0+(w?r.sizeCalculated+this.padding:0),t=s.sizeCalculated,i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0),v=n("#layout_"+this.name+"_panel_left");window.navigator.userAgent.indexOf("MSIE")>0&&v.length>0&&v[0].clientHeightthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_left").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ew-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("left",n),!1}))}else n("#layout_"+this.name+"_panel_left").hide(),n("#layout_"+this.name+"_resizer_left").hide();if(c!=null&&c.hidden!=!0){var o=y-c.sizeCalculated,e=0+(w?r.sizeCalculated+this.padding:0),t=c.sizeCalculated,i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0);n("#layout_"+this.name+"_panel_right").css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px"}).show(),c.width=t,c.height=i,c.resizable&&(o=o-this.padding,t=this.resizer>this.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_right").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ew-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("right",n),!1}))}else n("#layout_"+this.name+"_panel_right").hide();if(f!=null&&f.hidden!=!0){var o=0,e=h-f.sizeCalculated,t=y,i=f.sizeCalculated;n("#layout_"+this.name+"_panel_bottom").css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px"}).show(),f.width=t,f.height=i,f.resizable&&(e=e-(this.padding==0?0:this.padding),i=this.resizer>this.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_bottom").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("bottom",n),!1}))}else n("#layout_"+this.name+"_panel_bottom").hide();var o=0+(d?s.sizeCalculated+this.padding:0),e=0+(w?r.sizeCalculated+this.padding:0),t=y-(d?s.sizeCalculated+this.padding:0)-(rt?c.sizeCalculated+this.padding:0),i=h-(w?r.sizeCalculated+this.padding:0)-(g?f.sizeCalculated+this.padding:0)-(ft?l.sizeCalculated+this.padding:0),v=n("#layout_"+this.name+"_panel_main");if(window.navigator.userAgent.indexOf("MSIE")>0&&v.length>0&&v[0].clientHeight0&&v.length>0&&v[0].clientHeightthis.padding?this.resizer:this.padding,n("#layout_"+this.name+"_resizer_preview").show().css({display:"block",left:o+"px",top:e+"px",width:t+"px",height:i+"px",cursor:"ns-resize"}).bind("mousedown",function(n){return w2ui[p.name].tmp.events.resizeStart("preview",n),!1}))}else n("#layout_"+this.name+"_panel_preview").hide();for(a in{top:"",left:"",main:"",preview:"",right:"",bottom:""}){var k=this.get(a),u="#layout_"+this.name+"_panel_"+a+" > .w2ui-panel-",h=0;k.show.tabs&&(k.tabs!=null&&w2ui[this.name+"_"+a+"_tabs"]&&w2ui[this.name+"_"+a+"_tabs"].resize(),h+=w2utils.getSize(n(u+"tabs").css({display:"block"}),"height")),k.show.toolbar&&(k.toolbar!=null&&w2ui[this.name+"_"+a+"_toolbar"]&&w2ui[this.name+"_"+a+"_toolbar"].resize(),h+=w2utils.getSize(n(u+"toolbar").css({top:h+"px",display:"block"}),"height")),n(u+"content").css({display:"block"}).css({top:h+"px"})}return p=this,clearTimeout(this._resize_timer),this._resize_timer=setTimeout(function(){var t,i;for(t in w2ui)typeof w2ui[t].resize=="function"&&(w2ui[t].panels=="undefined"&&w2ui[t].resize(),i=n(w2ui[t].box).parents(".w2ui-layout"),i.length>0&&i.attr("name")==p.name&&w2ui[t].resize())},100),this.trigger(n.extend(nt,{phase:"after"})),+new Date-ut},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});return t.isCancelled===!0?!1:typeof w2ui[this.name]=="undefined"?!1:(n(this.box).find("#layout_"+this.name+"_panel_main").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-layout").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"})),this.tmp.events&&this.tmp.events.resize&&n(window).off("resize",this.tmp.events.resize),this.tmp.events&&this.tmp.events.mousemove&&n(document).off("mousemove",this.tmp.events.mousemove),this.tmp.events&&this.tmp.events.mouseup&&n(document).off("mouseup",this.tmp.events.mouseup),!0)},lock:function(t,i,r){if(n.inArray(String(t),["left","right","top","bottom","preview","main"])==-1){console.log("ERROR: First parameter needs to be the a valid panel name.");return}var u="#layout_"+this.name+"_panel_"+t;w2utils.lock(u,i,r)},unlock:function(t){if(n.inArray(String(t),["left","right","top","bottom","preview","main"])==-1){console.log("ERROR: First parameter needs to be the a valid panel name.");return}var i="#layout_"+this.name+"_panel_"+t;w2utils.unlock(i)}},n.extend(t.prototype,w2utils.event),w2obj.layout=t}(jQuery),w2popup={},function(n){n.fn.w2popup=function(t,i){typeof t=="undefined"&&(i={},t="open"),n.isPlainObject(t)&&(i=t,t="open"),t=t.toLowerCase(),t=="load"&&typeof i=="string"&&(i={url:i}),t=="open"&&typeof i.url!="undefined"&&(t="load"),typeof i=="undefined"&&(i={});var r={};return n(this).length>0&&(n(this).find("div[rel=title], div[rel=body], div[rel=buttons]").length>0?(n(this).find("div[rel=title]").length>0&&(r.title=n(this).find("div[rel=title]").html()),n(this).find("div[rel=body]").length>0&&(r.body=n(this).find("div[rel=body]").html(),r.style=n(this).find("div[rel=body]")[0].style.cssText),n(this).find("div[rel=buttons]").length>0&&(r.buttons=n(this).find("div[rel=buttons]").html())):(r.title=" ",r.body=n(this).html()),parseInt(n(this).css("width"))!=0&&(r.width=parseInt(n(this).css("width"))),parseInt(n(this).css("height"))!=0&&(r.height=parseInt(n(this).css("height")))),w2popup[t](n.extend({},r,i))},w2popup={defaults:{title:"",body:"",buttons:"",style:"",color:"#000",opacity:.4,speed:.3,modal:!1,maximized:!1,keyboard:!0,width:500,height:300,showClose:!0,showMax:!1,transition:null},handlers:[],onOpen:null,onClose:null,onMax:null,onMin:null,onKeydown:null,open:function(t){function w(n){if(n||(n=window.event),window.addEventListener||window.document.attachEvent("onselectstart",function(){return!1}),i.resizing=!0,i.tmp_x=n.screenX,i.tmp_y=n.screenY,n.stopPropagation?n.stopPropagation():n.cancelBubble=!0,n.preventDefault)n.preventDefault();else return!1}function c(t){i.resizing==!0&&(t||(t=window.event),i.tmp_div_x=t.screenX-i.tmp_x,i.tmp_div_y=t.screenY-i.tmp_y,n("#w2ui-popup").css({"-webkit-transition":"none","-webkit-transform":"translate3d("+i.tmp_div_x+"px, "+i.tmp_div_y+"px, 0px)","-moz-transition":"none","-moz-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-ms-transition":"none","-ms-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-o-transition":"none","-o-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)"}),n("#w2ui-panel").css({"-webkit-transition":"none","-webkit-transform":"translate3d("+i.tmp_div_x+"px, "+i.tmp_div_y+"px, 0px)","-moz-transition":"none","-moz-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)","-ms-transition":"none","-ms-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px","-o-transition":"none","-o-transform":"translate("+i.tmp_div_x+"px, "+i.tmp_div_y+"px)"}))}function h(t){i.resizing==!0&&(t||(t=window.event),i.tmp_div_x=t.screenX-i.tmp_x,i.tmp_div_y=t.screenY-i.tmp_y,n("#w2ui-popup").css({"-webkit-transition":"none","-webkit-transform":"translate3d(0px, 0px, 0px)","-moz-transition":"none","-moz-transform":"translate(0px, 0px)","-ms-transition":"none","-ms-transform":"translate(0px, 0px)","-o-transition":"none","-o-transform":"translate(0px, 0px)",left:parseInt(n("#w2ui-popup").css("left"))+parseInt(i.tmp_div_x)+"px",top:parseInt(n("#w2ui-popup").css("top"))+parseInt(i.tmp_div_y)+"px"}),n("#w2ui-panel").css({"-webkit-transition":"none","-webkit-transform":"translate3d(0px, 0px, 0px)","-moz-transition":"none","-moz-transform":"translate(0px, 0px)","-ms-transition":"none","-ms-transform":"translate(0px, 0px)","-o-transition":"none","-o-transform":"translate(0px, 0px)",left:parseInt(n("#w2ui-panel").css("left"))+parseInt(i.tmp_div_x)+"px",top:parseInt(n("#w2ui-panel").css("top"))+parseInt(i.tmp_div_y)+"px"}),i.resizing=!1)}var p=this,o=n("#w2ui-popup").data("options"),t=n.extend({},this.defaults,{body:""},o,t),e,f,v,y,r,u,a,l,s,i;if(n("#w2ui-popup").length==0&&(w2popup.handlers=[],w2popup.onMax=null,w2popup.onMin=null,w2popup.onOpen=null,w2popup.onClose=null,w2popup.onKeydown=null),t.onOpen&&(w2popup.onOpen=t.onOpen),t.onClose&&(w2popup.onClose=t.onClose),t.onMax&&(w2popup.onMax=t.onMax),t.onMin&&(w2popup.onMin=t.onMin),t.onKeydown&&(w2popup.onKeydown=t.onKeydown),window.innerHeight==undefined?(e=document.documentElement.offsetWidth,f=document.documentElement.offsetHeight,w2utils.engine=="IE7"&&(e+=21,f+=4)):(e=window.innerWidth,f=window.innerHeight),parseInt(e)-10',t.title!=""&&(r+='
      '+(t.showClose?'
      Close
      ':"")+(t.showMax?'
      Max
      ':"")+t.title+"
      "),r+='
      ',r+='
      '+t.body+"
      ",r+="
      ",r+='
      ',r+='
      ',r+="
      ",t.buttons!=""&&(r+='
      '+t.buttons+"
      "),r+="
      ",n("body").append(r),setTimeout(function(){n("#w2ui-popup .w2ui-box2").hide(),n("#w2ui-popup").css({"-webkit-transition":t.speed+"s opacity, "+t.speed+"s -webkit-transform","-webkit-transform":"scale(1)","-moz-transition":t.speed+"s opacity, "+t.speed+"s -moz-transform","-moz-transform":"scale(1)","-ms-transition":t.speed+"s opacity, "+t.speed+"s -ms-transform","-ms-transform":"scale(1)","-o-transition":t.speed+"s opacity, "+t.speed+"s -o-transform","-o-transform":"scale(1)",opacity:"1"})},1),setTimeout(function(){n("#w2ui-popup").css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":""}),p.trigger(n.extend(u,{phase:"after"}))},t.speed*1e3)}else{if(u=this.trigger({phase:"before",type:"open",target:"popup",options:t,present:!0}),u.isCancelled===!0)return;(typeof o=="undefined"||o.width!=t.width||o.height!=t.height)&&(n("#w2ui-panel").remove(),w2popup.resize(t.width,t.height)),a=n("#w2ui-popup .w2ui-box2 > .w2ui-msg-body").html(t.body),a.length>0&&(a[0].style.cssText=t.style),n("#w2ui-popup .w2ui-msg-buttons").html(t.buttons),n("#w2ui-popup .w2ui-msg-title").html((t.showClose?'
      Close
      ':"")+(t.showMax?'
      Max
      ':"")+t.title),l=n("#w2ui-popup .w2ui-box1")[0],s=n("#w2ui-popup .w2ui-box2")[0],w2utils.transition(l,s,t.transition),s.className="w2ui-box1",l.className="w2ui-box2",n(s).addClass("w2ui-current-box"),n("#w2ui-popup").data("prev-size",null),setTimeout(function(){p.trigger(n.extend(u,{phase:"after"}))},1)}if(t._last_w2ui_name=w2utils.keyboard.active(),w2utils.keyboard.active(null),n("#w2ui-popup").data("options",t),t.keyboard)n(document).on("keydown",this.keydown);i={resizing:!1};n("#w2ui-popup .w2ui-msg-title").on("mousedown",function(n){w(n)}).on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});n("#w2ui-popup .w2ui-msg-body").on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});n("#w2ui-lock").on("mousemove",function(n){c(n)}).on("mouseup",function(n){h(n)});return this},keydown:function(t){var r=n("#w2ui-popup").data("options"),i;if(r.keyboard&&(i=w2popup.trigger({phase:"before",type:"keydown",target:"popup",options:r,object:w2popup,originalEvent:t}),i.isCancelled!==!0)){switch(t.keyCode){case 27:t.preventDefault(),n("#w2ui-popup .w2ui-popup-message").length>0?w2popup.message():w2popup.close()}w2popup.trigger(n.extend(i,{phase:"after"}))}},close:function(t){var r=this,t=n.extend({},n("#w2ui-popup").data("options"),t),i=this.trigger({phase:"before",type:"close",target:"popup",options:t});i.isCancelled!==!0&&(n("#w2ui-popup, #w2ui-panel").css({"-webkit-transition":t.speed+"s opacity, "+t.speed+"s -webkit-transform","-webkit-transform":"scale(0.9)","-moz-transition":t.speed+"s opacity, "+t.speed+"s -moz-transform","-moz-transform":"scale(0.9)","-ms-transition":t.speed+"s opacity, "+t.speed+"s -ms-transform","-ms-transform":"scale(0.9)","-o-transition":t.speed+"s opacity, "+t.speed+"s -o-transform","-o-transform":"scale(0.9)",opacity:"0"}),w2popup.unlockScreen(),setTimeout(function(){n("#w2ui-popup").remove(),n("#w2ui-panel").remove(),r.trigger(n.extend(i,{phase:"after"}))},t.speed*1e3),w2utils.keyboard.active(t._last_w2ui_name),t.keyboard&&n(document).off("keydown",this.keydown))},toggle:function(){var t=n("#w2ui-popup").data("options");t.maximized===!0?w2popup.min():w2popup.max()},max:function(){var r=this,t=n("#w2ui-popup").data("options"),i;t.maximized!==!0&&(i=this.trigger({phase:"before",type:"max",target:"popup",options:t}),i.isCancelled!==!0)&&(t.maximized=!0,t.prevSize=n("#w2ui-popup").css("width")+":"+n("#w2ui-popup").css("height"),n("#w2ui-popup").data("options",t),w2popup.resize(1e4,1e4,function(){r.trigger(n.extend(i,{phase:"after"}))}))},min:function(){var u=this,t=n("#w2ui-popup").data("options"),i,r;t.maximized===!0&&(i=t.prevSize.split(":"),r=this.trigger({phase:"before",type:"min",target:"popup",options:t}),r.isCancelled!==!0)&&(t.maximized=!1,t.prevSize=null,n("#w2ui-popup").data("options",t),w2popup.resize(i[0],i[1],function(){u.trigger(n.extend(r,{phase:"after"}))}))},get:function(){return n("#w2ui-popup").data("options")},set:function(n){w2popup.open(n)},clear:function(){n("#w2ui-popup .w2ui-msg-title").html(""),n("#w2ui-popup .w2ui-msg-body").html(""),n("#w2ui-popup .w2ui-msg-buttons").html("")},reset:function(){w2popup.open(w2popup.defaults)},load:function(t){function u(i,r){if(delete t.url,n("body").append('"),typeof r!="undefined"&&n("#w2ui-tmp #"+r).length>0?n("#w2ui-tmp #"+r).w2popup(t):n("#w2ui-tmp > div").w2popup(t),n("#w2ui-tmp > style").length>0){var u=n("
      ").append(n("#w2ui-tmp > style").clone()).html();n("#w2ui-popup #div-style").length==0&&n("#w2ui-ppopup").append('
      '),n("#w2ui-popup #div-style").html(u)}n("#w2ui-tmp").remove()}var i;if(String(t.url)=="undefined"){console.log("ERROR: The url parameter is empty.");return}var f=String(t.url).split("#"),r=f[0],e=f[1];String(t)=="undefined"&&(t={}),i=n("#w2ui-popup").data(r),typeof i!="undefined"&&i!=null?u(i,e):n.get(r,function(t,i,f){u(f.responseText,e),n("#w2ui-popup").data(r,f.responseText)})},message:function(t){var r,u,i,t;n().w2tag(),t||(t={width:200,height:100}),parseInt(t.width)<10&&(t.width=10),parseInt(t.height)<10&&(t.height=10),typeof t.hideOnClick=="undefined"&&(t.hideOnClick=!1),r=n("#w2ui-popup .w2ui-msg-title"),n("#w2ui-popup .w2ui-popup-message").length==0?(u=parseInt(n("#w2ui-popup").width()),n("#w2ui-popup .w2ui-box1").before('"),n("#w2ui-popup .w2ui-popup-message").data("options",t)):(typeof t.width=="undefined"&&(t.width=w2utils.getSize(n("#w2ui-popup .w2ui-popup-message"),"width")),typeof t.height=="undefined"&&(t.height=w2utils.getSize(n("#w2ui-popup .w2ui-popup-message"),"height"))),i=n("#w2ui-popup .w2ui-popup-message").css("display"),n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-moz-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-ms-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)","-o-transform":i=="none"?"translateY(-"+t.height+"px)":"translateY(0px)"}),i=="none"?(n("#w2ui-popup .w2ui-popup-message").show().html(t.html),setTimeout(function(){n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transition":"0s","-moz-transition":"0s","-ms-transition":"0s","-o-transition":"0s","z-Index":1500}),w2popup.lock(),typeof t.onOpen=="function"&&t.onOpen()},300)):(n("#w2ui-popup .w2ui-popup-message").css("z-Index",250),t=n("#w2ui-popup .w2ui-popup-message").data("options"),n("#w2ui-popup .w2ui-popup-message").remove(),w2popup.unlock(),typeof t.onClose=="function"&&t.onClose()),setTimeout(function(){n("#w2ui-popup .w2ui-popup-message").css({"-webkit-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-moz-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-ms-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)","-o-transform":i=="none"?"translateY(0px)":"translateY(-"+t.height+"px)"})},1)},lock:function(t,i){w2utils.lock(n("#w2ui-popup"),t,i)},unlock:function(){w2utils.unlock(n("#w2ui-popup"))},lockScreen:function(t){if(n("#w2ui-lock").length>0)return!1;if(typeof t=="undefined"&&(t=n("#w2ui-popup").data("options")),typeof t=="undefined"&&(t={}),t=n.extend({},w2popup.defaults,t),n("body").append('
      '),setTimeout(function(){n("#w2ui-lock").css({"-webkit-transition":t.speed+"s opacity","-moz-transition":t.speed+"s opacity","-ms-transition":t.speed+"s opacity","-o-transition":t.speed+"s opacity",opacity:t.opacity})},1),t.modal==!0){n("#w2ui-lock").on("mousedown",function(){n("#w2ui-lock").css({"-webkit-transition":".1s","-moz-transition":".1s","-ms-transition":".1s","-o-transition":".1s",opacity:"0.6"}),window.getSelection&&window.getSelection().removeAllRanges()});n("#w2ui-lock").on("mouseup",function(){setTimeout(function(){n("#w2ui-lock").css({"-webkit-transition":".1s","-moz-transition":".1s","-ms-transition":".1s","-o-transition":".1s",opacity:t.opacity})},100),window.getSelection&&window.getSelection().removeAllRanges()})}else n("#w2ui-lock").on("mouseup",function(){w2popup.close()});return!0},unlockScreen:function(){if(n("#w2ui-lock").length==0)return!1;var t=n.extend({},n("#w2ui-popup").data("options"),t);return n("#w2ui-lock").css({"-webkit-transition":t.speed+"s opacity","-moz-transition":t.speed+"s opacity","-ms-transition":t.speed+"s opacity","-o-transition":t.speed+"s opacity",opacity:0}),setTimeout(function(){n("#w2ui-lock").remove()},t.speed*1e3),!0},resize:function(t,i,r){var u=n("#w2ui-popup").data("options"),e,f;parseInt(n(window).width())-100?w2popup.message({width:400,height:150,html:'
      \t\t
      '+n+'
      \t\t
      ',onClose:function(){typeof i=="function"&&i()}}):w2popup.open({width:450,height:200,showMax:!1,title:t,body:'
      '+n+"
      ",buttons:'',onClose:function(){typeof i=="function"&&i()}})},w2confirm=function(n,t,i){(typeof i=="undefined"||typeof t=="function")&&(i=t,t=w2utils.lang("Confirmation")),typeof t=="undefined"&&(t=w2utils.lang("Confirmation")),jQuery("#w2ui-popup").length>0?w2popup.message({width:400,height:150,html:'
      \t\t
      '+n+'
      \t\t\t\t
      ',onOpen:function(){jQuery("#w2ui-popup .w2ui-popup-message .w2ui-popup-button").on("click",function(n){w2popup.message(),typeof i=="function"&&i(n.target.id)})},onKeydown:function(n){switch(n.originalEvent.keyCode){case 13:typeof i=="function"&&i("Yes"),w2popup.message();break;case 27:typeof i=="function"&&i("No"),w2popup.message()}}}):w2popup.open({width:450,height:200,title:t,modal:!0,showClose:!1,body:'
      '+n+"
      ",buttons:'',onOpen:function(n){n.onComplete=function(){jQuery("#w2ui-popup .w2ui-popup-button").on("click",function(n){w2popup.close(),typeof i=="function"&&i(n.target.id)})}},onKeydown:function(n){switch(n.originalEvent.keyCode){case 13:typeof i=="function"&&i("Yes"),w2popup.close();break;case 27:typeof i=="function"&&i("No"),w2popup.close()}}})},function(n){var t=function(t){this.box=null,this.name=null,this.active=null,this.tabs=[],this.right="",this.style="",this.onClick=null,this.onClose=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.tabs,t)};n.fn.w2tabs=function(i){var e,r,f,u;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return u=w2ui[n(this).attr("name")],u[i].apply(u,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2tabs")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2tabs().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}e=i.tabs,r=new t(i),n.extend(r,{tabs:[],handlers:[]});for(f in e)r.tabs[f]=n.extend({},t.prototype.tab,e[f]);return n(this).length!=0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={tab:{id:null,text:"",hidden:!1,disabled:!1,closable:!1,hint:"",onClick:null,onRefresh:null,onClose:null},add:function(n){return this.insert(null,n)},insert:function(t,i){var r,f,e,i,u;n.isArray(i)||(i=[i]);for(r in i){if(String(i[r].id)=="undefined"){console.log('ERROR: The parameter "id" is required but not supplied. (obj: '+this.name+")");return}f=!0;for(e in this.tabs)if(this.tabs[e].id==i[r].id){f=!1;break}if(!f){console.log('ERROR: The parameter "id='+i[r].id+'" is not unique within the current tabs. (obj: '+this.name+")");return}if(!w2utils.isAlphaNumeric(i[r].id)){console.log('ERROR: The parameter "id='+i[r].id+'" must be alpha-numeric + "-_". (obj: '+this.name+")");return}i=n.extend({},i,i[r]),t==null||typeof t=="undefined"?this.tabs.push(i):(u=this.get(t,!0),this.tabs=this.tabs.slice(0,u).concat([i],this.tabs.slice(u))),this.refresh(i[r].id)}},remove:function(){for(var u=0,r,i=0;i
      ":"")+'\t
      "+i.text+"
      ",r.length==0?(u="",i.hidden&&(u+="display: none;"),i.disabled&&(u+="opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);"),html='
      ",this.get(t,!0)!=this.tabs.length-1&&n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))+1].id)).length>0?n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))+1].id)).before(html):n(this.box).find("#tabs_"+this.name+"_right").before(html)):(r.html(f),i.hidden?r.css("display","none"):r.css("display",""),i.disabled?r.css({opacity:"0.2","-moz-opacity":"0.2","-webkit-opacity":"0.2","-o-opacity":"0.2",filter:"alpha(opacity=20)"}):r.css({opacity:"1","-moz-opacity":"1","-webkit-opacity":"1","-o-opacity":"1",filter:"alpha(opacity=100)"})),this.trigger(n.extend(e,{phase:"after"})),+new Date-s)},render:function(t){var u=+new Date,i=this.trigger({phase:"before",type:"render",target:this.name,box:t}),r;return i.isCancelled===!0?!1:(window.getSelection&&window.getSelection().removeAllRanges(),String(t)!="undefined"&&t!=null&&(n(this.box).find("> table #tabs_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-tabs").html(""),this.box=t),!this.box)?void 0:(r='
      '+(i!==!0?"
      "+t+"
      ":"")+"
      '+(i!==!0?'\t
      \t\t\t
      ":"")+"
      '+(i!==!0?'\t
      \t\t"+e+"
      ":"")+"
      "+p+"
      '+f+"
      \t
      '+this.right+"
      ",n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-tabs").html(r),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.trigger(n.extend(i,{phase:"after"})),this.refresh(),+new Date-u)},resize:function(){window.getSelection&&window.getSelection().removeAllRanges();var t=this.trigger({phase:"before",type:"resize",target:this.name});if(t.isCancelled===!0)return!1;this.trigger(n.extend(t,{phase:"after"}))},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> table #tabs_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-tabs").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},click:function(t,i){var u=this.get(t),r;if(u==null||u.disabled||(r=this.trigger({phase:"before",type:"click",target:t,object:this.get(t),originalEvent:i}),r.isCancelled===!0))return!1;n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.active)+" .w2ui-tab").removeClass("active"),this.active=u.id,this.trigger(n.extend(r,{phase:"after"})),this.refresh(t)},animateClose:function(t,i){var u=this.get(t),f,r;if(u==null||u.disabled||(f=this.trigger({phase:"before",type:"close",target:t,object:this.get(t),originalEvent:i}),f.isCancelled===!0))return!1;r=this,n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(u.id)).css({"-webkit-transition":".2s","-moz-transition":"2s","-ms-transition":".2s","-o-transition":".2s",opacity:"0"}),setTimeout(function(){var t=n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).width();n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).html('
      '),setTimeout(function(){n(r.box).find("#tabs_"+r.name+"_tab_"+w2utils.escapeId(u.id)).find(":first-child").css({width:"0px"})},50)},200),setTimeout(function(){r.remove(t)},450),this.trigger(n.extend(f,{phase:"after"})),this.refresh()},animateInsert:function(t,i){var f,e,o,s,r,u;if(this.get(t)!=null&&n.isPlainObject(i)){f=!0;for(e in this.tabs)if(this.tabs[e].id==i.id){f=!1;break}if(!f){console.log('ERROR: The parameter "id='+i.id+'" is not unique within the current tabs. (obj: '+this.name+")");return}(o=n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(i.id)),o.length==0)&&(typeof i.caption!="undefined"&&(i.text=i.caption),s='
      '+(i.closable?'
      ':"")+'\t
      '+i.text+"
      ",n("body").append(s),tabHTML='
       
      ',r="",i.hidden&&(r+="display: none;"),i.disabled&&(r+="opacity: 0.2; -moz-opacity: 0.2; -webkit-opacity: 0.2; -o-opacity: 0.2; filter:alpha(opacity=20);"),html=''+tabHTML+"",this.get(t,!0)!=this.tabs.length&&n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))].id)).length>0?n(this.box).find("#tabs_"+this.name+"_tab_"+w2utils.escapeId(this.tabs[parseInt(this.get(t,!0))].id)).before(html):n(this.box).find("#tabs_"+this.name+"_right").before(html),u=this,setTimeout(function(){var t=n("#_tmp_simple_tab").width();n("#_tmp_tabs").remove(),n("#tabs_"+u.name+"_tab_"+w2utils.escapeId(i.id)+" > div").css("width",t+"px")},1),setTimeout(function(){u.insert(t,i)},200))}}},n.extend(t.prototype,w2utils.event),w2obj.tabs=t}(jQuery),function(n){var t=function(t){this.box=null,this.name=null,this.items=[],this.right="",this.onClick=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,n.extend(!0,this,w2obj.toolbar,t)};n.fn.w2toolbar=function(i){var e,r,f,u;if(typeof i!="object"&&i){if(w2ui[n(this).attr("name")])return u=w2ui[n(this).attr("name")],u[i].apply(u,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+i+" does not exist on jQuery.w2toolbar")}else{if(!i||typeof i.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2toolbar().');return}if(typeof w2ui[i.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+i.name+").");return}if(!w2utils.isAlphaNumeric(i.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}e=i.items,r=new t(i),n.extend(r,{items:[],handlers:[]});for(f in e)r.items[f]=n.extend({},t.prototype.item,e[f]);return n(this).length!=0&&r.render(n(this)[0]),w2ui[r.name]=r,r}},t.prototype={item:{id:null,type:"button",text:"",html:"",img:null,icon:null,hidden:!1,disabled:!1,checked:!1,arrow:!0,hint:"",group:null,items:null,onClick:null},add:function(n){this.insert(null,n)},insert:function(i,r){var u,s,e,f,o;n.isArray(r)||(r=[r]);for(u in r){if(typeof r[u].type=="undefined"){console.log('ERROR: The parameter "type" is required but not supplied in w2toolbar.add() method.');return}if(n.inArray(String(r[u].type),["button","check","radio","drop","menu","break","html","spacer"])==-1){console.log('ERROR: The parameter "type" should be one of the following [button, check, radio, drop, menu, break, html, spacer] in w2toolbar.add() method.');return}if(typeof r[u].id=="undefined"){console.log('ERROR: The parameter "id" is required but not supplied in w2toolbar.add() method.');return}for(s=!0,e=0;e table #tb_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-toolbar").html(""),this.box=t),this.box){for(r='',u=0;u':'");r+='",r+="
      '+this.getItemHTML(i)+"'+this.right+"
      ",n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-toolbar").html(r),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.trigger(n.extend(f,{phase:"after"}))}},refresh:function(t){var o=+new Date,e,f,i,r,u;if(window.getSelection&&window.getSelection().removeAllRanges(),e=this.trigger({phase:"before",type:"refresh",target:typeof t!="undefined"?t:this.name,item:this.get(t)}),e.isCancelled===!0)return!1;if(typeof t=="undefined")for(f=0;f':''+u+"",this.get(t,!0)==this.items.length-1?n(this.box).find("#tb_"+this.name+"_right").before(u):n(this.box).find("#tb_"+this.name+"_item_"+w2utils.escapeId(this.items[parseInt(this.get(t,!0))+1].id)).before(u)):(r.html(u),i.hidden?r.css("display","none"):r.css("display",""),i.disabled?r.addClass("disabled"):r.removeClass("disabled")),this.trigger(n.extend(e,{phase:"after"})),+new Date-o},resize:function(){var i=+new Date,t;return(window.getSelection&&window.getSelection().removeAllRanges(),t=this.trigger({phase:"before",type:"resize",target:this.name}),t.isCancelled===!0)?!1:(this.trigger(n.extend(t,{phase:"after"})),+new Date-i)},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> table #tb_"+this.name+"_right").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-toolbar").html(""),n(this.box).html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},getItemHTML:function(n){var t="",r,i;typeof n.caption!="undefined"&&(n.text=n.caption),typeof n.hint=="undefined"&&(n.hint=""),typeof n.text=="undefined"&&(n.text="");switch(n.type){case"menu":case"button":case"check":case"radio":case"drop":r=" ",n.img&&(r='
      '),n.icon&&(r='
      '),t+='
      '+r+(n.text!=""?'":"")+((n.type=="drop"||n.type=="menu")&&n.arrow!==!1?'':"")+"
      '+n.text+"   
      ";break;case"break":t+='
       
      ';break;case"html":t+='
      '+n.html+"
      "}return i="",typeof n.onRender=="function"&&(i=n.onRender.call(this,n.id,t)),typeof this.onRender=="function"&&(i=this.onRender(n.id,t)),i!=""&&typeof i!="undefined"&&(t=i),t},menuClick:function(t,i,r){var e,f,u;if(window.getSelection&&window.getSelection().removeAllRanges(),e=this,f=this.get(t),f&&!f.disabled){if(u=this.trigger({phase:"before",type:"click",target:typeof t!="undefined"?t:this.name,item:this.get(t),subItem:typeof i!="undefined"&&this.get(t)?this.get(t).items[i]:null,originalEvent:r}),u.isCancelled===!0)return!1;this.trigger(n.extend(u,{phase:"after"}))}},click:function(t,i){var f,r,o,e,u;if(window.getSelection&&window.getSelection().removeAllRanges(),f=this,r=this.get(t),r&&!r.disabled){if(o=this.trigger({phase:"before",type:"click",target:typeof t!="undefined"?t:this.name,item:this.get(t),originalEvent:i}),o.isCancelled===!0)return!1;if(n("#tb_"+this.name+"_item_"+w2utils.escapeId(r.id)+" table.w2ui-button").removeClass("down"),r.type=="radio"){for(e=0;e0&&this.insert(e,null,h)}return this.refresh(i.id),e},remove:function(){for(var r=0,n,i,t=0;t0&&arguments.length==1?this.refresh(n.parent.id):this.refresh(),r},set:function(t,i,r){var u,f;if(arguments.length==2&&(r=i,i=t,t=this),this._tmp=null,typeof t=="string"&&(t=this.get(t)),t.nodes==null)return null;for(u=0;u+
      '),r.expanded=!1,this.trigger(n.extend(i,{phase:"after"})),this.resize()},collapseAll:function(n){if(typeof n=="undefined"&&(n=this),typeof n=="string"&&(n=this.get(n)),n.nodes==null)return null;for(var t=0;t0&&this.collapseAll(n.nodes[t]);this.refresh(n.id)},expand:function(t){var r=this.get(t),i=this.trigger({phase:"before",type:"expand",target:t,object:r});if(i.isCancelled===!0)return!1;n(this.box).find("#node_"+w2utils.escapeId(t)+"_sub").slideDown("fast"),n(this.box).find("#node_"+w2utils.escapeId(t)+" .w2ui-node-dots:first-child").html('
      -
      '),r.expanded=!0,this.trigger(n.extend(i,{phase:"after"})),this.resize()},expandAll:function(n){if(typeof n=="undefined"&&(n=this),typeof n=="string"&&(n=this.get(n)),n.nodes==null)return null;for(var t=0;t0&&this.collapseAll(n.nodes[t]);this.refresh(n.id)},expandParents:function(n){var t=this.get(n);t!=null&&(t.parent&&(t.parent.expanded=!0,this.expandParents(t.parent.id)),this.refresh(n))},click:function(t,i){var r=this,f=this.get(t),u;f!=null&&((u=this.selected,f.disabled||f.group)||(n(r.box).find("#node_"+w2utils.escapeId(u)).removeClass("w2ui-selected").find(".w2ui-icon").removeClass("w2ui-icon-selected"),n(r.box).find("#node_"+w2utils.escapeId(t)).addClass("w2ui-selected").find(".w2ui-icon").addClass("w2ui-icon-selected"),setTimeout(function(){var e=r.trigger({phase:"before",type:"click",target:t,originalEvent:i,object:f});if(e.isCancelled===!0)return n(r.box).find("#node_"+w2utils.escapeId(t)).removeClass("w2ui-selected").find(".w2ui-icon").removeClass("w2ui-icon-selected"),n(r.box).find("#node_"+w2utils.escapeId(u)).addClass("w2ui-selected").find(".w2ui-icon").addClass("w2ui-icon-selected"),!1;u!=null&&(r.get(u).selected=!1),r.get(t).selected=!0,r.selected=t,r.trigger(n.extend(e,{phase:"after"}))},1)))},keydown:function(t){function f(n,t){var u;if(n==null)return null;var e=n.parent,o=i.get(n.id,!0),r=null;return n.expanded&&n.nodes.length>0&&t!==!0?(u=n.nodes[0],r=u.disabled||u.group?f(u):u):r=e&&o+10?(t=f.nodes[u-1],t.expanded&&t.nodes.length>0&&(r=t.nodes[t.nodes.length-1],t=r.disabled||r.group?e(r):r)):(t=f,o=!0),t!=null&&(t.disabled||t.group)&&(t=e(t)),t}var i=this,r=i.get(i.selected),o,u;if(r&&i.keyboard===!0){if(o=i.trigger({phase:"before",type:"keydown",target:i.name,originalEvent:t}),o.isCancelled===!0)return!1;(t.keyCode==13||t.keyCode==32)&&r.nodes.length>0&&i.toggle(i.selected),t.keyCode==37&&(r.nodes.length>0?i.collapse(i.selected):!r.parent||r.parent.disabled||r.parent.group||(i.collapse(r.parent.id),i.click(r.parent.id),setTimeout(function(){i.scrollIntoView()},50))),t.keyCode==39&&r.nodes.length>0&&i.expand(i.selected),t.keyCode==38&&(u=e(r),u!=null&&(i.click(u.id,t),setTimeout(function(){i.scrollIntoView()},50))),t.keyCode==40&&(u=f(r),u!=null&&(i.click(u.id,t),setTimeout(function(){i.scrollIntoView()},50))),n.inArray(t.keyCode,[13,32,37,38,39,40])!=-1&&(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()),i.trigger(n.extend(o,{phase:"after"}));return}},scrollIntoView:function(t){var f;if(typeof t=="undefined"&&(t=this.selected),f=this.get(t),f!=null){var i=n(this.box).find(".w2ui-sidebar-div"),u=n(this.box).find("#node_"+w2utils.escapeId(t)),r=u.offset().top-i.offset().top;r+u.height()>i.height()&&i.animate({scrollTop:i.scrollTop()+i.height()/1.3}),r<=0&&i.animate({scrollTop:i.scrollTop()-i.height()/1.3})}},dblClick:function(t,i){window.getSelection&&window.getSelection().removeAllRanges();var u=this.get(t),r=this.trigger({phase:"before",type:"dblClick",target:t,originalEvent:i,object:u});if(r.isCancelled===!0)return!1;u.nodes.length>0&&this.toggle(t),this.trigger(n.extend(r,{phase:"after"}))},contextMenu:function(t,i){var r=this,u=r.get(t);t!=r.selected&&r.click(t),setTimeout(function(){var f=r.trigger({phase:"before",type:"contextMenu",target:t,originalEvent:i,object:u});if(f.isCancelled===!0)return!1;u.group||u.disabled||(r.menu.length>0&&n(r.box).find("#node_"+w2utils.escapeId(t)).w2menu(r.menu,{left:(i?i.offsetX||i.pageX:50)-25,select:function(n,i,u){r.menuClick(t,u,i)}}),r.trigger(n.extend(f,{phase:"after"})))},1)},menuClick:function(t,i,r){var u=this,f=u.trigger({phase:"before",type:"menuClick",target:t,originalEvent:r,menuIndex:i,menuItem:u.menu[i]});if(f.isCancelled===!0)return!1;u.trigger(n.extend(f,{phase:"after"}))},render:function(t){var i=this.trigger({phase:"before",type:"render",target:this.name,box:t});if(i.isCancelled===!0)return!1;(typeof t!="undefined"&&t!=null&&(n(this.box).find("> div > div.w2ui-sidebar-div").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-sidebar").html(""),this.box=t),this.box)&&(n(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-sidebar").html('
      '),n(this.box).find("> div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),n(this.box).length>0&&(n(this.box)[0].style.cssText+=this.style),this.topHTML!=""&&(n(this.box).find(".w2ui-sidebar-top").html(this.topHTML),n(this.box).find(".w2ui-sidebar-div").css("top",n(this.box).find(".w2ui-sidebar-top").height()+"px")),this.bottomHTML!=""&&(n(this.box).find(".w2ui-sidebar-bottom").html(this.bottomHTML),n(this.box).find(".w2ui-sidebar-div").css("bottom",n(this.box).find(".w2ui-sidebar-bottom").height()+"px")),this.trigger(n.extend(i,{phase:"after"})),this.refresh())},refresh:function(t){function h(n){var e="",f=n.img,i,u,t;for(f==null&&(f=this.img),i=n.icon,i==null&&(i=this.icon),t=n.parent,u=0;t&&t.parent!=null;)t.group&&u--,t=t.parent,u++;return typeof n.caption!="undefined"&&(n.text=n.caption),n.group?e='
      \t"+(!n.hidden&&n.expanded?w2utils.lang("Hide"):w2utils.lang("Show"))+"\t"+n.text+'
      ':(n.selected&&!n.disabled&&(r.selected=n.id),t="",f&&(t='
      '),i&&(t='
      '),e='
      \t
      '+(n.nodes.length>0?n.expanded?"-":"+":n.plus?"+":"")+'
      '+t+(n.count!==""?'
      '+n.count+"
      ":"")+'
      '+n.text+'
      '),e}var c=+new Date,s,r,i,f,o,u,e;if(window.getSelection&&window.getSelection().removeAllRanges(),s=this.trigger({phase:"before",type:"refresh",target:typeof t!="undefined"?t:this.name}),s.isCancelled===!0)return!1;if(this.topHTML!=""&&(n(this.box).find(".w2ui-sidebar-top").html(this.topHTML),n(this.box).find(".w2ui-sidebar-div").css("top",n(this.box).find(".w2ui-sidebar-top").height()+"px")),this.bottomHTML!=""&&(n(this.box).find(".w2ui-sidebar-bottom").html(this.bottomHTML),n(this.box).find(".w2ui-sidebar-div").css("bottom",n(this.box).find(".w2ui-sidebar-bottom").height()+"px")),n(this.box).find("> div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),r=this,typeof t=="undefined")i=this,f=".w2ui-sidebar-div";else{if(i=this.get(t),i==null)return;f="#node_"+w2utils.escapeId(i.id)+"_sub"}for(i!=this&&(o="#node_"+w2utils.escapeId(i.id),e=h(i),n(this.box).find(o).before(''),n(this.box).find(o).remove(),n(this.box).find(f).remove(),n("#sidebar_"+this.name+"_tmp").before(e),n("#sidebar_"+this.name+"_tmp").remove()),n(this.box).find(f).html(""),u=0;u div").css({width:n(this.box).width()+"px",height:n(this.box).height()+"px"}),this.trigger(n.extend(t,{phase:"after"})),+new Date-i)},destroy:function(){var t=this.trigger({phase:"before",type:"destroy",target:this.name});if(t.isCancelled===!0)return!1;n(this.box).find("> div > div.w2ui-sidebar-div").length>0&&n(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-sidebar").html(""),delete w2ui[this.name],this.trigger(n.extend(t,{phase:"after"}))},lock:function(t,i){var r=n(this.box).find("> div:first-child");w2utils.lock(r,t,i)},unlock:function(){w2utils.unlock(this.box)}},n.extend(t.prototype,w2utils.event),w2obj.sidebar=t}(jQuery),function(n){var t=new function(){this.customTypes=[]};n.fn.w2field=function(n){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object")return t.init.apply(this,arguments);if(typeof n=="string")return t.init.apply(this,[{type:n}]);console.log("ERROR: Method "+n+" does not exist on jQuery.w2field")},n.extend(t,{init:function(i){var r=t;return n(this).each(function(){var l,s,y,f,h,o,c,a;if(typeof t.customTypes[i.type.toLowerCase()]=="function"){t.customTypes[i.type.toLowerCase()].call(this,i);return}l=i.type.toLowerCase();switch(l){case"clear":n(this).off("focus").off("blur").off("keypress").off("keydown").off("change").removeData(),n(this).prev().hasClass("w2ui-list")&&(n(this).prev().remove(),n(this).removeAttr("tabindex").css("border-color","").show()),n(this).prev().hasClass("w2ui-upload")&&(n(this).prev().remove(),n(this).removeAttr("tabindex").css("border-color","").show()),n(this).prev().hasClass("w2ui-field-helper")&&(n(this).css("padding-left",n(this).css("padding-top")),n(this).prev().remove()),n(this).next().hasClass("w2ui-field-helper")&&(n(this).css("padding-right",n(this).css("padding-top")),n(this).next().remove()),n(this).next().hasClass("w2ui-field-helper")&&n(this).next().remove();break;case"text":case"int":case"float":case"money":case"alphanumeric":case"hex":s=this,h={min:null,max:null,arrows:!1,keyboard:!0,suffix:"",prefix:""},i=n.extend({},h,i),["text","alphanumeric","hex"].indexOf(l)!=-1&&(i.arrows=!1,i.keyboard=!1);n(this).data("options",i).on("keypress",function(t){if(!t.metaKey&&!t.ctrlKey&&!t.altKey&&(t.charCode==t.keyCode||!(t.keyCode>0))){t.keyCode==13&&n(this).change();var i=String.fromCharCode(t.charCode);if(!v(i,!0))return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,!1}}).on("keydown",function(t,r){var e,u,o,f;if(i.keyboard){e=!1,u=n(s).val(),u=v(u)?parseFloat(u):i.min||0,o=t.keyCode||r.keyCode,f=1,(t.ctrlKey||t.metaKey)&&(f=10);switch(o){case 38:n(s).val(u+f<=i.max||i.max==null?u+f:i.max).change(),l=="money"&&n(s).val(Number(n(s).val()).toFixed(2)),e=!0;break;case 40:n(s).val(u-f>=i.min||i.min==null?u-f:i.min).change(),l=="money"&&n(s).val(Number(n(s).val()).toFixed(2)),e=!0}e&&(t.preventDefault(),setTimeout(function(){s.setSelectionRange(s.value.length,s.value.length)},0))}}).on("change",function(t){var r=n(s).val(),u=!1;if(i.min!=null&&r!=""&&ri.max&&(n(s).val(i.max).change(),u=!0),u)return t.stopPropagation(),t.preventDefault(),!1;this.value==""||v(this.value)||n(this).val(i.min!=null?i.min:"")});if(n(this).val()==""&&i.min!=null&&n(this).val(i.min),i.prefix!=""){n(this).before('
      '+i.prefix+"
      "),o=n(this).prev();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":n(this).css("padding-left"),"padding-right":0,"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px","margin-left":0,"margin-right":0}).on("click",function(){n(this).next().focus()});n(this).css("padding-left",o.width()+parseInt(n(this).css("padding-left"))+5+"px")}if(c=parseInt(n(this).css("padding-right")),i.arrows!=""){n(this).after('
       \t
      \t\t
      \t
      \t
      \t\t
      \t
      \t
      '),y=w2utils.getSize(this,"height"),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),height:n(this).height()+parseInt(n(this).css("padding-top"))+parseInt(n(this).css("padding-bottom"))+"px",padding:"0px","margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":"0px","border-left":"1px solid silver"}).css("margin-left","-"+(o.width()+parseInt(n(this).css("margin-right"))+12)+"px").on("mousedown",function(t){function r(){clearTimeout(n("body").data("_field_update_timer")),n("body").off("mouseup",r)}function i(t){n(s).focus().trigger(n.Event("keydown"),{keyCode:n(u.target).attr("type")=="up"?38:40}),t!==!1&&n("body").data("_field_update_timer",setTimeout(i,60))}var f=this,u=t;n("body").on("mouseup",r);n("body").data("_field_update_timer",setTimeout(i,700)),i(!1)});c+=o.width()+12,n(this).css("padding-right",c+"px")}if(i.suffix!=""){n(this).after('
      '+i.suffix+"
      "),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":"3px","padding-right":n(this).css("padding-right"),"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px"}).on("click",function(){n(this).prev().focus()});o.css("margin-left","-"+(o.width()+parseInt(n(this).css("padding-right"))+5)+"px"),c+=o.width()+3,n(this).css("padding-right",c+"px")}function v(n,t){switch(l){case"int":return t&&["-"].indexOf(n)!=-1?!0:w2utils.isInt(n);case"float":return t&&["-","."].indexOf(n)!=-1?!0:w2utils.isFloat(n);case"money":return t&&["-",".","$","€","£","¥"].indexOf(n)!=-1?!0:w2utils.isMoney(n);case"hex":return w2utils.isHex(n);case"alphanumeric":return w2utils.isAlphaNumeric(n)}return!0}break;case"date":f=this,h={format:w2utils.settings.date_format,start:"",end:"",blocked:{},colored:{}},i=n.extend({},h,i);n(this).css({transition:"none","-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none"}).data("options",i).on("focus",function(){var e=parseFloat(n(f).offset().top)+parseFloat(f.offsetHeight),u=parseFloat(n(f).offset().left),t,r;clearInterval(n(f).data("mtimer")),n("#global_calendar_div").remove(),n("body").append('
      '),n("#global_calendar_div").html(n().w2field("calendar_get",f.value,i)).css({left:u+"px",top:e+"px"}).data("el",f).show(),t=n(window).width()+n(document).scrollLeft()-1,u+n("#global_calendar_div").width()>t&&n("#global_calendar_div").css("left",t-n("#global_calendar_div").width()+"px"),r=setInterval(function(){var i=n(window).width()+n(document).scrollLeft()-1,t=n(f).offset().left;if(t+n("#global_calendar_div").width()>i&&(t=i-n("#global_calendar_div").width()),n("#global_calendar_div").data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&n("#global_calendar_div").css({"-webkit-transition":".2s",left:t+"px",top:n(f).offset().top+f.offsetHeight+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(r),n("#global_calendar_div").remove();return}},100),n(f).data("mtimer",r)}).on("blur",function(){n(f).val(n.trim(n(f).val())),n.trim(n(f).val())==""||w2utils.isDate(n(f).val(),i.format)||n(this).w2tag(w2utils.lang("Not a valid date")+": "+i.format),clearInterval(n(f).data("mtimer")),n("#global_calendar_div").remove()}).on("keypress",function(){var r=this;setTimeout(function(){n("#global_calendar_div").html(n().w2field("calendar_get",r.value,i))},10)});setTimeout(function(){w2utils.isInt(f.value)&&(f.value=w2utils.formatDate(f.value,i.format))},1);break;case"time":break;case"datetime":break;case"color":f=this,h={prefix:"#",suffix:'
      '},i=n.extend({},h,i);n(this).attr("maxlength",6).on("focus",function(){var u=parseFloat(n(f).offset().top)+parseFloat(f.offsetHeight),r=parseFloat(n(f).offset().left),t,i;clearInterval(n(f).data("mtimer")),n("#global_color_div").remove(),n("body").append('
      '),n("#global_color_div").html(n().w2field("getColorHTML",f.value)).css({left:r+"px",top:u+"px"}).data("el",f).show(),t=n(window).width()+n(document).scrollLeft()-1,r+n("#global_color_div").width()>t&&n("#global_color_div").css("left",t-n("#global_color_div").width()+"px"),i=setInterval(function(){var r=n(window).width()+n(document).scrollLeft()-1,t=n(f).offset().left;if(t+n("#global_color_div").width()>r&&(t=r-n("#global_color_div").width()),n("#global_color_div").data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&n("#global_color_div").css({"-webkit-transition":".2s",left:t+"px",top:n(f).offset().top+f.offsetHeight+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(i),n("#global_color_div").remove();return}},100),n(f).data("mtimer",i)}).on("click",function(){n(this).trigger("focus")}).on("blur",function(){n(f).val(n.trim(n(f).val())),clearInterval(n(f).data("mtimer")),n("#global_color_div").remove()}).on("keydown",function(t){if(t.keyCode==86&&(t.ctrlKey||t.metaKey)){var i=this;n(this).prop("maxlength",7),setTimeout(function(){var t=n(i).val();t.substr(0,1)=="#"&&(t=t.substr(1)),w2utils.isHex(t)||(t=""),n(i).val(t).prop("maxlength",6).change()},20)}}).on("keyup",function(t){t.keyCode==86&&(t.ctrlKey||t.metaKey)&&n(this).prop("maxlength",6)}).on("keypress",function(t){t.keyCode==13&&n(this).change();var i=String.fromCharCode(t.charCode);if(!w2utils.isHex(i,!0))return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,!1}).on("change",function(){var i="#"+n(this).val();n(this).val().length!=6&&n(this).val().length!=3&&(i=""),n(this).next().find("div").css("background-color",i)});if(i.prefix!=""){n(this).before('
      '+i.prefix+"
      "),o=n(this).prev();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":n(this).css("padding-left"),"padding-right":0,"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px","margin-left":0,"margin-right":0}).on("click",function(){n(this).next().focus()});n(this).css("padding-left",o.width()+parseInt(n(this).css("padding-left"))+2+"px")}if(i.suffix!=""){n(this).after('
      '+i.suffix+"
      "),o=n(this).next();o.css({color:n(this).css("color"),"font-family":n(this).css("font-family"),"font-size":n(this).css("font-size"),"padding-top":n(this).css("padding-top"),"padding-bottom":n(this).css("padding-bottom"),"padding-left":"3px","padding-right":n(this).css("padding-right"),"margin-top":parseInt(n(this).css("margin-top"))+1+"px","margin-bottom":parseInt(n(this).css("margin-bottom"))+1+"px"}).on("click",function(){n(this).prev().focus()});o.css("margin-left","-"+(o.width()+parseInt(n(this).css("padding-right"))+4)+"px"),c=o.width()+parseInt(n(this).css("padding-right"))+4,n(this).css("padding-right",c+"px"),o.find("div").css("background-color","#"+n(f).val())}break;case"select":case"list":if(this.tagName!="SELECT"){console.log("ERROR: You can only apply $().w2field('list') to a SELECT element");return}var h={url:"",items:[],value:null,showNone:!0},f=this,e=n.extend({},h,i);n(f).data("settings",e),f.refresh=function(){var i=n(f).data("settings"),e="",r=t.cleanItems(i.items),u;i.showNone&&(e='");for(u in r)i.showNone||i.value!=null||(i.value=r[u].id),e+='";n(f).html(e),n(f).val(i.value),n(f).val()!=i.value&&n(f).change()},e.url!=""?n.ajax({type:"GET",dataType:"text",url:e.url,complete:function(i,r){if(r=="success"){var e=n.parseJSON(i.responseText),u=n(f).data("settings");u.items=t.cleanItems(e.items),n(f).data("settings",u),f.refresh()}}}):f.refresh();break;case"enum":if(this.tagName!="INPUT"){console.log("ERROR: You can only apply $().w2field('enum') to an INPUT element");return}var h={url:"",items:[],selected:[],max:0,maxHeight:172,showAll:!1,match:"begins with",render:null,maxCache:500,onShow:null,onHide:null,onAdd:null,onRemove:null,onItemOver:null,onItemOut:null,onItemClick:null},f=this,e=n.extend({},h,i);e.items=t.cleanItems(e.items),e.selected=t.cleanItems(e.selected),n(this).data("selected",e.selected),n(this).css({padding:"0px","border-color":"transparent","background-color":"transparent",outline:"none"}),this.add=function(t){var i,r,u;n(this).attr("readonly")||(i=n(this).data("selected"),r=n(this).data("settings"),typeof r.onAdd!="function"||(u=r.onAdd(t,r),u!==!1))&&(n.isArray(i)||(i=[]),r.max!=0&&r.max<=i.length&&i.splice(i.length-1,1),i.push(t),n(this).data("last_del",null),n(this).trigger("change"))},this.remove=function(i){var r=n(this).data("settings"),u;(typeof r.onRemove!="function"||(u=r.onRemove(i,r),u!==!1))&&(n(this).attr("readonly")||(n(this).data("selected").splice(i,1),n(this).parent().find("[title=Remove][index="+i+"]").remove(),this.refresh(),t.list_render.call(this),n(this).trigger("change")))},this.show=function(){var i,u,r;if(!n(this).attr("readonly")){if(i=n(this).data("settings"),n("#w2ui-global-items").length==0)n("body").append('
      ');else return;u=n("#w2ui-global-items"),u.css({display:"block",left:n(f).offset().left+"px",top:n(f).offset().top+f.offsetHeight+3+"px"}).width(w2utils.getSize(f,"width")).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),t.list_render.call(f),r=function(){var i=n("#w2ui-global-items");if(n(f).length==0||n(f).offset().left==0&&n(f).offset().top==0){clearInterval(n(f).data("mtimer")),hide();return}i.data("position")!=n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)&&(i.css({"-webkit-transition":".2s",left:n(f).offset().left+"px",top:n(f).offset().top+f.offsetHeight+3+"px"}).data("position",n(f).offset().left+"x"+(n(f).offset().top+f.offsetHeight)),setTimeout(function(){t.list_render.call(f,n(f).data("last_search"))},200)),i.length>0&&n(f).data("mtimer",setTimeout(r,100))},n(f).data("mtimer",setTimeout(r,100)),typeof i.onShow=="function"&&i.onShow.call(this,i)}},this.hide=function(){var t=n(this).data("settings");clearTimeout(n(f).data("mtimer")),n("#w2ui-global-items").remove(),typeof t.onHide=="function"&&t.onHide.call(this,t)},this.refresh=function(){var r=this,i,t;n(n(this).data("div")).remove();var o="margin-top: "+n(this).css("margin-top")+"; margin-bottom: "+n(this).css("margin-bottom")+"; margin-left: "+n(this).css("margin-left")+"; margin-right: "+n(this).css("margin-right")+"; width: "+(w2utils.getSize(this,"width")-parseInt(n(this).css("margin-left"))-parseInt(n(this).css("margin-right")))+"px; ",u='
        ',f=n(this).data("selected");for(i in f)u+='
      • \t
          
        '+f[i].text+"
      • ";u+='
      • \t
      ',n(this).before(u),t=n(this).prev()[0],n(this).data("div",t);n(t).find("li").data("mouse","out").on("click",function(t){if(!n(t.target).hasClass("nomouse")){if(t.target.title==w2utils.lang("Remove")){r.remove(n(t.target).attr("index"));return}t.stopPropagation(),typeof e.onItemClick=="function"&&e.onItemClick.call(this,e)}}).on("mouseover",function(t){var i=t.target;(i.tagName!="LI"&&(i=i.parentNode),n(i).hasClass("nomouse"))||(n(i).data("mouse")=="out"&&typeof e.onItemOver=="function"&&e.onItemOver.call(this,e),n(i).data("mouse","over"))}).on("mouseout",function(t){var i=t.target;(i.tagName!="LI"&&(i=i.parentNode),n(i).hasClass("nomouse"))||(n(i).data("mouse","leaving"),setTimeout(function(){n(i).data("mouse")=="leaving"&&(n(i).data("mouse","out"),typeof e.onItemOut=="function"&&e.onItemOut.call(this,e))},0))});n(t).on("click",function(){n(this).find("input").focus()}).find("input").on("focus",function(i){n(t).css({outline:"auto 5px -webkit-focus-ring-color","outline-offset":"-2px"}),r.show(),i.stopPropagation?i.stopPropagation():i.cancelBubble=!0}).on("blur",function(i){n(t).css("outline","none"),r.hide(),i.stopPropagation?i.stopPropagation():i.cancelBubble=!0});r.resize()},this.resize=function(){var r=n(this).data("settings"),i=n(this).prev(),t=n(i).find(">div").height();t<23&&(t=23),t>r.maxHeight&&(t=r.maxHeight),n(i).height(t+(t%23==0?0:23-t%23)),i.length>0&&(i[0].scrollTop=1e3),n(this).height(t)},n(this).data("settings",e).attr("tabindex",-1),f.refresh();break;case"upload":if(this.tagName!="INPUT"){console.log("ERROR: You can only apply $().w2field('upload') to an INPUT element");return}var h={url:"",base64:!0,hint:w2utils.lang("Attach files by dragging and dropping or Click to Select"),max:0,maxSize:0,maxFileSize:0,onAdd:null,onRemove:null,onItemClick:null,onItemDblClick:null,onItemOver:null,onItemOut:null,onProgress:null,onComplete:null},f=this,e=n.extend({},h,i);e.base64===!0&&(e.maxSize==0&&(e.maxSize=20971520),e.maxFileSize==0&&(e.maxFileSize=20971520)),a=e.selected,delete e.selected,n.isArray(a)||(a=[]),n(this).data("selected",a).data("settings",e).attr("tabindex",-1),t.upload_init.call(this),this.refresh=function(){var o=this,r=n(this).data("div"),i=n(this).data("settings"),c=n(this).data("selected"),h,t,s,l,e,f,u;n(r).find("li").remove(),n(r).find("> span:first-child").css("line-height",n(r).height()-w2utils.getSize(r,"+height")-8+"px");for(h in c){t=c[h],s=n(r).find(".file-list li").length,n(r).find("> span:first-child").remove(),n(r).find(".file-list").append('
    • \t
        
      \t'+t.name+'\t - '+w2utils.size(t.size)+"
    • "),l=n(r).find(".file-list #file-"+s),e="",/image/i.test(t.type)&&(e='
      \t
      '),f='style="padding: 3px; text-align: right; color: #777;"',u='style="padding: 3px"',e+='
      \t\t\t\t\t\t
      Name:"+t.name+"
      Size:"+w2utils.size(t.size)+"
      Type:\t\t'+t.type+"\t
      Modified:"+w2utils.date(t.modified)+"
      ";l.data("file",t).on("click",function(t){if(typeof i.onItemClick=="function"){var r=i.onItemClick.call(o,n(this).data("file"));if(r===!1)return}n(t.target).hasClass("file-delete")||t.stopPropagation()}).on("dblclick",function(t){if(typeof i.onItemDblClick=="function"){var r=i.onItemDblClick.call(o,n(this).data("file"));if(r===!1)return}t.stopPropagation(),document.selection?document.selection.empty():document.defaultView.getSelection().removeAllRanges()}).on("mouseover",function(){var u,r;(typeof i.onItemOver!="function"||(u=i.onItemOver.call(o,n(this).data("file")),u!==!1))&&(r=n(this).data("file"),n(this).w2overlay(e.replace("##FILE##",r.content?"data:"+r.type+";base64,"+r.content:""),{top:-4}))}).on("mouseout",function(){if(typeof i.onItemOut=="function"){var t=i.onItemOut.call(o,n(this).data("file"));if(t===!1)return}n(this).w2overlay()})}},this.refresh();break;case"slider":break;default:console.log('ERROR: w2field does not recognize "'+i.type+'" field type.')}})},addType:function(n,i){t.customTypes[String(n).toLowerCase()]=i},cleanItems:function(t){var e=[],f;for(f in t){var r="",u="",i=t[f];if(i!=null){if(n.isPlainObject(t))r=f,u=i;else if(typeof i=="object"&&(typeof i.id!="undefined"&&(r=i.id),typeof i.value!="undefined"&&(r=i.value),typeof i.txt!="undefined"&&(u=i.txt),typeof i.text!="undefined"&&(u=i.text)),typeof i=="string"){if(String(i)=="")continue;r=i,u=i,i={}}w2utils.isInt(r)&&(r=parseInt(r)),w2utils.isFloat(r)&&(r=parseFloat(r)),e.push(n.extend({},i,{id:r,text:u}))}}return e},upload_init:function(){var i=this,o=n(this).data("settings"),u=n(i).prev(),e,f,r;u.length>0&&u[0].tagName=="DIV"&&u.hasClass("w2ui-upload")&&u.remove(),e="margin-top: "+n(i).css("margin-top")+"; margin-bottom: "+n(i).css("margin-bottom")+"; margin-left: "+n(i).css("margin-left")+"; margin-right: "+n(i).css("margin-right")+"; width: "+(w2utils.getSize(i,"width")-parseInt(n(i).css("margin-left"))-parseInt(n(i).css("margin-right")))+"px; height: "+(w2utils.getSize(i,"height")-parseInt(n(i).css("margin-top"))-parseInt(n(i).css("margin-bottom")))+"px; ",f='
      \t'+o.hint+'\t
        \t
        ',n(i).css({display1:"none","border-color":"transparent"}).before(f),n(i).data("div",n(i).prev()[0]),r=n(i).data("div");n(r).find(".file-input").off("change").on("change",function(){if(typeof this.files!="undefined")for(var n=0,r=this.files.length;ni.maxFileSize){r="Maximum file size is "+w2utils.size(i.maxFileSize),n(o).w2tag(r),console.log("ERROR: "+r);return}if(i.maxSize!=0&&l+f.size>i.maxSize){r="Maximum total size is "+w2utils.size(i.maxFileSize),n(o).w2tag(r),console.log("ERROR: "+r);return}if(i.max!=0&&a>=i.max){r="Maximum number of files is "+i.max,n(o).w2tag(r),console.log("ERROR: "+r);return}(typeof i.onAdd!="function"||(h=i.onAdd.call(u,f),h!==!1))&&(s.push(f),typeof FileReader!="undefined"&&i.base64===!0?(e=new FileReader,e.onload=function(){return function(t){var i=t.target.result,r=i.indexOf(",");f.content=i.substr(r+1),u.refresh(),n(u).trigger("change")}}(),e.readAsDataURL(t)):(u.refresh(),n(u).trigger("change")))},upload_remove:function(t){var r=this,s=n(r).data("div"),e=n(r).data("settings"),u=n(r).data("selected"),f=n(t).data("file"),o,i;if(typeof e.onRemove=="function"&&(o=e.onRemove.call(r,f),o===!1))return!1;for(i=u.length-1;i>=0;i--)u[i].name==f.name&&u[i].size==f.size&&u.splice(i,1);n(t).fadeOut("fast"),setTimeout(function(){n(t).remove(),u.length==0&&n(s).prepend(""+e.hint+""),r.refresh(),n(r).trigger("change")},300)},list_render:function(i){var r=this,e=n("#w2ui-global-items"),u=n(this).data("settings"),o=u.items,v=n(this).data("selected"),k,a,w,f,c,h,g,y;if(e.length!=0){typeof i=="undefined"&&(k="",k+='
        ',e.html(k),i=""),n(this).data("last_search",i),(typeof n(r).data("last_index")=="undefined"||n(r).data("last_index")==null)&&n(r).data("last_index",0),typeof u.last_total=="undefined"&&(u.last_total=-1),typeof u.last_search_len=="undefined"&&(u.last_search_len=0),typeof u.last_search_match=="undefined"&&(u.last_search_match=-1),u.url!=""&&(o.length==0&&u.last_total!=0||i.length>u.last_search_len&&u.last_total>u.maxCache||i.length",d=[];for(f in v)d.push(w2utils.isInt(v[f].id)?parseInt(v[f].id):String(v[f].id));w="";for(f in o)if(c=o[f].id,h=o[f].text,n.inArray(w2utils.isInt(c)?parseInt(c):String(c),d)==-1||u.showAll===!0){var p=String(i).toLowerCase(),b=h.toLowerCase(),a=p.length<=b.length&&b.substr(0,p.length)==p;u.match.toLowerCase()=="contains"&&b.indexOf(p)!=-1&&(a=!0),a&&(typeof u.render=="function"&&(h=u.render(o[f],v)),h!==!1&&(typeof o[f].group!="undefined"&&o[f].group!=w&&(w=o[f].group,l+='
      • '+w+"
      • "),l+='\n
      • '+h+"
      • ",s==n(r).data("last_index")&&n(r).data("last_item",o[f]),s++))}l+="",s==0&&(l='
        '+w2utils.lang("No items found")+"
        ",g=!0),e.find(".w2ui-items-list").html(l),n(this).data("last_max",s-1),e.find("li.selected").length>0&&e.find("li.selected")[0].scrollIntoView(!1),e.css({"-webkit-transition":"0s",height:"auto"}),y=parseInt(n(document).height())-parseInt(e.offset().top)-8,parseInt(e.height())>y&&(e.css({height:y-5+"px",overflow:"show"}),n(e).find(".w2ui-items-list").css({height:y-15+"px",overflow:"auto"}));n(e).off("mousedown").on("mousedown",function(i){var e=i.target,f,o;if(e.tagName!="LI"&&(e=n(e).parents("li")),f=n(e).attr("index"),f){if(o=u.items[f],typeof f=="undefined")if(i.preventDefault)i.preventDefault();else return!1;r.add(o),n(r).data("last_index",0),r.refresh(),t.list_render.call(r,"")}});n(r).prev().find("li > input").val(i).css("max-width",n(e).width()-25+"px").width((i.length+2)*6+"px").focus().on("click",function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}).off("keyup").on("keyup",function(i){var u=this;setTimeout(function(){var f=n(r).data("last_index"),e;switch(i.keyCode){case 38:f--,f<0&&(f=0),n(r).data("last_index",f),i.preventDefault&&i.preventDefault();break;case 40:f++,f>n(r).data("last_max")&&(f=n(r).data("last_max")),n(r).data("last_index",f),i.preventDefault&&i.preventDefault();break;case 13:if(typeof n(r).data("last_item")=="undefined"||n(r).data("last_item")==null||g===!0)break;e=n(r).data("selected"),r.add(n(r).data("last_item")),f>n(r).data("last_max")-1&&(f=n(r).data("last_max")-1),n(r).data("last_index",f),n(r).data("last_item",null),n(u).val(""),r.refresh(),i.preventDefault&&i.preventDefault();break;case 8:String(u.value)==""&&(typeof n(r).data("last_del")=="undefined"||n(r).data("last_del")==null?(e=n(r).data("selected"),n.isArray(e)||(e=[]),n(r).data("last_del",e.length-1),r.refresh()):(e=n(r).data("selected"),r.remove(e.length-1)));break;default:n(r).data("last_index",0),n(r).data("last_del",null)}r.resize(),i.keyCode==8&&String(u.value)==""||(n(r).prev().find("li").css("opacity","1"),n(r).data("last_del",null)),n.inArray(i.keyCode,[16,91,37,39])==-1&&t.list_render.call(r,u.value)},10)})}},calendar_get:function(t,i){var e=new Date,s=Number(e.getMonth())+1+"/"+e.getDate()+"/"+(String(e.getYear()).length>3?e.getYear():e.getYear()+1900),o;(String(t)==""||String(t)=="undefined")&&(t=w2utils.formatDate(s,i.format)),w2utils.isDate(t,i.format)||(t=w2utils.formatDate(s,i.format));var r=t.replace(/-/g,"/").replace(/\./g,"/").toLowerCase().split("/"),f=i.format.replace(/-/g,"/").replace(/\./g,"/").toLowerCase(),u=new Date;return f=="mm/dd/yyyy"&&(u=new Date(r[0]+"/"+r[1]+"/"+r[2])),f=="m/d/yyyy"&&(u=new Date(r[0]+"/"+r[1]+"/"+r[2])),f=="dd/mm/yyyy"&&(u=new Date(r[1]+"/"+r[0]+"/"+r[2])),f=="d/m/yyyy"&&(u=new Date(r[1]+"/"+r[0]+"/"+r[2])),f=="yyyy/dd/mm"&&(u=new Date(r[2]+"/"+r[1]+"/"+r[0])),f=="yyyy/d/m"&&(u=new Date(r[2]+"/"+r[1]+"/"+r[0])),f=="yyyy/mm/dd"&&(u=new Date(r[1]+"/"+r[2]+"/"+r[0])),f=="yyyy/m/d"&&(u=new Date(r[1]+"/"+r[2]+"/"+r[0])),o='
        '+n().w2field("calendar_month",u.getMonth()+1,u.getFullYear(),i)+"
        "},calendar_next:function(t){var f=String(t).split("/"),i=f[0],u=f[1],r;parseInt(i)<12?i=parseInt(i)+1:(i=1,u=parseInt(u)+1),r=n(n("#global_calendar_div.w2ui-calendar").data("el")).data("options"),n("#global_calendar_div.w2ui-calendar").html(n().w2field("calendar_get",w2utils.formatDate(i+"/1/"+u,r.format),r))},calendar_previous:function(t){var f=String(t).split("/"),i=f[0],u=f[1],r;parseInt(i)>1?i=parseInt(i)-1:(i=12,u=parseInt(u)-1),r=n(n("#global_calendar_div.w2ui-calendar").data("el")).data("options"),n("#global_calendar_div.w2ui-calendar").html(n().w2field("calendar_get",w2utils.formatDate(i+"/1/"+u,r.format),r))},calendar_month:function(t,i,r){var u=new Date,rt=w2utils.settings.fullmonths,et=w2utils.settings.fulldays,p=["31","28","31","30","31","30","31","31","30","31","30","31"],ft=Number(u.getMonth())+1+"/"+u.getDate()+"/"+(String(u.getYear()).length>3?u.getYear():u.getYear()+1900),c,g,e,s,f,v,o,h,l;i=Number(i),t=Number(t),(i===null||i==="")&&(i=String(u.getYear()).length>3?u.getYear():u.getYear()+1900),(t===null||t==="")&&(t=Number(u.getMonth())+1),t>12&&(t=t-12,i++),(t<1||t==0)&&(t=t+12,i--),p[1]=i/4==Math.floor(i/4)?"29":"28",i==null&&(i=u.getYear()),t==null&&(t=u.getMonth()-1),u=new Date,u.setDate(1),u.setMonth(t-1),u.setYear(i);var y=u.getDay(),nt=w2utils.settings.shortdays,d="";for(c=0,g=nt.length;c"+nt[c]+"";for(e='
        \t
        <-
        \t
        ->
        "+rt[t-1]+", "+i+'
        \t'+d+"\t",s=1,f=1;f<43;f++){if(y==0&&f==1){for(v=0;v<6;v++)e+='';f+=6}else if(fp[t-1]){e+='',f%7==0&&(e+="");continue}o=t+"/"+s+"/"+i,h="",f%7==6&&(h="w2ui-saturday"),f%7==0&&(h="w2ui-sunday"),o==ft&&(h+=" w2ui-today");var ut=s,b="",w="",a="";if(r.colored&&r.colored[o]!=undefined&&(tmp=r.colored[o].split(":"),w="background-color: "+tmp[0]+";",b="color: "+tmp[1]+";"),l=!1,r.start||r.end){var tt=new Date(r.start),it=new Date(r.end),k=new Date(o);(kit)&&(a=" w2ui-blocked-date",l=!0)}r.blocked&&n.inArray(o,r.blocked)!=-1&&(a=" w2ui-blocked-date",l=!0),e+='"),s++}return e+="
          
        ",(f%7==0||y==0&&f==1)&&(e+="
        "},getColorHTML:function(n){for(var r='
        ',u=[["000000","444444","666666","999999","CCCCCC","EEEEEE","F3F3F3","FFFFFF"],["FF011B","FF9838","FFFD59","01FD55","00FFFE","0424F3","9B24F4","FF21F5"],["F4CCCC","FCE5CD","FFF2CC","D9EAD3","D0E0E3","CFE2F3","D9D1E9","EAD1DC"],["EA9899","F9CB9C","FEE599","B6D7A8","A2C4C9","9FC5E8","B4A7D6","D5A6BD"],["E06666","F6B26B","FED966","93C47D","76A5AF","6FA8DC","8E7CC3","C27BA0"],["CC0814","E69138","F1C232","6AA84F","45818E","3D85C6","674EA7","A54D79"],["99050C","B45F17","BF901F","37761D","124F5C","0A5394","351C75","741B47"],["660205","783F0B","7F6011","274E12","0C343D","063762","20124D","4C1030"]],i,t=0;t<8;t++){for(r+="",i=0;i<8;i++)r+="";r+="",t<2&&(r+='')}return r+="
        \t
        \t\t'+(n==u[t][i]?"•":" ")+"\t
        "}}),w2obj.field=t}(jQuery),function($){var w2form=function(n){this.name=null,this.header="",this.box=null,this.url="",this.formURL="",this.formHTML="",this.page=0,this.recid=0,this.fields=[],this.actions={},this.record={},this.original={},this.postData={},this.toolbar={},this.tabs={},this.style="",this.focus=0,this.msgNotJSON=w2utils.lang("Return data is not in JSON format."),this.msgRefresh=w2utils.lang("Refreshing..."),this.msgSaving=w2utils.lang("Saving..."),this.onRequest=null,this.onLoad=null,this.onValidate=null,this.onSubmit=null,this.onSave=null,this.onChange=null,this.onRender=null,this.onRefresh=null,this.onResize=null,this.onDestroy=null,this.onAction=null,this.onToolbar=null,this.onError=null,this.isGenerated=!1,this.last={xhr:null},$.extend(!0,this,w2obj.form,n)};$.fn.w2form=function(n){var s,u,i,r;if(typeof n!="object"&&n){if(w2ui[$(this).attr("name")])return r=w2ui[$(this).attr("name")],r[n].apply(r,Array.prototype.slice.call(arguments,1)),this;console.log("ERROR: Method "+n+" does not exist on jQuery.w2form")}else{if(r=this,!n||typeof n.name=="undefined"){console.log('ERROR: The parameter "name" is required but not supplied in $().w2form().');return}if(typeof w2ui[n.name]!="undefined"){console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+n.name+").");return}if(!w2utils.isAlphaNumeric(n.name)){console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). ');return}var o=n.record,e=n.original,h=n.fields,c=n.toolbar,f=n.tabs,t=new w2form(n);if($.extend(t,{record:{},original:{},fields:[],tabs:{},toolbar:{},handlers:[]}),$.isArray(f)){$.extend(!0,t.tabs,{tabs:[]});for(s in f)u=f[s],typeof u=="object"?t.tabs.tabs.push(u):t.tabs.tabs.push({id:u,caption:u})}else $.extend(!0,t.tabs,f);$.extend(!0,t.toolbar,c);for(i in h)t.fields[i]=$.extend(!0,{},h[i]);for(i in o)t.record[i]=$.isPlainObject(o[i])?$.extend(!0,{},o[i]):o[i];for(i in e)t.original[i]=$.isPlainObject(e[i])?$.extend(!0,{},e[i]):e[i];return r.length>0&&(t.box=r[0]),t.formURL!=""?$.get(t.formURL,function(n){t.formHTML=n,t.isGenerated=!0,($(t.box).length!=0||n.length!=0)&&($(t.box).html(n),t.render(t.box))}):t.formHTML!=""||(t.formHTML=$(this).length!=0&&$.trim($(this).html())!=""?$(this).html():t.generateHTML()),w2ui[t.name]=t,t.formURL==""&&(String(t.formHTML).indexOf("w2ui-page")==-1&&(t.formHTML='
        '+t.formHTML+"
        "),$(t.box).html(t.formHTML),t.isGenerated=!0,t.render(t.box)),t}},w2form.prototype={get:function(n,t){for(var i in this.fields)if(this.fields[i].name==n)return t===!0?i:this.fields[i];return null},set:function(n,t){for(var i in this.fields)if(this.fields[i].name==n)return $.extend(this.fields[i],t),this.refresh(),!0;return!1},reload:function(n){var t=typeof this.url!="object"?this.url:this.url.get;t&&this.recid!=0?this.request(n):(this.refresh(),typeof n=="function"&&n())},clear:function(){var n,t;this.recid=0,this.record={};for(n in this.fields)t=this.fields[n];$().w2tag(),this.refresh()},error:function(n){var i=this,t=this.trigger({target:this.name,type:"error",message:n,xhr:this.last.xhr});if(t.isCancelled===!0)return typeof callBack=="function"&&callBack(),!1;setTimeout(function(){w2alert(n,"Error")},1),this.trigger($.extend(t,{phase:"after"}))},validate:function(n){var i,e,t,u,r,o,f;typeof n=="undefined"&&(n=!0),i=[];for(e in this.fields){t=this.fields[e],this.record[t.name]==null&&(this.record[t.name]="");switch(t.type){case"int":this.record[t.name]&&!w2utils.isInt(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not an integer")});break;case"float":this.record[t.name]&&!w2utils.isFloat(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a float")});break;case"money":this.record[t.name]&&!w2utils.isMoney(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not in money format")});break;case"hex":this.record[t.name]&&!w2utils.isHex(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a hex number")});break;case"email":this.record[t.name]&&!w2utils.isEmail(this.record[t.name])&&i.push({field:t,error:w2utils.lang("Not a valid email")});break;case"checkbox":this.record[t.name]=this.record[t.name]==!0?1:0;break;case"date":this.record[t.name]&&!w2utils.isDate(this.record[t.name],t.options.format)&&i.push({field:t,error:w2utils.lang("Not a valid date")+": "+t.options.format})}u=this.record[t.name],t.required&&(u===""||$.isArray(u)&&u.length==0)&&i.push({field:t,error:w2utils.lang("Required field")}),t.equalto&&this.record[t.name]!=this.record[t.equalto]&&i.push({field:t,error:w2utils.lang("Field should be equal to ")+t.equalto})}if(r=this.trigger({phase:"before",target:this.name,type:"validate",errors:i}),r.isCancelled===!0)return i;if(n)for(o in r.errors)f=r.errors[o],$(f.field.el).w2tag(f.error,{"class":"w2ui-error"});return this.trigger($.extend(r,{phase:"after"})),i},request:function(postData,callBack){var obj=this,params,eventData,url;if(typeof postData=="function"&&(callBack=postData,postData=null),(typeof postData=="undefined"||postData==null)&&(postData={}),this.url&&(typeof this.url!="object"||this.url.get)){if((this.recid==null||typeof this.recid=="undefined")&&(this.recid=0),params={},params.cmd="get-record",params.name=this.name,params.recid=this.recid,$.extend(params,this.postData),$.extend(params,postData),eventData=this.trigger({phase:"before",type:"request",target:this.name,url:this.url,postData:params}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Request aborted."}),!1;if(this.record={},this.original={},this.lock(this.msgRefresh),url=eventData.url,typeof eventData.url=="object"&&eventData.url.get&&(url=eventData.url.get),this.last.xhr)try{this.last.xhr.abort()}catch(e){}this.last.xhr=$.ajax({type:"GET",url:url,data:String($.param(eventData.postData,!1)).replace(/%5B/g,"[").replace(/%5D/g,"]"),dataType:"text",complete:function(xhr,status){var eventData,responseText,data;if(obj.unlock(),eventData=obj.trigger({phase:"before",target:obj.name,type:"load",xhr:xhr,status:status}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Request aborted."}),!1;if(responseText=obj.last.xhr.responseText,status!="error"){if(typeof responseText!="undefined"&&responseText!=""){if(typeof responseText=="object")data=responseText;else try{eval("data = "+responseText)}catch(e){}typeof data=="undefined"&&(data={status:"error",message:obj.msgNotJSON,responseText:responseText}),data.status=="error"?obj.error(data.message):(obj.record=$.extend({},data.record),obj.original=$.extend({},data.record))}}else obj.error("AJAX Error "+xhr.status+": "+xhr.statusText);obj.trigger($.extend(eventData,{phase:"after"})),obj.refresh(),typeof callBack=="function"&&callBack(data)}}),this.trigger($.extend(eventData,{phase:"after"}))}},submit:function(n,t){return this.save(n,t)},save:function(postData,callBack){var obj=this,errors;if(typeof postData=="function"&&(callBack=postData,postData=null),errors=obj.validate(!0),errors.length!==0){obj.goto(errors[0].field.page);return}if((typeof postData=="undefined"||postData==null)&&(postData={}),!obj.url||typeof obj.url=="object"&&!obj.url.save){console.log("ERROR: Form cannot be saved because no url is defined.");return}obj.lock(obj.msgSaving+' '),setTimeout(function(){var params={},f,field,tmp,dt,eventData,url;params.cmd="save-record",params.name=obj.name,params.recid=obj.recid,$.extend(params,obj.postData),$.extend(params,postData),params.record=$.extend(!0,{},obj.record);for(f in obj.fields){field=obj.fields[f];switch(String(field.type).toLowerCase()){case"date":dt=params.record[field.name],(field.options.format.toLowerCase()=="dd/mm/yyyy"||field.options.format.toLowerCase()=="dd-mm-yyyy"||field.options.format.toLowerCase()=="dd.mm.yyyy")&&(tmp=dt.replace(/-/g,"/").replace(/\./g,"/").split("/"),dt=new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0])),params.record[field.name]=w2utils.formatDate(dt,"yyyy-mm-dd")}}if(eventData=obj.trigger({phase:"before",type:"submit",target:obj.name,url:obj.url,postData:params}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Saving aborted."}),!1;if(url=eventData.url,typeof eventData.url=="object"&&eventData.url.save&&(url=eventData.url.save),obj.last.xhr)try{obj.last.xhr.abort()}catch(e){}obj.last.xhr=$.ajax({type:w2utils.settings.RESTfull?obj.recid==0?"POST":"PUT":"POST",url:url,data:String($.param(eventData.postData,!1)).replace(/%5B/g,"[").replace(/%5D/g,"]"),dataType:"text",xhr:function(){var n=new window.XMLHttpRequest;return n.upload.addEventListener("progress",function(n){if(n.lengthComputable){var t=Math.round(n.loaded/n.total*100);$("#"+obj.name+"_progress").text(""+t+"%")}},!1),n},complete:function(xhr,status){var eventData,responseText,data;if(obj.unlock(),eventData=obj.trigger({phase:"before",target:obj.name,type:"save",xhr:xhr,status:status}),eventData.isCancelled===!0)return typeof callBack=="function"&&callBack({status:"error",message:"Saving aborted."}),!1;if(responseText=xhr.responseText,status!="error"){if(typeof responseText!="undefined"&&responseText!=""){if(typeof responseText=="object")data=responseText;else try{eval("data = "+responseText)}catch(e){}typeof data=="undefined"&&(data={status:"error",message:obj.msgNotJSON,responseText:responseText}),data.status=="error"?obj.error(data.message):obj.original=$.extend({},obj.record)}}else obj.error("AJAX Error "+xhr.status+": "+xhr.statusText);obj.trigger($.extend(eventData,{phase:"after"})),obj.refresh(),typeof callBack=="function"&&callBack(data)}}),obj.trigger($.extend(eventData,{phase:"after"}))},50)},lock:function(n,t){var i=$(this.box).find("> div:first-child");w2utils.lock(i,n,t)},unlock:function(){var n=this;setTimeout(function(){w2utils.unlock(n.box)},25)},goto:function(n){typeof n!="undefined"&&(this.page=n),$(this.box).data("auto-size")===!0&&$(this.box).height(0),this.refresh()},generateHTML:function(){var t=[],e,f,n,r,o,i,u;for(e in this.fields)f="",n=this.fields[e],typeof n.html=="undefined"&&(n.html={}),n.html=$.extend(!0,{caption:"",span:6,attr:"",text:"",page:0},n.html),n.html.caption==""&&(n.html.caption=n.name),r='",n.type=="list"&&(r='"),n.type=="checkbox"&&(r='"),n.type=="textarea"&&(r='"),f+='\n
        '+n.html.caption+':
        \n
        '+r+n.html.text+"
        ",typeof t[n.html.page]=="undefined"&&(t[n.html.page]='
        '),t[n.html.page]+=f;for(o in t)t[o]+="\n
        ";if(i="",!$.isEmptyObject(this.actions)){i+='\n
        ';for(u in this.actions)i+='\n ';i+="\n
        "}return t.join("")+i},action:function(n,t){var i=this.trigger({phase:"before",target:n,type:"action",originalEvent:t});if(i.isCancelled===!0)return!1;typeof this.actions[n]=="function"&&this.actions[n].call(this,t),this.trigger($.extend(i,{phase:"after"}))},resize:function(){function o(){s.width($(n.box).width()).height($(n.box).height()),i.css("top",n.header!=""?w2utils.getSize(t,"height"):0),f.css("top",(n.header!=""?w2utils.getSize(t,"height"):0)+(n.toolbar.items.length>0?w2utils.getSize(i,"height"):0)),u.css("top",(n.header!=""?w2utils.getSize(t,"height"):0)+(n.toolbar.items.length>0?w2utils.getSize(i,"height")+5:0)+(n.tabs.tabs.length>0?w2utils.getSize(f,"height")+5:0)),u.css("bottom",r.length>0?w2utils.getSize(r,"height"):0)}var n=this,e=this.trigger({phase:"before",target:this.name,type:"resize"});if(e.isCancelled===!0)return!1;var s=$(this.box).find("> div"),t=$(this.box).find("> div .w2ui-form-header"),i=$(this.box).find("> div .w2ui-form-toolbar"),f=$(this.box).find("> div .w2ui-form-tabs"),u=$(this.box).find("> div .w2ui-page"),h=$(this.box).find("> div .w2ui-page.page-"+this.page),c=$(this.box).find("> div .w2ui-page.page-"+this.page+" > div"),r=$(this.box).find("> div .w2ui-buttons");o(),(parseInt($(this.box).height())==0||$(this.box).data("auto-size")===!0)&&($(this.box).height((t.length>0?w2utils.getSize(t,"height"):0)+(this.tabs.tabs.length>0?w2utils.getSize(f,"height"):0)+(this.toolbar.items.length>0?w2utils.getSize(i,"height"):0)+(u.length>0?w2utils.getSize(c,"height")+w2utils.getSize(h,"+height")+12:0)+(r.length>0?w2utils.getSize(r,"height"):0)),$(this.box).data("auto-size",!0)),o(),n.trigger($.extend(e,{phase:"after"}))},refresh:function(){var i=this,e,f,n,t,u,r;if(this.box&&this.isGenerated&&typeof $(this.box).html()!="undefined"){if($(this.box).find("input, textarea, select").each(function(n,t){var e=typeof $(t).attr("name")!="undefined"?$(t).attr("name"):$(t).attr("id"),f=i.get(e),u,r;if(f&&(u=$(t).parents(".w2ui-page"),u.length>0))for(r=0;r<100;r++)if(u.hasClass("page-"+r)){f.page=r;break}}),e=this.trigger({phase:"before",target:this.name,type:"refresh",page:this.page}),e.isCancelled===!0)return!1;$(this.box).find(".w2ui-page").hide(),$(this.box).find(".w2ui-page.page-"+this.page).show(),$(this.box).find(".w2ui-form-header").html(this.header),typeof this.tabs=="object"&&this.tabs.tabs.length>0?($("#form_"+this.name+"_tabs").show(),this.tabs.active=this.tabs.tabs[this.page].id,this.tabs.refresh()):$("#form_"+this.name+"_tabs").hide(),typeof this.toolbar=="object"&&this.toolbar.items.length>0?($("#form_"+this.name+"_toolbar").show(),this.toolbar.refresh()):$("#form_"+this.name+"_toolbar").hide();for(f in this.fields){n=this.fields[f],n.el=$(this.box).find('[name="'+String(n.name).replace(/\\/g,"\\\\")+'"]')[0],typeof n.el=="undefined"&&console.log('ERROR: Cannot associate field "'+n.name+'" with html control. Make sure html control exists with the same name.'),n.el&&(n.el.id=n.name);$(n.el).off("change").on("change",function(){var r=this.value,s=i.record[this.name]?i.record[this.name]:"",u=i.get(this.name),n,f,t;if((u.type=="enum"||u.type=="upload")&&$(this).data("selected")){var e=$(this).data("selected"),o=i.record[this.name],r=[],s=[];if($.isArray(e))for(n in e)r[n]=$.extend(!0,{},e[n]);if($.isArray(o))for(n in o)s[n]=$.extend(!0,{},o[n])}if(f=i.trigger({phase:"before",target:this.name,type:"change",value_new:r,value_previous:s}),f.isCancelled===!0)return $(this).val(i.record[this.name]),!1;t=this.value,this.type=="checkbox"&&(t=this.checked?!0:!1),this.type=="radio"&&(t=this.checked?!0:!1),u.type=="enum"&&(t=r),u.type=="upload"&&(t=r),i.record[this.name]=t,i.trigger($.extend(f,{phase:"after"}))});n.required?$(n.el).parent().addClass("w2ui-required"):$(n.el).parent().removeClass("w2ui-required")}$(this.box).find("button, input[type=button]").each(function(n,t){$(t).off("click").on("click",function(n){var t=this.value;this.name&&(t=this.name),this.id&&(t=this.id),i.action(t,n)})});for(f in this.fields)if(n=this.fields[f],t=typeof this.record[n.name]!="undefined"?this.record[n.name]:"",n.el)switch(String(n.type).toLowerCase()){case"email":case"text":case"textarea":n.el.value=t;break;case"date":n.options||(n.options={}),n.options.format||(n.options.format=w2utils.settings.date_format),n.el.value=t,this.record[n.name]=t,$(n.el).w2field($.extend({},n.options,{type:"date"}));break;case"int":n.el.value=t,$(n.el).w2field("int");break;case"float":n.el.value=t,$(n.el).w2field("float");break;case"money":n.el.value=t,$(n.el).w2field("money");break;case"hex":n.el.value=t,$(n.el).w2field("hex");break;case"alphanumeric":n.el.value=t,$(n.el).w2field("alphaNumeric");break;case"checkbox":this.record[n.name]==!0||this.record[n.name]==1||this.record[n.name]=="t"?$(n.el).prop("checked",!0):$(n.el).prop("checked",!1);break;case"password":n.el.value=t;break;case"select":case"list":$(n.el).w2field($.extend({},n.options,{type:"list",value:t}));break;case"enum":if(typeof n.options=="undefined"||typeof n.options.url=="undefined"&&typeof n.options.items=="undefined"){console.log("ERROR: (w2form."+i.name+") the field "+n.name+" defined as enum but not field.options.url or field.options.items provided.");break}this.record[n.name]=w2obj.field.cleanItems(t),t=this.record[n.name],$(n.el).w2field($.extend({},n.options,{type:"enum",selected:t}));break;case"upload":$(n.el).w2field($.extend({},n.options,{type:"upload",selected:t}));break;default:console.log('ERROR: field type "'+n.type+'" is not recognized.')}for(u=$(this.box).find(".w2ui-page"),r=0;r *").length>1&&$(u[r]).wrapInner("
        ");this.trigger($.extend(e,{phase:"after"})),this.resize()}},render:function(n){function f(){var n=$(t.box).find("input, select, textarea");n.length>t.focus&&n[t.focus].focus()}var t=this,i,u,r;if(typeof n=="object"&&($(this.box).find("#form_"+this.name+"_tabs").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-form").html(""),this.box=n),this.isGenerated){if(i=this.trigger({phase:"before",target:this.name,type:"render",box:typeof n!="undefined"?n:this.box}),i.isCancelled===!0)return!1;if(u="
        "+(this.header!=""?'
        '+this.header+"
        ":"")+'\t
        \t
        '+this.formHTML+"
        ",$(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-form").html(u),$(this.box).length>0&&($(this.box)[0].style.cssText+=this.style),typeof this.toolbar.render=="undefined"){this.toolbar=$().w2toolbar($.extend({},this.toolbar,{name:this.name+"_toolbar",owner:this}));this.toolbar.on("click",function(n){var i=t.trigger({phase:"before",type:"toolbar",target:n.target,originalEvent:n});if(i.isCancelled===!0)return!1;t.trigger($.extend(i,{phase:"after"}))})}if(typeof this.toolbar=="object"&&typeof this.toolbar.render=="function"&&this.toolbar.render($("#form_"+this.name+"_toolbar")[0]),typeof this.tabs.render=="undefined"){this.tabs=$().w2tabs($.extend({},this.tabs,{name:this.name+"_tabs",owner:this}));this.tabs.on("click",function(n){t.goto(this.get(n.target,!0))})}if(typeof this.tabs=="object"&&typeof this.tabs.render=="function"&&this.tabs.render($("#form_"+this.name+"_tabs")[0]),this.trigger($.extend(i,{phase:"after"})),this.resize(),r=typeof this.url!="object"?this.url:this.url.get,r&&this.recid!=0?this.request():this.refresh(),$(".w2ui-layout").length==0){this.tmp_resize=function(){w2ui[t.name].resize()};$(window).off("resize","body").on("resize","body",this.tmp_resize)}setTimeout(function(){t.resize(),t.refresh()},150),this.focus>=0&&setTimeout(f,500)}},destroy:function(){var n=this.trigger({phase:"before",target:this.name,type:"destroy"});if(n.isCancelled===!0)return!1;typeof this.toolbar=="object"&&this.toolbar.destroy&&this.toolbar.destroy(),typeof this.tabs=="object"&&this.tabs.destroy&&this.tabs.destroy(),$(this.box).find("#form_"+this.name+"_tabs").length>0&&$(this.box).removeAttr("name").removeClass("w2ui-reset w2ui-form").html(""),delete w2ui[this.name],this.trigger($.extend(n,{phase:"after"})),$(window).off("resize","body")}},$.extend(w2form.prototype,w2utils.event),w2obj.form=w2form}(jQuery); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 3cf5c27..743b601 100644 --- a/readme.txt +++ b/readme.txt @@ -5,6 +5,8 @@ Tags: ad, adbrite, adgridwork, adify, admin, adpinion, adroll, ads, adsense, ads Requires at least: 3.5 Tested up to: 3.7.1 Stable tag: 1.8.70-SE +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html Advertisement rotation system with a flexible logic of displaying advertisements. @@ -12,6 +14,8 @@ Advertisement rotation system with a flexible logic of displaying advertisements Simple Ads Manager is easy to use plugin providing a flexible logic of displaying advertisements. +[![endorse](https://api.coderwall.com/minimus/endorsecount.png)](https://coderwall.com/minimus) + = Features = * Flexible logic of advertisements rotation based on defined weight of each advertisement in group (Ads Place) * Custom default ad for each Ads Place From f6814c7dfc438598487e092dd4d00be9f656b090 Mon Sep 17 00:00:00 2001 From: minimus Date: Mon, 11 Nov 2013 23:31:03 +0300 Subject: [PATCH 03/18] Changes for prevent duplicate logic of "Do Show"/"Do Not Show" --- css/sam-admin-edit.css | 3 +- editor.admin.class.php | 21 ++- js/sam-admin-edit.js | 282 ++++++++++++++++++++++++++++++--------- js/sam-admin-edit.min.js | 2 +- 4 files changed, 242 insertions(+), 66 deletions(-) diff --git a/css/sam-admin-edit.css b/css/sam-admin-edit.css index 9506a75..3f41f00 100644 --- a/css/sam-admin-edit.css +++ b/css/sam-admin-edit.css @@ -149,7 +149,8 @@ input.button-primary, input.button-secondary, #auth-grid, #x-auth-grid, #tags-grid, #x-tags-grid, #cust-grid, #x-cust-grid, -#users-grid, #ctt-grid { +#users-grid, #ctt-grid, +#x-ctt-grid { width: 100%; height: 197px; } diff --git a/editor.admin.class.php b/editor.admin.class.php index 302b4f8..eed99e8 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -1205,7 +1205,7 @@ public function page() {

        > - +

        @@ -1216,6 +1216,25 @@ public function page() {

        +
        +

        + +

        +
        +
        +

        + > + +

        +
        + +
        +
        +
        +
        +

        + +

        > diff --git a/js/sam-admin-edit.js b/js/sam-admin-edit.js index be69637..b9b2d97 100644 --- a/js/sam-admin-edit.js +++ b/js/sam-admin-edit.js @@ -4,6 +4,8 @@ */ (function ($) { $(document).ready(function () { + var em = $('#editor_mode').val(); + $("#title").tooltip({ track: true }); @@ -48,8 +50,8 @@ .fadeOut(1000, function () { $(this).remove(); }); - if ($('#editor_mode').val() == 'item') $("#ad_img").val(options.url + file); - if ($('#editor_mode').val() == 'place') $("#patch_img").val(options.url + file); + if (em == 'item') $("#ad_img").val(options.url + file); + else if (em == 'place') $("#patch_img").val(options.url + file); } else { $('#files').text(file + ' ' + response) @@ -62,7 +64,7 @@ } }); - if ($('#editor_mode').val() == 'item') { + if (em == 'item') { sPointer = samPointer.ads; sPointer.pointer = 'ads'; @@ -140,6 +142,10 @@ var cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'); buildGrid('ctt-grid', cttGrid, 'view-custom-tax-terms', cttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); + // + var xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x-view-custom-tax-terms'); + buildGrid('x-ctt-grid', xcttGrid, 'x-view-custom-tax-terms', xcttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); + // Posts Grid var postsGrid = $('#posts-grid'), postsIn = $('#view_id'); buildGrid('posts-grid', postsGrid, 'view_id', postsIn, 'id', options.posts.columns, options.posts.posts); @@ -192,6 +198,7 @@ } if(el == 'tabs-2') { if($('#rc-ctt').is(':visible')) cttGrid.w2render('ctt-grid'); + if($('#rc-xct').is(':visible')) xcttGrid.w2render('x-ctt-grid'); if($('#rc-xid').is(':visible')) xpostsGrid.w2render('x-posts-grid'); if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); if($('#rc-ac').is(':visible')) catsGrid.w2render('cats-grid'); @@ -222,25 +229,60 @@ $("#rc-cmt").show('blind', {direction:'vertical'}, 500); }); + var + rcvt0 = $('#rc-vt0'), + rcvt2 = $('#rc-vt2'), + xId = $('#x_id'), + rcxid = $('#rc-xid'); + + if(2 == $('input:radio[name=view_type]:checked').val()) { + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } + xId.attr('disabled', true); + } + $("input:radio[name=view_type]").click(function () { var cval = $('input:radio[name=view_type]:checked').val(); switch (cval) { case '0': - if ($('#rc-vt0').is(':hidden')) $("#rc-vt0").show('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':visible')) $("#rc-vt2").hide('blind', {direction:'vertical'}, 500); + if (rcvt0.is(':hidden')) rcvt0.show('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); break; case '1': - if ($('#rc-vt0').is(':visible')) $("#rc-vt0").hide('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':visible')) $("#rc-vt2").hide('blind', {direction:'vertical'}, 500); + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); break; case '2': - if ($('#rc-vt0').is(':visible')) $("#rc-vt0").hide('blind', {direction:'vertical'}, 500); - if ($('#rc-vt2').is(':hidden')) { - $("#rc-vt2").show('blind', {direction:'vertical'}, 500, function() { + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':hidden')) { + rcvt2.show('blind', {direction:'vertical'}, 500, function() { postsGrid.w2render('posts-grid'); }); + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } } + xId.attr('disabled', true); + break; + } + }); + + xId.click(function () { + if (xId.is(':checked')) { + if(2 == $('input:radio[name=view_type]:checked').val()) { + xId.attr('checked', false); + } + else + rcxid.show('blind', {direction:'vertical'}, 500, function() { + xpostsGrid.w2render('x-posts-grid'); + }); } + else rcxid.hide('blind', {direction:'vertical'}, 500); }); $("input:radio[name=ad_users]").click(function() { @@ -277,105 +319,219 @@ else $('#swf-params').hide('blind', {direction:'vertical'}, 500); }); - $('#x_id').click(function () { - if ($('#x_id').is(':checked')) { - $('#rc-xid').show('blind', {direction:'vertical'}, 500, function() { - xpostsGrid.w2render('x-posts-grid'); - }); - } - else $('#rc-xid').hide('blind', {direction:'vertical'}, 500); - }); + var + adCats = $('#ad_cats'), + rcac = $('#rc-ac'), + acw = $('#acw'), + xCats = $('#x_cats'), + rcxc = $('#rc-xc'); - $('#ad_cats').click(function () { - if ($('#ad_cats').is(':checked')) { - $('#rc-ac').show('blind', {direction:'vertical'}, 500, function() { + if(adCats.is(':checked') && xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } + + adCats.click(function () { + if (adCats.is(':checked')) { + rcac.show('blind', {direction:'vertical'}, 500, function() { catsGrid.w2render('cats-grid'); }); - $('#acw').show('blind', {direction:'vertical'}, 500); + acw.show('blind', {direction:'vertical'}, 500); + if(xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } } else { - $('#rc-ac').hide('blind', {direction:'vertical'}, 500); - $('#acw').hide('blind', {direction:'vertical'}, 500); + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); } }); - $('#x_cats').click(function () { - if ($('#x_cats').is(':checked')) - $('#rc-xc').show('blind', {direction:'vertical'}, 500, function() { + xCats.click(function () { + if (xCats.is(':checked')) { + rcxc.show('blind', {direction:'vertical'}, 500, function() { xcatsGrid.w2render('x-cats-grid'); }); - else $('#rc-xc').hide('blind', {direction:'vertical'}, 500); + if(adCats.is(':checked')) { + adCats.attr('checked', false); + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxc.hide('blind', {direction:'vertical'}, 500); }); - $('#ad_custom_tax_terms').click(function() { - if($('#ad_custom_tax_terms').is(':checked')) - $('#rc-ctt').show('blind', {direction: 'vertical'}, 500, function() { + var + actt = $('#ad_custom_tax_terms'), + rcctt = $('#rc-ctt'), + cttw = $('#cttw'), + xacct = $('#x_ad_custom_tax_terms'), + rcxct = $('#rc-xct'); + + if(actt.is(':checked') && xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + + actt.click(function() { + if(actt.is(':checked')) { + rcctt.show('blind', {direction: 'vertical'}, 500, function() { cttGrid.w2render('ctt-grid'); }); - else $('#rc-ctt').hide('blind', {direction:'vertical'}, 500); + cttw.show('blind', {direction:'vertical'}, 500); + if(xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xacct.click(function() { + if(xacct.is(':checked')) { + rcxct.show('blind', {direction: 'vertical'}, 500, function() { + xcttGrid.w2render('x-ctt-grid'); + }); + if(actt.is(':checked')) { + actt.attr('checked', false); + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxct.hide('blind', {direction: 'vertical'}, 500); }); - $('#ad_authors').click(function () { - if ($('#ad_authors').is(':checked')) { - $('#rc-au').show('blind', {direction:'vertical'}, 500, function() { + var + adAuth = $('#ad_authors'), + rcau = $('#rc-au'), + aaw = $('#aaw'), + xAuth = $('#x_authors'), + rcxa = $('#rc-xa'); + + if(adAuth.is(':checked') && xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } + + adAuth.click(function () { + if (adAuth.is(':checked')) { + rcau.show('blind', {direction:'vertical'}, 500, function() { authGrid.w2render('auth-grid'); }); - $('#aaw').show('blind', {direction:'vertical'}, 500); + aaw.show('blind', {direction:'vertical'}, 500); + if(xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } } else { - $('#rc-au').hide('blind', {direction:'vertical'}, 500); - $('#aaw').hide('blind', {direction:'vertical'}, 500); + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); } }); - $('#x_authors').click(function () { - if ($('#x_authors').is(':checked')) - $('#rc-xa').show('blind', {direction:'vertical'}, 500, function() { + xAuth.click(function () { + if (xAuth.is(':checked')) { + rcxa.show('blind', {direction:'vertical'}, 500, function() { xauthGrid.w2render('x-auth-grid'); }); - else $('#rc-xa').hide('blind', {direction:'vertical'}, 500); + if(adAuth.is(':checked')) { + adAuth.attr('checked', false); + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxa.hide('blind', {direction:'vertical'}, 500); }); - $('#ad_tags').click(function () { - if ($('#ad_tags').is(':checked')) { - $('#rc-at').show('blind', {direction:'vertical'}, 500, function() { + var + adTags = $('#ad_tags'), + rcat = $('#rc-at'), + atw = $('#atw'), + xTags = $('#x_tags'), + rcxt = $('#rc-xt'); + + if(adTags.is(':checked') && xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } + + adTags.click(function () { + if (adTags.is(':checked')) { + rcat.show('blind', {direction:'vertical'}, 500, function() { tagsGrid.w2render('tags-grid'); }); - $('#atw').show('blind', {direction:'vertical'}, 500); + atw.show('blind', {direction:'vertical'}, 500); + if(xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } } else { - $('#rc-at').hide('blind', {direction:'vertical'}, 500); - $('#atw').hide('blind', {direction:'vertical'}, 500); + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); } }); - $('#x_tags').click(function () { - if ($('#x_tags').is(':checked')) - $('#rc-xt').show('blind', {direction:'vertical'}, 500, function() { + xTags.click(function () { + if (xTags.is(':checked')) { + rcxt.show('blind', {direction:'vertical'}, 500, function() { xtagsGrid.w2render('x-tags-grid'); }); - else $('#rc-xt').hide('blind', {direction:'vertical'}, 500); + if(adTags.is(':checked')) { + adTags.attr('checked', false); + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxt.hide('blind', {direction:'vertical'}, 500); }); - $('#ad_custom').click(function () { - if ($('#ad_custom').is(':checked')) { - $('#rc-cu').show('blind', {direction:'vertical'}, 500, function() { + var + adCust = $('#ad_custom'), + rccu = $('#rc-cu'), + cuw = $('#cuw'), + xCust = $('#x_custom'), + rcxu = $('#rc-xu'); + + if(adCust.is(':checked') && xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } + + adCust.click(function () { + if (adCust.is(':checked')) { + rccu.show('blind', {direction:'vertical'}, 500, function() { custGrid.w2render('cust-grid'); }); - $('#cuw').show('blind', {direction:'vertical'}, 500); + cuw.show('blind', {direction:'vertical'}, 500); + if(xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } } else { - $('#rc-cu').hide('blind', {direction:'vertical'}, 500); - $('#cuw').hide('blind', {direction:'vertical'}, 500); + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); } }); - $('#x_custom').click(function () { - if ($('#x_custom').is(':checked')) - $('#rc-xu').show('blind', {direction:'vertical'}, 500, function() { + xCust.click(function () { + if (xCust.is(':checked')) { + rcxu.show('blind', {direction:'vertical'}, 500, function() { xcustGrid.w2render('x-cust-grid'); }); - else $('#rc-xu').hide('blind', {direction:'vertical'}, 500); + if(adCust.is(':checked')) { + adCust.attr('checked', false); + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxu.hide('blind', {direction:'vertical'}, 500); }); $('#ad_schedule').click(function () { @@ -394,7 +550,7 @@ }); } - if ($('#editor_mode').val() == 'place') { + if (em == 'place') { sPointer = samPointer.places; sPointer.pointer = 'places'; diff --git a/js/sam-admin-edit.min.js b/js/sam-admin-edit.min.js index 1827d2e..c8e4c07 100644 --- a/js/sam-admin-edit.min.js +++ b/js/sam-admin-edit.min.js @@ -2,4 +2,4 @@ * @author minimus * @copyright 2010 - 2013 */ -(function(n){n(document).ready(function(){var y,rt,o,it,u,ft,c,st,s,ot,l,et,e,b,h,tt,f,g,p,d,v,nt,a,k;n("#title").tooltip({track:!0});var t=n.parseJSON(n.ajax({url:ajaxurl,data:{action:"get_strings"},async:!1,dataType:"jsonp"}).responseText),ct=n("#upload-file-button"),w=n("#uploading"),ht=n("#uploading-help"),ut=n("#load_img"),r,lt="",at=new AjaxUpload(ct,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,i){if(!(i&&/^(jpg|png|jpeg|gif|swf)$/.test(i)))return w.text(t.status),!1;ut.show(),w.text(t.uploading)},onComplete:function(i,r){w.text(""),ut.hide(),n('

        ').appendTo(ht),r=="success"?(n("#files").text(t.file+" "+i+" "+t.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),n("#editor_mode").val()=="item"&&n("#ad_img").val(t.url+i),n("#editor_mode").val()=="place"&&n("#patch_img").val(t.url+i)):n("#files").text(i+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});if(n("#editor_mode").val()=="item"){r=samPointer.ads,r.pointer="ads",n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0}),n("#adv_nick").combogrid({url:ajaxurl+"?action=get_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:t.users.colModel,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});function i(t,i,r,u,f,e,o){var s=u.val(),h;i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:e,records:o,onSelect:function(n){n.onComplete=function(){for(var e="",r=this.getSelection(),i,t,n=0;n"+r.title+"

        "+r.content+"

        ",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:r.pointer},async:!0})}}).pointer("open"),n("#is_singular").click(function(){n("#is_singular").is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)}),n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!n("#is_singular").is(":checked")||n("#is_single").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_posttype").is(":checked")?!n("#is_singular").is(":checked")&&n("#is_single").is(":checked")&&n("#is_posttype").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_singular").attr("checked",!0):n("#is_singular").attr("checked",!1)}),n("#is_archive").click(function(){n("#is_archive").is(":checked")&&n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").attr("checked",!0)}),n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").click(function(){!n("#is_archive").is(":checked")||n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")?!n("#is_archive").is(":checked")&&n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")&&n("#is_archive").attr("checked",!0):n("#is_archive").attr("checked",!1)}),!1})})(jQuery); \ No newline at end of file +(function(n){n(document).ready(function(){var at=n("#editor_mode").val(),ct,oi,lt,wi,yt,bi,h,di,ot,li,st,hi,ht,vi,vt,pi,pt,ei,nt,ki,k,ci,d,ai,g,yi;n("#title").tooltip({track:!0});var t=n.parseJSON(n.ajax({url:ajaxurl,data:{action:"get_strings"},async:!1,dataType:"jsonp"}).responseText),gi=n("#upload-file-button"),ti=n("#uploading"),nr=n("#uploading-help"),si=n("#load_img"),u,tr="",ir=new AjaxUpload(gi,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,i){if(!(i&&/^(jpg|png|jpeg|gif|swf)$/.test(i)))return ti.text(t.status),!1;si.show(),ti.text(t.uploading)},onComplete:function(i,r){ti.text(""),si.hide(),n('
        ').appendTo(nr),r=="success"?(n("#files").text(t.file+" "+i+" "+t.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),at=="item"?n("#ad_img").val(t.url+i):at=="place"&&n("#patch_img").val(t.url+i)):n("#files").text(i+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});if(at=="item"){u=samPointer.ads,u.pointer="ads",n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0}),n("#adv_nick").combogrid({url:ajaxurl+"?action=get_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:t.users.colModel,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});function i(t,i,r,u,f,e,o){var s=u.val(),h;i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:e,records:o,onSelect:function(n){n.onComplete=function(){for(var e="",r=this.getSelection(),i,t,n=0;n"+u.title+"

        "+u.content+"

        ",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:u.pointer},async:!0})}}).pointer("open"),n("#is_singular").click(function(){n("#is_singular").is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)}),n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!n("#is_singular").is(":checked")||n("#is_single").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_posttype").is(":checked")?!n("#is_singular").is(":checked")&&n("#is_single").is(":checked")&&n("#is_posttype").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_singular").attr("checked",!0):n("#is_singular").attr("checked",!1)}),n("#is_archive").click(function(){n("#is_archive").is(":checked")&&n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").attr("checked",!0)}),n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").click(function(){!n("#is_archive").is(":checked")||n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")?!n("#is_archive").is(":checked")&&n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")&&n("#is_archive").attr("checked",!0):n("#is_archive").attr("checked",!1)}),!1})})(jQuery); \ No newline at end of file From b0baeec286ed3197d672dca8c77a5ac4a97f6c61 Mon Sep 17 00:00:00 2001 From: minimus Date: Tue, 12 Nov 2013 15:46:01 +0300 Subject: [PATCH 04/18] Start developing caching compatibility --- .gitignore | 1 + ad.class.php | 5 +- admin.class.php | 48 +- css/color-buttons.css | 60 +- lang/simple-ads-manager-ru_RU.mo | Bin 79848 -> 82522 bytes lang/simple-ads-manager-ru_RU.po | 1493 ++++++++++++++++-------------- sam-ajax-loader.php | 59 ++ sam.class.php | 1 + 8 files changed, 895 insertions(+), 772 deletions(-) create mode 100644 .gitignore create mode 100644 sam-ajax-loader.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1cc4572 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/workspace.xml diff --git a/ad.class.php b/ad.class.php index 466fb68..1e24e52 100644 --- a/ad.class.php +++ b/ad.class.php @@ -132,8 +132,9 @@ class SamAdPlace { private $crawler = false; public $ad = ''; private $clauses; + private $force; - public function __construct($args = null, $useCodes = false, $crawler = false, $clauses = null) { + public function __construct($args = null, $useCodes = false, $crawler = false, $clauses = null, $ajax = false) { global $SAM_Query; $this->args = $args; @@ -141,6 +142,8 @@ public function __construct($args = null, $useCodes = false, $crawler = false, $ $this->crawler = $crawler; if(is_null( $clauses )) $this->clauses = $SAM_Query['clauses']; else $this->clauses = $clauses; + $this->force = $ajax; + $this->ad = $this->buildAd($this->args, $this->useCodes); } diff --git a/admin.class.php b/admin.class.php index 7f2f3af..1f26b2b 100644 --- a/admin.class.php +++ b/admin.class.php @@ -180,6 +180,7 @@ public function initSettings() { add_settings_field('adCycle', __("Views per Cycle", SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_general_section', array('description' => __('Number of hits of one ad for a full cycle of rotation (maximal activity).', SAM_DOMAIN))); add_settings_field('access', __('Minimum Level for access to menu', SAM_DOMAIN), array(&$this, 'drawJSliderOption'), 'sam-settings', 'sam_general_section', array('description' => __('Who can use menu of plugin - Minimum User Level needed for access to menu of plugin. In any case only Super Admin and Administrator can use Settings Menu of SAM Plugin.', SAM_DOMAIN), 'options' => array('manage_network' => __('Super Admin', SAM_DOMAIN), 'manage_options' => __('Administrator', SAM_DOMAIN), 'edit_others_posts' => __('Editor', SAM_DOMAIN), 'publish_posts' => __('Author', SAM_DOMAIN), 'edit_posts' => __('Contributor', SAM_DOMAIN)), 'values' => array('manage_network', 'manage_options', 'edit_others_posts', 'publish_posts', 'edit_posts'))); + add_settings_field('adShow', __("Ad Output Mode", SAM_DOMAIN), array(&$this, 'drawRadioOption'), 'sam-settings', 'sam_general_section', array('description' => __('Standard (PHP) mode is more faster but is not compatible with caching plugins. If your blog use caching plugin (i.e WP Super Cache or Hyper Cache) select "Caching Compatible (Javascript)" mode.', SAM_DOMAIN), 'options' => array('php' => __('Standard (PHP)', SAM_DOMAIN), 'js' => __('Caching Compatible (Javascript)', SAM_DOMAIN)))); add_settings_field('adDisplay', __("Display Ad Source in", SAM_DOMAIN), array(&$this, 'drawRadioOption'), 'sam-settings', 'sam_general_section', array('description' => __('Target wintow (tab) for advetisement source.', SAM_DOMAIN), 'options' => array('blank' => __('New Window (Tab)', SAM_DOMAIN), 'self' => __('Current Window (Tab)', SAM_DOMAIN)))); add_settings_field('bpAdsId', __("Ads Place before content", SAM_DOMAIN), array(&$this, 'drawSelectOptionX'), 'sam-settings', 'sam_single_section', array('description' => '')); @@ -278,8 +279,6 @@ public function help($contextualHelp, $screenId, $screen) { public function adminEditStyles() { wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui.css', false, '1.10.3'); - //wp_enqueue_style('ColorPickerCSS', SAM_URL.'css/colorpicker.css'); - //wp_enqueue_style('slick', SAM_URL.'css/slick.grid.css', false, '2.0'); wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); wp_enqueue_style('wp-pointer'); wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); @@ -291,6 +290,7 @@ public function adminSettingsStyles() { //wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-1.8.9.custom.css', false, '1.8.9'); wp_enqueue_style('jSlider', SAM_URL.'css/jslider.css', false, '1.1.0'); wp_enqueue_style('jSlider-plastic', SAM_URL.'css/jslider.round.plastic.css', false, '1.1.0'); + wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); } public function adminListStyles() { @@ -327,31 +327,15 @@ public function adminEditScripts() { wp_enqueue_script('jquery-ui-tooltip'); if(file_exists(SAM_PATH.'/js/i18n/jquery.ui.datepicker-'.$lc.'.js')) wp_enqueue_script('jquery-ui-locale', SAM_URL.'js/i18n/jquery.ui.datepicker-'.$lc.'.js', array('jquery'), '1.8.9'); - //wp_enqueue_script('ColorPicker', SAM_URL.'js/colorpicker.js', array('jquery')); wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); - //('jquery-event-drag', SAM_URL.'js/slick/jquery.event.drag-2.0.min.js', array('jquery'), '2.0'); - //wp_enqueue_script('slick-core', SAM_URL.'js/slick/slick.core.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-checkboxes', SAM_URL.'js/slick/slick.checkboxselectcolumn.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-tooltips', SAM_URL.'js/slick/slick.autotooltips.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-cell-rd', SAM_URL.'js/slick/slick.cellrangedecorator.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-cell-rs', SAM_URL.'js/slick/slick.cellrangeselector.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-cell-cm', SAM_URL.'js/slick/slick.cellcopymanager.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-cell-sm', SAM_URL.'js/slick/slick.cellselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-row-sm', SAM_URL.'js/slick/slick.rowselectionmodel.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-formatters', SAM_URL.'js/slick/slick.formatters.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-editors', SAM_URL.'js/slick/slick.editors.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('slick-grid', SAM_URL.'js/slick/slick.grid.js', array('jquery', 'jquery-ui-core'), '2.0'); - //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.2'); wp_enqueue_script('wp-pointer'); wp_localize_script('wp-pointer', 'samPointer', array( 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), - 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), - 'zones' => array('enabled' => $pointers['zones'], 'title' => __('Name of Ads Zone', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), - 'blocks' => array('enabled' => $pointers['blocks'], 'title' => __('Name of Ads Block', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use plugin\'s widgets.', SAM_DOMAIN)) + 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)) )); wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); } @@ -370,8 +354,6 @@ public function adminEditZBScripts() { wp_enqueue_script('wp-pointer'); wp_localize_script('wp-pointer', 'samPointer', array( - 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), - 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), 'zones' => array('enabled' => $pointers['zones'], 'title' => __('Name of Ads Zone', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), 'blocks' => array('enabled' => $pointers['blocks'], 'title' => __('Name of Ads Block', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use plugin\'s widgets.', SAM_DOMAIN)) )); @@ -687,9 +669,6 @@ public function getStringsHandler() { 'url' => SAM_AD_URL, 'cats' => array( 'columns' => array( - /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), - array('id' => "title", 'name' => __("Category Title", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("Category Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), array('field' => 'title', 'caption' => __("Category Title", SAM_DOMAIN), 'size' => '50%'), array('field' => 'slug', 'caption' => __("Category Slug", SAM_DOMAIN), 'size' => '40%') @@ -698,9 +677,6 @@ public function getStringsHandler() { ), 'authors' => array( 'columns' => array( - /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), - array('id' => "title", 'name' => __("Display Name", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("User Name", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '50%'), array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '40%') @@ -709,9 +685,6 @@ public function getStringsHandler() { ), 'tags' => array( 'columns' => array( - /*array('id' => "id", 'name' => "ID", 'field' => "id", 'width' => 50), - array('id' => "title", 'name' => __("Tag Title", SAM_DOMAIN), 'field' => "title", 'width' => 500), - array('id' => "slug", 'name' => __("Tag Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), array('field' => 'title', 'caption' => __("Tag Title", SAM_DOMAIN), 'size' => '50%'), array('field' => 'slug', 'caption' => __("Tag Slug", SAM_DOMAIN), 'size' => '40%') @@ -720,8 +693,6 @@ public function getStringsHandler() { ), 'customs' => array( 'columns' => array( - /*array('id' => "title", 'name' => __("Custom Type Title", SAM_DOMAIN), 'field' => "title", 'width' => 550), - array('id' => "slug", 'name' => __("Custom Type Slug", SAM_DOMAIN), 'field' => "slug", 'width' => 200)*/ array('field' => 'title', 'caption' => __("Custom Type Title", SAM_DOMAIN), 'size' => '50%'), array('field' => 'slug', 'caption' => __("Custom Type Slug", SAM_DOMAIN), 'size' => '50%') ), @@ -743,10 +714,6 @@ public function getStringsHandler() { array('columnName' => 'email', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser e-mail', SAM_DOMAIN)) ), 'columns' => array( - /*array('id' => 'id', 'name' => 'ID', 'field' => 'id', 'width' => 50), - array('id' => "title", 'name' => __("Display Name", SAM_DOMAIN), 'field' => "title", 'width' => 250), - array('id' => "slug", 'name' => __("User Name", SAM_DOMAIN), 'field' => "slug", 'width' => 200), - array('id' => 'role', 'name' => __("Role", SAM_DOMAIN), 'field' => 'role', 'width' => 200)*/ array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '40%'), array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '25%'), @@ -757,7 +724,6 @@ public function getStringsHandler() { 'custom_taxes' => array( 'taxes' => $cTax, 'columns' => array( - //array('field' => 'recid', 'caption' => 'Record ID', 'size' => '30px'), array('field' => 'term_id', 'caption' => __('ID', SAM_DOMAIN), 'size' => '30px'), array('field' => 'name', 'caption' => __('Term Name', SAM_DOMAIN), 'size' => '50%'), array('field' => 'ctax_name', 'caption' => __('Custom Taxonomy Name', SAM_DOMAIN), 'size' => '40%') @@ -1076,9 +1042,13 @@ public function samAdminPage() { doSettingsSections('sam-settings'); ?>

        - + +

        -

        Simple Ads Manager plugin for Wordpress. Copyright © 2010 - 2011, minimus. All rights reserved.

        +

        Copyright © 2010 - 2014, minimus.

        diff --git a/css/color-buttons.css b/css/color-buttons.css index 3ea71dc..2b018ce 100644 --- a/css/color-buttons.css +++ b/css/color-buttons.css @@ -16,11 +16,11 @@ border:1px solid #ccc; border-radius:2px; background:#f5f5f5; - background:linear-gradient(to top,#f5f5f5,#ddd); - background:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#ddd)); - background:-moz-linear-gradient(top,#f5f5f5,#ddd); - background:-ms-linear-gradient(top,#f5f5f5,#ddd); - background:-o-linear-gradient(top,#f5f5f5,#ddd); + background-image:linear-gradient(to top,#f5f5f5,#ddd); + background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#ddd)); + background-image:-moz-linear-gradient(top,#f5f5f5,#ddd); + background-image:-ms-linear-gradient(top,#f5f5f5,#ddd); + background-image:-o-linear-gradient(top,#f5f5f5,#ddd); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5',endColorstr='#dddddd'); -moz-box-shadow:-1px 2px 3px rgba(0,0,0,0.1); -webkit-box-shadow:-1px 2px 3px rgba(0,0,0,0.1); @@ -29,11 +29,11 @@ .color-btn:hover,.color-btn:active { background:#fdfdfd; - background:linear-gradient(top,#fdfdfd,#eee); - background:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee)); - background:-moz-linear-gradient(top,#fdfdfd,#eee); - background:-ms-linear-gradient(top,#fdfdfd,#eee); - background:-o-linear-gradient(top,#fdfdfd,#eee); + background-image:linear-gradient(top,#fdfdfd,#eee); + background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee)); + background-image:-moz-linear-gradient(top,#fdfdfd,#eee); + background-image:-ms-linear-gradient(top,#fdfdfd,#eee); + background-image:-o-linear-gradient(top,#fdfdfd,#eee); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdfdfd',endColorstr='#eeeeee'); border:1px solid #ddd } @@ -124,11 +124,11 @@ border-bottom:1px solid transparent; border-right:0; background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none @@ -136,11 +136,11 @@ .color-btn-left:hover b,.color-btn-left:active b { background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) } .color-btn-left:active b { @@ -172,11 +172,11 @@ border-bottom:1px solid transparent; border-right:0; background:rgba(0,0,0,0); - background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.1))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.1)); -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none @@ -184,11 +184,11 @@ .color-btn-right:hover b, .color-btn-right:active b { background:rgba(0,0,0,0); - background:linear-gradient(to top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); - background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); - background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) + background-image:linear-gradient(to top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.05))); + background-image:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-ms-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)); + background-image:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.05)) } .color-btn-right:active b { diff --git a/lang/simple-ads-manager-ru_RU.mo b/lang/simple-ads-manager-ru_RU.mo index 07b1cfc4379c0195e898c84b1d258e108f9c237a..be351da52bfe887c2b135e0f5d97b3ac21371382 100644 GIT binary patch delta 13456 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 V{iBvB$9I3lmD@e5jvJr%e*j>I6XyT` delta 11918 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 oAq!5d$+hEAh$qc&$CPl-Ur{^e*7VfMy\n" "Language-Team: minimus \n" @@ -17,63 +17,64 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" -"_n:1,2;_nc:1,2;esc_attr__\n" +"_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" "X-Poedit-Basepath: .\n" "X-Generator: Poedit 1.5.7\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: ..\n" -#: ad.class.php:78 ad.class.php:477 +#: ../ad.class.php:78 ../ad.class.php:338 msgid "Flash ad" msgstr "Флеш объявление" -#: ad.class.php:193 +#: ../ad.class.php:188 msgid "Empty data..." msgstr "Нет данных ..." -#: admin.class.php:172 +#: ../admin.class.php:173 msgid "General Settings" msgstr "Основные параметры" -#: admin.class.php:173 +#: ../admin.class.php:174 msgid "Auto Inserting Settings" msgstr "Параметры автовставки" -#: admin.class.php:174 +#: ../admin.class.php:175 msgid "Extended Options" msgstr "Дополнительные параметры" -#: admin.class.php:175 +#: ../admin.class.php:176 msgid "Google DFP Settings" msgstr "Параметры Google DFP" -#: admin.class.php:176 help.class.php:68 help.class.php:195 +#: ../admin.class.php:177 ../help.class.php:68 ../help.class.php:195 msgid "Statistics Settings" msgstr "Параметры статистики" -#: admin.class.php:177 +#: ../admin.class.php:178 msgid "Admin Layout" msgstr "Параметры административных страниц" -#: admin.class.php:178 +#: ../admin.class.php:179 msgid "Plugin Deactivating" msgstr "Деактивация плагина" -#: admin.class.php:180 +#: ../admin.class.php:181 msgid "Views per Cycle" msgstr "Показов в цикле" -#: admin.class.php:180 +#: ../admin.class.php:181 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" "Количество показов одного рекламного объявления за полный цикл ротации при " "максимальной активности (см. \"вес объявления\")." -#: admin.class.php:181 +#: ../admin.class.php:182 msgid "Minimum Level for access to menu" msgstr "Минимальный уровень для доступа к меню" -#: admin.class.php:181 +#: ../admin.class.php:182 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " @@ -83,79 +84,101 @@ msgstr "" "необходимый для доступа к меню плагина. В любом случае, доступ к меню " "настроек плагина имеют только Администратор и Супер Администратор." -#: admin.class.php:181 admin.class.php:418 admin.class.php:558 +#: ../admin.class.php:182 ../admin.class.php:403 ../admin.class.php:585 msgid "Super Admin" msgstr "Супер Админ" -#: admin.class.php:181 admin.class.php:419 admin.class.php:557 +#: ../admin.class.php:182 ../admin.class.php:404 ../admin.class.php:584 msgid "Administrator" msgstr "Администратор" -#: admin.class.php:181 admin.class.php:420 admin.class.php:556 +#: ../admin.class.php:182 ../admin.class.php:405 ../admin.class.php:583 msgid "Editor" msgstr "Редактор" -#: admin.class.php:181 admin.class.php:421 admin.class.php:554 +#: ../admin.class.php:182 ../admin.class.php:406 ../admin.class.php:582 msgid "Author" msgstr "Автор" -#: admin.class.php:181 admin.class.php:422 admin.class.php:553 +#: ../admin.class.php:182 ../admin.class.php:407 ../admin.class.php:581 msgid "Contributor" msgstr "Участник" -#: admin.class.php:182 +#: ../admin.class.php:183 +msgid "Ad Output Mode" +msgstr "Режим вывода объявления" + +#: ../admin.class.php:183 +msgid "" +"Standard (PHP) mode is more faster but is not compatible with caching " +"plugins. If your blog use caching plugin (i.e WP Super Cache or Hyper Cache) " +"select \"Caching Compatible (Javascript)\" mode." +msgstr "" +"Стандартный (PHP) режим более быстрый, но не совместим с плагинами " +"кэширования. Если на Вашем блоге установлены плагины кэширования (например: " +"WP Super Cache или Hyper Cache), выберите режим совместимости с кэшированием." + +#: ../admin.class.php:183 +msgid "Standard (PHP)" +msgstr "Стандартный (PHP)" + +#: ../admin.class.php:183 +msgid "Caching Compatible (Javascript)" +msgstr "Совместимость с кэшированием (Javascript)" + +#: ../admin.class.php:184 msgid "Display Ad Source in" msgstr "Открывать ссылку в" -#: admin.class.php:182 +#: ../admin.class.php:184 msgid "Target wintow (tab) for advetisement source." msgstr "Открытие окна (вкладки) для рекламного объявления." -#: admin.class.php:182 +#: ../admin.class.php:184 msgid "New Window (Tab)" msgstr "Новое окно (вкладка)" -#: admin.class.php:182 +#: ../admin.class.php:184 msgid "Current Window (Tab)" msgstr "Текущее окно (вкладка)" -#: admin.class.php:184 +#: ../admin.class.php:186 msgid "Ads Place before content" msgstr "Рекламное место до контента" -#: admin.class.php:185 +#: ../admin.class.php:187 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места перед контентом статьи/" "страницы" -#: admin.class.php:186 admin.class.php:189 admin.class.php:192 +#: ../admin.class.php:188 ../admin.class.php:191 ../admin.class.php:194 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" "Использовать заранее заданные коды рекламного места (коды рекламного места " "\"до\" и \"после\")" -#: admin.class.php:187 +#: ../admin.class.php:189 msgid "Ads Place in the middle of content" msgstr "Рекламное место в средней части контента" -#: admin.class.php:188 +#: ../admin.class.php:190 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места в середину контента статьи/" "страницы" -#: admin.class.php:190 +#: ../admin.class.php:192 msgid "Ads Place after content" msgstr "Рекламное место после контента" -#: admin.class.php:191 +#: ../admin.class.php:193 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места после контента статьи/" "страницы" -#: admin.class.php:194 +#: ../admin.class.php:196 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." @@ -163,35 +186,35 @@ msgstr "" "Я использую (планирую использовать) мои собственные флеш (SWF) баннеры. " "Другими словами, разрешить загрузку скрипта \"SWFObject\" на страницах блога." -#: admin.class.php:195 +#: ../admin.class.php:197 msgid "Turn on/off the error log." msgstr "Включить/выключить журнал ошибок." -#: admin.class.php:196 +#: ../admin.class.php:198 msgid "Turn on/off the error log for Face Side." msgstr "Включить/выключить журнал ошибок для Face Side." -#: admin.class.php:198 +#: ../admin.class.php:200 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "Разрешить использование кодов Google DoubleClick for Publishers (DFP)" -#: admin.class.php:199 +#: ../admin.class.php:201 msgid "Google DFP Pub Code" msgstr "Pub-код Google DFP" -#: admin.class.php:199 +#: ../admin.class.php:201 msgid "Your Google DFP Pub code. i.e:" msgstr "Ваш pub-код Google DFP. Например:" -#: admin.class.php:201 +#: ../admin.class.php:203 msgid "Allow Bots and Crawlers detection" msgstr "Разрешить обнаружение ботов и сканеров" -#: admin.class.php:202 +#: ../admin.class.php:204 msgid "Accuracy of Bots and Crawlers Detection" msgstr "Точность обнаружения ботов и сканеров" -#: admin.class.php:202 +#: ../admin.class.php:204 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." @@ -199,23 +222,23 @@ msgstr "" "Если обнаружен бот, показы объявлений не будут защитаны. Используйте с " "осторожностью! Чем точнее определение, тем больше ресурсов сервера требуется." -#: admin.class.php:202 +#: ../admin.class.php:204 msgid "Inexact detection" msgstr "Неточное определение" -#: admin.class.php:202 +#: ../admin.class.php:204 msgid "Exact detection" msgstr "Точное определение" -#: admin.class.php:202 +#: ../admin.class.php:204 msgid "More exact detection" msgstr "Более точное определение" -#: admin.class.php:203 help.class.php:70 help.class.php:197 +#: ../admin.class.php:205 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "Показ валюты" -#: admin.class.php:203 help.class.php:70 help.class.php:197 +#: ../admin.class.php:205 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." @@ -224,23 +247,23 @@ msgstr "" "валюты из параметров настройки блога. Доллары США, Евро - принудительное " "отображение валюты в долларах США или евро." -#: admin.class.php:203 +#: ../admin.class.php:205 msgid "Auto" msgstr "Автоопределение" -#: admin.class.php:203 +#: ../admin.class.php:205 msgid "USD" msgstr "Доллары США" -#: admin.class.php:203 +#: ../admin.class.php:205 msgid "EUR" msgstr "Евро" -#: admin.class.php:205 +#: ../admin.class.php:207 msgid "TinyMCE Editor Button Mode" msgstr "Режим кнопки плагина в редакторе TinyMCE" -#: admin.class.php:205 +#: ../admin.class.php:207 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " @@ -251,19 +274,19 @@ msgstr "" "можете использовать классические кнопки TinyMCE. В этом случае выберите " "\"Классические кнопки TinyMCE\"." -#: admin.class.php:205 +#: ../admin.class.php:207 msgid "Modern TinyMCE Button" msgstr "Современная кнопка TinyMCE" -#: admin.class.php:205 +#: ../admin.class.php:207 msgid "Classic TinyMCE Buttons" msgstr "Классические кнопки TinyMCE" -#: admin.class.php:206 +#: ../admin.class.php:208 msgid "Ads Places per Page" msgstr "Рекламных мест на страницу" -#: admin.class.php:206 +#: ../admin.class.php:208 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." @@ -271,11 +294,11 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных мест. Сколько " "рекламных мест будет показано в таблице на одной странице." -#: admin.class.php:207 +#: ../admin.class.php:209 msgid "Ads per Page" msgstr "Объявлений на страницу" -#: admin.class.php:207 +#: ../admin.class.php:209 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." @@ -283,92 +306,92 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных объявлений. Сколько " "рекламных объявлений будет показано в таблице на одной странице." -#: admin.class.php:209 +#: ../admin.class.php:211 msgid "Delete plugin options during deactivating plugin" msgstr "Удалить параметры плагина при деактивации" -#: admin.class.php:210 +#: ../admin.class.php:212 msgid "Delete database tables of plugin during deactivating plugin" msgstr "Удалить таблицы базы данных плагина во время деактивации" -#: admin.class.php:211 +#: ../admin.class.php:213 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" "Удалить папку пользовательских изображений плагина во время деактивации" -#: admin.class.php:219 +#: ../admin.class.php:221 msgid "Ads" msgstr "Реклама" -#: admin.class.php:220 +#: ../admin.class.php:222 msgid "Ads List" msgstr "Список рекламных объявлений" -#: admin.class.php:220 +#: ../admin.class.php:222 msgid "Ads Places" msgstr "Рекламные места" -#: admin.class.php:222 +#: ../admin.class.php:224 msgid "Ad Editor" msgstr "Редактор рекламного объявления" -#: admin.class.php:222 +#: ../admin.class.php:224 msgid "New Place" msgstr "Новое место" -#: admin.class.php:225 +#: ../admin.class.php:227 msgid "Ads Zones List" msgstr "Список зон рекламных объявлений" -#: admin.class.php:225 +#: ../admin.class.php:227 msgid "Ads Zones" msgstr "Рекламные зоны" -#: admin.class.php:227 +#: ../admin.class.php:229 msgid "Ads Zone Editor" msgstr "Редактор рекламной зоны" -#: admin.class.php:227 +#: ../admin.class.php:229 msgid "New Zone" msgstr "Новая зона" -#: admin.class.php:230 +#: ../admin.class.php:232 msgid "Ads Blocks List" msgstr "Список блоков рекламных объявлений" -#: admin.class.php:230 +#: ../admin.class.php:232 msgid "Ads Blocks" msgstr "Рекламные блоки" -#: admin.class.php:232 block.editor.admin.class.php:391 +#: ../admin.class.php:234 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "Редактор рекламного блока" -#: admin.class.php:232 +#: ../admin.class.php:234 msgid "New Block" msgstr "Новый блок" -#: admin.class.php:235 admin.class.php:873 +#: ../admin.class.php:237 ../admin.class.php:935 msgid "Simple Ads Manager Settings" msgstr "Параметры Simple Ads Manager" -#: admin.class.php:235 +#: ../admin.class.php:237 msgid "Settings" msgstr "Параметры" -#: admin.class.php:238 +#: ../admin.class.php:240 msgid "Simple Ads Manager Error Log" msgstr "Журнал ошибок Simple Ads Manager" -#: admin.class.php:238 errorlog.admin.class.php:57 +#: ../admin.class.php:240 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "Журнал ошибок" -#: admin.class.php:348 admin.class.php:370 editor.admin.class.php:388 +#: ../admin.class.php:337 ../editor.admin.class.php:399 msgid "Name of Ads Place" msgstr "Имя рекламного места" -#: admin.class.php:348 admin.class.php:370 +#: ../admin.class.php:337 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." @@ -377,12 +400,11 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений, виджеты плагина " "или автовставку объявлений." -#: admin.class.php:349 admin.class.php:371 editor.admin.class.php:874 +#: ../admin.class.php:338 ../editor.admin.class.php:896 msgid "Name of Ad" msgstr "Имя рекламного объявления" -#: admin.class.php:349 admin.class.php:350 admin.class.php:371 -#: admin.class.php:372 +#: ../admin.class.php:338 ../admin.class.php:357 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." @@ -391,15 +413,15 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений или виджеты " "плагина." -#: admin.class.php:350 admin.class.php:372 zone.editor.admin.class.php:341 +#: ../admin.class.php:357 ../zone.editor.admin.class.php:352 msgid "Name of Ads Zone" msgstr "Имя рекламной зоны" -#: admin.class.php:351 admin.class.php:373 block.editor.admin.class.php:298 +#: ../admin.class.php:358 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "Имя рекламного блока" -#: admin.class.php:351 admin.class.php:373 +#: ../admin.class.php:358 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." @@ -407,136 +429,155 @@ msgstr "" "Необязательный параметр. Однако, настоятельно рекомендуется определить его, " "если вы планируете использовать виджеты плагина." -#: admin.class.php:390 +#: ../admin.class.php:375 msgid "Error ID" msgstr "ID ошибки" -#: admin.class.php:391 +#: ../admin.class.php:376 msgid "Error Date" msgstr "Дата ошибки" -#: admin.class.php:392 errorlog.admin.class.php:86 errorlog.admin.class.php:96 +#: ../admin.class.php:377 ../errorlog.admin.class.php:86 +#: ../errorlog.admin.class.php:96 msgid "Table" msgstr "Таблица" -#: admin.class.php:393 +#: ../admin.class.php:378 msgid "Error Message" msgstr "Сообщение об ошибке" -#: admin.class.php:394 +#: ../admin.class.php:379 msgid "Error SQL" msgstr "SQL вызвавший ошибку" -#: admin.class.php:395 errorlog.admin.class.php:87 errorlog.admin.class.php:97 +#: ../admin.class.php:380 ../errorlog.admin.class.php:87 +#: ../errorlog.admin.class.php:97 msgid "Type" msgstr "Тип ошибки" -#: admin.class.php:396 +#: ../admin.class.php:381 msgid "Close" msgstr "Закрыть" -#: admin.class.php:398 errorlog.admin.class.php:116 -#: errorlog.admin.class.php:132 +#: ../admin.class.php:383 ../errorlog.admin.class.php:116 +#: ../errorlog.admin.class.php:132 msgid "Warning" msgstr "Внимание" -#: admin.class.php:398 errorlog.admin.class.php:136 +#: ../admin.class.php:383 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "Ok" -#: admin.class.php:552 +#: ../admin.class.php:580 msgid "Subscriber" msgstr "Подписчик" -#: admin.class.php:598 +#: ../admin.class.php:650 msgid "Post" msgstr "Статья" -#: admin.class.php:601 editor.admin.class.php:1036 +#: ../admin.class.php:653 ../editor.admin.class.php:1058 msgid "Page" msgstr "Страница" -#: admin.class.php:604 +#: ../admin.class.php:656 msgid "Post:" msgstr "Статья:" -#: admin.class.php:610 +#: ../admin.class.php:664 msgid "Uploading" msgstr "Загружается" -#: admin.class.php:611 +#: ../admin.class.php:665 msgid "Uploaded." msgstr "загружен." -#: admin.class.php:612 +#: ../admin.class.php:666 msgid "Only JPG, PNG or GIF files are allowed" msgstr "Разрешается загрузка файлов формата JPG, PNG или GIF" -#: admin.class.php:613 +#: ../admin.class.php:667 msgid "File" msgstr "Файл" -#: admin.class.php:619 +#: ../admin.class.php:673 msgid "Category Title" msgstr "Наименование рубрики" -#: admin.class.php:620 +#: ../admin.class.php:674 msgid "Category Slug" msgstr "Ярлык рубрики" -#: admin.class.php:627 admin.class.php:664 +#: ../admin.class.php:681 ../admin.class.php:718 msgid "Display Name" msgstr "Показываемое имя" -#: admin.class.php:628 admin.class.php:665 +#: ../admin.class.php:682 ../admin.class.php:719 msgid "User Name" msgstr "Имя пользователя" -#: admin.class.php:635 +#: ../admin.class.php:689 msgid "Tag Title" msgstr "Название метки" -#: admin.class.php:636 +#: ../admin.class.php:690 msgid "Tag Slug" msgstr "Ярлык метки" -#: admin.class.php:642 +#: ../admin.class.php:696 msgid "Custom Type Title" msgstr "Заголовок пользовательского типа" -#: admin.class.php:643 +#: ../admin.class.php:697 msgid "Custom Type Slug" msgstr "Ярлык пользовательского типа" -#: admin.class.php:650 +#: ../admin.class.php:704 msgid "Publication Title" msgstr "Заголовок публикации" -#: admin.class.php:651 +#: ../admin.class.php:705 msgid "Publication Type" msgstr "Тип публикации" -#: admin.class.php:658 editor.admin.class.php:1349 +#: ../admin.class.php:712 ../editor.admin.class.php:1404 msgid "Advertiser Name" msgstr "Имя рекламодателя" -#: admin.class.php:659 +#: ../admin.class.php:713 msgid "Advertiser Nick" msgstr "Ник рекламодателя" -#: admin.class.php:660 editor.admin.class.php:1353 +#: ../admin.class.php:714 ../editor.admin.class.php:1408 msgid "Advertiser e-mail" msgstr "e-mail рекламодателя" -#: admin.class.php:666 +#: ../admin.class.php:720 msgid "Role" msgstr "Роль" -#: admin.class.php:740 +#: ../admin.class.php:727 ../block.list.admin.class.php:88 +#: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:172 +#: ../list.admin.class.php:183 ../list.admin.class.php:359 +#: ../list.admin.class.php:369 ../zone.list.admin.class.php:88 +#: ../zone.list.admin.class.php:94 +msgid "ID" +msgstr "ID" + +#: ../admin.class.php:728 +msgid "Term Name" +msgstr "Имя термина" + +#: ../admin.class.php:729 +msgid "Custom Taxonomy Name" +msgstr "Имя пользовательской таксономии" + +#: ../admin.class.php:802 msgid "There are general options." msgstr "Основные параметры плагина." -#: admin.class.php:744 +#: ../admin.class.php:806 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" @@ -546,90 +587,91 @@ msgstr "" "Используйте эти параметры для разрешения/определения рекламных мест, которые " "будут автоматически вставлены до/после контента статьи/страницы." -#: admin.class.php:752 +#: ../admin.class.php:814 msgid "Adjust parameters of your Google DFP account." msgstr "Настройте параметры вашей учётной записи Google DFP." -#: admin.class.php:756 +#: ../admin.class.php:818 msgid "Adjust parameters of plugin statistics." msgstr "Настройте параметры статистики плагина." -#: admin.class.php:760 +#: ../admin.class.php:822 msgid "This options define layout for Ads Managin Pages." msgstr "" "Эти параметры определяют внешний вид страниц управления рекламными " "объявлениями и рекламными местами." -#: admin.class.php:764 +#: ../admin.class.php:826 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "Вы разрешаете выполнение этих деиствий в ходе деактивации плагина?" -#: admin.class.php:886 +#: ../admin.class.php:948 msgid "Simple Ads Manager Settings Updated." msgstr "Параметры Simple Ads Manager сохранены." -#: admin.class.php:894 +#: ../admin.class.php:956 msgid "System Info" msgstr "Системная информация" -#: admin.class.php:901 +#: ../admin.class.php:963 msgid "Wordpress Version" msgstr "Версия Wordpress" -#: admin.class.php:902 +#: ../admin.class.php:964 msgid "SAM Version" msgstr "Версия плагина" -#: admin.class.php:903 +#: ../admin.class.php:965 msgid "SAM DB Version" msgstr "Версия таблиц БД плагина" -#: admin.class.php:904 +#: ../admin.class.php:966 msgid "PHP Version" msgstr "Версия PHP" -#: admin.class.php:905 +#: ../admin.class.php:967 msgid "MySQL Version" msgstr "Версия MySQL" -#: admin.class.php:906 +#: ../admin.class.php:968 msgid "Memory Limit" msgstr "Лимит памяти" -#: admin.class.php:910 +#: ../admin.class.php:972 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" "Обратите внимание! Если вы обнаружили ошибку, не забудьте включить эти " "данные в отчет об ошибке." -#: admin.class.php:915 +#: ../admin.class.php:977 msgid "Resources" msgstr "Ресурсы" -#: admin.class.php:918 +#: ../admin.class.php:980 msgid "Wordpress Plugin Page" msgstr "Страница плагина на Wordpress" -#: admin.class.php:919 +#: ../admin.class.php:981 msgid "Author Plugin Page" msgstr "Страница плагина" -#: admin.class.php:920 help.class.php:34 help.class.php:51 help.class.php:58 -#: help.class.php:72 help.class.php:105 help.class.php:113 help.class.php:124 -#: help.class.php:141 help.class.php:150 help.class.php:166 help.class.php:182 -#: help.class.php:199 +#: ../admin.class.php:982 ../help.class.php:34 ../help.class.php:51 +#: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 +#: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 +#: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 +#: ../help.class.php:199 msgid "Support Forum" msgstr "Форум поддержки" -#: admin.class.php:921 +#: ../admin.class.php:983 msgid "Author's Blog" msgstr "Блог автора" -#: admin.class.php:926 +#: ../admin.class.php:988 msgid "Donations" msgstr "Пожертвования" -#: admin.class.php:930 +#: ../admin.class.php:992 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " @@ -639,19 +681,19 @@ msgstr "" "%s, чтобы поддержать дальнейшие работы по разработке плагина. Ваша поддержка " "будет оценена по достоинству. Спасибо!" -#: admin.class.php:931 admin.class.php:938 +#: ../admin.class.php:993 ../admin.class.php:1000 msgid "Donate Now!" msgstr "Пожертвовать!" -#: admin.class.php:931 +#: ../admin.class.php:993 msgid "donation" msgstr "пожертвование" -#: admin.class.php:935 admin.class.php:948 +#: ../admin.class.php:997 ../admin.class.php:1010 msgid "Donate via" msgstr "Пожертвовать через" -#: admin.class.php:943 +#: ../admin.class.php:1005 #, php-format msgid "" "Warning! The default value of donation is %s. Don't worry! This is not my " @@ -661,24 +703,24 @@ msgstr "" "волнуйтесь! Это не мой аппетит, это - значение по умолчанию, определенное " "службой Payoneer." -#: admin.class.php:943 +#: ../admin.class.php:1005 msgid " You can change it to any value you want!" msgstr " Вы можете изменить его на любое значение, которое посчитаете нужным!" -#: admin.class.php:960 +#: ../admin.class.php:1022 msgid "Another Plugins" msgstr "Другие плагины" -#: admin.class.php:964 +#: ../admin.class.php:1026 #, php-format msgid "Another plugins from %s" msgstr "Другие плагины от %s'а" -#: admin.class.php:970 +#: ../admin.class.php:1032 msgid "Highlights any portion of text as text in the colored boxes." msgstr "Подсветка любой части текста в виде текста в цветной рамке." -#: admin.class.php:971 +#: ../admin.class.php:1033 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." @@ -686,136 +728,150 @@ msgstr "" "Добавляет бейджик счётчиков (подписчики Feedburner и последователи Twitter) " "на все страницы блога." -#: admin.class.php:972 +#: ../admin.class.php:1034 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "Wordpress оболочка для плагина FloatBox от Байрона МакГрегора." -#: admin.class.php:973 +#: ../admin.class.php:1035 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" "Добавляет строку уведомления об авторском праве в конец каждой статьи блога." -#: block.editor.admin.class.php:73 block.editor.admin.class.php:253 -#: block.editor.admin.class.php:303 block.editor.admin.class.php:317 -#: block.editor.admin.class.php:335 block.editor.admin.class.php:361 -#: block.editor.admin.class.php:390 editor.admin.class.php:335 -#: editor.admin.class.php:393 editor.admin.class.php:407 -#: editor.admin.class.php:428 editor.admin.class.php:505 -#: editor.admin.class.php:810 editor.admin.class.php:879 -#: editor.admin.class.php:901 editor.admin.class.php:987 -#: editor.admin.class.php:1086 editor.admin.class.php:1129 -#: editor.admin.class.php:1341 editor.admin.class.php:1361 -#: editor.admin.class.php:1393 zone.editor.admin.class.php:296 -#: zone.editor.admin.class.php:346 zone.editor.admin.class.php:360 +#: ../admin.class.php:1051 +msgctxt "Copyright String" +msgid "Simple Ads Manager plugin for Wordpress." +msgstr "Wordpress плагин Simple Ads Manager" + +#: ../admin.class.php:1051 +msgctxt "Copyright String" +msgid "All rights reserved." +msgstr "Все права защищены." + +#: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 +#: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 +#: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:335 +#: ../editor.admin.class.php:404 ../editor.admin.class.php:418 +#: ../editor.admin.class.php:439 ../editor.admin.class.php:516 +#: ../editor.admin.class.php:821 ../editor.admin.class.php:901 +#: ../editor.admin.class.php:923 ../editor.admin.class.php:1009 +#: ../editor.admin.class.php:1108 ../editor.admin.class.php:1151 +#: ../editor.admin.class.php:1396 ../editor.admin.class.php:1416 +#: ../editor.admin.class.php:1448 ../zone.editor.admin.class.php:296 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:371 msgid "Click to toggle" msgstr "Кликнуть для переключения" -#: block.editor.admin.class.php:74 +#: ../block.editor.admin.class.php:74 msgid "Item" msgstr "Элемент" -#: block.editor.admin.class.php:77 help.class.php:125 widget.class.php:15 -#: js/dialog.php:48 +#: ../block.editor.admin.class.php:77 ../help.class.php:125 +#: ../widget.class.php:15 ../js/dialog.php:48 msgid "Ads Place" msgstr "Рекламное место" -#: block.editor.admin.class.php:79 block.editor.admin.class.php:92 -#: block.editor.admin.class.php:105 +#: ../block.editor.admin.class.php:79 ../block.editor.admin.class.php:92 +#: ../block.editor.admin.class.php:105 msgid "Non selected" msgstr "Не выбрано" -#: block.editor.admin.class.php:90 widget.class.php:293 +#: ../block.editor.admin.class.php:90 ../widget.class.php:293 msgid "Single Ad" msgstr "Рекламное объявление" -#: block.editor.admin.class.php:103 widget.class.php:149 widget.class.php:154 -#: js/dialog-zone.php:48 +#: ../block.editor.admin.class.php:103 ../widget.class.php:149 +#: ../widget.class.php:154 ../js/dialog-zone.php:48 msgid "Ads Zone" msgstr "Рекламная зона" -#: block.editor.admin.class.php:173 block.editor.admin.class.php:217 -#: block.editor.admin.class.php:243 editor.admin.class.php:266 -#: editor.admin.class.php:298 editor.admin.class.php:315 -#: editor.admin.class.php:316 editor.admin.class.php:317 -#: editor.admin.class.php:325 editor.admin.class.php:637 -#: editor.admin.class.php:727 editor.admin.class.php:791 -#: editor.admin.class.php:792 editor.admin.class.php:793 -#: zone.editor.admin.class.php:158 zone.editor.admin.class.php:253 -#: zone.editor.admin.class.php:286 +#: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:266 +#: ../editor.admin.class.php:298 ../editor.admin.class.php:315 +#: ../editor.admin.class.php:316 ../editor.admin.class.php:317 +#: ../editor.admin.class.php:325 ../editor.admin.class.php:648 +#: ../editor.admin.class.php:738 ../editor.admin.class.php:802 +#: ../editor.admin.class.php:803 ../editor.admin.class.php:804 +#: ../zone.editor.admin.class.php:158 ../zone.editor.admin.class.php:253 +#: ../zone.editor.admin.class.php:286 msgid "Undefined" msgstr "Не определено" -#: block.editor.admin.class.php:184 +#: ../block.editor.admin.class.php:184 msgid "Ads Block Data Updated." msgstr "Данные рекламного блока сохранены." -#: block.editor.admin.class.php:243 +#: ../block.editor.admin.class.php:243 msgid "New Ads Block" msgstr "Новый рекламный блок" -#: block.editor.admin.class.php:243 +#: ../block.editor.admin.class.php:243 msgid "Edit Ads Block" msgstr "Изменить рекламный блок" -#: block.editor.admin.class.php:254 editor.admin.class.php:336 -#: editor.admin.class.php:811 errorlog.admin.class.php:84 -#: errorlog.admin.class.php:94 zone.editor.admin.class.php:297 +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:336 +#: ../editor.admin.class.php:822 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:297 msgid "Status" msgstr "Статус" -#: block.editor.admin.class.php:261 +#: ../block.editor.admin.class.php:263 msgid "Back to Blocks List" msgstr "Назад, к списку блоков" -#: block.editor.admin.class.php:267 js/dialog-block.php:66 +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:66 msgid "Ads Block ID" msgstr "ID рекламного блока" -#: block.editor.admin.class.php:273 editor.admin.class.php:363 -#: zone.editor.admin.class.php:316 +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:366 +#: ../zone.editor.admin.class.php:319 msgid "Is Active" msgstr "Активно" -#: block.editor.admin.class.php:274 editor.admin.class.php:364 -#: editor.admin.class.php:850 zone.editor.admin.class.php:317 +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:367 +#: ../editor.admin.class.php:864 ../zone.editor.admin.class.php:320 msgid "Is In Trash" msgstr "В корзине" -#: block.editor.admin.class.php:281 editor.admin.class.php:371 -#: editor.admin.class.php:857 zone.editor.admin.class.php:324 -#: js/dialog-ad.php:89 js/dialog-block.php:79 js/dialog-zone.php:89 -#: js/dialog.php:89 +#: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 +#: ../editor.admin.class.php:374 ../editor.admin.class.php:379 +#: ../editor.admin.class.php:871 ../editor.admin.class.php:876 +#: ../zone.editor.admin.class.php:327 ../zone.editor.admin.class.php:333 +#: ../js/dialog-ad.php:89 ../js/dialog-block.php:79 ../js/dialog-zone.php:89 +#: ../js/dialog.php:89 msgid "Cancel" msgstr "Отмена" -#: block.editor.admin.class.php:284 editor.admin.class.php:374 -#: editor.admin.class.php:860 zone.editor.admin.class.php:327 +#: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 +#: ../editor.admin.class.php:383 ../editor.admin.class.php:385 +#: ../editor.admin.class.php:880 ../editor.admin.class.php:882 +#: ../zone.editor.admin.class.php:330 ../zone.editor.admin.class.php:337 msgid "Save" msgstr "Сохранить" -#: block.editor.admin.class.php:297 editor.admin.class.php:387 -#: zone.editor.admin.class.php:340 +#: ../block.editor.admin.class.php:308 ../editor.admin.class.php:398 +#: ../zone.editor.admin.class.php:351 msgid "Name" msgstr "Наименование" -#: block.editor.admin.class.php:298 editor.admin.class.php:874 -#: zone.editor.admin.class.php:341 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:352 msgid "Required for SAM widgets." msgstr "Требуется для виджетов плагина." -#: block.editor.admin.class.php:304 block.editor.admin.class.php:308 -#: editor.admin.class.php:394 editor.admin.class.php:398 -#: editor.admin.class.php:883 zone.editor.admin.class.php:347 -#: zone.editor.admin.class.php:351 +#: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 +#: ../editor.admin.class.php:405 ../editor.admin.class.php:409 +#: ../editor.admin.class.php:905 ../zone.editor.admin.class.php:358 +#: ../zone.editor.admin.class.php:362 msgid "Description" msgstr "Описание" -#: block.editor.admin.class.php:306 block.editor.admin.class.php:393 +#: ../block.editor.admin.class.php:317 ../block.editor.admin.class.php:404 msgid "Enter description of this Ads Block." msgstr "Введите описание для этого рекламного блока." -#: block.editor.admin.class.php:311 editor.admin.class.php:401 -#: editor.admin.class.php:887 zone.editor.admin.class.php:354 +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:412 +#: ../editor.admin.class.php:909 ../zone.editor.admin.class.php:365 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -823,23 +879,23 @@ msgstr "" "Это описание нигде не используется и введено исключительно для удобства в " "уравлении рекламными объявлениями." -#: block.editor.admin.class.php:318 +#: ../block.editor.admin.class.php:329 msgid "Block Structure" msgstr "Структура блока" -#: block.editor.admin.class.php:320 +#: ../block.editor.admin.class.php:331 msgid "Ads Block Structure Properties." msgstr "Параметры структуры блока." -#: block.editor.admin.class.php:322 +#: ../block.editor.admin.class.php:333 msgid "Block Lines" msgstr "Строк" -#: block.editor.admin.class.php:326 +#: ../block.editor.admin.class.php:337 msgid "Block Columns" msgstr "Колонок" -#: block.editor.admin.class.php:329 +#: ../block.editor.admin.class.php:340 msgid "" "After changing these properties you must save Ads Block settings before " "using Ads Block Editor." @@ -847,61 +903,61 @@ msgstr "" "После изменения этих параметров Вы должны сохранить параметры блока " "рекламных объявлений перед использованием Редактора Блока." -#: block.editor.admin.class.php:336 +#: ../block.editor.admin.class.php:347 msgid "Block Styles" msgstr "Стили блока" -#: block.editor.admin.class.php:338 +#: ../block.editor.admin.class.php:349 msgid "Configure Styles for this Ads Block." msgstr "Настройте стили для этого блока рекламных объявлений." -#: block.editor.admin.class.php:340 block.editor.admin.class.php:366 +#: ../block.editor.admin.class.php:351 ../block.editor.admin.class.php:377 msgid "Margins" msgstr "Внешние отступы" -#: block.editor.admin.class.php:344 block.editor.admin.class.php:370 +#: ../block.editor.admin.class.php:355 ../block.editor.admin.class.php:381 msgid "Padding" msgstr "Внутренние отступы" -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 +#: ../block.editor.admin.class.php:359 ../block.editor.admin.class.php:385 msgid "Background" msgstr "Фон" -#: block.editor.admin.class.php:352 block.editor.admin.class.php:378 +#: ../block.editor.admin.class.php:363 ../block.editor.admin.class.php:389 msgid "Borders" msgstr "Окантовка" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "Use Stylesheet rules for defining these properties." msgstr "" "Используйте Правила таблиц стилей для определения этих " "параметров." -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "For example:" msgstr "Например:" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "for background property or" msgstr "для параметра \"Фон\" или" -#: block.editor.admin.class.php:355 block.editor.admin.class.php:381 +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 msgid "for border property" msgstr "для параметра \"Окантовка\"" -#: block.editor.admin.class.php:362 +#: ../block.editor.admin.class.php:373 msgid "Block Items Styles" msgstr "Стили элементов блока" -#: block.editor.admin.class.php:364 +#: ../block.editor.admin.class.php:375 msgid "Configure Styles for this Ads Block Items." msgstr "Настройте стили для элементов этого блока рекламных объявлений." -#: block.editor.admin.class.php:382 +#: ../block.editor.admin.class.php:393 msgid "Important Note" msgstr "Важная информация" -#: block.editor.admin.class.php:382 +#: ../block.editor.admin.class.php:393 msgid "" "As the Ads Block is the regular structure, predefined styles of individual " "items for drawing Ads Block's elements aren't used. Define styles for Ads " @@ -912,222 +968,220 @@ msgstr "" "Блока Рекламных Объявлений не используются. Определите стили для элементов " "Блока Рекламных Объявлений здесь!" -#: block.editor.admin.class.php:395 +#: ../block.editor.admin.class.php:406 msgid "Block Editor." msgstr "Редактор рекламного блока." -#: block.list.admin.class.php:48 errorlog.admin.class.php:49 -#: list.admin.class.php:129 list.admin.class.php:312 -#: zone.list.admin.class.php:48 +#: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 +#: ../list.admin.class.php:129 ../list.admin.class.php:312 +#: ../zone.list.admin.class.php:48 msgid "«" msgstr "«" -#: block.list.admin.class.php:49 errorlog.admin.class.php:50 -#: list.admin.class.php:130 list.admin.class.php:313 -#: zone.list.admin.class.php:49 +#: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../zone.list.admin.class.php:49 msgid "»" msgstr "»" -#: block.list.admin.class.php:56 +#: ../block.list.admin.class.php:56 msgid "Managing Ads Blocks" msgstr "Управление рекламными блоками" -#: block.list.admin.class.php:63 errorlog.admin.class.php:59 -#: list.admin.class.php:144 list.admin.class.php:327 -#: zone.list.admin.class.php:63 +#: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 +#: ../list.admin.class.php:144 ../list.admin.class.php:327 +#: ../zone.list.admin.class.php:63 msgid "All" msgstr "Все" -#: block.list.admin.class.php:64 errorlog.admin.class.php:60 -#: list.admin.class.php:145 list.admin.class.php:328 -#: zone.list.admin.class.php:64 +#: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../zone.list.admin.class.php:64 msgid "Active" msgstr "Активные" -#: block.list.admin.class.php:65 list.admin.class.php:146 -#: list.admin.class.php:329 zone.list.admin.class.php:65 +#: ../block.list.admin.class.php:65 ../list.admin.class.php:146 +#: ../list.admin.class.php:329 ../zone.list.admin.class.php:65 msgid "Trash" msgstr "Корзина" -#: block.list.admin.class.php:70 block.list.admin.class.php:144 -#: list.admin.class.php:151 list.admin.class.php:271 list.admin.class.php:335 -#: list.admin.class.php:469 zone.list.admin.class.php:70 -#: zone.list.admin.class.php:144 +#: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 +#: ../list.admin.class.php:151 ../list.admin.class.php:271 +#: ../list.admin.class.php:335 ../list.admin.class.php:469 +#: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 msgid "Clear Trash" msgstr "Очистить корзину" -#: block.list.admin.class.php:72 block.list.admin.class.php:146 +#: ../block.list.admin.class.php:72 ../block.list.admin.class.php:146 msgid "Add New Block" msgstr "Добавить новый блок" -#: block.list.admin.class.php:76 block.list.admin.class.php:150 -#: errorlog.admin.class.php:71 errorlog.admin.class.php:179 -#: list.admin.class.php:160 list.admin.class.php:280 list.admin.class.php:345 -#: list.admin.class.php:478 zone.list.admin.class.php:76 -#: zone.list.admin.class.php:150 +#: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 +#: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:179 +#: ../list.admin.class.php:160 ../list.admin.class.php:280 +#: ../list.admin.class.php:345 ../list.admin.class.php:478 +#: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 #, php-format msgid "Displaying %s–%s of %s" msgstr "Показано %s–%s из %s" -#: block.list.admin.class.php:88 block.list.admin.class.php:94 -#: errorlog.admin.class.php:83 errorlog.admin.class.php:93 -#: list.admin.class.php:172 list.admin.class.php:183 list.admin.class.php:359 -#: list.admin.class.php:369 zone.list.admin.class.php:88 -#: zone.list.admin.class.php:94 -msgid "ID" -msgstr "ID" - -#: block.list.admin.class.php:89 block.list.admin.class.php:95 +#: ../block.list.admin.class.php:89 ../block.list.admin.class.php:95 msgid "Block Name" msgstr "Имя блока" -#: block.list.admin.class.php:113 errorlog.admin.class.php:121 -#: list.admin.class.php:216 list.admin.class.php:418 -#: zone.list.admin.class.php:113 +#: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 +#: ../list.admin.class.php:216 ../list.admin.class.php:418 +#: ../zone.list.admin.class.php:113 msgid "There are no data ..." msgstr "Нет данных для показа ..." -#: block.list.admin.class.php:121 list.admin.class.php:241 -#: list.admin.class.php:446 zone.list.admin.class.php:121 +#: ../block.list.admin.class.php:121 ../list.admin.class.php:241 +#: ../list.admin.class.php:446 ../zone.list.admin.class.php:121 msgid "in Trash" msgstr "в корзине" -#: block.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 msgid "Edit Block" msgstr "Изменить рекламный блок" -#: block.list.admin.class.php:123 list.admin.class.php:243 -#: list.admin.class.php:448 zone.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 ../list.admin.class.php:243 +#: ../list.admin.class.php:448 ../zone.list.admin.class.php:123 msgid "Edit" msgstr "Изменить" -#: block.list.admin.class.php:127 errorlog.admin.class.php:151 +#: ../block.list.admin.class.php:127 ../errorlog.admin.class.php:151 msgid "Restore this Block from the Trash" msgstr "Восстановить этот блок из корзины" -#: block.list.admin.class.php:127 list.admin.class.php:247 -#: list.admin.class.php:452 zone.list.admin.class.php:127 +#: ../block.list.admin.class.php:127 ../list.admin.class.php:247 +#: ../list.admin.class.php:452 ../zone.list.admin.class.php:127 msgid "Restore" msgstr "Восстановить" -#: block.list.admin.class.php:128 errorlog.admin.class.php:152 +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 msgid "Remove this Block permanently" msgstr "Удалить этот рекламный блок навсегда" -#: block.list.admin.class.php:128 errorlog.admin.class.php:152 -#: list.admin.class.php:248 list.admin.class.php:453 -#: zone.list.admin.class.php:128 +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +#: ../list.admin.class.php:248 ../list.admin.class.php:453 +#: ../zone.list.admin.class.php:128 msgid "Remove permanently" msgstr "Удалить навсегда" -#: block.list.admin.class.php:133 errorlog.admin.class.php:157 +#: ../block.list.admin.class.php:133 ../errorlog.admin.class.php:157 msgid "Move this Block to the Trash" msgstr "Поместить этот блок в корзину" -#: block.list.admin.class.php:133 list.admin.class.php:253 -#: list.admin.class.php:454 zone.list.admin.class.php:133 +#: ../block.list.admin.class.php:133 ../list.admin.class.php:253 +#: ../list.admin.class.php:454 ../zone.list.admin.class.php:133 msgid "Delete" msgstr "Удалить" -#: editor.admin.class.php:71 editor.admin.class.php:191 -#: list.admin.class.php:23 +#: ../editor.admin.class.php:71 ../editor.admin.class.php:191 +#: ../list.admin.class.php:23 msgid "Custom sizes" msgstr "Пользовательские размеры" -#: editor.admin.class.php:74 editor.admin.class.php:135 -#: list.admin.class.php:26 +#: ../editor.admin.class.php:74 ../editor.admin.class.php:135 +#: ../list.admin.class.php:26 msgid "Large Leaderboard" msgstr "Большая доска почёта" -#: editor.admin.class.php:75 editor.admin.class.php:136 -#: list.admin.class.php:27 +#: ../editor.admin.class.php:75 ../editor.admin.class.php:136 +#: ../list.admin.class.php:27 msgid "Leaderboard" msgstr "Доска почёта" -#: editor.admin.class.php:76 editor.admin.class.php:78 -#: editor.admin.class.php:79 editor.admin.class.php:137 -#: editor.admin.class.php:139 editor.admin.class.php:140 -#: list.admin.class.php:28 list.admin.class.php:30 list.admin.class.php:31 +#: ../editor.admin.class.php:76 ../editor.admin.class.php:78 +#: ../editor.admin.class.php:79 ../editor.admin.class.php:137 +#: ../editor.admin.class.php:139 ../editor.admin.class.php:140 +#: ../list.admin.class.php:28 ../list.admin.class.php:30 +#: ../list.admin.class.php:31 msgid "Small Leaderboard" msgstr "Малая доска почёта" -#: editor.admin.class.php:77 editor.admin.class.php:138 -#: list.admin.class.php:29 +#: ../editor.admin.class.php:77 ../editor.admin.class.php:138 +#: ../list.admin.class.php:29 msgid "Mega Unit" msgstr "Мегаблок" -#: editor.admin.class.php:80 editor.admin.class.php:81 -#: editor.admin.class.php:82 editor.admin.class.php:84 -#: editor.admin.class.php:85 editor.admin.class.php:86 -#: editor.admin.class.php:141 editor.admin.class.php:142 -#: editor.admin.class.php:143 editor.admin.class.php:145 -#: editor.admin.class.php:146 editor.admin.class.php:147 -#: list.admin.class.php:32 list.admin.class.php:33 list.admin.class.php:34 -#: list.admin.class.php:36 list.admin.class.php:37 list.admin.class.php:38 +#: ../editor.admin.class.php:80 ../editor.admin.class.php:81 +#: ../editor.admin.class.php:82 ../editor.admin.class.php:84 +#: ../editor.admin.class.php:85 ../editor.admin.class.php:86 +#: ../editor.admin.class.php:141 ../editor.admin.class.php:142 +#: ../editor.admin.class.php:143 ../editor.admin.class.php:145 +#: ../editor.admin.class.php:146 ../editor.admin.class.php:147 +#: ../list.admin.class.php:32 ../list.admin.class.php:33 +#: ../list.admin.class.php:34 ../list.admin.class.php:36 +#: ../list.admin.class.php:37 ../list.admin.class.php:38 msgid "Tall Banner" msgstr "Высокий баннер" -#: editor.admin.class.php:83 editor.admin.class.php:144 -#: list.admin.class.php:35 +#: ../editor.admin.class.php:83 ../editor.admin.class.php:144 +#: ../list.admin.class.php:35 msgid "Banner" msgstr "Баннер" -#: editor.admin.class.php:87 editor.admin.class.php:89 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:148 editor.admin.class.php:150 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: list.admin.class.php:39 list.admin.class.php:41 list.admin.class.php:71 -#: list.admin.class.php:72 +#: ../editor.admin.class.php:87 ../editor.admin.class.php:89 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:148 ../editor.admin.class.php:150 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../list.admin.class.php:39 ../list.admin.class.php:41 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 msgid "Half Banner" msgstr "Полубаннер" -#: editor.admin.class.php:88 editor.admin.class.php:117 -#: editor.admin.class.php:118 editor.admin.class.php:149 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: list.admin.class.php:40 list.admin.class.php:69 list.admin.class.php:70 +#: ../editor.admin.class.php:88 ../editor.admin.class.php:117 +#: ../editor.admin.class.php:118 ../editor.admin.class.php:149 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../list.admin.class.php:40 ../list.admin.class.php:69 +#: ../list.admin.class.php:70 msgid "Tall Half Banner" msgstr "Высокий полубаннер" -#: editor.admin.class.php:90 editor.admin.class.php:91 -#: editor.admin.class.php:116 editor.admin.class.php:123 -#: editor.admin.class.php:124 editor.admin.class.php:151 -#: editor.admin.class.php:152 editor.admin.class.php:181 -#: editor.admin.class.php:188 editor.admin.class.php:189 -#: list.admin.class.php:42 list.admin.class.php:43 list.admin.class.php:68 -#: list.admin.class.php:75 list.admin.class.php:76 +#: ../editor.admin.class.php:90 ../editor.admin.class.php:91 +#: ../editor.admin.class.php:116 ../editor.admin.class.php:123 +#: ../editor.admin.class.php:124 ../editor.admin.class.php:151 +#: ../editor.admin.class.php:152 ../editor.admin.class.php:181 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:42 ../list.admin.class.php:43 +#: ../list.admin.class.php:68 ../list.admin.class.php:75 +#: ../list.admin.class.php:76 msgid "Button" msgstr "Кнопка" -#: editor.admin.class.php:92 editor.admin.class.php:153 -#: list.admin.class.php:44 +#: ../editor.admin.class.php:92 ../editor.admin.class.php:153 +#: ../list.admin.class.php:44 msgid "Micro Bar" msgstr "Микро-бар" -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 msgid "Thin Banner" msgstr "Тонкий баннер" -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:117 editor.admin.class.php:118 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: editor.admin.class.php:188 editor.admin.class.php:189 -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 list.admin.class.php:69 list.admin.class.php:70 -#: list.admin.class.php:71 list.admin.class.php:72 list.admin.class.php:73 -#: list.admin.class.php:74 list.admin.class.php:75 list.admin.class.php:76 +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:117 ../editor.admin.class.php:118 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:123 ../editor.admin.class.php:124 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +#: ../list.admin.class.php:69 ../list.admin.class.php:70 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +#: ../list.admin.class.php:75 ../list.admin.class.php:76 #, php-format msgid "%d Link" msgid_plural "%d Links" @@ -1135,157 +1189,157 @@ msgstr[0] "%d ссылка" msgstr[1] "%d ссылки" msgstr[2] "%d ссылок" -#: editor.admin.class.php:97 editor.admin.class.php:160 -#: list.admin.class.php:49 +#: ../editor.admin.class.php:97 ../editor.admin.class.php:160 +#: ../list.admin.class.php:49 msgid "Wide Skyscraper" msgstr "Широкий небоскрёб" -#: editor.admin.class.php:98 editor.admin.class.php:161 -#: list.admin.class.php:50 +#: ../editor.admin.class.php:98 ../editor.admin.class.php:161 +#: ../list.admin.class.php:50 msgid "Skyscraper" msgstr "Небоскрёб" -#: editor.admin.class.php:99 editor.admin.class.php:162 -#: list.admin.class.php:51 +#: ../editor.admin.class.php:99 ../editor.admin.class.php:162 +#: ../list.admin.class.php:51 msgid "Wide Half Banner" msgstr "Широкий полубаннер" -#: editor.admin.class.php:100 editor.admin.class.php:163 -#: list.admin.class.php:52 +#: ../editor.admin.class.php:100 ../editor.admin.class.php:163 +#: ../list.admin.class.php:52 msgid "Vertical Rectangle" msgstr "Вертикальный прямоугольник" -#: editor.admin.class.php:101 editor.admin.class.php:102 -#: editor.admin.class.php:164 editor.admin.class.php:165 -#: list.admin.class.php:53 list.admin.class.php:54 +#: ../editor.admin.class.php:101 ../editor.admin.class.php:102 +#: ../editor.admin.class.php:164 ../editor.admin.class.php:165 +#: ../list.admin.class.php:53 ../list.admin.class.php:54 msgid "Tall Rectangle" msgstr "Высокий прямоугольник" -#: editor.admin.class.php:103 editor.admin.class.php:166 -#: list.admin.class.php:55 +#: ../editor.admin.class.php:103 ../editor.admin.class.php:166 +#: ../list.admin.class.php:55 msgid "Vertical Banner" msgstr "Вертикальный баннер" -#: editor.admin.class.php:104 editor.admin.class.php:169 -#: list.admin.class.php:56 +#: ../editor.admin.class.php:104 ../editor.admin.class.php:169 +#: ../list.admin.class.php:56 msgid "Large Rectangle" msgstr "Большой прямоугольник" -#: editor.admin.class.php:105 editor.admin.class.php:106 -#: editor.admin.class.php:170 editor.admin.class.php:171 -#: list.admin.class.php:57 list.admin.class.php:58 +#: ../editor.admin.class.php:105 ../editor.admin.class.php:106 +#: ../editor.admin.class.php:170 ../editor.admin.class.php:171 +#: ../list.admin.class.php:57 ../list.admin.class.php:58 msgid "Wide Rectangle" msgstr "Широкий прямоугольник" -#: editor.admin.class.php:107 editor.admin.class.php:172 -#: list.admin.class.php:59 +#: ../editor.admin.class.php:107 ../editor.admin.class.php:172 +#: ../list.admin.class.php:59 msgid "Medium Rectangle" msgstr "Средний прямоугольник" -#: editor.admin.class.php:108 editor.admin.class.php:109 -#: editor.admin.class.php:173 editor.admin.class.php:174 -#: list.admin.class.php:60 list.admin.class.php:61 +#: ../editor.admin.class.php:108 ../editor.admin.class.php:109 +#: ../editor.admin.class.php:173 ../editor.admin.class.php:174 +#: ../list.admin.class.php:60 ../list.admin.class.php:61 msgid "Small Wide Rectangle" msgstr "Малый широкий прямоугольник" -#: editor.admin.class.php:110 editor.admin.class.php:175 -#: list.admin.class.php:62 +#: ../editor.admin.class.php:110 ../editor.admin.class.php:175 +#: ../list.admin.class.php:62 msgid "Mini Wide Rectangle" msgstr "Маленький широкий прямоугольник" -#: editor.admin.class.php:111 editor.admin.class.php:176 -#: editor.admin.class.php:196 list.admin.class.php:63 +#: ../editor.admin.class.php:111 ../editor.admin.class.php:176 +#: ../editor.admin.class.php:196 ../list.admin.class.php:63 msgid "Square" msgstr "Прямоугольники" -#: editor.admin.class.php:112 editor.admin.class.php:115 -#: editor.admin.class.php:177 editor.admin.class.php:180 -#: list.admin.class.php:64 list.admin.class.php:67 +#: ../editor.admin.class.php:112 ../editor.admin.class.php:115 +#: ../editor.admin.class.php:177 ../editor.admin.class.php:180 +#: ../list.admin.class.php:64 ../list.admin.class.php:67 msgid "Small Square" msgstr "Малый квадрат" -#: editor.admin.class.php:113 editor.admin.class.php:114 -#: editor.admin.class.php:178 editor.admin.class.php:179 -#: list.admin.class.php:65 list.admin.class.php:66 +#: ../editor.admin.class.php:113 ../editor.admin.class.php:114 +#: ../editor.admin.class.php:178 ../editor.admin.class.php:179 +#: ../list.admin.class.php:65 ../list.admin.class.php:66 msgid "Small Rectangle" msgstr "Малый прямоугольник" -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: list.admin.class.php:73 list.admin.class.php:74 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 msgid "Tall Button" msgstr "Широкая кнопка" -#: editor.admin.class.php:194 +#: ../editor.admin.class.php:194 msgid "Horizontal" msgstr "Горизонтальные" -#: editor.admin.class.php:195 +#: ../editor.admin.class.php:195 msgid "Vertical" msgstr "Вертикальные" -#: editor.admin.class.php:197 +#: ../editor.admin.class.php:197 msgid "Custom width and height" msgstr "Пользовательские высота и ширина" -#: editor.admin.class.php:279 +#: ../editor.admin.class.php:279 msgid "Ads Place Data Updated." msgstr "Данные рекламного места сохранены." -#: editor.admin.class.php:325 +#: ../editor.admin.class.php:325 msgid "New Ads Place" msgstr "Новое рекламное место" -#: editor.admin.class.php:325 +#: ../editor.admin.class.php:325 msgid "Edit Ads Place" msgstr "Изменить рекламное место" -#: editor.admin.class.php:343 +#: ../editor.admin.class.php:345 msgid "Back to Places List" msgstr "Назад, к списку мест" -#: editor.admin.class.php:349 js/dialog.php:66 +#: ../editor.admin.class.php:352 ../js/dialog.php:66 msgid "Ads Place ID" msgstr "ID рекламного места" -#: editor.admin.class.php:355 editor.admin.class.php:839 -#: list.admin.class.php:174 list.admin.class.php:185 +#: ../editor.admin.class.php:358 ../editor.admin.class.php:853 +#: ../list.admin.class.php:174 ../list.admin.class.php:185 msgid "Size" msgstr "Размеры" -#: editor.admin.class.php:357 editor.admin.class.php:841 +#: ../editor.admin.class.php:360 ../editor.admin.class.php:855 msgid "Width" msgstr "Ширина" -#: editor.admin.class.php:359 editor.admin.class.php:843 +#: ../editor.admin.class.php:362 ../editor.admin.class.php:857 msgid "Height" msgstr "Высота" -#: editor.admin.class.php:388 +#: ../editor.admin.class.php:399 msgid "Required for SAM widgets and settings." msgstr "Требуется для виджетов и параметров плагина." -#: editor.admin.class.php:396 +#: ../editor.admin.class.php:407 msgid "Enter description of this Ads Place." msgstr "Введите описание для этого рекламного места." -#: editor.admin.class.php:408 +#: ../editor.admin.class.php:419 msgid "Ads Place Size" msgstr "Размеры рекламного места" -#: editor.admin.class.php:410 +#: ../editor.admin.class.php:421 msgid "Select size of this Ads Place." msgstr "Выберите размеры для этого рекламного места." -#: editor.admin.class.php:415 +#: ../editor.admin.class.php:426 msgid "Custom Width" msgstr "Ширина, заданная пользователем" -#: editor.admin.class.php:419 +#: ../editor.admin.class.php:430 msgid "Custom Height" msgstr "Высота, заданная пользователем" -#: editor.admin.class.php:422 +#: ../editor.admin.class.php:433 msgid "" "These values are not used and are added solely for the convenience of " "advertising management. Will be used in the future..." @@ -1293,22 +1347,22 @@ msgstr "" "Эти значения нигде не используется и введены исключительно для удобства в " "уравлении рекламными объявлениями. Будут использоваться в будущем ..." -#: editor.admin.class.php:429 +#: ../editor.admin.class.php:440 msgid "Ads Place Patch" msgstr "Заглушка рекламного места" -#: editor.admin.class.php:431 +#: ../editor.admin.class.php:442 msgid "" "Select type of the code of a patch and fill data entry fields with the " "appropriate data." msgstr "" "Выберите тип заплатки и заполните нужные поля соответствующими данными." -#: editor.admin.class.php:433 editor.admin.class.php:437 +#: ../editor.admin.class.php:444 ../editor.admin.class.php:448 msgid "Image" msgstr "Изображение" -#: editor.admin.class.php:441 +#: ../editor.admin.class.php:452 msgid "" "This image is a patch for advertising space. This may be an image with the " "text \"Place your ad here\"." @@ -1316,52 +1370,52 @@ msgstr "" "Введите путь к изображению для заплатки рекламного места. Это может быть " "изображение содержащее текст \"Разместите своё рекламное объявление здесь\"." -#: editor.admin.class.php:444 +#: ../editor.admin.class.php:455 msgid "Target" msgstr "Цель" -#: editor.admin.class.php:448 +#: ../editor.admin.class.php:459 msgid "This is a link to a page where are your suggestions for advertisers." msgstr "" "Это ссылка на страницу, на которой размещены Ваши предложения рекламодателям." -#: editor.admin.class.php:451 editor.admin.class.php:952 +#: ../editor.admin.class.php:462 ../editor.admin.class.php:974 msgid "Image Tools" msgstr "Инструменты" -#: editor.admin.class.php:453 editor.admin.class.php:954 +#: ../editor.admin.class.php:464 ../editor.admin.class.php:976 msgid "Select File" msgstr "Выберите файл" -#: editor.admin.class.php:457 editor.admin.class.php:958 +#: ../editor.admin.class.php:468 ../editor.admin.class.php:980 msgid "Apply" msgstr "Применить" -#: editor.admin.class.php:458 editor.admin.class.php:959 +#: ../editor.admin.class.php:469 ../editor.admin.class.php:981 msgid "Select file from your blog server." msgstr "Выберите файл, расположенный на сервере Вашего блога." -#: editor.admin.class.php:461 editor.admin.class.php:962 +#: ../editor.admin.class.php:472 ../editor.admin.class.php:984 msgid "Upload File" msgstr "Загрузить файл" -#: editor.admin.class.php:462 editor.admin.class.php:963 +#: ../editor.admin.class.php:473 ../editor.admin.class.php:985 msgid "Upload" msgstr "Загрузить" -#: editor.admin.class.php:465 editor.admin.class.php:966 +#: ../editor.admin.class.php:476 ../editor.admin.class.php:988 msgid "Select and upload file from your local computer." msgstr "Выберите и загрузите файл на сервер с Вашего локального компьютера." -#: editor.admin.class.php:471 +#: ../editor.admin.class.php:482 msgid "HTML or Javascript Code" msgstr "Код HTML или Javascript" -#: editor.admin.class.php:475 +#: ../editor.admin.class.php:486 msgid "Patch Code" msgstr "Код заглушки" -#: editor.admin.class.php:480 +#: ../editor.admin.class.php:491 msgid "" "This is one-block code of third-party AdServer rotator. Selecting this " "checkbox prevents displaying contained ads." @@ -1370,7 +1424,7 @@ msgstr "" "Выбор этого параметра останавливает показ содержащихся в рекламном месте " "объявлений для показа только этого кода." -#: editor.admin.class.php:483 +#: ../editor.admin.class.php:494 msgid "" "This is a HTML-code patch of advertising space. For example: use the code to " "display AdSense advertisement. " @@ -1378,19 +1432,19 @@ msgstr "" "Это HTML-код заплатки рекламного места. Например: используйте код показа " "рекламы от AdSense." -#: editor.admin.class.php:488 +#: ../editor.admin.class.php:499 msgid "Google DFP" msgstr "Блок Google DFP" -#: editor.admin.class.php:492 +#: ../editor.admin.class.php:503 msgid "DFP Block Name" msgstr "Имя блока DFP" -#: editor.admin.class.php:496 +#: ../editor.admin.class.php:507 msgid "This is name of Google DFP block!" msgstr "Это имя блока от Google DFP!" -#: editor.admin.class.php:499 +#: ../editor.admin.class.php:510 msgid "" "The patch (default advertisement) will be shown that if the logic of the " "plugin can not show any contained advertisement on the current page of the " @@ -1400,23 +1454,23 @@ msgstr "" "когда логика плагина не позволяет показать какое-либо рекламное объявление " "на текущей странице документа." -#: editor.admin.class.php:506 +#: ../editor.admin.class.php:517 msgid "Codes" msgstr "Коды" -#: editor.admin.class.php:508 +#: ../editor.admin.class.php:519 msgid "Enter the code to output before and after the codes of Ads Place." msgstr "Введите коды для вывода до и после кода места рекламных объявлений." -#: editor.admin.class.php:510 +#: ../editor.admin.class.php:521 msgid "Code Before" msgstr "Код до" -#: editor.admin.class.php:514 +#: ../editor.admin.class.php:525 msgid "Code After" msgstr "Код после" -#: editor.admin.class.php:517 +#: ../editor.admin.class.php:528 msgid "" "You can enter any HTML codes here for the further withdrawal of their before " "and after the code of Ads Place." @@ -1424,103 +1478,105 @@ msgstr "" "Вы можете ввести здесь любой HTML код для дальнейшего вывода его до и после " "кода рекламного места." -#: editor.admin.class.php:648 +#: ../editor.admin.class.php:659 msgid "Ad Data Updated." msgstr "Данные рекламного объявления сохранены." -#: editor.admin.class.php:800 +#: ../editor.admin.class.php:811 msgid "New advertisement" msgstr "Новое рекламное объявление" -#: editor.admin.class.php:800 +#: ../editor.admin.class.php:811 msgid "Edit advertisement" msgstr "Изменить рекламное объявление" -#: editor.admin.class.php:818 +#: ../editor.admin.class.php:831 msgid "Back to Ads List" msgstr "Назад, к списку объявлений" -#: editor.admin.class.php:824 +#: ../editor.admin.class.php:838 msgid "Advertisement ID" msgstr "ID объявления" -#: editor.admin.class.php:831 list.admin.class.php:361 -#: list.admin.class.php:371 +#: ../editor.admin.class.php:845 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 msgid "Activity" msgstr "Активность" -#: editor.admin.class.php:832 +#: ../editor.admin.class.php:846 msgid "Ad is Active" msgstr "Активно" -#: editor.admin.class.php:832 +#: ../editor.admin.class.php:846 msgid "Ad is Inactive" msgstr "Неактивно" -#: editor.admin.class.php:833 list.admin.class.php:175 -#: list.admin.class.php:186 list.admin.class.php:234 list.admin.class.php:362 -#: list.admin.class.php:372 list.admin.class.php:439 +#: ../editor.admin.class.php:847 ../list.admin.class.php:175 +#: ../list.admin.class.php:186 ../list.admin.class.php:234 +#: ../list.admin.class.php:362 ../list.admin.class.php:372 +#: ../list.admin.class.php:439 msgid "Hits" msgstr "Показы" -#: editor.admin.class.php:835 list.admin.class.php:235 -#: list.admin.class.php:363 list.admin.class.php:373 list.admin.class.php:440 +#: ../editor.admin.class.php:849 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:440 msgid "Clicks" msgstr "Клики" -#: editor.admin.class.php:848 +#: ../editor.admin.class.php:862 msgid "Is in Rotation" msgstr "В ротации" -#: editor.admin.class.php:873 +#: ../editor.admin.class.php:895 msgid "Title" msgstr "Имя" -#: editor.admin.class.php:880 +#: ../editor.admin.class.php:902 msgid "Advertisement Description" msgstr "Описание рекламного объявления" -#: editor.admin.class.php:894 +#: ../editor.admin.class.php:916 msgid "General" msgstr "Основные параметры" -#: editor.admin.class.php:895 +#: ../editor.admin.class.php:917 msgid "Extended Restrictions" msgstr "Дополнительные ограничения" -#: editor.admin.class.php:896 +#: ../editor.admin.class.php:918 msgid "Earnings settings" msgstr "Параметры доходов" -#: editor.admin.class.php:902 editor.admin.class.php:977 +#: ../editor.admin.class.php:924 ../editor.admin.class.php:999 msgid "Ad Code" msgstr "Код рекламного объявления" -#: editor.admin.class.php:906 +#: ../editor.admin.class.php:928 msgid "Image Mode" msgstr "Режим изображения" -#: editor.admin.class.php:910 +#: ../editor.admin.class.php:932 msgid "Ad Image" msgstr "Изображение объявления" -#: editor.admin.class.php:914 +#: ../editor.admin.class.php:936 msgid "Ad Target" msgstr "Ссылка объявления" -#: editor.admin.class.php:918 +#: ../editor.admin.class.php:940 msgid "Ad Alternative Text" msgstr "Альтернативный текст" -#: editor.admin.class.php:923 +#: ../editor.admin.class.php:945 msgid "Count clicks for this advertisement" msgstr "Считать клики для этого рекламного объявления" -#: editor.admin.class.php:925 +#: ../editor.admin.class.php:947 msgid "Use carefully!" msgstr "Используйте крайне осторожно!" -#: editor.admin.class.php:925 +#: ../editor.admin.class.php:947 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " @@ -1530,83 +1586,83 @@ msgstr "" "этом случае, во время Ajax запроса посетителю будет предложено ввести имя " "пользователя и пароль." -#: editor.admin.class.php:928 +#: ../editor.admin.class.php:950 msgid "This is flash (SWF) banner" msgstr "Это флеш (SWF) баннер" -#: editor.admin.class.php:931 +#: ../editor.admin.class.php:953 msgid "Flash banner \"flashvars\"" msgstr "Параметр \"flashvars\"" -#: editor.admin.class.php:933 +#: ../editor.admin.class.php:955 msgid "Insert \"flashvars\" parameters between braces..." msgstr "Вставьте параметры \"flashvars\" между фигурными скобками" -#: editor.admin.class.php:934 +#: ../editor.admin.class.php:956 msgid "Flash banner \"params\"" msgstr "Параметр \"params\"" -#: editor.admin.class.php:936 +#: ../editor.admin.class.php:958 msgid "Insert \"params\" parameters between braces..." msgstr "Вставьте параметры \"params\" между фигурными скобками" -#: editor.admin.class.php:937 +#: ../editor.admin.class.php:959 msgid "Flash banner \"attributes\"" msgstr "Параметр \"attributes\"" -#: editor.admin.class.php:939 +#: ../editor.admin.class.php:961 msgid "Insert \"attributes\" parameters between braces..." msgstr "Вставьте параметры \"attributes\" между фигурными скобками" -#: editor.admin.class.php:942 +#: ../editor.admin.class.php:964 msgid "Add to ad" msgstr "Добавить теги" -#: editor.admin.class.php:944 +#: ../editor.admin.class.php:966 msgid "Non Selected" msgstr "Не выбрано" -#: editor.admin.class.php:945 +#: ../editor.admin.class.php:967 msgid "nofollow" msgstr "nofollow" -#: editor.admin.class.php:946 +#: ../editor.admin.class.php:968 msgid "noindex" msgstr "noindex" -#: editor.admin.class.php:947 +#: ../editor.admin.class.php:969 msgid "nofollow and noindex" msgstr "nofollow и noindex" -#: editor.admin.class.php:973 +#: ../editor.admin.class.php:995 msgid "Code Mode" msgstr "Режим кода" -#: editor.admin.class.php:979 +#: ../editor.admin.class.php:1001 msgid "This code of ad contains PHP script" msgstr "Этот код объявления содержит PHP скрипт" -#: editor.admin.class.php:988 +#: ../editor.admin.class.php:1010 msgid "Restrictions of advertisements showing" msgstr "Ограничения показа объявления" -#: editor.admin.class.php:991 +#: ../editor.admin.class.php:1013 msgid "Ad Weight" msgstr "Вес объявления" -#: editor.admin.class.php:998 +#: ../editor.admin.class.php:1020 msgid "Inactive" msgstr "Неактивно" -#: editor.admin.class.php:999 +#: ../editor.admin.class.php:1021 msgid "Minimal Activity" msgstr "Минимальная активность" -#: editor.admin.class.php:1000 +#: ../editor.admin.class.php:1022 msgid "Maximal Activity" msgstr "Максимальная активность" -#: editor.admin.class.php:1010 +#: ../editor.admin.class.php:1032 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." @@ -1614,79 +1670,79 @@ msgstr "" "Вес рекламного объявления является коэффициентом частоты показа рекламного " "объявления за однин цикл ротации." -#: editor.admin.class.php:1012 +#: ../editor.admin.class.php:1034 msgid "0 - ad is inactive" msgstr "0 - объявление не активно" -#: editor.admin.class.php:1013 +#: ../editor.admin.class.php:1035 msgid "1 - minimal activity of this advertisement" msgstr "1 - минимальная активность этого объявления" -#: editor.admin.class.php:1015 +#: ../editor.admin.class.php:1037 msgid "10 - maximal activity of this ad." msgstr "10 - максимальная активность данного объявления" -#: editor.admin.class.php:1021 help.class.php:20 help.class.php:161 +#: ../editor.admin.class.php:1043 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "Показывать объявление на всех страницах блога" -#: editor.admin.class.php:1025 +#: ../editor.admin.class.php:1047 msgid "Show ad only on pages of this type" msgstr "Показывать объявление только на страницах данного типа" -#: editor.admin.class.php:1029 +#: ../editor.admin.class.php:1051 msgid "Home Page (Home or Front Page)" msgstr "Главная страница (главная или фронтальная страница)" -#: editor.admin.class.php:1031 +#: ../editor.admin.class.php:1053 msgid "Singular Pages" msgstr "Сингулярные страницы" -#: editor.admin.class.php:1034 +#: ../editor.admin.class.php:1056 msgid "Single Post" msgstr "Страница статьи" -#: editor.admin.class.php:1038 +#: ../editor.admin.class.php:1060 msgid "Custom Post Type" msgstr "Пользовательский тип статьи" -#: editor.admin.class.php:1040 +#: ../editor.admin.class.php:1062 msgid "Attachment" msgstr "Приложение" -#: editor.admin.class.php:1043 +#: ../editor.admin.class.php:1065 msgid "Search Page" msgstr "Страница вывода результата поиска" -#: editor.admin.class.php:1045 +#: ../editor.admin.class.php:1067 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "Страница \"Не найдено\" (ошибка HTTP 404)" -#: editor.admin.class.php:1047 +#: ../editor.admin.class.php:1069 msgid "Archive Pages" msgstr "Страницы архивов" -#: editor.admin.class.php:1050 +#: ../editor.admin.class.php:1072 msgid "Taxonomy Archive Pages" msgstr "Страницы архивов таксономий" -#: editor.admin.class.php:1052 +#: ../editor.admin.class.php:1074 msgid "Category Archive Pages" msgstr "Страницы архивов рубрик" -#: editor.admin.class.php:1054 +#: ../editor.admin.class.php:1076 msgid "Tag Archive Pages" msgstr "Страницы архивов меток" -#: editor.admin.class.php:1056 +#: ../editor.admin.class.php:1078 msgid "Author Archive Pages" msgstr "Страницы архивов авторов" -#: editor.admin.class.php:1058 +#: ../editor.admin.class.php:1080 msgid "Custom Post Type Archive Pages" msgstr "Страницы архивов пользовательскии типов" -#: editor.admin.class.php:1060 +#: ../editor.admin.class.php:1082 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" @@ -1694,15 +1750,15 @@ msgstr "" "Страницы архивов по датам (любые основанные на датах страницы архивов, " "другими словами, архивы по месяцам, по годам, по дням и по времени)" -#: editor.admin.class.php:1065 +#: ../editor.admin.class.php:1087 msgid "Show ad only in certain posts/pages" msgstr "Показывать объявление только в определённых статьях/страницах" -#: editor.admin.class.php:1069 editor.admin.class.php:1138 +#: ../editor.admin.class.php:1091 ../editor.admin.class.php:1160 msgid "Posts/Pages" msgstr "Статьи/Страницы" -#: editor.admin.class.php:1076 +#: ../editor.admin.class.php:1098 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." @@ -1710,47 +1766,47 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: editor.admin.class.php:1087 +#: ../editor.admin.class.php:1109 msgid "Users" msgstr "Пользователи" -#: editor.admin.class.php:1089 +#: ../editor.admin.class.php:1111 msgid "Show this ad for" msgstr "Показывать это рекламное объявление для" -#: editor.admin.class.php:1092 +#: ../editor.admin.class.php:1114 msgid "all users" msgstr "всех пользователей" -#: editor.admin.class.php:1097 +#: ../editor.admin.class.php:1119 msgid "these users" msgstr "этих пользователей" -#: editor.admin.class.php:1102 +#: ../editor.admin.class.php:1124 msgid "Unregistered Users" msgstr "Незарегистрированные пользователи" -#: editor.admin.class.php:1106 editor.admin.class.php:1114 +#: ../editor.admin.class.php:1128 ../editor.admin.class.php:1136 msgid "Registered Users" msgstr "Зарегистрированные пользователи" -#: editor.admin.class.php:1111 +#: ../editor.admin.class.php:1133 msgid "Exclude these users" msgstr "Исключая этих пользователей" -#: editor.admin.class.php:1122 +#: ../editor.admin.class.php:1144 msgid "Do not show this ad for advertiser" msgstr "Не показывать объявление рекламодателю" -#: editor.admin.class.php:1130 +#: ../editor.admin.class.php:1152 msgid "Extended restrictions of advertisements showing" msgstr "Дополнительные ограничения показа объявления" -#: editor.admin.class.php:1134 +#: ../editor.admin.class.php:1156 msgid "Do not show ad on certain posts/pages" msgstr "Не показывать объявление в определённых статьях/страницах" -#: editor.admin.class.php:1146 +#: ../editor.admin.class.php:1168 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." @@ -1758,17 +1814,17 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: editor.admin.class.php:1151 +#: ../editor.admin.class.php:1173 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных рубрик" -#: editor.admin.class.php:1154 editor.admin.class.php:1174 +#: ../editor.admin.class.php:1176 ../editor.admin.class.php:1196 msgid "Categories" msgstr "Рубрики" -#: editor.admin.class.php:1161 +#: ../editor.admin.class.php:1183 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." @@ -1776,8 +1832,9 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных рубрик." -#: editor.admin.class.php:1165 editor.admin.class.php:1200 -#: editor.admin.class.php:1235 editor.admin.class.php:1270 +#: ../editor.admin.class.php:1187 ../editor.admin.class.php:1221 +#: ../editor.admin.class.php:1255 ../editor.admin.class.php:1290 +#: ../editor.admin.class.php:1325 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " @@ -1788,12 +1845,12 @@ msgstr "" "объявление только на страницах данного типа\". В противном случае, параметр " "будет проигнорирован." -#: editor.admin.class.php:1171 +#: ../editor.admin.class.php:1193 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "Не показывать объявление в одиночных статьях и архивах заданных рубрик" -#: editor.admin.class.php:1181 +#: ../editor.admin.class.php:1203 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." @@ -1801,16 +1858,46 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных рубрик." -#: editor.admin.class.php:1186 +#: ../editor.admin.class.php:1208 +msgid "" +"Show ad only in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" +"Показывать объявление только в одиночных статьях и архивах заданных терминов " +"пользовательских таксономий" + +#: ../editor.admin.class.php:1217 +msgid "" +"Use this setting to display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" +"Используйте этот параметр для показа рекламного объявления только в " +"одиночных статьях и архивах выбранных терминов пользовательских таксономий." + +#: ../editor.admin.class.php:1227 +msgid "" +"Do not show ad in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" +"Не показывать объявление в одиночных статьях и архивах заданных терминов " +"пользовательских таксономий" + +#: ../editor.admin.class.php:1236 +msgid "" +"Use this setting to not display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." +msgstr "" +"Используйте этот параметр для блокировки показа рекламного объявления в " +"одиночных статьях и архивах выбранных терминов пользовательских таксономий." + +#: ../editor.admin.class.php:1241 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных авторов" -#: editor.admin.class.php:1189 editor.admin.class.php:1209 +#: ../editor.admin.class.php:1244 ../editor.admin.class.php:1264 msgid "Authors" msgstr "Авторы" -#: editor.admin.class.php:1196 +#: ../editor.admin.class.php:1251 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." @@ -1818,12 +1905,12 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных авторов." -#: editor.admin.class.php:1206 +#: ../editor.admin.class.php:1261 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных авторов" -#: editor.admin.class.php:1216 +#: ../editor.admin.class.php:1271 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." @@ -1831,16 +1918,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных авторов." -#: editor.admin.class.php:1221 +#: ../editor.admin.class.php:1276 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных меток" -#: editor.admin.class.php:1224 editor.admin.class.php:1244 +#: ../editor.admin.class.php:1279 ../editor.admin.class.php:1299 msgid "Tags" msgstr "Метки" -#: editor.admin.class.php:1231 +#: ../editor.admin.class.php:1286 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." @@ -1848,11 +1935,11 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных меток." -#: editor.admin.class.php:1241 +#: ../editor.admin.class.php:1296 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "Не показывать объявление в одиночных статьях и архивах заданных меток" -#: editor.admin.class.php:1251 +#: ../editor.admin.class.php:1306 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." @@ -1860,7 +1947,7 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных меток." -#: editor.admin.class.php:1256 +#: ../editor.admin.class.php:1311 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" @@ -1868,11 +1955,11 @@ msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных " "пользовательских типов" -#: editor.admin.class.php:1259 editor.admin.class.php:1279 +#: ../editor.admin.class.php:1314 ../editor.admin.class.php:1334 msgid "Custom post types" msgstr "Пользовательские типы" -#: editor.admin.class.php:1266 +#: ../editor.admin.class.php:1321 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." @@ -1880,7 +1967,7 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных пользовательских типов." -#: editor.admin.class.php:1276 +#: ../editor.admin.class.php:1331 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" @@ -1888,7 +1975,7 @@ msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных " "пользовательских типов" -#: editor.admin.class.php:1286 +#: ../editor.admin.class.php:1341 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." @@ -1896,76 +1983,76 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных пользовательских типов." -#: editor.admin.class.php:1291 +#: ../editor.admin.class.php:1346 msgid "Use the schedule for this ad" msgstr "Использовать расписание для этого объявления" -#: editor.admin.class.php:1295 +#: ../editor.admin.class.php:1350 msgid "Campaign Start Date" msgstr "Дата начала кампании" -#: editor.admin.class.php:1299 +#: ../editor.admin.class.php:1354 msgid "Campaign End Date" msgstr "Дата окончания кампании" -#: editor.admin.class.php:1304 +#: ../editor.admin.class.php:1359 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" "Используйте эти параметры для показа объявления в течение определенного " "периода времени." -#: editor.admin.class.php:1309 +#: ../editor.admin.class.php:1364 msgid "Use limitation by hits" msgstr "Использовать ограничение по показам" -#: editor.admin.class.php:1313 +#: ../editor.admin.class.php:1368 msgid "Hits Limit" msgstr "Лимит показов" -#: editor.admin.class.php:1318 +#: ../editor.admin.class.php:1373 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" "Используйте этот параметр для ограничения показа объявлений по просмотрам." -#: editor.admin.class.php:1323 +#: ../editor.admin.class.php:1378 msgid "Use limitation by clicks" msgstr "Использовать ограничение по кликам" -#: editor.admin.class.php:1327 +#: ../editor.admin.class.php:1382 msgid "Clicks Limit" msgstr "Лимит кликов" -#: editor.admin.class.php:1332 +#: ../editor.admin.class.php:1387 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "Используйте этот параметр для ограничения показа объявлений по кликам." -#: editor.admin.class.php:1342 +#: ../editor.admin.class.php:1397 msgid "Advertiser" msgstr "Рекламодатель" -#: editor.admin.class.php:1345 +#: ../editor.admin.class.php:1400 msgid "Advertiser Nick Name" msgstr "Ник рекламодателя" -#: editor.admin.class.php:1362 help.class.php:32 help.class.php:180 +#: ../editor.admin.class.php:1417 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "Расценки" -#: editor.admin.class.php:1365 +#: ../editor.admin.class.php:1420 msgid "Price of ad placement per month" msgstr "Цена размещения в месяц" -#: editor.admin.class.php:1369 +#: ../editor.admin.class.php:1424 msgid "Tthis parameter used only for scheduled ads." msgstr "" "Этот параметр используется только для объявлений, показываемых по расписанию." -#: editor.admin.class.php:1372 +#: ../editor.admin.class.php:1427 msgid "Price per Thousand Hits" msgstr "Цена за тысячу показов" -#: editor.admin.class.php:1376 +#: ../editor.admin.class.php:1431 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." @@ -1973,11 +2060,11 @@ msgstr "" "Не только люди посещают Ваш блог ... Включите обнаружение ботов и сканеров " "для того, чтобы правильно считать показы и не обманывать рекламодателя." -#: editor.admin.class.php:1379 +#: ../editor.admin.class.php:1434 msgid "Price per Click" msgstr "Цена за клик" -#: editor.admin.class.php:1383 +#: ../editor.admin.class.php:1438 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." @@ -1985,60 +2072,60 @@ msgstr "" "Для подсчёта заработка по кликам, необходимо включить подсчёт кликов для " "этого объявления." -#: editor.admin.class.php:1394 +#: ../editor.admin.class.php:1449 msgid "Ad Preview" msgstr "Предварительный просмотр объявления" -#: errorlog.admin.class.php:61 errorlog.admin.class.php:145 -#: errorlog.admin.class.php:157 +#: ../errorlog.admin.class.php:61 ../errorlog.admin.class.php:145 +#: ../errorlog.admin.class.php:157 msgid "Resolved" msgstr "Исправлено" -#: errorlog.admin.class.php:65 errorlog.admin.class.php:173 +#: ../errorlog.admin.class.php:65 ../errorlog.admin.class.php:173 msgid "Clear Error Log" msgstr "Очистить журнал ошибок" -#: errorlog.admin.class.php:68 errorlog.admin.class.php:176 +#: ../errorlog.admin.class.php:68 ../errorlog.admin.class.php:176 msgid "Clear Resolved" msgstr "Очистить исправленные" -#: errorlog.admin.class.php:85 errorlog.admin.class.php:95 +#: ../errorlog.admin.class.php:85 ../errorlog.admin.class.php:95 msgid "Date" msgstr "Дата" -#: errorlog.admin.class.php:88 errorlog.admin.class.php:98 +#: ../errorlog.admin.class.php:88 ../errorlog.admin.class.php:98 msgid "Error Massage" msgstr "Сообщение об ошибке" -#: errorlog.admin.class.php:116 +#: ../errorlog.admin.class.php:116 msgid "Update Error" msgstr "Ошибка обновления" -#: errorlog.admin.class.php:116 +#: ../errorlog.admin.class.php:116 msgid "Output Error" msgstr "Ошибка вывода" -#: errorlog.admin.class.php:147 +#: ../errorlog.admin.class.php:147 msgid "More Info" msgstr "Подробнее" -#: errorlog.admin.class.php:151 +#: ../errorlog.admin.class.php:151 msgid "Not Resolved" msgstr "Не исправлено" -#: errorlog.admin.class.php:188 +#: ../errorlog.admin.class.php:188 msgid "Error Info" msgstr "Подробно" -#: errors.class.php:46 +#: ../errors.class.php:46 msgid "Simple Ads Manager Images Folder hasn't been created!" msgstr "Папка изображений плагина Simple Ads Manager не была создана." -#: errors.class.php:47 +#: ../errors.class.php:47 msgid "Try to reactivate plugin or create folder manually." msgstr "Попытайтесь реактивировать плагин или зоздайте папку вручную." -#: errors.class.php:47 +#: ../errors.class.php:47 msgid "" "Manually creation: Create folder 'sam-images' in 'wp-content/plugins' " "folder. Don't forget to set folder's permissions to 777." @@ -2046,17 +2133,17 @@ msgstr "" "Создание папки вручную: Создайте папку 'sam-images' в папке 'wp-content/" "plugins'. Не забудьте установить для созданной папки права доступа 777." -#: errors.class.php:54 +#: ../errors.class.php:54 #, php-format msgid "Database table %s hasn't been created!" msgstr "Таблица базы данных %s не была создана!" -#: errors.class.php:58 +#: ../errors.class.php:58 #, php-format msgid "Database table %s hasn't been upgraded!" msgstr "Таблица базы данных %s не была обновлена!" -#: help.class.php:14 help.class.php:155 +#: ../help.class.php:14 ../help.class.php:155 msgid "" "Enter a name and a description of the " "advertisement. These parameters are optional, because don’t influence " @@ -2067,7 +2154,7 @@ msgstr "" "объявления. Это необязательные параметры, т.к. ни на что не влияют, но " "помогают в визуальной идентификации объявления (не забыть что есть что)." -#: help.class.php:15 help.class.php:156 +#: ../help.class.php:15 ../help.class.php:156 msgid "" "Ad Code – code can be defined as a combination of the image " "URL and target page URL, or as HTML code, javascript code, or PHP code (for " @@ -2084,11 +2171,11 @@ msgstr "" "кликов, а так же инструменты для загрузки/выбора загруженного изображения " "баннера." -#: help.class.php:16 help.class.php:157 +#: ../help.class.php:16 ../help.class.php:157 msgid "Restrictions of advertisement Showing" msgstr "Ограничения показа объявления" -#: help.class.php:17 help.class.php:158 +#: ../help.class.php:17 ../help.class.php:158 msgid "" "Ad Weight – coefficient of frequency of show of the advertisement " "for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " @@ -2098,11 +2185,11 @@ msgstr "" "объявления за однин цикл ротации. 0 - объявление неактивно, 1 - минимальная " "активность, 10 - максимальная активность объявления." -#: help.class.php:18 help.class.php:159 +#: ../help.class.php:18 ../help.class.php:159 msgid "Restrictions by the type of pages – select restrictions:" msgstr "Ограничения по типу страниц - выберите режим ограничения:" -#: help.class.php:21 help.class.php:162 +#: ../help.class.php:21 ../help.class.php:162 msgid "" "Show ad only on pages of this type – ad will appear only on the pages of " "selected types" @@ -2110,7 +2197,7 @@ msgstr "" "Показывать на страницах только данного типа – объявление будет показываться " "только на страницах выбранных типов" -#: help.class.php:22 help.class.php:163 +#: ../help.class.php:22 ../help.class.php:163 msgid "" "Show ad only in certain posts – ad will be shown only on single posts pages " "with the given IDs (ID items separated by commas, no spaces)" @@ -2119,11 +2206,11 @@ msgstr "" "показываться только на страницах статей с заданными ID статей (ID статей " "разделять запятыми, без пробелов)" -#: help.class.php:24 +#: ../help.class.php:24 msgid "Additional restrictions" msgstr "Доплнительные ограничения" -#: help.class.php:26 help.class.php:174 +#: ../help.class.php:26 ../help.class.php:174 msgid "" "Show ad only in single posts or categories archives of certain categories – " "ad will be shown only on single posts pages or category archive pages of the " @@ -2133,7 +2220,7 @@ msgstr "" "– объявление будет показываться только на страницах статей, входящих в " "заданные рубрики и на страницах архивов заданных рубрик" -#: help.class.php:27 help.class.php:175 +#: ../help.class.php:27 ../help.class.php:175 msgid "" "Show ad only in single posts or authors archives of certain authors – ad " "will be shown only on single posts pages or author archive pages of the " @@ -2143,7 +2230,7 @@ msgstr "" "авторов – объявление будет показываться только на страницах статей и на " "страницах архивов заданных авторов." -#: help.class.php:29 help.class.php:177 +#: ../help.class.php:29 ../help.class.php:177 msgid "" "Use the schedule for this ad – if necessary, select checkbox " "labeled “Use the schedule for this ad” and set start and finish dates of ad " @@ -2153,7 +2240,7 @@ msgstr "" "«Использовать расписание для этого объявления» и установите даты начала и " "конца рекламной кампании." -#: help.class.php:30 help.class.php:178 +#: ../help.class.php:30 ../help.class.php:178 msgid "" "Use limitation by hits – if necessary, select checkbox labeled “Use " "limitation by hits” and set hits limit." @@ -2161,7 +2248,7 @@ msgstr "" "Использовать ограничение по показам – если необходимо, взведите " "флажок «Использовать ограничение по показам» и установите лимит показов." -#: help.class.php:31 help.class.php:179 +#: ../help.class.php:31 ../help.class.php:179 msgid "" "Use limitation by clicks – if necessary, select checkbox labeled " "“Use limitation by clicks” and set clicks limit." @@ -2169,7 +2256,7 @@ msgstr "" "Использовать ограничение по кликам – если необходимо, взведите " "флажок «Использовать ограничение по кликам» и установите лимит кликов." -#: help.class.php:32 help.class.php:180 +#: ../help.class.php:32 ../help.class.php:180 msgid "" "Use these parameters to get the statistics of incomes from advertisements " "placed in your blog. \"Price of ad placement per month\" - parameter used " @@ -2180,13 +2267,14 @@ msgstr "" "параметр используется для расчета статистики только для объявлений, " "показываемых по расписанию." -#: help.class.php:33 help.class.php:50 help.class.php:57 help.class.php:71 -#: help.class.php:104 help.class.php:112 help.class.php:123 help.class.php:140 -#: help.class.php:149 help.class.php:165 help.class.php:181 help.class.php:198 +#: ../help.class.php:33 ../help.class.php:50 ../help.class.php:57 +#: ../help.class.php:71 ../help.class.php:104 ../help.class.php:112 +#: ../help.class.php:123 ../help.class.php:140 ../help.class.php:149 +#: ../help.class.php:165 ../help.class.php:181 ../help.class.php:198 msgid "Manual" msgstr "Руководство" -#: help.class.php:39 help.class.php:129 +#: ../help.class.php:39 ../help.class.php:129 msgid "" "Enter a name and a description of the Ads " "Place. In principle, it is not mandatory parameters, because these " @@ -2198,7 +2286,7 @@ msgstr "" "однако опыт подсказывает, что через некоторое время всякие ID забываются и " "такая информация может быть полезной." -#: help.class.php:40 help.class.php:130 +#: ../help.class.php:40 ../help.class.php:130 msgid "" "Ads Place Size – in this version is only for informational " "purposes only, but in future I plan to use this option. It is desirable to " @@ -2208,7 +2296,7 @@ msgstr "" "исключительно информационную нагрузку, но в будущем я планирую использовать " "этот параметр. Желательно выставлять реальный размер." -#: help.class.php:41 help.class.php:131 +#: ../help.class.php:41 ../help.class.php:131 msgid "" "Ads Place Patch - it’s an ad that will appear in the event " "that the logic of basic ads outputing of this Ads Place on the current page " @@ -2232,19 +2320,19 @@ msgstr "" "ведущий на вашу страницу расценок публикации рекламных объявлений или баннер " "от AdSense." -#: help.class.php:42 help.class.php:132 +#: ../help.class.php:42 ../help.class.php:132 msgid "Patch can be defined" msgstr "Заглушка может быть задана" -#: help.class.php:44 help.class.php:134 +#: ../help.class.php:44 ../help.class.php:134 msgid "as combination of the image URL and target page URL" msgstr "как комбинация URL изображения и URL целевой страницы" -#: help.class.php:45 help.class.php:135 +#: ../help.class.php:45 ../help.class.php:135 msgid "as HTML code or javascript code" msgstr "как код HTML или Javascript" -#: help.class.php:46 help.class.php:136 +#: ../help.class.php:46 ../help.class.php:136 msgid "" "as name of Google DoubleClick for Publishers (DFP) block" @@ -2252,7 +2340,7 @@ msgstr "" "как имя блока Google DoubleClick for Publishers (DFP)" -#: help.class.php:48 help.class.php:138 +#: ../help.class.php:48 ../help.class.php:138 msgid "" "If you select the first option (image mode), tools to download/choosing of " "downloaded image banner become available for you." @@ -2260,7 +2348,7 @@ msgstr "" "В случае использования первого варианта (режим изображения) Вам становятся " "доступны инструменты для загрузки/выбора загруженного изображения баннера." -#: help.class.php:49 help.class.php:139 +#: ../help.class.php:49 ../help.class.php:139 msgid "" "Codes – as Ads Place can be inserted into the page code not " "only as widget, but as a short code or by using function, you can use code " @@ -2272,7 +2360,7 @@ msgstr "" "вполне резонно можно использовать коды «до» и «после» для центровки или " "выравнивания рекламного места на месте вставки. Используйте HTML теги." -#: help.class.php:63 help.class.php:190 +#: ../help.class.php:63 ../help.class.php:190 msgid "" "Views per Cycle – the number of impressions an ad for one " "cycle of rotation, provided that this ad has maximum weight (the activity). " @@ -2286,7 +2374,7 @@ msgstr "" "цикле равном 1000, объявление с весом 10 будет показано 1000 раз, а " "объявление с весом 3 будет показано 300 раз." -#: help.class.php:64 help.class.php:191 +#: ../help.class.php:64 ../help.class.php:191 msgid "" "Do not set this parameter to a value less than the maximum number of " "visitors which may simultaneously be on your site – it may violate the logic " @@ -2296,7 +2384,7 @@ msgstr "" "количество посетителей могущих одномоментно находиться на Вашем сайте – это " "может привести к нарушению логики ротации." -#: help.class.php:65 help.class.php:192 +#: ../help.class.php:65 ../help.class.php:192 msgid "" "Not worth it, though it has no special meaning, set this parameter to a " "value greater than the number of hits your web pages during a month. " @@ -2307,7 +2395,7 @@ msgstr "" "Оптимальным, пожалуй, является значение равное суточному показу страниц " "сайта." -#: help.class.php:66 help.class.php:193 +#: ../help.class.php:66 ../help.class.php:193 msgid "" "Auto Inserting Settings - here you can select the Ads " "Places and allow the display of their ads before and after the content of " @@ -2317,7 +2405,7 @@ msgstr "" "места и разрешить показ их рекламных объявлений до и после контента " "одиночной статьи." -#: help.class.php:67 help.class.php:194 +#: ../help.class.php:67 ../help.class.php:194 msgid "" "Google DFP Settings - if you want to use codes of Google " "DFP rotator, you must allow it's using and define your pub-code." @@ -2326,11 +2414,11 @@ msgstr "" "ротатора Google DFP, Вы должны разрешить их использование и определить Ваш " "pub-код." -#: help.class.php:69 help.class.php:196 +#: ../help.class.php:69 ../help.class.php:196 msgid "Bots and Crawlers detection" msgstr "Обнаружение ботов и сканеров" -#: help.class.php:69 help.class.php:196 +#: ../help.class.php:69 ../help.class.php:196 msgid "" "For obtaining of more exact indexes of statistics and incomes it is " "preferable to exclude data about visits of bots and crawlers from the data " @@ -2344,19 +2432,19 @@ msgstr "" "сканера данные о показе не будут записаны. Выберите точность обнаружения " "ботов, но помните, что чем точнее тем больше требуется ресурсов сервера." -#: help.class.php:103 +#: ../help.class.php:103 msgid "This is list of Ads Places" msgstr "Список рекламных мест" -#: help.class.php:107 help.class.php:115 help.class.php:201 +#: ../help.class.php:107 ../help.class.php:115 ../help.class.php:201 msgid "Help" msgstr "Справка" -#: help.class.php:111 +#: ../help.class.php:111 msgid "This is list of Ads" msgstr "Список рекламных объявлений" -#: help.class.php:122 +#: ../help.class.php:122 msgid "" "The main object of the plugin is “Ads Place“. Each Ads Place is a container " "for the advertisements and provides the logic of the show and rotation. In " @@ -2374,11 +2462,11 @@ msgstr "" "рекламном месте. Одно рекламное место может содержать любое количество " "объектов “рекламное объявление”." -#: help.class.php:142 help.class.php:168 +#: ../help.class.php:142 ../help.class.php:168 msgid "Parameters" msgstr "Параметры" -#: help.class.php:148 +#: ../help.class.php:148 msgid "" "Object “advertisement” rigidly attached to his container “Ads Place”. Its " "parameters determine frequency (weight) of displaying and limiting " @@ -2390,232 +2478,233 @@ msgstr "" "ограничения показа, от “показывать на всех страницах” до “показывать в " "статьях с ID …” и показывать с … по (расписание)." -#: help.class.php:151 list.admin.class.php:360 list.admin.class.php:370 +#: ../help.class.php:151 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 msgid "Advertisement" msgstr "Рекламное объявление" -#: help.class.php:172 +#: ../help.class.php:172 msgid "Additional restrictions" msgstr "Доплнительные ограничения" -#: help.class.php:184 +#: ../help.class.php:184 msgid "Additional Parameters" msgstr "Доплнительные параметры" -#: list.admin.class.php:137 +#: ../list.admin.class.php:137 msgid "Managing Ads Places" msgstr "Управление рекламными местами" -#: list.admin.class.php:153 list.admin.class.php:273 +#: ../list.admin.class.php:153 ../list.admin.class.php:273 msgid "Add New Place" msgstr "Добавить новое место" -#: list.admin.class.php:157 list.admin.class.php:277 +#: ../list.admin.class.php:157 ../list.admin.class.php:277 msgid "Reset Statistics" msgstr "Очистить статистику" -#: list.admin.class.php:173 list.admin.class.php:184 +#: ../list.admin.class.php:173 ../list.admin.class.php:184 msgid "Place Name" msgstr "Имя места" -#: list.admin.class.php:176 list.admin.class.php:187 +#: ../list.admin.class.php:176 ../list.admin.class.php:187 msgid "Total Hits" msgstr "Всего показов" -#: list.admin.class.php:177 list.admin.class.php:188 +#: ../list.admin.class.php:177 ../list.admin.class.php:188 msgid "Total Ads" msgstr "Объявлений" -#: list.admin.class.php:178 list.admin.class.php:189 list.admin.class.php:364 -#: list.admin.class.php:374 +#: ../list.admin.class.php:178 ../list.admin.class.php:189 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 msgid "Earnings" msgstr "Доходы" -#: list.admin.class.php:233 list.admin.class.php:438 +#: ../list.admin.class.php:233 ../list.admin.class.php:438 msgid "Placement" msgstr "Размещение" -#: list.admin.class.php:236 list.admin.class.php:441 +#: ../list.admin.class.php:236 ../list.admin.class.php:441 msgid "Total" msgstr "Всего" -#: list.admin.class.php:236 list.admin.class.php:441 +#: ../list.admin.class.php:236 ../list.admin.class.php:441 msgid "N/A" msgstr "Нет" -#: list.admin.class.php:243 +#: ../list.admin.class.php:243 msgid "Edit Place" msgstr "Изменить рекламное место" -#: list.admin.class.php:247 +#: ../list.admin.class.php:247 msgid "Restore this Place from the Trash" msgstr "Восстановить это место из корзины" -#: list.admin.class.php:248 +#: ../list.admin.class.php:248 msgid "Remove this Place permanently" msgstr "Удалить это рекламное место навсегда" -#: list.admin.class.php:253 +#: ../list.admin.class.php:253 msgid "Move this Place to the Trash" msgstr "Поместить это место в корзину" -#: list.admin.class.php:254 +#: ../list.admin.class.php:254 msgid "View List of Place Ads" msgstr "Показать список рекламных мест" -#: list.admin.class.php:254 +#: ../list.admin.class.php:254 msgid "View Ads" msgstr "Объявления" -#: list.admin.class.php:255 +#: ../list.admin.class.php:255 msgid "Create New Ad" msgstr "Создать новое объявление" -#: list.admin.class.php:255 +#: ../list.admin.class.php:255 msgid "New Ad" msgstr "Новое объявление" -#: list.admin.class.php:320 +#: ../list.admin.class.php:320 msgid "Managing Items of Ads Place" msgstr "Управление объявлениями рекламного места" -#: list.admin.class.php:337 list.admin.class.php:471 +#: ../list.admin.class.php:337 ../list.admin.class.php:471 msgid "Add New Ad" msgstr "Добавить новое рекламное объявление" -#: list.admin.class.php:341 list.admin.class.php:475 +#: ../list.admin.class.php:341 ../list.admin.class.php:475 msgid "Back to Ads Places Management" msgstr "Назад, к списку мест" -#: list.admin.class.php:432 +#: ../list.admin.class.php:432 msgid "Yes" msgstr "Да" -#: list.admin.class.php:433 +#: ../list.admin.class.php:433 msgid "No" msgstr "Нет" -#: list.admin.class.php:448 +#: ../list.admin.class.php:448 msgid "Edit this Item of Ads Place" msgstr "Изменить этот элемент рекламного места" -#: list.admin.class.php:452 +#: ../list.admin.class.php:452 msgid "Restore this Ad from the Trash" msgstr "Восстановить это объявление из корзины" -#: list.admin.class.php:453 +#: ../list.admin.class.php:453 msgid "Remove this Ad permanently" msgstr "Удалить это рекламное объявление навсегда" -#: list.admin.class.php:454 +#: ../list.admin.class.php:454 msgid "Move this item to the Trash" msgstr "Поместить этот элемент в корзину" -#: updater.class.php:25 +#: ../updater.class.php:25 msgid "An error occurred during updating process..." msgstr "Произошла ошибка во время процесса обновления ..." -#: updater.class.php:39 +#: ../updater.class.php:39 msgid "Updated..." msgstr "Обновлено ..." -#: widget.class.php:10 +#: ../widget.class.php:10 msgid "Ads Place:" msgstr "Рекламное место" -#: widget.class.php:13 +#: ../widget.class.php:13 msgid "Ads Place rotator serviced by Simple Ads Manager." msgstr "" "Ротатор рекламных объявлений, обслуживаемый плагином Simple Ads Manager." -#: widget.class.php:101 widget.class.php:240 widget.class.php:379 -#: widget.class.php:516 +#: ../widget.class.php:101 ../widget.class.php:240 ../widget.class.php:379 +#: ../widget.class.php:516 msgid "Title:" msgstr "Заголовок:" -#: widget.class.php:124 widget.class.php:263 widget.class.php:402 -#: widget.class.php:539 +#: ../widget.class.php:124 ../widget.class.php:263 ../widget.class.php:402 +#: ../widget.class.php:539 msgid "Hide widget style." msgstr "Скрывать стиль виджета." -#: widget.class.php:133 widget.class.php:272 widget.class.php:411 +#: ../widget.class.php:133 ../widget.class.php:272 ../widget.class.php:411 msgid "" "Allow using previously defined \"before\" and \"after\" codes of Ads Place.." msgstr "" "Разрешить использование ранее определённых кодов \"до\" и \"после\" для " "рекламного места." -#: widget.class.php:152 +#: ../widget.class.php:152 msgid "Ads Zone selector serviced by Simple Ads Manager." msgstr "" "Селектор \"Зона рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: widget.class.php:288 js/dialog-ad.php:48 +#: ../widget.class.php:288 ../js/dialog-ad.php:48 msgid "Ad" msgstr "Рекламное объявление" -#: widget.class.php:291 +#: ../widget.class.php:291 msgid "Non-rotating single ad serviced by Simple Ads Manager." msgstr "" "Неротируемое одиночное рекламное объявление, обслуживаемое плагином Simple " "Ads Manager." -#: widget.class.php:427 +#: ../widget.class.php:427 msgid "Block" msgstr "Блок" -#: widget.class.php:430 +#: ../widget.class.php:430 msgid "Ads Block collector serviced by Simple Ads Manager." msgstr "" "Коллектор \"Блок рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: widget.class.php:432 js/dialog-block.php:48 +#: ../widget.class.php:432 ../js/dialog-block.php:48 msgid "Ads Block" msgstr "Рекламный блок" -#: zone.editor.admin.class.php:15 +#: ../zone.editor.admin.class.php:15 msgid "Default" msgstr "По умолчанию" -#: zone.editor.admin.class.php:16 +#: ../zone.editor.admin.class.php:16 msgid "None" msgstr "Нет" -#: zone.editor.admin.class.php:169 +#: ../zone.editor.admin.class.php:169 msgid "Ads Zone Data Updated." msgstr "Данные рекламной зоны сохранены." -#: zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:286 msgid "New Ads Zone" msgstr "Новая рекламная зона" -#: zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:286 msgid "Edit Ads Zone" msgstr "Изменить рекламную зону" -#: zone.editor.admin.class.php:304 +#: ../zone.editor.admin.class.php:306 msgid "Back to Zones List" msgstr "Назад, к списку зон" -#: zone.editor.admin.class.php:310 js/dialog-zone.php:66 +#: ../zone.editor.admin.class.php:313 ../js/dialog-zone.php:66 msgid "Ads Zone ID" msgstr "ID рекламноой зоны" -#: zone.editor.admin.class.php:349 +#: ../zone.editor.admin.class.php:360 msgid "Enter description of this Ads Zone." msgstr "Введите описание для этой рекламной зоны." -#: zone.editor.admin.class.php:361 +#: ../zone.editor.admin.class.php:372 msgid "Ads Zone Settings" msgstr "Параметры зоны рекламных объявлений" -#: zone.editor.admin.class.php:364 +#: ../zone.editor.admin.class.php:375 msgid "Default Ads Place" msgstr "Рекламное место по умолчанию" -#: zone.editor.admin.class.php:370 +#: ../zone.editor.admin.class.php:381 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " @@ -2625,85 +2714,85 @@ msgstr "" "экран для тех страниц, для которых параметр рекламного места установлен в " "значение \"По умолчанию\"." -#: zone.editor.admin.class.php:374 +#: ../zone.editor.admin.class.php:385 msgid "Home Page Ads Place" msgstr "Рекламное место главной страницы" -#: zone.editor.admin.class.php:380 +#: ../zone.editor.admin.class.php:391 msgid "Default Ads Place for Singular Pages" msgstr "Рекламное место по умолчанию для сингулярных страниц" -#: zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:398 msgid "Single Post Ads Place" msgstr "Рекламное место статьи" -#: zone.editor.admin.class.php:396 +#: ../zone.editor.admin.class.php:407 msgid "Default Ads Place for Single Custom Type Post" msgstr "" "Рекламное место по умолчанию для одиночных статей пользовательских типов" -#: zone.editor.admin.class.php:407 +#: ../zone.editor.admin.class.php:418 msgid "Ads Place for Single Post of Custom Type" msgstr "Рекламное место для одиночной статьи пользовательского типа" -#: zone.editor.admin.class.php:416 +#: ../zone.editor.admin.class.php:427 msgid "Page Ads Place" msgstr "Рекламное место страницы" -#: zone.editor.admin.class.php:422 +#: ../zone.editor.admin.class.php:433 msgid "Attachment Ads Place" msgstr "Рекламное место страницы вложения" -#: zone.editor.admin.class.php:429 +#: ../zone.editor.admin.class.php:440 msgid "Search Pages Ads Place" msgstr "Рекламное место страницы вывода результата поиска" -#: zone.editor.admin.class.php:435 +#: ../zone.editor.admin.class.php:446 msgid "404 Page Ads Place" msgstr "Рекламное место страницы ошибки 404" -#: zone.editor.admin.class.php:441 +#: ../zone.editor.admin.class.php:452 msgid "Default Ads Place for Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов" -#: zone.editor.admin.class.php:448 +#: ../zone.editor.admin.class.php:459 msgid "Default Ads Place for Taxonomies Pages" msgstr "Рекламное место по умолчанию для странц таксономий" -#: zone.editor.admin.class.php:455 +#: ../zone.editor.admin.class.php:466 msgid "Default Ads Place for Category Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов рубрик" -#: zone.editor.admin.class.php:468 +#: ../zone.editor.admin.class.php:479 msgid "Ads Place for Category" msgstr "Рекламное место для рубрики" -#: zone.editor.admin.class.php:484 +#: ../zone.editor.admin.class.php:495 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" "Рекламное место по умолчанию для страниц архивов пользовательских типов" -#: zone.editor.admin.class.php:494 +#: ../zone.editor.admin.class.php:505 msgid "Ads Place for Custom Type Posts Archive" msgstr "Рекламное место по умолчанию для страниц архива пользовательского типа" -#: zone.editor.admin.class.php:503 +#: ../zone.editor.admin.class.php:514 msgid "Tags Archive Pages Ads Place" msgstr "Рекламное место страницы архивов меток" -#: zone.editor.admin.class.php:510 +#: ../zone.editor.admin.class.php:521 msgid "Default Ads Place for Author Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов авторов" -#: zone.editor.admin.class.php:519 +#: ../zone.editor.admin.class.php:530 msgid "Ads Place for author" msgstr "Рекламное место для автора" -#: zone.editor.admin.class.php:528 +#: ../zone.editor.admin.class.php:539 msgid "Date Archive Pages Ads Place" msgstr "Рекламное место страницы архивов дат" -#: zone.editor.admin.class.php:535 +#: ../zone.editor.admin.class.php:546 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." @@ -2712,81 +2801,81 @@ msgstr "" "архивных страниц являются рекламными местами по умолчанию для " "соответствующих страниц нижнего уровня." -#: zone.list.admin.class.php:56 +#: ../zone.list.admin.class.php:56 msgid "Managing Ads Zones" msgstr "Управление рекламными зонами" -#: zone.list.admin.class.php:72 zone.list.admin.class.php:146 +#: ../zone.list.admin.class.php:72 ../zone.list.admin.class.php:146 msgid "Add New Zone" msgstr "Добавить новую зону" -#: zone.list.admin.class.php:89 zone.list.admin.class.php:95 +#: ../zone.list.admin.class.php:89 ../zone.list.admin.class.php:95 msgid "Zone Name" msgstr "Имя зоны" -#: zone.list.admin.class.php:123 +#: ../zone.list.admin.class.php:123 msgid "Edit Zone" msgstr "Изменить зону" -#: zone.list.admin.class.php:127 +#: ../zone.list.admin.class.php:127 msgid "Restore this Zone from the Trash" msgstr "Восстановить эту зону из корзины" -#: zone.list.admin.class.php:128 +#: ../zone.list.admin.class.php:128 msgid "Remove this Zone permanently" msgstr "Удалить эту зону навсегда" -#: zone.list.admin.class.php:133 +#: ../zone.list.admin.class.php:133 msgid "Move this Zone to the Trash" msgstr "Поместить эту зону в корзину" -#: js/dialog-ad.php:27 +#: ../js/dialog-ad.php:27 msgid "Insert Single Ad" msgstr "Вставить рекламное объявление" -#: js/dialog-ad.php:41 js/dialog-block.php:41 js/dialog-zone.php:41 -#: js/dialog.php:41 +#: ../js/dialog-ad.php:41 ../js/dialog-block.php:41 ../js/dialog-zone.php:41 +#: ../js/dialog.php:41 msgid "Basic Settings" msgstr "Основные параметры" -#: js/dialog-ad.php:66 +#: ../js/dialog-ad.php:66 msgid "Single Ad ID" msgstr "ID объявления" -#: js/dialog-ad.php:69 +#: ../js/dialog-ad.php:69 msgid "Single Ad Name" msgstr "Имя объявления" -#: js/dialog-ad.php:79 js/dialog-zone.php:79 js/dialog.php:79 +#: ../js/dialog-ad.php:79 ../js/dialog-zone.php:79 ../js/dialog.php:79 msgid "Allow Ads Places predefined codes" msgstr "Использовать заданные коды рекламного места" -#: js/dialog-ad.php:92 js/dialog-block.php:82 js/dialog-zone.php:92 -#: js/dialog.php:92 +#: ../js/dialog-ad.php:92 ../js/dialog-block.php:82 ../js/dialog-zone.php:92 +#: ../js/dialog.php:92 msgid "Insert" msgstr "Вставить" -#: js/dialog-block.php:27 +#: ../js/dialog-block.php:27 msgid "Insert Ads Block" msgstr "Вставить блок объявлений" -#: js/dialog-block.php:69 +#: ../js/dialog-block.php:69 msgid "Ads Block Name" msgstr "Имя блока" -#: js/dialog-zone.php:27 +#: ../js/dialog-zone.php:27 msgid "Insert Ads Zone" msgstr "Вставить рекламную зону" -#: js/dialog-zone.php:69 +#: ../js/dialog-zone.php:69 msgid "Ads Zone Name" msgstr "Имя зоны" -#: js/dialog.php:27 +#: ../js/dialog.php:27 msgid "Insert Ads Place" msgstr "Вставить рекламное место" -#: js/dialog.php:69 +#: ../js/dialog.php:69 msgid "Ads Place Name" msgstr "Имя места" diff --git a/sam-ajax-loader.php b/sam-ajax-loader.php new file mode 100644 index 0000000..37ae68a --- /dev/null +++ b/sam-ajax-loader.php @@ -0,0 +1,59 @@ +prefix . 'options'; +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +//Typical headers +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_POST['action']) ? 'sam_ajax_' . stripslashes($_POST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_place', + 'sam_ajax_load_zone' +); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_place': + if(isset($_POST['id']) && isset($_POST['wc'])) { + $placeId = $_POST['id']; + $clauses = unserialize(base64_decode($_POST['wc'])); + include_once('ad.class.php'); + $ad = new SamAdPlace($args, false, false, $clauses, true); + wp_send_json_success(array('ad' => $ad->ad)); + } + break; + } +} +else wp_send_json_error(array('error' => 'Not allowed action')); \ No newline at end of file diff --git a/sam.class.php b/sam.class.php index 6c7cf47..6e4d473 100644 --- a/sam.class.php +++ b/sam.class.php @@ -9,6 +9,7 @@ class SimpleAdsManager { private $defaultSettings = array( 'adCycle' => 1000, + 'adShow' => 'php', // php|js 'adDisplay' => 'blank', 'placesPerPage' => 10, 'itemsPerPage' => 10, From 861d630e3e20ff6e10916491120f2f0ba658a4cd Mon Sep 17 00:00:00 2001 From: minimus Date: Tue, 12 Nov 2013 16:06:02 +0300 Subject: [PATCH 05/18] Language .pot file is upgraded --- lang/simple-ads-manager.pot | 2981 +++++++++++++++++++++-------------- 1 file changed, 1766 insertions(+), 1215 deletions(-) diff --git a/lang/simple-ads-manager.pot b/lang/simple-ads-manager.pot index 97eb319..3fdb074 100644 --- a/lang/simple-ads-manager.pot +++ b/lang/simple-ads-manager.pot @@ -2,2070 +2,2621 @@ # This file is distributed under the same license as the Simple Ads Manager package. msgid "" msgstr "" -"Project-Id-Version: Simple Ads Manager 1.0.32\n" +"Project-Id-Version: Simple Ads Manager 1.8.70\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-ads-manager\n" -"POT-Creation-Date: 2011-07-18 20:33:15+00:00\n" +"POT-Creation-Date: 2013-11-12 16:01+0300\n" +"PO-Revision-Date: 2013-11-12 16:02+0300\n" +"Last-Translator: minimus \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"X-Generator: Poedit 1.5.7\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" +"_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" -#: zone.list.admin.class.php:48 block.list.admin.class.php:48 -#: list.admin.class.php:129 list.admin.class.php:308 -msgid "«" +#: ../ad.class.php:78 ../ad.class.php:338 +msgid "Flash ad" msgstr "" -#: zone.list.admin.class.php:49 block.list.admin.class.php:49 -#: list.admin.class.php:130 list.admin.class.php:309 -msgid "»" +#: ../ad.class.php:188 +msgid "Empty data..." msgstr "" -#: zone.list.admin.class.php:56 -msgid "Managing Ads Zones" +#: ../admin.class.php:173 +msgid "General Settings" msgstr "" -#: zone.list.admin.class.php:58 block.list.admin.class.php:58 -#: list.admin.class.php:139 list.admin.class.php:318 -msgid "All" +#: ../admin.class.php:174 +msgid "Auto Inserting Settings" msgstr "" -#: zone.list.admin.class.php:59 block.list.admin.class.php:59 -#: list.admin.class.php:140 list.admin.class.php:319 -msgid "Active" +#: ../admin.class.php:175 +msgid "Extended Options" msgstr "" -#: zone.list.admin.class.php:60 block.list.admin.class.php:60 -#: list.admin.class.php:141 list.admin.class.php:320 -msgid "Trash" +#: ../admin.class.php:176 +msgid "Google DFP Settings" msgstr "" -#: zone.list.admin.class.php:65 zone.list.admin.class.php:140 -#: block.list.admin.class.php:65 block.list.admin.class.php:140 -#: list.admin.class.php:146 list.admin.class.php:267 list.admin.class.php:326 -#: list.admin.class.php:461 -msgid "Clear Trash" +#: ../admin.class.php:177 ../help.class.php:68 ../help.class.php:195 +msgid "Statistics Settings" msgstr "" -#: zone.list.admin.class.php:67 zone.list.admin.class.php:142 -msgid "Add New Zone" +#: ../admin.class.php:178 +msgid "Admin Layout" msgstr "" -#: zone.list.admin.class.php:71 zone.list.admin.class.php:146 -#: block.list.admin.class.php:71 block.list.admin.class.php:146 -#: list.admin.class.php:155 list.admin.class.php:276 list.admin.class.php:336 -#: list.admin.class.php:470 -msgid "Displaying %s–%s of %s" +#: ../admin.class.php:179 +msgid "Plugin Deactivating" msgstr "" -#: zone.list.admin.class.php:83 zone.list.admin.class.php:89 -#: block.list.admin.class.php:83 block.list.admin.class.php:89 -#: list.admin.class.php:167 list.admin.class.php:178 list.admin.class.php:350 -#: list.admin.class.php:360 -msgid "ID" +#: ../admin.class.php:181 +msgid "Views per Cycle" msgstr "" -#: zone.list.admin.class.php:84 zone.list.admin.class.php:90 -msgid "Zone Name" +#: ../admin.class.php:181 +msgid "" +"Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" -#: zone.list.admin.class.php:109 block.list.admin.class.php:109 -#: list.admin.class.php:212 list.admin.class.php:410 -msgid "There are no data ..." +#: ../admin.class.php:182 +msgid "Minimum Level for access to menu" msgstr "" -#: zone.list.admin.class.php:117 block.list.admin.class.php:117 -#: list.admin.class.php:237 list.admin.class.php:438 -msgid "in Trash" +#: ../admin.class.php:182 +msgid "" +"Who can use menu of plugin - Minimum User Level needed for access to menu of " +"plugin. In any case only Super Admin and Administrator can use Settings Menu " +"of SAM Plugin." msgstr "" -#: zone.list.admin.class.php:119 block.list.admin.class.php:119 -msgid "Edit Zone" +#: ../admin.class.php:182 ../admin.class.php:403 ../admin.class.php:585 +msgid "Super Admin" msgstr "" -#: zone.list.admin.class.php:119 block.list.admin.class.php:119 -#: list.admin.class.php:239 list.admin.class.php:440 -msgid "Edit" +#: ../admin.class.php:182 ../admin.class.php:404 ../admin.class.php:584 +msgid "Administrator" msgstr "" -#: zone.list.admin.class.php:123 -msgid "Restore this Zone from the Trash" +#: ../admin.class.php:182 ../admin.class.php:405 ../admin.class.php:583 +msgid "Editor" msgstr "" -#: zone.list.admin.class.php:123 block.list.admin.class.php:123 -#: list.admin.class.php:243 list.admin.class.php:444 -msgid "Restore" +#: ../admin.class.php:182 ../admin.class.php:406 ../admin.class.php:582 +msgid "Author" msgstr "" -#: zone.list.admin.class.php:124 -msgid "Remove this Zone permanently" +#: ../admin.class.php:182 ../admin.class.php:407 ../admin.class.php:581 +msgid "Contributor" msgstr "" -#: zone.list.admin.class.php:124 block.list.admin.class.php:124 -#: list.admin.class.php:244 list.admin.class.php:445 -msgid "Remove permanently" +#: ../admin.class.php:183 +msgid "Ad Output Mode" msgstr "" -#: zone.list.admin.class.php:129 -msgid "Move this Zone to the Trash" +#: ../admin.class.php:183 +msgid "" +"Standard (PHP) mode is more faster but is not compatible with caching " +"plugins. If your blog use caching plugin (i.e WP Super Cache or Hyper Cache) " +"select \"Caching Compatible (Javascript)\" mode." msgstr "" -#: zone.list.admin.class.php:129 block.list.admin.class.php:129 -#: list.admin.class.php:249 list.admin.class.php:446 -msgid "Delete" +#: ../admin.class.php:183 +msgid "Standard (PHP)" msgstr "" -#: block.list.admin.class.php:56 -msgid "Managing Ads Blocks" +#: ../admin.class.php:183 +msgid "Caching Compatible (Javascript)" msgstr "" -#: block.list.admin.class.php:67 block.list.admin.class.php:142 -msgid "Add New Block" +#: ../admin.class.php:184 +msgid "Display Ad Source in" msgstr "" -#: block.list.admin.class.php:84 block.list.admin.class.php:90 -msgid "Block Name" +#: ../admin.class.php:184 +msgid "Target wintow (tab) for advetisement source." msgstr "" -#: block.list.admin.class.php:123 -msgid "Restore this Block from the Trash" +#: ../admin.class.php:184 +msgid "New Window (Tab)" msgstr "" -#: block.list.admin.class.php:124 -msgid "Remove this Block permanently" +#: ../admin.class.php:184 +msgid "Current Window (Tab)" msgstr "" -#: block.list.admin.class.php:129 -msgid "Move this Block to the Trash" +#: ../admin.class.php:186 +msgid "Ads Place before content" msgstr "" -#: list.admin.class.php:23 editor.admin.class.php:71 -#: editor.admin.class.php:191 -msgid "Custom sizes" +#: ../admin.class.php:187 +msgid "Allow Ads Place auto inserting before post/page content" msgstr "" -#: list.admin.class.php:26 editor.admin.class.php:74 -#: editor.admin.class.php:135 -msgid "Large Leaderboard" +#: ../admin.class.php:188 ../admin.class.php:191 ../admin.class.php:194 +msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" -#: list.admin.class.php:27 editor.admin.class.php:75 -#: editor.admin.class.php:136 -msgid "Leaderboard" +#: ../admin.class.php:189 +msgid "Ads Place in the middle of content" msgstr "" -#: list.admin.class.php:28 list.admin.class.php:30 list.admin.class.php:31 -#: editor.admin.class.php:76 editor.admin.class.php:78 -#: editor.admin.class.php:79 editor.admin.class.php:137 -#: editor.admin.class.php:139 editor.admin.class.php:140 -msgid "Small Leaderboard" +#: ../admin.class.php:190 +msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" -#: list.admin.class.php:29 editor.admin.class.php:77 -#: editor.admin.class.php:138 -msgid "Mega Unit" +#: ../admin.class.php:192 +msgid "Ads Place after content" msgstr "" -#: list.admin.class.php:32 list.admin.class.php:33 list.admin.class.php:34 -#: list.admin.class.php:36 list.admin.class.php:37 list.admin.class.php:38 -#: editor.admin.class.php:80 editor.admin.class.php:81 -#: editor.admin.class.php:82 editor.admin.class.php:84 -#: editor.admin.class.php:85 editor.admin.class.php:86 -#: editor.admin.class.php:141 editor.admin.class.php:142 -#: editor.admin.class.php:143 editor.admin.class.php:145 -#: editor.admin.class.php:146 editor.admin.class.php:147 -msgid "Tall Banner" +#: ../admin.class.php:193 +msgid "Allow Ads Place auto inserting after post/page content" msgstr "" -#: list.admin.class.php:35 editor.admin.class.php:83 -#: editor.admin.class.php:144 -msgid "Banner" +#: ../admin.class.php:196 +msgid "" +"I use (plan to use) my own flash (SWF) banners. In other words, allow " +"loading the script \"SWFObject\" on the pages of the blog." msgstr "" -#: list.admin.class.php:39 list.admin.class.php:41 list.admin.class.php:71 -#: list.admin.class.php:72 editor.admin.class.php:87 editor.admin.class.php:89 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:148 editor.admin.class.php:150 -#: editor.admin.class.php:184 editor.admin.class.php:185 -msgid "Half Banner" +#: ../admin.class.php:197 +msgid "Turn on/off the error log." msgstr "" -#: list.admin.class.php:40 list.admin.class.php:69 list.admin.class.php:70 -#: editor.admin.class.php:88 editor.admin.class.php:117 -#: editor.admin.class.php:118 editor.admin.class.php:149 -#: editor.admin.class.php:182 editor.admin.class.php:183 -msgid "Tall Half Banner" +#: ../admin.class.php:198 +msgid "Turn on/off the error log for Face Side." msgstr "" -#: list.admin.class.php:42 list.admin.class.php:43 list.admin.class.php:68 -#: list.admin.class.php:75 list.admin.class.php:76 editor.admin.class.php:90 -#: editor.admin.class.php:91 editor.admin.class.php:116 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:151 editor.admin.class.php:152 -#: editor.admin.class.php:181 editor.admin.class.php:188 -#: editor.admin.class.php:189 -msgid "Button" +#: ../admin.class.php:200 +msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "" -#: list.admin.class.php:44 editor.admin.class.php:92 -#: editor.admin.class.php:153 -msgid "Micro Bar" +#: ../admin.class.php:201 +msgid "Google DFP Pub Code" msgstr "" -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -msgid "Thin Banner" +#: ../admin.class.php:201 +msgid "Your Google DFP Pub code. i.e:" msgstr "" -#: list.admin.class.php:45 list.admin.class.php:46 list.admin.class.php:47 -#: list.admin.class.php:48 list.admin.class.php:69 list.admin.class.php:70 -#: list.admin.class.php:71 list.admin.class.php:72 list.admin.class.php:73 -#: list.admin.class.php:74 list.admin.class.php:75 list.admin.class.php:76 -#: editor.admin.class.php:93 editor.admin.class.php:94 -#: editor.admin.class.php:95 editor.admin.class.php:96 -#: editor.admin.class.php:117 editor.admin.class.php:118 -#: editor.admin.class.php:119 editor.admin.class.php:120 -#: editor.admin.class.php:121 editor.admin.class.php:122 -#: editor.admin.class.php:123 editor.admin.class.php:124 -#: editor.admin.class.php:154 editor.admin.class.php:155 -#: editor.admin.class.php:156 editor.admin.class.php:157 -#: editor.admin.class.php:182 editor.admin.class.php:183 -#: editor.admin.class.php:184 editor.admin.class.php:185 -#: editor.admin.class.php:186 editor.admin.class.php:187 -#: editor.admin.class.php:188 editor.admin.class.php:189 -msgid "%d Link" -msgid_plural "%d Links" -msgstr[0] "" -msgstr[1] "" - -#: list.admin.class.php:49 editor.admin.class.php:97 -#: editor.admin.class.php:160 -msgid "Wide Skyscraper" +#: ../admin.class.php:203 +msgid "Allow Bots and Crawlers detection" msgstr "" -#: list.admin.class.php:50 editor.admin.class.php:98 -#: editor.admin.class.php:161 -msgid "Skyscraper" +#: ../admin.class.php:204 +msgid "Accuracy of Bots and Crawlers Detection" msgstr "" -#: list.admin.class.php:51 editor.admin.class.php:99 -#: editor.admin.class.php:162 -msgid "Wide Half Banner" +#: ../admin.class.php:204 +msgid "" +"If bot is detected hits of ads won't be counted. Use with caution! More " +"exact detection requires more server resources." msgstr "" -#: list.admin.class.php:52 editor.admin.class.php:100 -#: editor.admin.class.php:163 -msgid "Vertical Rectangle" +#: ../admin.class.php:204 +msgid "Inexact detection" msgstr "" -#: list.admin.class.php:53 list.admin.class.php:54 editor.admin.class.php:101 -#: editor.admin.class.php:102 editor.admin.class.php:164 -#: editor.admin.class.php:165 -msgid "Tall Rectangle" +#: ../admin.class.php:204 +msgid "Exact detection" msgstr "" -#: list.admin.class.php:55 editor.admin.class.php:103 -#: editor.admin.class.php:166 -msgid "Vertical Banner" +#: ../admin.class.php:204 +msgid "More exact detection" msgstr "" -#: list.admin.class.php:56 editor.admin.class.php:104 -#: editor.admin.class.php:169 -msgid "Large Rectangle" +#: ../admin.class.php:205 ../help.class.php:70 ../help.class.php:197 +msgid "Display of Currency" msgstr "" -#: list.admin.class.php:57 list.admin.class.php:58 editor.admin.class.php:105 -#: editor.admin.class.php:106 editor.admin.class.php:170 -#: editor.admin.class.php:171 -msgid "Wide Rectangle" +#: ../admin.class.php:205 ../help.class.php:70 ../help.class.php:197 +msgid "" +"Define display of currency. Auto - auto detection of currency from blog " +"settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." msgstr "" -#: list.admin.class.php:59 editor.admin.class.php:107 -#: editor.admin.class.php:172 -msgid "Medium Rectangle" +#: ../admin.class.php:205 +msgid "Auto" msgstr "" -#: list.admin.class.php:60 list.admin.class.php:61 editor.admin.class.php:108 -#: editor.admin.class.php:109 editor.admin.class.php:173 -#: editor.admin.class.php:174 -msgid "Small Wide Rectangle" +#: ../admin.class.php:205 +msgid "USD" msgstr "" -#: list.admin.class.php:62 editor.admin.class.php:110 -#: editor.admin.class.php:175 -msgid "Mini Wide Rectangle" +#: ../admin.class.php:205 +msgid "EUR" msgstr "" -#: list.admin.class.php:63 editor.admin.class.php:111 -#: editor.admin.class.php:176 editor.admin.class.php:196 -msgid "Square" +#: ../admin.class.php:207 +msgid "TinyMCE Editor Button Mode" msgstr "" -#: list.admin.class.php:64 list.admin.class.php:67 editor.admin.class.php:112 -#: editor.admin.class.php:115 editor.admin.class.php:177 -#: editor.admin.class.php:180 -msgid "Small Square" +#: ../admin.class.php:207 +msgid "" +"If you do not want to use the modern dropdown button in your TinyMCE editor, " +"or use of this button causes a problem, you can use classic TinyMCE buttons. " +"In this case select \"Classic TinyMCE Buttons\"." msgstr "" -#: list.admin.class.php:65 list.admin.class.php:66 editor.admin.class.php:113 -#: editor.admin.class.php:114 editor.admin.class.php:178 -#: editor.admin.class.php:179 -msgid "Small Rectangle" +#: ../admin.class.php:207 +msgid "Modern TinyMCE Button" msgstr "" -#: list.admin.class.php:73 list.admin.class.php:74 editor.admin.class.php:121 -#: editor.admin.class.php:122 editor.admin.class.php:186 -#: editor.admin.class.php:187 -msgid "Tall Button" +#: ../admin.class.php:207 +msgid "Classic TinyMCE Buttons" msgstr "" -#: list.admin.class.php:137 -msgid "Managing Ads Places" +#: ../admin.class.php:208 +msgid "Ads Places per Page" msgstr "" -#: list.admin.class.php:148 list.admin.class.php:269 -msgid "Add New Place" +#: ../admin.class.php:208 +msgid "" +"Ads Places Management grid pagination. How many Ads Places will be shown on " +"one page of grid." msgstr "" -#: list.admin.class.php:152 list.admin.class.php:273 -msgid "Reset Statistics" +#: ../admin.class.php:209 +msgid "Ads per Page" msgstr "" -#: list.admin.class.php:168 list.admin.class.php:179 -msgid "Place Name" +#: ../admin.class.php:209 +msgid "" +"Ads of Ads Place Management grid pagination. How many Ads will be shown on " +"one page of grid." msgstr "" -#: list.admin.class.php:169 list.admin.class.php:180 -#: editor.admin.class.php:345 editor.admin.class.php:760 -msgid "Size" +#: ../admin.class.php:211 +msgid "Delete plugin options during deactivating plugin" msgstr "" -#: list.admin.class.php:170 list.admin.class.php:181 list.admin.class.php:230 -#: list.admin.class.php:353 list.admin.class.php:363 list.admin.class.php:431 -#: editor.admin.class.php:754 -msgid "Hits" +#: ../admin.class.php:212 +msgid "Delete database tables of plugin during deactivating plugin" msgstr "" -#: list.admin.class.php:171 list.admin.class.php:182 -msgid "Total Hits" +#: ../admin.class.php:213 +msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" -#: list.admin.class.php:172 list.admin.class.php:183 -msgid "Total Ads" +#: ../admin.class.php:221 +msgid "Ads" msgstr "" -#: list.admin.class.php:173 list.admin.class.php:184 list.admin.class.php:355 -#: list.admin.class.php:365 -msgid "Earnings" +#: ../admin.class.php:222 +msgid "Ads List" msgstr "" -#: list.admin.class.php:229 list.admin.class.php:430 -msgid "Placement" +#: ../admin.class.php:222 +msgid "Ads Places" msgstr "" -#: list.admin.class.php:231 list.admin.class.php:354 list.admin.class.php:364 -#: list.admin.class.php:432 editor.admin.class.php:756 -msgid "Clicks" +#: ../admin.class.php:224 +msgid "Ad Editor" msgstr "" -#: list.admin.class.php:232 list.admin.class.php:433 -msgid "Total" +#: ../admin.class.php:224 +msgid "New Place" msgstr "" -#: list.admin.class.php:232 list.admin.class.php:433 -msgid "N/A" +#: ../admin.class.php:227 +msgid "Ads Zones List" msgstr "" -#: list.admin.class.php:239 -msgid "Edit Place" +#: ../admin.class.php:227 +msgid "Ads Zones" msgstr "" -#: list.admin.class.php:243 -msgid "Restore this Place from the Trash" +#: ../admin.class.php:229 +msgid "Ads Zone Editor" msgstr "" -#: list.admin.class.php:244 -msgid "Remove this Place permanently" +#: ../admin.class.php:229 +msgid "New Zone" msgstr "" -#: list.admin.class.php:249 -msgid "Move this Place to the Trash" +#: ../admin.class.php:232 +msgid "Ads Blocks List" msgstr "" -#: list.admin.class.php:250 -msgid "View List of Place Ads" +#: ../admin.class.php:232 +msgid "Ads Blocks" msgstr "" -#: list.admin.class.php:250 -msgid "View Ads" +#: ../admin.class.php:234 ../block.editor.admin.class.php:402 +msgid "Ads Block Editor" msgstr "" -#: list.admin.class.php:251 -msgid "Create New Ad" +#: ../admin.class.php:234 +msgid "New Block" msgstr "" -#: list.admin.class.php:251 -msgid "New Ad" +#: ../admin.class.php:237 ../admin.class.php:935 +msgid "Simple Ads Manager Settings" msgstr "" -#: list.admin.class.php:316 -msgid "Managing Items of Ads Place" +#: ../admin.class.php:237 +msgid "Settings" msgstr "" -#: list.admin.class.php:328 list.admin.class.php:463 -msgid "Add New Ad" +#: ../admin.class.php:240 +msgid "Simple Ads Manager Error Log" msgstr "" -#: list.admin.class.php:332 list.admin.class.php:467 -msgid "Back to Ads Places Management" +#: ../admin.class.php:240 ../errorlog.admin.class.php:57 +msgid "Error Log" msgstr "" -#: list.admin.class.php:351 list.admin.class.php:361 -msgid "Advertisement" +#: ../admin.class.php:337 ../editor.admin.class.php:399 +msgid "Name of Ads Place" msgstr "" -#: list.admin.class.php:352 list.admin.class.php:362 -#: editor.admin.class.php:752 -msgid "Activity" +#: ../admin.class.php:337 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." msgstr "" -#: list.admin.class.php:424 -msgid "Yes" +#: ../admin.class.php:338 ../editor.admin.class.php:896 +msgid "Name of Ad" msgstr "" -#: list.admin.class.php:425 -msgid "No" +#: ../admin.class.php:338 ../admin.class.php:357 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use Ads Blocks or plugin's widgets." msgstr "" -#: list.admin.class.php:440 -msgid "Edit this Item of Ads Place" +#: ../admin.class.php:357 ../zone.editor.admin.class.php:352 +msgid "Name of Ads Zone" msgstr "" -#: list.admin.class.php:444 -msgid "Restore this Ad from the Trash" +#: ../admin.class.php:358 ../block.editor.admin.class.php:309 +msgid "Name of Ads Block" msgstr "" -#: list.admin.class.php:445 -msgid "Remove this Ad permanently" +#: ../admin.class.php:358 +msgid "" +"This is not required parameter. But it is strongly recommended to define it " +"if you plan to use plugin's widgets." msgstr "" -#: list.admin.class.php:446 -msgid "Move this item to the Trash" +#: ../admin.class.php:375 +msgid "Error ID" msgstr "" -#: admin.class.php:347 -msgid "General Settings" +#: ../admin.class.php:376 +msgid "Error Date" msgstr "" -#: admin.class.php:348 -msgid "Auto Inserting Settings" +#: ../admin.class.php:377 ../errorlog.admin.class.php:86 +#: ../errorlog.admin.class.php:96 +msgid "Table" msgstr "" -#: admin.class.php:349 -msgid "Google DFP Settings" +#: ../admin.class.php:378 +msgid "Error Message" msgstr "" -#: admin.class.php:350 admin.class.php:458 -msgid "Statistics Settings" +#: ../admin.class.php:379 +msgid "Error SQL" msgstr "" -#: admin.class.php:351 -msgid "Admin Layout" +#: ../admin.class.php:380 ../errorlog.admin.class.php:87 +#: ../errorlog.admin.class.php:97 +msgid "Type" msgstr "" -#: admin.class.php:352 -msgid "Plugin Deactivating" +#: ../admin.class.php:381 +msgid "Close" msgstr "" -#: admin.class.php:354 -msgid "Views per Cycle" +#: ../admin.class.php:383 ../errorlog.admin.class.php:116 +#: ../errorlog.admin.class.php:132 +msgid "Warning" msgstr "" -#: admin.class.php:354 -msgid "" -"Number of hits of one ad for a full cycle of rotation (maximal activity)." +#: ../admin.class.php:383 ../errorlog.admin.class.php:136 +msgid "Ok" msgstr "" -#: admin.class.php:355 -msgid "Display Ad Source in" +#: ../admin.class.php:580 +msgid "Subscriber" msgstr "" -#: admin.class.php:355 -msgid "Target wintow (tab) for advetisement source." +#: ../admin.class.php:650 +msgid "Post" msgstr "" -#: admin.class.php:355 -msgid "New Window (Tab)" +#: ../admin.class.php:653 ../editor.admin.class.php:1058 +msgid "Page" msgstr "" -#: admin.class.php:355 -msgid "Current Window (Tab)" +#: ../admin.class.php:656 +msgid "Post:" msgstr "" -#: admin.class.php:357 -msgid "Ads Place before content" +#: ../admin.class.php:664 +msgid "Uploading" msgstr "" -#: admin.class.php:358 -msgid "Allow Ads Place auto inserting before post/page content" +#: ../admin.class.php:665 +msgid "Uploaded." msgstr "" -#: admin.class.php:359 admin.class.php:362 -msgid "Allow using predefined Ads Place HTML codes (before and after codes)" +#: ../admin.class.php:666 +msgid "Only JPG, PNG or GIF files are allowed" msgstr "" -#: admin.class.php:360 -msgid "Ads Place after content" +#: ../admin.class.php:667 +msgid "File" msgstr "" -#: admin.class.php:361 -msgid "Allow Ads Place auto inserting after post/page content" +#: ../admin.class.php:673 +msgid "Category Title" msgstr "" -#: admin.class.php:364 -msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" +#: ../admin.class.php:674 +msgid "Category Slug" msgstr "" -#: admin.class.php:365 -msgid "Google DFP Pub Code" +#: ../admin.class.php:681 ../admin.class.php:718 +msgid "Display Name" msgstr "" -#: admin.class.php:365 -msgid "Your Google DFP Pub code. i.e:" +#: ../admin.class.php:682 ../admin.class.php:719 +msgid "User Name" msgstr "" -#: admin.class.php:367 -msgid "Allow Bots and Crawlers detection" +#: ../admin.class.php:689 +msgid "Tag Title" msgstr "" -#: admin.class.php:368 -msgid "Accuracy of Bots and Crawlers Detection" +#: ../admin.class.php:690 +msgid "Tag Slug" msgstr "" -#: admin.class.php:368 -msgid "" -"If bot is detected hits of ads won't be counted. Use with caution! More " -"exact detection requires more server resources." +#: ../admin.class.php:696 +msgid "Custom Type Title" msgstr "" -#: admin.class.php:368 -msgid "Inexact detection" +#: ../admin.class.php:697 +msgid "Custom Type Slug" msgstr "" -#: admin.class.php:368 -msgid "Exact detection" +#: ../admin.class.php:704 +msgid "Publication Title" msgstr "" -#: admin.class.php:368 -msgid "More exact detection" +#: ../admin.class.php:705 +msgid "Publication Type" msgstr "" -#: admin.class.php:369 admin.class.php:460 -msgid "Display of Currency" +#: ../admin.class.php:712 ../editor.admin.class.php:1404 +msgid "Advertiser Name" msgstr "" -#: admin.class.php:369 admin.class.php:460 -msgid "" -"Define display of currency. Auto - auto detection of currency from blog " -"settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." +#: ../admin.class.php:713 +msgid "Advertiser Nick" msgstr "" -#: admin.class.php:369 -msgid "Auto" +#: ../admin.class.php:714 ../editor.admin.class.php:1408 +msgid "Advertiser e-mail" msgstr "" -#: admin.class.php:369 -msgid "USD" +#: ../admin.class.php:720 +msgid "Role" msgstr "" -#: admin.class.php:369 -msgid "EUR" +#: ../admin.class.php:727 ../block.list.admin.class.php:88 +#: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:172 +#: ../list.admin.class.php:183 ../list.admin.class.php:359 +#: ../list.admin.class.php:369 ../zone.list.admin.class.php:88 +#: ../zone.list.admin.class.php:94 +msgid "ID" msgstr "" -#: admin.class.php:371 -msgid "Ads Places per Page" +#: ../admin.class.php:728 +msgid "Term Name" msgstr "" -#: admin.class.php:371 -msgid "" -"Ads Places Management grid pagination. How many Ads Places will be shown on " -"one page of grid." +#: ../admin.class.php:729 +msgid "Custom Taxonomy Name" msgstr "" -#: admin.class.php:372 -msgid "Ads per Page" +#: ../admin.class.php:802 +msgid "There are general options." msgstr "" -#: admin.class.php:372 +#: ../admin.class.php:806 msgid "" -"Ads of Ads Place Management grid pagination. How many Ads will be shown on " -"one page of grid." +"Single post/page auto inserting options. Use these parameters for allowing/" +"defining Ads Places which will be automatically inserted before/after post/" +"page content." msgstr "" -#: admin.class.php:374 -msgid "Delete plugin options during deactivating plugin" +#: ../admin.class.php:814 +msgid "Adjust parameters of your Google DFP account." msgstr "" -#: admin.class.php:375 -msgid "Delete database tables of plugin during deactivating plugin" +#: ../admin.class.php:818 +msgid "Adjust parameters of plugin statistics." msgstr "" -#: admin.class.php:376 -msgid "Delete custom images folder of plugin during deactivating plugin" +#: ../admin.class.php:822 +msgid "This options define layout for Ads Managin Pages." msgstr "" -#: admin.class.php:382 -msgid "Ads" +#: ../admin.class.php:826 +msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "" -#: admin.class.php:383 -msgid "Ads List" +#: ../admin.class.php:948 +msgid "Simple Ads Manager Settings Updated." msgstr "" -#: admin.class.php:383 -msgid "Ads Places" +#: ../admin.class.php:956 +msgid "System Info" msgstr "" -#: admin.class.php:385 -msgid "Ad Editor" +#: ../admin.class.php:963 +msgid "Wordpress Version" msgstr "" -#: admin.class.php:385 -msgid "New Place" +#: ../admin.class.php:964 +msgid "SAM Version" msgstr "" -#: admin.class.php:388 -msgid "Ads Zones List" +#: ../admin.class.php:965 +msgid "SAM DB Version" msgstr "" -#: admin.class.php:388 -msgid "Ads Zones" +#: ../admin.class.php:966 +msgid "PHP Version" msgstr "" -#: admin.class.php:390 -msgid "Ads Zone Editor" +#: ../admin.class.php:967 +msgid "MySQL Version" msgstr "" -#: admin.class.php:390 -msgid "New Zone" +#: ../admin.class.php:968 +msgid "Memory Limit" msgstr "" -#: admin.class.php:392 -msgid "Ads Blocks List" +#: ../admin.class.php:972 +msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" -#: admin.class.php:392 -msgid "Ads Blocks" +#: ../admin.class.php:977 +msgid "Resources" msgstr "" -#: admin.class.php:394 block.editor.admin.class.php:384 -msgid "Ads Block Editor" +#: ../admin.class.php:980 +msgid "Wordpress Plugin Page" msgstr "" -#: admin.class.php:394 -msgid "New Block" +#: ../admin.class.php:981 +msgid "Author Plugin Page" msgstr "" -#: admin.class.php:396 admin.class.php:762 -msgid "Simple Ads Manager Settings" +#: ../admin.class.php:982 ../help.class.php:34 ../help.class.php:51 +#: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 +#: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 +#: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 +#: ../help.class.php:199 +msgid "Support Forum" msgstr "" -#: admin.class.php:396 -msgid "Settings" +#: ../admin.class.php:983 +msgid "Author's Blog" msgstr "" -#: admin.class.php:404 -msgid "" -"Enter a name and a description of the " -"advertisement. These parameters are optional, because don’t influence " -"anything, but help in the visual identification of the ad (do not forget " -"which is which)." +#: ../admin.class.php:988 +msgid "Donations" msgstr "" -#: admin.class.php:405 +#: ../admin.class.php:992 +#, php-format msgid "" -"Ad Code – code can be defined as a combination of the image " -"URL and target page URL, or as HTML code, javascript code, or PHP code (for " -"PHP-code don’t forget to set the checkbox labeled \"This code of ad contains " -"PHP script\"). If you select the first option (image mode) you can keep " -"statistics of clicks and also tools for uploading/selecting the downloaded " -"image banner becomes available to you." +"If you have found this plugin useful, please consider making a %s to help " +"support future development. Your support will be much appreciated. Thank you!" +msgstr "" + +#: ../admin.class.php:993 ../admin.class.php:1000 +msgid "Donate Now!" +msgstr "" + +#: ../admin.class.php:993 +msgid "donation" +msgstr "" + +#: ../admin.class.php:997 ../admin.class.php:1010 +msgid "Donate via" +msgstr "" + +#: ../admin.class.php:1005 +#, php-format +msgid "" +"Warning! The default value of donation is %s. Don't worry! This is not my " +"appetite, this is default value defined by Payoneer service." +msgstr "" + +#: ../admin.class.php:1005 +msgid " You can change it to any value you want!" +msgstr "" + +#: ../admin.class.php:1022 +msgid "Another Plugins" +msgstr "" + +#: ../admin.class.php:1026 +#, php-format +msgid "Another plugins from %s" +msgstr "" + +#: ../admin.class.php:1032 +msgid "Highlights any portion of text as text in the colored boxes." +msgstr "" + +#: ../admin.class.php:1033 +msgid "" +"Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " +"your blog." +msgstr "" + +#: ../admin.class.php:1034 +msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." +msgstr "" + +#: ../admin.class.php:1035 +msgid "Adds copyright notice in the end of each post of your blog. " +msgstr "" + +#: ../admin.class.php:1051 +msgctxt "Copyright String" +msgid "Simple Ads Manager plugin for Wordpress." +msgstr "" + +#: ../admin.class.php:1051 +msgctxt "Copyright String" +msgid "All rights reserved." +msgstr "" + +#: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 +#: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 +#: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:335 +#: ../editor.admin.class.php:404 ../editor.admin.class.php:418 +#: ../editor.admin.class.php:439 ../editor.admin.class.php:516 +#: ../editor.admin.class.php:821 ../editor.admin.class.php:901 +#: ../editor.admin.class.php:923 ../editor.admin.class.php:1009 +#: ../editor.admin.class.php:1108 ../editor.admin.class.php:1151 +#: ../editor.admin.class.php:1396 ../editor.admin.class.php:1416 +#: ../editor.admin.class.php:1448 ../zone.editor.admin.class.php:296 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:371 +msgid "Click to toggle" +msgstr "" + +#: ../block.editor.admin.class.php:74 +msgid "Item" +msgstr "" + +#: ../block.editor.admin.class.php:77 ../help.class.php:125 +#: ../widget.class.php:15 ../js/dialog.php:48 +msgid "Ads Place" +msgstr "" + +#: ../block.editor.admin.class.php:79 ../block.editor.admin.class.php:92 +#: ../block.editor.admin.class.php:105 +msgid "Non selected" +msgstr "" + +#: ../block.editor.admin.class.php:90 ../widget.class.php:293 +msgid "Single Ad" +msgstr "" + +#: ../block.editor.admin.class.php:103 ../widget.class.php:149 +#: ../widget.class.php:154 ../js/dialog-zone.php:48 +msgid "Ads Zone" +msgstr "" + +#: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:266 +#: ../editor.admin.class.php:298 ../editor.admin.class.php:315 +#: ../editor.admin.class.php:316 ../editor.admin.class.php:317 +#: ../editor.admin.class.php:325 ../editor.admin.class.php:648 +#: ../editor.admin.class.php:738 ../editor.admin.class.php:802 +#: ../editor.admin.class.php:803 ../editor.admin.class.php:804 +#: ../zone.editor.admin.class.php:158 ../zone.editor.admin.class.php:253 +#: ../zone.editor.admin.class.php:286 +msgid "Undefined" +msgstr "" + +#: ../block.editor.admin.class.php:184 +msgid "Ads Block Data Updated." +msgstr "" + +#: ../block.editor.admin.class.php:243 +msgid "New Ads Block" +msgstr "" + +#: ../block.editor.admin.class.php:243 +msgid "Edit Ads Block" +msgstr "" + +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:336 +#: ../editor.admin.class.php:822 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:297 +msgid "Status" +msgstr "" + +#: ../block.editor.admin.class.php:263 +msgid "Back to Blocks List" +msgstr "" + +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:66 +msgid "Ads Block ID" +msgstr "" + +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:366 +#: ../zone.editor.admin.class.php:319 +msgid "Is Active" +msgstr "" + +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:367 +#: ../editor.admin.class.php:864 ../zone.editor.admin.class.php:320 +msgid "Is In Trash" +msgstr "" + +#: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 +#: ../editor.admin.class.php:374 ../editor.admin.class.php:379 +#: ../editor.admin.class.php:871 ../editor.admin.class.php:876 +#: ../zone.editor.admin.class.php:327 ../zone.editor.admin.class.php:333 +#: ../js/dialog-ad.php:89 ../js/dialog-block.php:79 ../js/dialog-zone.php:89 +#: ../js/dialog.php:89 +msgid "Cancel" +msgstr "" + +#: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 +#: ../editor.admin.class.php:383 ../editor.admin.class.php:385 +#: ../editor.admin.class.php:880 ../editor.admin.class.php:882 +#: ../zone.editor.admin.class.php:330 ../zone.editor.admin.class.php:337 +msgid "Save" +msgstr "" + +#: ../block.editor.admin.class.php:308 ../editor.admin.class.php:398 +#: ../zone.editor.admin.class.php:351 +msgid "Name" +msgstr "" + +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:352 +msgid "Required for SAM widgets." +msgstr "" + +#: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 +#: ../editor.admin.class.php:405 ../editor.admin.class.php:409 +#: ../editor.admin.class.php:905 ../zone.editor.admin.class.php:358 +#: ../zone.editor.admin.class.php:362 +msgid "Description" +msgstr "" + +#: ../block.editor.admin.class.php:317 ../block.editor.admin.class.php:404 +msgid "Enter description of this Ads Block." +msgstr "" + +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:412 +#: ../editor.admin.class.php:909 ../zone.editor.admin.class.php:365 +msgid "" +"This description is not used anywhere and is added solely for the " +"convenience of managing advertisements." +msgstr "" + +#: ../block.editor.admin.class.php:329 +msgid "Block Structure" +msgstr "" + +#: ../block.editor.admin.class.php:331 +msgid "Ads Block Structure Properties." +msgstr "" + +#: ../block.editor.admin.class.php:333 +msgid "Block Lines" +msgstr "" + +#: ../block.editor.admin.class.php:337 +msgid "Block Columns" +msgstr "" + +#: ../block.editor.admin.class.php:340 +msgid "" +"After changing these properties you must save Ads Block settings before " +"using Ads Block Editor." +msgstr "" + +#: ../block.editor.admin.class.php:347 +msgid "Block Styles" +msgstr "" + +#: ../block.editor.admin.class.php:349 +msgid "Configure Styles for this Ads Block." +msgstr "" + +#: ../block.editor.admin.class.php:351 ../block.editor.admin.class.php:377 +msgid "Margins" +msgstr "" + +#: ../block.editor.admin.class.php:355 ../block.editor.admin.class.php:381 +msgid "Padding" +msgstr "" + +#: ../block.editor.admin.class.php:359 ../block.editor.admin.class.php:385 +msgid "Background" +msgstr "" + +#: ../block.editor.admin.class.php:363 ../block.editor.admin.class.php:389 +msgid "Borders" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "Use Stylesheet rules for defining these properties." +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "For example:" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "for background property or" +msgstr "" + +#: ../block.editor.admin.class.php:366 ../block.editor.admin.class.php:392 +msgid "for border property" +msgstr "" + +#: ../block.editor.admin.class.php:373 +msgid "Block Items Styles" +msgstr "" + +#: ../block.editor.admin.class.php:375 +msgid "Configure Styles for this Ads Block Items." +msgstr "" + +#: ../block.editor.admin.class.php:393 +msgid "Important Note" +msgstr "" + +#: ../block.editor.admin.class.php:393 +msgid "" +"As the Ads Block is the regular structure, predefined styles of individual " +"items for drawing Ads Block's elements aren't used. Define styles for Ads " +"Block Items here!" +msgstr "" + +#: ../block.editor.admin.class.php:406 +msgid "Block Editor." +msgstr "" + +#: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 +#: ../list.admin.class.php:129 ../list.admin.class.php:312 +#: ../zone.list.admin.class.php:48 +msgid "«" +msgstr "" + +#: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../zone.list.admin.class.php:49 +msgid "»" +msgstr "" + +#: ../block.list.admin.class.php:56 +msgid "Managing Ads Blocks" +msgstr "" + +#: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 +#: ../list.admin.class.php:144 ../list.admin.class.php:327 +#: ../zone.list.admin.class.php:63 +msgid "All" +msgstr "" + +#: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../zone.list.admin.class.php:64 +msgid "Active" +msgstr "" + +#: ../block.list.admin.class.php:65 ../list.admin.class.php:146 +#: ../list.admin.class.php:329 ../zone.list.admin.class.php:65 +msgid "Trash" +msgstr "" + +#: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 +#: ../list.admin.class.php:151 ../list.admin.class.php:271 +#: ../list.admin.class.php:335 ../list.admin.class.php:469 +#: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 +msgid "Clear Trash" +msgstr "" + +#: ../block.list.admin.class.php:72 ../block.list.admin.class.php:146 +msgid "Add New Block" +msgstr "" + +#: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 +#: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:179 +#: ../list.admin.class.php:160 ../list.admin.class.php:280 +#: ../list.admin.class.php:345 ../list.admin.class.php:478 +#: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 +#, php-format +msgid "Displaying %s–%s of %s" +msgstr "" + +#: ../block.list.admin.class.php:89 ../block.list.admin.class.php:95 +msgid "Block Name" +msgstr "" + +#: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 +#: ../list.admin.class.php:216 ../list.admin.class.php:418 +#: ../zone.list.admin.class.php:113 +msgid "There are no data ..." +msgstr "" + +#: ../block.list.admin.class.php:121 ../list.admin.class.php:241 +#: ../list.admin.class.php:446 ../zone.list.admin.class.php:121 +msgid "in Trash" +msgstr "" + +#: ../block.list.admin.class.php:123 +msgid "Edit Block" +msgstr "" + +#: ../block.list.admin.class.php:123 ../list.admin.class.php:243 +#: ../list.admin.class.php:448 ../zone.list.admin.class.php:123 +msgid "Edit" +msgstr "" + +#: ../block.list.admin.class.php:127 ../errorlog.admin.class.php:151 +msgid "Restore this Block from the Trash" +msgstr "" + +#: ../block.list.admin.class.php:127 ../list.admin.class.php:247 +#: ../list.admin.class.php:452 ../zone.list.admin.class.php:127 +msgid "Restore" +msgstr "" + +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +msgid "Remove this Block permanently" +msgstr "" + +#: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 +#: ../list.admin.class.php:248 ../list.admin.class.php:453 +#: ../zone.list.admin.class.php:128 +msgid "Remove permanently" +msgstr "" + +#: ../block.list.admin.class.php:133 ../errorlog.admin.class.php:157 +msgid "Move this Block to the Trash" +msgstr "" + +#: ../block.list.admin.class.php:133 ../list.admin.class.php:253 +#: ../list.admin.class.php:454 ../zone.list.admin.class.php:133 +msgid "Delete" +msgstr "" + +#: ../editor.admin.class.php:71 ../editor.admin.class.php:191 +#: ../list.admin.class.php:23 +msgid "Custom sizes" +msgstr "" + +#: ../editor.admin.class.php:74 ../editor.admin.class.php:135 +#: ../list.admin.class.php:26 +msgid "Large Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:75 ../editor.admin.class.php:136 +#: ../list.admin.class.php:27 +msgid "Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:76 ../editor.admin.class.php:78 +#: ../editor.admin.class.php:79 ../editor.admin.class.php:137 +#: ../editor.admin.class.php:139 ../editor.admin.class.php:140 +#: ../list.admin.class.php:28 ../list.admin.class.php:30 +#: ../list.admin.class.php:31 +msgid "Small Leaderboard" +msgstr "" + +#: ../editor.admin.class.php:77 ../editor.admin.class.php:138 +#: ../list.admin.class.php:29 +msgid "Mega Unit" +msgstr "" + +#: ../editor.admin.class.php:80 ../editor.admin.class.php:81 +#: ../editor.admin.class.php:82 ../editor.admin.class.php:84 +#: ../editor.admin.class.php:85 ../editor.admin.class.php:86 +#: ../editor.admin.class.php:141 ../editor.admin.class.php:142 +#: ../editor.admin.class.php:143 ../editor.admin.class.php:145 +#: ../editor.admin.class.php:146 ../editor.admin.class.php:147 +#: ../list.admin.class.php:32 ../list.admin.class.php:33 +#: ../list.admin.class.php:34 ../list.admin.class.php:36 +#: ../list.admin.class.php:37 ../list.admin.class.php:38 +msgid "Tall Banner" +msgstr "" + +#: ../editor.admin.class.php:83 ../editor.admin.class.php:144 +#: ../list.admin.class.php:35 +msgid "Banner" +msgstr "" + +#: ../editor.admin.class.php:87 ../editor.admin.class.php:89 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:148 ../editor.admin.class.php:150 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../list.admin.class.php:39 ../list.admin.class.php:41 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +msgid "Half Banner" +msgstr "" + +#: ../editor.admin.class.php:88 ../editor.admin.class.php:117 +#: ../editor.admin.class.php:118 ../editor.admin.class.php:149 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../list.admin.class.php:40 ../list.admin.class.php:69 +#: ../list.admin.class.php:70 +msgid "Tall Half Banner" +msgstr "" + +#: ../editor.admin.class.php:90 ../editor.admin.class.php:91 +#: ../editor.admin.class.php:116 ../editor.admin.class.php:123 +#: ../editor.admin.class.php:124 ../editor.admin.class.php:151 +#: ../editor.admin.class.php:152 ../editor.admin.class.php:181 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:42 ../list.admin.class.php:43 +#: ../list.admin.class.php:68 ../list.admin.class.php:75 +#: ../list.admin.class.php:76 +msgid "Button" +msgstr "" + +#: ../editor.admin.class.php:92 ../editor.admin.class.php:153 +#: ../list.admin.class.php:44 +msgid "Micro Bar" +msgstr "" + +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +msgid "Thin Banner" +msgstr "" + +#: ../editor.admin.class.php:93 ../editor.admin.class.php:94 +#: ../editor.admin.class.php:95 ../editor.admin.class.php:96 +#: ../editor.admin.class.php:117 ../editor.admin.class.php:118 +#: ../editor.admin.class.php:119 ../editor.admin.class.php:120 +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:123 ../editor.admin.class.php:124 +#: ../editor.admin.class.php:154 ../editor.admin.class.php:155 +#: ../editor.admin.class.php:156 ../editor.admin.class.php:157 +#: ../editor.admin.class.php:182 ../editor.admin.class.php:183 +#: ../editor.admin.class.php:184 ../editor.admin.class.php:185 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../editor.admin.class.php:188 ../editor.admin.class.php:189 +#: ../list.admin.class.php:45 ../list.admin.class.php:46 +#: ../list.admin.class.php:47 ../list.admin.class.php:48 +#: ../list.admin.class.php:69 ../list.admin.class.php:70 +#: ../list.admin.class.php:71 ../list.admin.class.php:72 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +#: ../list.admin.class.php:75 ../list.admin.class.php:76 +#, php-format +msgid "%d Link" +msgid_plural "%d Links" +msgstr[0] "" +msgstr[1] "" + +#: ../editor.admin.class.php:97 ../editor.admin.class.php:160 +#: ../list.admin.class.php:49 +msgid "Wide Skyscraper" +msgstr "" + +#: ../editor.admin.class.php:98 ../editor.admin.class.php:161 +#: ../list.admin.class.php:50 +msgid "Skyscraper" +msgstr "" + +#: ../editor.admin.class.php:99 ../editor.admin.class.php:162 +#: ../list.admin.class.php:51 +msgid "Wide Half Banner" +msgstr "" + +#: ../editor.admin.class.php:100 ../editor.admin.class.php:163 +#: ../list.admin.class.php:52 +msgid "Vertical Rectangle" +msgstr "" + +#: ../editor.admin.class.php:101 ../editor.admin.class.php:102 +#: ../editor.admin.class.php:164 ../editor.admin.class.php:165 +#: ../list.admin.class.php:53 ../list.admin.class.php:54 +msgid "Tall Rectangle" +msgstr "" + +#: ../editor.admin.class.php:103 ../editor.admin.class.php:166 +#: ../list.admin.class.php:55 +msgid "Vertical Banner" +msgstr "" + +#: ../editor.admin.class.php:104 ../editor.admin.class.php:169 +#: ../list.admin.class.php:56 +msgid "Large Rectangle" +msgstr "" + +#: ../editor.admin.class.php:105 ../editor.admin.class.php:106 +#: ../editor.admin.class.php:170 ../editor.admin.class.php:171 +#: ../list.admin.class.php:57 ../list.admin.class.php:58 +msgid "Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:107 ../editor.admin.class.php:172 +#: ../list.admin.class.php:59 +msgid "Medium Rectangle" +msgstr "" + +#: ../editor.admin.class.php:108 ../editor.admin.class.php:109 +#: ../editor.admin.class.php:173 ../editor.admin.class.php:174 +#: ../list.admin.class.php:60 ../list.admin.class.php:61 +msgid "Small Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:110 ../editor.admin.class.php:175 +#: ../list.admin.class.php:62 +msgid "Mini Wide Rectangle" +msgstr "" + +#: ../editor.admin.class.php:111 ../editor.admin.class.php:176 +#: ../editor.admin.class.php:196 ../list.admin.class.php:63 +msgid "Square" +msgstr "" + +#: ../editor.admin.class.php:112 ../editor.admin.class.php:115 +#: ../editor.admin.class.php:177 ../editor.admin.class.php:180 +#: ../list.admin.class.php:64 ../list.admin.class.php:67 +msgid "Small Square" +msgstr "" + +#: ../editor.admin.class.php:113 ../editor.admin.class.php:114 +#: ../editor.admin.class.php:178 ../editor.admin.class.php:179 +#: ../list.admin.class.php:65 ../list.admin.class.php:66 +msgid "Small Rectangle" +msgstr "" + +#: ../editor.admin.class.php:121 ../editor.admin.class.php:122 +#: ../editor.admin.class.php:186 ../editor.admin.class.php:187 +#: ../list.admin.class.php:73 ../list.admin.class.php:74 +msgid "Tall Button" +msgstr "" + +#: ../editor.admin.class.php:194 +msgid "Horizontal" +msgstr "" + +#: ../editor.admin.class.php:195 +msgid "Vertical" +msgstr "" + +#: ../editor.admin.class.php:197 +msgid "Custom width and height" +msgstr "" + +#: ../editor.admin.class.php:279 +msgid "Ads Place Data Updated." +msgstr "" + +#: ../editor.admin.class.php:325 +msgid "New Ads Place" +msgstr "" + +#: ../editor.admin.class.php:325 +msgid "Edit Ads Place" +msgstr "" + +#: ../editor.admin.class.php:345 +msgid "Back to Places List" +msgstr "" + +#: ../editor.admin.class.php:352 ../js/dialog.php:66 +msgid "Ads Place ID" +msgstr "" + +#: ../editor.admin.class.php:358 ../editor.admin.class.php:853 +#: ../list.admin.class.php:174 ../list.admin.class.php:185 +msgid "Size" +msgstr "" + +#: ../editor.admin.class.php:360 ../editor.admin.class.php:855 +msgid "Width" +msgstr "" + +#: ../editor.admin.class.php:362 ../editor.admin.class.php:857 +msgid "Height" +msgstr "" + +#: ../editor.admin.class.php:399 +msgid "Required for SAM widgets and settings." +msgstr "" + +#: ../editor.admin.class.php:407 +msgid "Enter description of this Ads Place." +msgstr "" + +#: ../editor.admin.class.php:419 +msgid "Ads Place Size" +msgstr "" + +#: ../editor.admin.class.php:421 +msgid "Select size of this Ads Place." +msgstr "" + +#: ../editor.admin.class.php:426 +msgid "Custom Width" +msgstr "" + +#: ../editor.admin.class.php:430 +msgid "Custom Height" +msgstr "" + +#: ../editor.admin.class.php:433 +msgid "" +"These values are not used and are added solely for the convenience of " +"advertising management. Will be used in the future..." +msgstr "" + +#: ../editor.admin.class.php:440 +msgid "Ads Place Patch" +msgstr "" + +#: ../editor.admin.class.php:442 +msgid "" +"Select type of the code of a patch and fill data entry fields with the " +"appropriate data." +msgstr "" + +#: ../editor.admin.class.php:444 ../editor.admin.class.php:448 +msgid "Image" +msgstr "" + +#: ../editor.admin.class.php:452 +msgid "" +"This image is a patch for advertising space. This may be an image with the " +"text \"Place your ad here\"." +msgstr "" + +#: ../editor.admin.class.php:455 +msgid "Target" +msgstr "" + +#: ../editor.admin.class.php:459 +msgid "This is a link to a page where are your suggestions for advertisers." +msgstr "" + +#: ../editor.admin.class.php:462 ../editor.admin.class.php:974 +msgid "Image Tools" +msgstr "" + +#: ../editor.admin.class.php:464 ../editor.admin.class.php:976 +msgid "Select File" +msgstr "" + +#: ../editor.admin.class.php:468 ../editor.admin.class.php:980 +msgid "Apply" +msgstr "" + +#: ../editor.admin.class.php:469 ../editor.admin.class.php:981 +msgid "Select file from your blog server." +msgstr "" + +#: ../editor.admin.class.php:472 ../editor.admin.class.php:984 +msgid "Upload File" +msgstr "" + +#: ../editor.admin.class.php:473 ../editor.admin.class.php:985 +msgid "Upload" +msgstr "" + +#: ../editor.admin.class.php:476 ../editor.admin.class.php:988 +msgid "Select and upload file from your local computer." +msgstr "" + +#: ../editor.admin.class.php:482 +msgid "HTML or Javascript Code" +msgstr "" + +#: ../editor.admin.class.php:486 +msgid "Patch Code" +msgstr "" + +#: ../editor.admin.class.php:491 +msgid "" +"This is one-block code of third-party AdServer rotator. Selecting this " +"checkbox prevents displaying contained ads." +msgstr "" + +#: ../editor.admin.class.php:494 +msgid "" +"This is a HTML-code patch of advertising space. For example: use the code to " +"display AdSense advertisement. " +msgstr "" + +#: ../editor.admin.class.php:499 +msgid "Google DFP" +msgstr "" + +#: ../editor.admin.class.php:503 +msgid "DFP Block Name" +msgstr "" + +#: ../editor.admin.class.php:507 +msgid "This is name of Google DFP block!" +msgstr "" + +#: ../editor.admin.class.php:510 +msgid "" +"The patch (default advertisement) will be shown that if the logic of the " +"plugin can not show any contained advertisement on the current page of the " +"document." msgstr "" -#: admin.class.php:406 -msgid "Restrictions of advertisement Showing" +#: ../editor.admin.class.php:517 +msgid "Codes" msgstr "" -#: admin.class.php:407 -msgid "" -"Ad Weight – coefficient of frequency of show of the advertisement " -"for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " -"activity of this advertisement, 10 – maximal activity of this ad." +#: ../editor.admin.class.php:519 +msgid "Enter the code to output before and after the codes of Ads Place." msgstr "" -#: admin.class.php:408 -msgid "Restrictions by the type of pages – select restrictions:" +#: ../editor.admin.class.php:521 +msgid "Code Before" msgstr "" -#: admin.class.php:410 editor.admin.class.php:915 -msgid "Show ad on all pages of blog" +#: ../editor.admin.class.php:525 +msgid "Code After" msgstr "" -#: admin.class.php:411 +#: ../editor.admin.class.php:528 msgid "" -"Show ad only on pages of this type – ad will appear only on the pages of " -"selected types" +"You can enter any HTML codes here for the further withdrawal of their before " +"and after the code of Ads Place." msgstr "" -#: admin.class.php:412 -msgid "" -"Show ad only in certain posts – ad will be shown only on single posts pages " -"with the given IDs (ID items separated by commas, no spaces)" +#: ../editor.admin.class.php:659 +msgid "Ad Data Updated." msgstr "" -#: admin.class.php:414 -msgid "Additional restrictions" +#: ../editor.admin.class.php:811 +msgid "New advertisement" msgstr "" -#: admin.class.php:416 -msgid "" -"Show ad only in single posts or categories archives of certain categories – " -"ad will be shown only on single posts pages or category archive pages of the " -"specified categories" +#: ../editor.admin.class.php:811 +msgid "Edit advertisement" msgstr "" -#: admin.class.php:417 -msgid "" -"Show ad only in single posts or authors archives of certain authors – ad " -"will be shown only on single posts pages or author archive pages of the " -"specified authors" +#: ../editor.admin.class.php:831 +msgid "Back to Ads List" msgstr "" -#: admin.class.php:419 -msgid "" -"Use the schedule for this ad – if necessary, select checkbox " -"labeled “Use the schedule for this ad” and set start and finish dates of ad " -"campaign." +#: ../editor.admin.class.php:838 +msgid "Advertisement ID" msgstr "" -#: admin.class.php:420 -msgid "" -"Use limitation by hits – if necessary, select checkbox labeled “Use " -"limitation by hits” and set hits limit." +#: ../editor.admin.class.php:845 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 +msgid "Activity" msgstr "" -#: admin.class.php:421 -msgid "" -"Use limitation by clicks – if necessary, select checkbox labeled " -"“Use limitation by clicks” and set clicks limit." +#: ../editor.admin.class.php:846 +msgid "Ad is Active" msgstr "" -#: admin.class.php:422 editor.admin.class.php:1152 -msgid "Prices" +#: ../editor.admin.class.php:846 +msgid "Ad is Inactive" msgstr "" -#: admin.class.php:422 -msgid "" -"Use these parameters to get the statistics of incomes from advertisements " -"placed in your blog. \"Price of ad placement per month\" - parameter used " -"only for calculating statistic of scheduled ads." +#: ../editor.admin.class.php:847 ../list.admin.class.php:175 +#: ../list.admin.class.php:186 ../list.admin.class.php:234 +#: ../list.admin.class.php:362 ../list.admin.class.php:372 +#: ../list.admin.class.php:439 +msgid "Hits" msgstr "" -#: admin.class.php:423 admin.class.php:440 admin.class.php:447 -#: admin.class.php:461 -msgid "Manual" +#: ../editor.admin.class.php:849 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:440 +msgid "Clicks" msgstr "" -#: admin.class.php:424 admin.class.php:441 admin.class.php:448 -#: admin.class.php:462 admin.class.php:800 -msgid "Support Forum" +#: ../editor.admin.class.php:862 +msgid "Is in Rotation" msgstr "" -#: admin.class.php:429 -msgid "" -"Enter a name and a description of the Ads " -"Place. In principle, it is not mandatory parameters, because these " -"parameters don’t influence anything, but experience suggests that after a " -"while all IDs usually will be forgotten and such information may be useful." +#: ../editor.admin.class.php:895 +msgid "Title" msgstr "" -#: admin.class.php:430 -msgid "" -"Ads Place Size – in this version is only for informational " -"purposes only, but in future I plan to use this option. It is desirable to " -"expose the real size." +#: ../editor.admin.class.php:902 +msgid "Advertisement Description" msgstr "" -#: admin.class.php:431 -msgid "" -"Ads Place Patch - it’s an ad that will appear in the event " -"that the logic of basic ads outputing of this Ads Place on the current page " -"will not be able to choose a single basic ad for displaying. For example, if " -"all basic announcements are set to displaying only on archives pages or " -"single pages, in this case the patch ad of Ads Place will be shown on the " -"Home page. Conveniently to use the patch ad of Ads Place where you sell the " -"advertising place for a limited time – after the time expiration of ordered " -"ad will appear patch ad. It may be a banner leading to your page of " -"advertisement publication costs or a banner from AdSense." +#: ../editor.admin.class.php:916 +msgid "General" msgstr "" -#: admin.class.php:432 -msgid "Patch can be defined" +#: ../editor.admin.class.php:917 +msgid "Extended Restrictions" msgstr "" -#: admin.class.php:434 -msgid "as combination of the image URL and target page URL" +#: ../editor.admin.class.php:918 +msgid "Earnings settings" msgstr "" -#: admin.class.php:435 -msgid "as HTML code or javascript code" +#: ../editor.admin.class.php:924 ../editor.admin.class.php:999 +msgid "Ad Code" msgstr "" -#: admin.class.php:436 -msgid "" -"as name of Google DoubleClick for Publishers (DFP) block" +#: ../editor.admin.class.php:928 +msgid "Image Mode" msgstr "" -#: admin.class.php:438 -msgid "" -"If you select the first option (image mode), tools to download/choosing of " -"downloaded image banner become available for you." +#: ../editor.admin.class.php:932 +msgid "Ad Image" msgstr "" -#: admin.class.php:439 -msgid "" -"Codes – as Ads Place can be inserted into the page code not " -"only as widget, but as a short code or by using function, you can use code " -"“before” and “after” for centering or alignment of Ads Place on the place of " -"inserting or for something else you need. Use HTML tags." +#: ../editor.admin.class.php:936 +msgid "Ad Target" msgstr "" -#: admin.class.php:453 -msgid "" -"Views per Cycle – the number of impressions an ad for one " -"cycle of rotation, provided that this ad has maximum weight (the activity). " -"In other words, if the number of hits in the series is 1000, an ad with a " -"weight of 10 will be shown in 1000, and the ad with a weight of 3 will be " -"shown 300 times." +#: ../editor.admin.class.php:940 +msgid "Ad Alternative Text" msgstr "" -#: admin.class.php:454 -msgid "" -"Do not set this parameter to a value less than the maximum number of " -"visitors which may simultaneously be on your site – it may violate the logic " -"of rotation." +#: ../editor.admin.class.php:945 +msgid "Count clicks for this advertisement" msgstr "" -#: admin.class.php:455 -msgid "" -"Not worth it, though it has no special meaning, set this parameter to a " -"value greater than the number of hits your web pages during a month. " -"Optimal, perhaps, is the value to the daily shows website pages." +#: ../editor.admin.class.php:947 +msgid "Use carefully!" msgstr "" -#: admin.class.php:456 +#: ../editor.admin.class.php:947 msgid "" -"Auto Inserting Settings - here you can select the Ads " -"Places and allow the display of their ads before and after the content of " -"single post." +"Do not use if the wp-admin folder is password protected. In this case the " +"viewer will be prompted to enter a username and password during ajax " +"request. It's not good." msgstr "" -#: admin.class.php:457 -msgid "" -"Google DFP Settings - if you want to use codes of Google " -"DFP rotator, you must allow it's using and define your pub-code." +#: ../editor.admin.class.php:950 +msgid "This is flash (SWF) banner" msgstr "" -#: admin.class.php:459 -msgid "Bots and Crawlers detection" +#: ../editor.admin.class.php:953 +msgid "Flash banner \"flashvars\"" msgstr "" -#: admin.class.php:459 -msgid "" -"For obtaining of more exact indexes of statistics and incomes it is " -"preferable to exclude data about visits of bots and crawlers from the data " -"about all visits of your blog. If enabled and bot or crawler is detected, " -"hits of ads won't be counted. Select accuracy of detection but use with " -"caution - more exact detection requires more server resources." +#: ../editor.admin.class.php:955 +msgid "Insert \"flashvars\" parameters between braces..." msgstr "" -#: admin.class.php:589 -msgid "Uploading" +#: ../editor.admin.class.php:956 +msgid "Flash banner \"params\"" msgstr "" -#: admin.class.php:590 -msgid "Uploaded." +#: ../editor.admin.class.php:958 +msgid "Insert \"params\" parameters between braces..." msgstr "" -#: admin.class.php:591 -msgid "Only JPG, PNG or GIF files are allowed" +#: ../editor.admin.class.php:959 +msgid "Flash banner \"attributes\"" msgstr "" -#: admin.class.php:592 -msgid "File" +#: ../editor.admin.class.php:961 +msgid "Insert \"attributes\" parameters between braces..." msgstr "" -#: admin.class.php:669 -msgid "There are general options." +#: ../editor.admin.class.php:964 +msgid "Add to ad" +msgstr "" + +#: ../editor.admin.class.php:966 +msgid "Non Selected" +msgstr "" + +#: ../editor.admin.class.php:967 +msgid "nofollow" +msgstr "" + +#: ../editor.admin.class.php:968 +msgid "noindex" +msgstr "" + +#: ../editor.admin.class.php:969 +msgid "nofollow and noindex" +msgstr "" + +#: ../editor.admin.class.php:995 +msgid "Code Mode" +msgstr "" + +#: ../editor.admin.class.php:1001 +msgid "This code of ad contains PHP script" +msgstr "" + +#: ../editor.admin.class.php:1010 +msgid "Restrictions of advertisements showing" +msgstr "" + +#: ../editor.admin.class.php:1013 +msgid "Ad Weight" +msgstr "" + +#: ../editor.admin.class.php:1020 +msgid "Inactive" +msgstr "" + +#: ../editor.admin.class.php:1021 +msgid "Minimal Activity" msgstr "" -#: admin.class.php:673 +#: ../editor.admin.class.php:1022 +msgid "Maximal Activity" +msgstr "" + +#: ../editor.admin.class.php:1032 msgid "" -"Single post/page auto inserting options. Use these parameters for allowing/" -"defining Ads Places which will be automatically inserted before/after post/" -"page content." +"Ad weight - coefficient of frequency of show of the advertisement for one " +"cycle of advertisements rotation." msgstr "" -#: admin.class.php:677 -msgid "Adjust parameters of your Google DFP account." +#: ../editor.admin.class.php:1034 +msgid "0 - ad is inactive" msgstr "" -#: admin.class.php:681 -msgid "Adjust parameters of plugin statistics." +#: ../editor.admin.class.php:1035 +msgid "1 - minimal activity of this advertisement" msgstr "" -#: admin.class.php:685 -msgid "This options define layout for Ads Managin Pages." +#: ../editor.admin.class.php:1037 +msgid "10 - maximal activity of this ad." msgstr "" -#: admin.class.php:689 -msgid "Are you allow to perform these actions during deactivating plugin?" +#: ../editor.admin.class.php:1043 ../help.class.php:20 ../help.class.php:161 +msgid "Show ad on all pages of blog" msgstr "" -#: admin.class.php:769 -msgid "Simple Ads Manager Settings Updated." +#: ../editor.admin.class.php:1047 +msgid "Show ad only on pages of this type" msgstr "" -#: admin.class.php:777 -msgid "System Info" +#: ../editor.admin.class.php:1051 +msgid "Home Page (Home or Front Page)" msgstr "" -#: admin.class.php:781 -msgid "Wordpress Version" +#: ../editor.admin.class.php:1053 +msgid "Singular Pages" msgstr "" -#: admin.class.php:782 -msgid "SAM Version" +#: ../editor.admin.class.php:1056 +msgid "Single Post" msgstr "" -#: admin.class.php:783 -msgid "SAM DB Version" +#: ../editor.admin.class.php:1060 +msgid "Custom Post Type" msgstr "" -#: admin.class.php:784 -msgid "PHP Version" +#: ../editor.admin.class.php:1062 +msgid "Attachment" msgstr "" -#: admin.class.php:785 -msgid "MySQL Version" +#: ../editor.admin.class.php:1065 +msgid "Search Page" msgstr "" -#: admin.class.php:786 -msgid "Memory Limit" +#: ../editor.admin.class.php:1067 +msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "" -#: admin.class.php:790 -msgid "Note! If you have detected a bug, include this data to bug report." +#: ../editor.admin.class.php:1069 +msgid "Archive Pages" msgstr "" -#: admin.class.php:795 -msgid "Resources" +#: ../editor.admin.class.php:1072 +msgid "Taxonomy Archive Pages" msgstr "" -#: admin.class.php:798 -msgid "Wordpress Plugin Page" +#: ../editor.admin.class.php:1074 +msgid "Category Archive Pages" msgstr "" -#: admin.class.php:799 -msgid "Author Plugin Page" +#: ../editor.admin.class.php:1076 +msgid "Tag Archive Pages" msgstr "" -#: admin.class.php:801 -msgid "Author's Blog" +#: ../editor.admin.class.php:1078 +msgid "Author Archive Pages" msgstr "" -#: admin.class.php:806 -msgid "Donations" +#: ../editor.admin.class.php:1080 +msgid "Custom Post Type Archive Pages" msgstr "" -#: admin.class.php:810 +#: ../editor.admin.class.php:1082 msgid "" -"If you have found this plugin useful, please consider making a %s to help " -"support future development. Your support will be much appreciated. Thank you!" +"Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " +"daily or time-based archive)" msgstr "" -#: admin.class.php:811 admin.class.php:817 -msgid "Donate Now!" +#: ../editor.admin.class.php:1087 +msgid "Show ad only in certain posts/pages" msgstr "" -#: admin.class.php:811 -msgid "donation" +#: ../editor.admin.class.php:1091 ../editor.admin.class.php:1160 +msgid "Posts/Pages" msgstr "" -#: admin.class.php:822 +#: ../editor.admin.class.php:1098 msgid "" -"Warning! The default value of donation is %s. Don't worry! This is not my " -"appetite, this is default value defined by Payoneer service." +"Use this setting to display an ad only in certain posts/pages. Select posts/" +"pages." msgstr "" -#: admin.class.php:822 -msgid " You can change it to any value you want!" +#: ../editor.admin.class.php:1109 +msgid "Users" msgstr "" -#: admin.class.php:835 -msgid "Save Changes" +#: ../editor.admin.class.php:1111 +msgid "Show this ad for" msgstr "" -#: editor.admin.class.php:194 -msgid "Horizontal" +#: ../editor.admin.class.php:1114 +msgid "all users" msgstr "" -#: editor.admin.class.php:195 -msgid "Vertical" +#: ../editor.admin.class.php:1119 +msgid "these users" msgstr "" -#: editor.admin.class.php:197 -msgid "Custom width and height" +#: ../editor.admin.class.php:1124 +msgid "Unregistered Users" msgstr "" -#: editor.admin.class.php:261 editor.admin.class.php:293 -#: editor.admin.class.php:310 editor.admin.class.php:311 -#: editor.admin.class.php:312 editor.admin.class.php:320 -#: editor.admin.class.php:589 editor.admin.class.php:666 -#: editor.admin.class.php:717 editor.admin.class.php:718 -#: editor.admin.class.php:719 zone.editor.admin.class.php:154 -#: zone.editor.admin.class.php:247 zone.editor.admin.class.php:280 -#: block.editor.admin.class.php:171 block.editor.admin.class.php:215 -#: block.editor.admin.class.php:241 -msgid "Undefined" +#: ../editor.admin.class.php:1128 ../editor.admin.class.php:1136 +msgid "Registered Users" msgstr "" -#: editor.admin.class.php:274 -msgid "Ads Place Data Updated." +#: ../editor.admin.class.php:1133 +msgid "Exclude these users" msgstr "" -#: editor.admin.class.php:320 -msgid "New Ads Place" +#: ../editor.admin.class.php:1144 +msgid "Do not show this ad for advertiser" msgstr "" -#: editor.admin.class.php:320 -msgid "Edit Ads Place" +#: ../editor.admin.class.php:1152 +msgid "Extended restrictions of advertisements showing" msgstr "" -#: editor.admin.class.php:325 editor.admin.class.php:383 -#: editor.admin.class.php:397 editor.admin.class.php:418 -#: editor.admin.class.php:495 editor.admin.class.php:731 -#: editor.admin.class.php:800 editor.admin.class.php:815 -#: editor.admin.class.php:886 editor.admin.class.php:975 -#: editor.admin.class.php:1151 editor.admin.class.php:1181 -#: zone.editor.admin.class.php:285 zone.editor.admin.class.php:335 -#: zone.editor.admin.class.php:349 block.editor.admin.class.php:73 -#: block.editor.admin.class.php:246 block.editor.admin.class.php:296 -#: block.editor.admin.class.php:310 block.editor.admin.class.php:328 -#: block.editor.admin.class.php:354 block.editor.admin.class.php:383 -msgid "Click to toggle" +#: ../editor.admin.class.php:1156 +msgid "Do not show ad on certain posts/pages" msgstr "" -#: editor.admin.class.php:326 editor.admin.class.php:732 -#: zone.editor.admin.class.php:286 block.editor.admin.class.php:247 -msgid "Status" +#: ../editor.admin.class.php:1168 +msgid "" +"Use this setting to not display an ad on certain posts/pages. Select posts/" +"pages." msgstr "" -#: editor.admin.class.php:333 -msgid "Back to Places List" +#: ../editor.admin.class.php:1173 +msgid "" +"Show ad only in single posts or categories archives of certain categories" msgstr "" -#: editor.admin.class.php:339 js/dialog.php:66 -msgid "Ads Place ID" +#: ../editor.admin.class.php:1176 ../editor.admin.class.php:1196 +msgid "Categories" msgstr "" -#: editor.admin.class.php:347 editor.admin.class.php:762 -msgid "Width" +#: ../editor.admin.class.php:1183 +msgid "" +"Use this setting to display an ad only in single posts or categories " +"archives of certain categories." msgstr "" -#: editor.admin.class.php:349 editor.admin.class.php:764 -msgid "Height" +#: ../editor.admin.class.php:1187 ../editor.admin.class.php:1221 +#: ../editor.admin.class.php:1255 ../editor.admin.class.php:1290 +#: ../editor.admin.class.php:1325 +msgid "" +"This display logic parameter will be applied only when you use the \"Show ad " +"on all pages of blog\" and \"Show your ad only on the pages of this type\" " +"modes. Otherwise, it will be ignored." msgstr "" -#: editor.admin.class.php:353 zone.editor.admin.class.php:305 -#: block.editor.admin.class.php:266 -msgid "Is Active" +#: ../editor.admin.class.php:1193 +msgid "" +"Do not show ad in single posts or categories archives of certain categories" +msgstr "" + +#: ../editor.admin.class.php:1203 +msgid "" +"Use this setting to not display an ad in single posts or categories archives " +"of certain categories." +msgstr "" + +#: ../editor.admin.class.php:1208 +msgid "" +"Show ad only in single posts or archives of certain Custom Taxonomies Terms" +msgstr "" + +#: ../editor.admin.class.php:1217 +msgid "" +"Use this setting to display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." msgstr "" -#: editor.admin.class.php:354 editor.admin.class.php:771 -#: zone.editor.admin.class.php:306 block.editor.admin.class.php:267 -msgid "Is In Trash" +#: ../editor.admin.class.php:1227 +msgid "" +"Do not show ad in single posts or archives of certain Custom Taxonomies Terms" msgstr "" -#: editor.admin.class.php:361 editor.admin.class.php:778 -#: zone.editor.admin.class.php:313 js/dialog.php:89 js/dialog-zone.php:89 -#: js/dialog-ad.php:89 js/dialog-block.php:79 block.editor.admin.class.php:274 -msgid "Cancel" +#: ../editor.admin.class.php:1236 +msgid "" +"Use this setting to not display an ad only in single posts or archives of " +"certain Custom Taxonomies Terms." msgstr "" -#: editor.admin.class.php:364 editor.admin.class.php:781 -#: zone.editor.admin.class.php:316 block.editor.admin.class.php:277 -msgid "Save" +#: ../editor.admin.class.php:1241 +msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" -#: editor.admin.class.php:377 zone.editor.admin.class.php:329 -#: block.editor.admin.class.php:290 -msgid "Name" +#: ../editor.admin.class.php:1244 ../editor.admin.class.php:1264 +msgid "Authors" msgstr "" -#: editor.admin.class.php:384 editor.admin.class.php:388 -#: editor.admin.class.php:804 zone.editor.admin.class.php:336 -#: zone.editor.admin.class.php:340 block.editor.admin.class.php:297 -#: block.editor.admin.class.php:301 -msgid "Description" +#: ../editor.admin.class.php:1251 +msgid "" +"Use this setting to display an ad only in single posts or authors archives " +"of certain authors." msgstr "" -#: editor.admin.class.php:386 -msgid "Enter description of this Ads Place." +#: ../editor.admin.class.php:1261 +msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" -#: editor.admin.class.php:391 editor.admin.class.php:808 -#: zone.editor.admin.class.php:343 block.editor.admin.class.php:304 +#: ../editor.admin.class.php:1271 msgid "" -"This description is not used anywhere and is added solely for the " -"convenience of managing advertisements." +"Use this setting to not display an ad in single posts or authors archives of " +"certain authors." msgstr "" -#: editor.admin.class.php:398 -msgid "Ads Place Size" +#: ../editor.admin.class.php:1276 +msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" -#: editor.admin.class.php:400 -msgid "Select size of this Ads Place." +#: ../editor.admin.class.php:1279 ../editor.admin.class.php:1299 +msgid "Tags" msgstr "" -#: editor.admin.class.php:405 -msgid "Custom Width" +#: ../editor.admin.class.php:1286 +msgid "" +"Use this setting to display an ad only in single posts or tags archives of " +"certain tags." msgstr "" -#: editor.admin.class.php:409 -msgid "Custom Height" +#: ../editor.admin.class.php:1296 +msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "" -#: editor.admin.class.php:412 +#: ../editor.admin.class.php:1306 msgid "" -"These values are not used and are added solely for the convenience of " -"advertising management. Will be used in the future..." +"Use this setting to not display an ad in single posts or tags archives of " +"certain tags." msgstr "" -#: editor.admin.class.php:419 -msgid "Ads Place Patch" +#: ../editor.admin.class.php:1311 +msgid "" +"Show ad only in custom type single posts or custom post type archives of " +"certain custom post types" msgstr "" -#: editor.admin.class.php:421 -msgid "" -"Select type of the code of a patch and fill data entry fields with the " -"appropriate data." +#: ../editor.admin.class.php:1314 ../editor.admin.class.php:1334 +msgid "Custom post types" msgstr "" -#: editor.admin.class.php:423 editor.admin.class.php:427 -msgid "Image" +#: ../editor.admin.class.php:1321 +msgid "" +"Use this setting to display an ad only in custom type single posts or custom " +"post type archives of certain custom post types." msgstr "" -#: editor.admin.class.php:431 +#: ../editor.admin.class.php:1331 msgid "" -"This image is a patch for advertising space. This may be an image with the " -"text \"Place your ad here\"." +"Do not show ad in custom type single posts or custom post type archives of " +"certain custom post types" msgstr "" -#: editor.admin.class.php:434 -msgid "Target" +#: ../editor.admin.class.php:1341 +msgid "" +"Use this setting to not display an ad in custom type single posts or custom " +"post type archives of certain custom post types." msgstr "" -#: editor.admin.class.php:438 -msgid "This is a link to a page where are your suggestions for advertisers." +#: ../editor.admin.class.php:1346 +msgid "Use the schedule for this ad" msgstr "" -#: editor.admin.class.php:441 editor.admin.class.php:851 -msgid "Image Tools" +#: ../editor.admin.class.php:1350 +msgid "Campaign Start Date" msgstr "" -#: editor.admin.class.php:443 editor.admin.class.php:853 -msgid "Select File" +#: ../editor.admin.class.php:1354 +msgid "Campaign End Date" msgstr "" -#: editor.admin.class.php:447 editor.admin.class.php:857 -msgid "Apply" +#: ../editor.admin.class.php:1359 +msgid "" +"Use these parameters for displaying ad during the certain period of time." msgstr "" -#: editor.admin.class.php:448 editor.admin.class.php:858 -msgid "Select file from your blog server." +#: ../editor.admin.class.php:1364 +msgid "Use limitation by hits" msgstr "" -#: editor.admin.class.php:451 editor.admin.class.php:861 -msgid "Upload File" +#: ../editor.admin.class.php:1368 +msgid "Hits Limit" msgstr "" -#: editor.admin.class.php:452 editor.admin.class.php:862 -msgid "Upload" +#: ../editor.admin.class.php:1373 +msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" -#: editor.admin.class.php:455 editor.admin.class.php:865 -msgid "Select and upload file from your local computer." +#: ../editor.admin.class.php:1378 +msgid "Use limitation by clicks" msgstr "" -#: editor.admin.class.php:461 -msgid "HTML or Javascript Code" +#: ../editor.admin.class.php:1382 +msgid "Clicks Limit" msgstr "" -#: editor.admin.class.php:465 -msgid "Patch Code" +#: ../editor.admin.class.php:1387 +msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "" -#: editor.admin.class.php:470 -msgid "" -"This is one-block code of third-party AdServer rotator. Selecting this " -"checkbox prevents displaying contained ads." +#: ../editor.admin.class.php:1397 +msgid "Advertiser" msgstr "" -#: editor.admin.class.php:473 -msgid "" -"This is a HTML-code patch of advertising space. For example: use the code to " -"display AdSense advertisement. " +#: ../editor.admin.class.php:1400 +msgid "Advertiser Nick Name" msgstr "" -#: editor.admin.class.php:478 -msgid "Google DFP" +#: ../editor.admin.class.php:1417 ../help.class.php:32 ../help.class.php:180 +msgid "Prices" msgstr "" -#: editor.admin.class.php:482 -msgid "DFP Block Name" +#: ../editor.admin.class.php:1420 +msgid "Price of ad placement per month" msgstr "" -#: editor.admin.class.php:486 -msgid "This is name of Google DFP block!" +#: ../editor.admin.class.php:1424 +msgid "Tthis parameter used only for scheduled ads." msgstr "" -#: editor.admin.class.php:489 -msgid "" -"The patch (default advertisement) will be shown that if the logic of the " -"plugin can not show any contained advertisement on the current page of the " -"document." +#: ../editor.admin.class.php:1427 +msgid "Price per Thousand Hits" msgstr "" -#: editor.admin.class.php:496 -msgid "Codes" +#: ../editor.admin.class.php:1431 +msgid "" +"Not only humans visit your blog, bots and crawlers too. In order not to " +"deceive an advertiser, you must enable the detection of bots and crawlers." msgstr "" -#: editor.admin.class.php:498 -msgid "Enter the code to output before and after the codes of Ads Place." +#: ../editor.admin.class.php:1434 +msgid "Price per Click" msgstr "" -#: editor.admin.class.php:500 -msgid "Code Before" +#: ../editor.admin.class.php:1438 +msgid "" +"To calculate the earnings on clicks, you must enable counting of clicks for " +"that ad." msgstr "" -#: editor.admin.class.php:504 -msgid "Code After" +#: ../editor.admin.class.php:1449 +msgid "Ad Preview" msgstr "" -#: editor.admin.class.php:507 -msgid "" -"You can enter any HTML codes here for the further withdrawal of their before " -"and after the code of Ads Place." +#: ../errorlog.admin.class.php:61 ../errorlog.admin.class.php:145 +#: ../errorlog.admin.class.php:157 +msgid "Resolved" msgstr "" -#: editor.admin.class.php:600 -msgid "Ad Data Updated." +#: ../errorlog.admin.class.php:65 ../errorlog.admin.class.php:173 +msgid "Clear Error Log" msgstr "" -#: editor.admin.class.php:726 -msgid "New advertisement" +#: ../errorlog.admin.class.php:68 ../errorlog.admin.class.php:176 +msgid "Clear Resolved" msgstr "" -#: editor.admin.class.php:726 -msgid "Edit advertisement" +#: ../errorlog.admin.class.php:85 ../errorlog.admin.class.php:95 +msgid "Date" msgstr "" -#: editor.admin.class.php:739 -msgid "Back to Ads List" +#: ../errorlog.admin.class.php:88 ../errorlog.admin.class.php:98 +msgid "Error Massage" msgstr "" -#: editor.admin.class.php:745 -msgid "Advertisement ID" +#: ../errorlog.admin.class.php:116 +msgid "Update Error" msgstr "" -#: editor.admin.class.php:753 -msgid "Ad is Active" +#: ../errorlog.admin.class.php:116 +msgid "Output Error" msgstr "" -#: editor.admin.class.php:753 -msgid "Ad is Inactive" +#: ../errorlog.admin.class.php:147 +msgid "More Info" msgstr "" -#: editor.admin.class.php:769 -msgid "Is in Rotation" +#: ../errorlog.admin.class.php:151 +msgid "Not Resolved" msgstr "" -#: editor.admin.class.php:794 -msgid "Title" +#: ../errorlog.admin.class.php:188 +msgid "Error Info" msgstr "" -#: editor.admin.class.php:801 -msgid "Advertisement Description" +#: ../errors.class.php:46 +msgid "Simple Ads Manager Images Folder hasn't been created!" msgstr "" -#: editor.admin.class.php:816 editor.admin.class.php:876 -msgid "Ad Code" +#: ../errors.class.php:47 +msgid "Try to reactivate plugin or create folder manually." msgstr "" -#: editor.admin.class.php:820 -msgid "Image Mode" +#: ../errors.class.php:47 +msgid "" +"Manually creation: Create folder 'sam-images' in 'wp-content/plugins' " +"folder. Don't forget to set folder's permissions to 777." msgstr "" -#: editor.admin.class.php:824 -msgid "Ad Image" +#: ../errors.class.php:54 +#, php-format +msgid "Database table %s hasn't been created!" msgstr "" -#: editor.admin.class.php:828 -msgid "Ad Target" +#: ../errors.class.php:58 +#, php-format +msgid "Database table %s hasn't been upgraded!" msgstr "" -#: editor.admin.class.php:832 -msgid "Ad Alternative Text" +#: ../help.class.php:14 ../help.class.php:155 +msgid "" +"Enter a name and a description of the " +"advertisement. These parameters are optional, because don’t influence " +"anything, but help in the visual identification of the ad (do not forget " +"which is which)." msgstr "" -#: editor.admin.class.php:837 -msgid "Count clicks for this advertisement" +#: ../help.class.php:15 ../help.class.php:156 +msgid "" +"Ad Code – code can be defined as a combination of the image " +"URL and target page URL, or as HTML code, javascript code, or PHP code (for " +"PHP-code don’t forget to set the checkbox labeled \"This code of ad contains " +"PHP script\"). If you select the first option (image mode) you can keep " +"statistics of clicks and also tools for uploading/selecting the downloaded " +"image banner becomes available to you." msgstr "" -#: editor.admin.class.php:839 -msgid "Use carefully!" +#: ../help.class.php:16 ../help.class.php:157 +msgid "Restrictions of advertisement Showing" msgstr "" -#: editor.admin.class.php:839 +#: ../help.class.php:17 ../help.class.php:158 msgid "" -"Do not use if the wp-admin folder is password protected. In this case the " -"viewer will be prompted to enter a username and password during ajax " -"request. It's not good." +"Ad Weight – coefficient of frequency of show of the advertisement " +"for one cycle of advertisements rotation. 0 – ad is inactive, 1 – minimal " +"activity of this advertisement, 10 – maximal activity of this ad." msgstr "" -#: editor.admin.class.php:841 -msgid "Add to ad" +#: ../help.class.php:18 ../help.class.php:159 +msgid "Restrictions by the type of pages – select restrictions:" msgstr "" -#: editor.admin.class.php:843 -msgid "Non Selected" +#: ../help.class.php:21 ../help.class.php:162 +msgid "" +"Show ad only on pages of this type – ad will appear only on the pages of " +"selected types" msgstr "" -#: editor.admin.class.php:844 -msgid "nofollow" +#: ../help.class.php:22 ../help.class.php:163 +msgid "" +"Show ad only in certain posts – ad will be shown only on single posts pages " +"with the given IDs (ID items separated by commas, no spaces)" msgstr "" -#: editor.admin.class.php:845 -msgid "noindex" +#: ../help.class.php:24 +msgid "Additional restrictions" msgstr "" -#: editor.admin.class.php:846 -msgid "nofollow and noindex" +#: ../help.class.php:26 ../help.class.php:174 +msgid "" +"Show ad only in single posts or categories archives of certain categories – " +"ad will be shown only on single posts pages or category archive pages of the " +"specified categories" msgstr "" -#: editor.admin.class.php:872 -msgid "Code Mode" +#: ../help.class.php:27 ../help.class.php:175 +msgid "" +"Show ad only in single posts or authors archives of certain authors – ad " +"will be shown only on single posts pages or author archive pages of the " +"specified authors" msgstr "" -#: editor.admin.class.php:878 -msgid "This code of ad contains PHP script" +#: ../help.class.php:29 ../help.class.php:177 +msgid "" +"Use the schedule for this ad – if necessary, select checkbox " +"labeled “Use the schedule for this ad” and set start and finish dates of ad " +"campaign." msgstr "" -#: editor.admin.class.php:887 -msgid "Restrictions of advertisements showing" +#: ../help.class.php:30 ../help.class.php:178 +msgid "" +"Use limitation by hits – if necessary, select checkbox labeled “Use " +"limitation by hits” and set hits limit." msgstr "" -#: editor.admin.class.php:890 -msgid "Ad Weight" +#: ../help.class.php:31 ../help.class.php:179 +msgid "" +"Use limitation by clicks – if necessary, select checkbox labeled " +"“Use limitation by clicks” and set clicks limit." msgstr "" -#: editor.admin.class.php:897 -msgid "Inactive" +#: ../help.class.php:32 ../help.class.php:180 +msgid "" +"Use these parameters to get the statistics of incomes from advertisements " +"placed in your blog. \"Price of ad placement per month\" - parameter used " +"only for calculating statistic of scheduled ads." msgstr "" -#: editor.admin.class.php:898 -msgid "Minimal Activity" +#: ../help.class.php:33 ../help.class.php:50 ../help.class.php:57 +#: ../help.class.php:71 ../help.class.php:104 ../help.class.php:112 +#: ../help.class.php:123 ../help.class.php:140 ../help.class.php:149 +#: ../help.class.php:165 ../help.class.php:181 ../help.class.php:198 +msgid "Manual" msgstr "" -#: editor.admin.class.php:899 -msgid "Maximal Activity" +#: ../help.class.php:39 ../help.class.php:129 +msgid "" +"Enter a name and a description of the Ads " +"Place. In principle, it is not mandatory parameters, because these " +"parameters don’t influence anything, but experience suggests that after a " +"while all IDs usually will be forgotten and such information may be useful." msgstr "" -#: editor.admin.class.php:909 +#: ../help.class.php:40 ../help.class.php:130 msgid "" -"Ad weight - coefficient of frequency of show of the advertisement for one " -"cycle of advertisements rotation." +"Ads Place Size – in this version is only for informational " +"purposes only, but in future I plan to use this option. It is desirable to " +"expose the real size." msgstr "" -#: editor.admin.class.php:910 +#: ../help.class.php:41 ../help.class.php:131 msgid "" -"0 - ad is inactive, 1 - minimal activity of this advertisement, 10 - maximal " -"activity of this ad." +"Ads Place Patch - it’s an ad that will appear in the event " +"that the logic of basic ads outputing of this Ads Place on the current page " +"will not be able to choose a single basic ad for displaying. For example, if " +"all basic announcements are set to displaying only on archives pages or " +"single pages, in this case the patch ad of Ads Place will be shown on the " +"Home page. Conveniently to use the patch ad of Ads Place where you sell the " +"advertising place for a limited time – after the time expiration of ordered " +"ad will appear patch ad. It may be a banner leading to your page of " +"advertisement publication costs or a banner from AdSense." msgstr "" -#: editor.admin.class.php:919 -msgid "Show ad only on pages of this type" +#: ../help.class.php:42 ../help.class.php:132 +msgid "Patch can be defined" msgstr "" -#: editor.admin.class.php:923 -msgid "Home Page (Home or Front Page)" +#: ../help.class.php:44 ../help.class.php:134 +msgid "as combination of the image URL and target page URL" msgstr "" -#: editor.admin.class.php:925 -msgid "Singular Pages" +#: ../help.class.php:45 ../help.class.php:135 +msgid "as HTML code or javascript code" msgstr "" -#: editor.admin.class.php:928 -msgid "Single Post" +#: ../help.class.php:46 ../help.class.php:136 +msgid "" +"as name of Google DoubleClick for Publishers (DFP) block" msgstr "" -#: editor.admin.class.php:930 -msgid "Page" +#: ../help.class.php:48 ../help.class.php:138 +msgid "" +"If you select the first option (image mode), tools to download/choosing of " +"downloaded image banner become available for you." msgstr "" -#: editor.admin.class.php:932 -msgid "Custom Post Type" +#: ../help.class.php:49 ../help.class.php:139 +msgid "" +"Codes – as Ads Place can be inserted into the page code not " +"only as widget, but as a short code or by using function, you can use code " +"“before” and “after” for centering or alignment of Ads Place on the place of " +"inserting or for something else you need. Use HTML tags." msgstr "" -#: editor.admin.class.php:934 -msgid "Attachment" +#: ../help.class.php:63 ../help.class.php:190 +msgid "" +"Views per Cycle – the number of impressions an ad for one " +"cycle of rotation, provided that this ad has maximum weight (the activity). " +"In other words, if the number of hits in the series is 1000, an ad with a " +"weight of 10 will be shown in 1000, and the ad with a weight of 3 will be " +"shown 300 times." msgstr "" -#: editor.admin.class.php:937 -msgid "Search Page" +#: ../help.class.php:64 ../help.class.php:191 +msgid "" +"Do not set this parameter to a value less than the maximum number of " +"visitors which may simultaneously be on your site – it may violate the logic " +"of rotation." msgstr "" -#: editor.admin.class.php:939 -msgid "\"Not found\" Page (HTTP 404: Not Found)" +#: ../help.class.php:65 ../help.class.php:192 +msgid "" +"Not worth it, though it has no special meaning, set this parameter to a " +"value greater than the number of hits your web pages during a month. " +"Optimal, perhaps, is the value to the daily shows website pages." msgstr "" -#: editor.admin.class.php:941 -msgid "Archive Pages" +#: ../help.class.php:66 ../help.class.php:193 +msgid "" +"Auto Inserting Settings - here you can select the Ads " +"Places and allow the display of their ads before and after the content of " +"single post." msgstr "" -#: editor.admin.class.php:944 -msgid "Taxonomy Archive Pages" +#: ../help.class.php:67 ../help.class.php:194 +msgid "" +"Google DFP Settings - if you want to use codes of Google " +"DFP rotator, you must allow it's using and define your pub-code." msgstr "" -#: editor.admin.class.php:946 -msgid "Category Archive Pages" +#: ../help.class.php:69 ../help.class.php:196 +msgid "Bots and Crawlers detection" msgstr "" -#: editor.admin.class.php:948 -msgid "Tag Archive Pages" +#: ../help.class.php:69 ../help.class.php:196 +msgid "" +"For obtaining of more exact indexes of statistics and incomes it is " +"preferable to exclude data about visits of bots and crawlers from the data " +"about all visits of your blog. If enabled and bot or crawler is detected, " +"hits of ads won't be counted. Select accuracy of detection but use with " +"caution - more exact detection requires more server resources." msgstr "" -#: editor.admin.class.php:950 -msgid "Author Archive Pages" +#: ../help.class.php:103 +msgid "This is list of Ads Places" msgstr "" -#: editor.admin.class.php:952 -msgid "Custom Post Type Archive Pages" +#: ../help.class.php:107 ../help.class.php:115 ../help.class.php:201 +msgid "Help" msgstr "" -#: editor.admin.class.php:954 +#: ../help.class.php:111 +msgid "This is list of Ads" +msgstr "" + +#: ../help.class.php:122 msgid "" -"Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " -"daily or time-based archive)" +"The main object of the plugin is “Ads Place“. Each Ads Place is a container " +"for the advertisements and provides the logic of the show and rotation. In " +"addition, one of the parameters of advertising space is “patch ad code”, ie " +"ad to be shown if and only if the logic of ads this Ads Place does not " +"permit to show none of the advertisements contained in this Ads Place. One " +"Ads Place can contain any number of objects “advertisement”." msgstr "" -#: editor.admin.class.php:959 -msgid "Show ad only in certain posts/pages" +#: ../help.class.php:142 ../help.class.php:168 +msgid "Parameters" msgstr "" -#: editor.admin.class.php:963 editor.admin.class.php:984 -msgid "Posts/Pages IDs (comma separated)" +#: ../help.class.php:148 +msgid "" +"Object “advertisement” rigidly attached to his container “Ads Place”. Its " +"parameters determine frequency (weight) of displaying and limiting " +"displaying from “show all pages” to “show the articles with ID … ” and show " +"from date to date (the schedule)." msgstr "" -#: editor.admin.class.php:968 -msgid "" -"Use this setting to display an ad only in certain posts/pages. Enter the IDs " -"of posts/pages, separated by commas." +#: ../help.class.php:151 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 +msgid "Advertisement" msgstr "" -#: editor.admin.class.php:976 -msgid "Extended restrictions of advertisements showing" +#: ../help.class.php:172 +msgid "Additional restrictions" msgstr "" -#: editor.admin.class.php:980 -msgid "Do not show ad on certain posts/pages" +#: ../help.class.php:184 +msgid "Additional Parameters" msgstr "" -#: editor.admin.class.php:989 -msgid "" -"Use this setting to not display an ad on certain posts/pages. Enter the IDs " -"of posts/pages, separated by commas." +#: ../list.admin.class.php:137 +msgid "Managing Ads Places" msgstr "" -#: editor.admin.class.php:994 -msgid "" -"Show ad only in single posts or categories archives of certain categories" +#: ../list.admin.class.php:153 ../list.admin.class.php:273 +msgid "Add New Place" msgstr "" -#: editor.admin.class.php:997 editor.admin.class.php:1014 -msgid "Categories (comma separated)" +#: ../list.admin.class.php:157 ../list.admin.class.php:277 +msgid "Reset Statistics" msgstr "" -#: editor.admin.class.php:1001 -msgid "" -"Use this setting to display an ad only in single posts or categories " -"archives of certain categories. Enter the names of categories, separated by " -"commas." +#: ../list.admin.class.php:173 ../list.admin.class.php:184 +msgid "Place Name" msgstr "" -#: editor.admin.class.php:1005 editor.admin.class.php:1034 -#: editor.admin.class.php:1063 editor.admin.class.php:1092 -msgid "" -"This display logic parameter will be applied only when you use the \"Show ad " -"on all pages of blog\" and \"Show your ad only on the pages of this type\" " -"modes. Otherwise, it will be ignored." +#: ../list.admin.class.php:176 ../list.admin.class.php:187 +msgid "Total Hits" msgstr "" -#: editor.admin.class.php:1011 -msgid "" -"Do not show ad in single posts or categories archives of certain categories" +#: ../list.admin.class.php:177 ../list.admin.class.php:188 +msgid "Total Ads" msgstr "" -#: editor.admin.class.php:1018 -msgid "" -"Use this setting to not display an ad in single posts or categories archives " -"of certain categories. Enter the names of categories, separated by commas." +#: ../list.admin.class.php:178 ../list.admin.class.php:189 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 +msgid "Earnings" msgstr "" -#: editor.admin.class.php:1023 -msgid "Show ad only in single posts or authors archives of certain authors" +#: ../list.admin.class.php:233 ../list.admin.class.php:438 +msgid "Placement" msgstr "" -#: editor.admin.class.php:1026 editor.admin.class.php:1043 -msgid "Authors (comma separated)" +#: ../list.admin.class.php:236 ../list.admin.class.php:441 +msgid "Total" msgstr "" -#: editor.admin.class.php:1030 -msgid "" -"Use this setting to display an ad only in single posts or authors archives " -"of certain authors. Enter the names of authors, separated by commas." +#: ../list.admin.class.php:236 ../list.admin.class.php:441 +msgid "N/A" msgstr "" -#: editor.admin.class.php:1040 -msgid "Do not show ad in single posts or authors archives of certain authors" +#: ../list.admin.class.php:243 +msgid "Edit Place" msgstr "" -#: editor.admin.class.php:1047 -msgid "" -"Use this setting to not display an ad in single posts or authors archives of " -"certain authors. Enter the names of authors, separated by commas." +#: ../list.admin.class.php:247 +msgid "Restore this Place from the Trash" msgstr "" -#: editor.admin.class.php:1052 -msgid "Show ad only in single posts or tags archives of certain tags" +#: ../list.admin.class.php:248 +msgid "Remove this Place permanently" msgstr "" -#: editor.admin.class.php:1055 editor.admin.class.php:1072 -msgid "Tags (comma separated)" +#: ../list.admin.class.php:253 +msgid "Move this Place to the Trash" msgstr "" -#: editor.admin.class.php:1059 -msgid "" -"Use this setting to display an ad only in single posts or tags archives of " -"certain tags. Enter the names of tags, separated by commas." +#: ../list.admin.class.php:254 +msgid "View List of Place Ads" msgstr "" -#: editor.admin.class.php:1069 -msgid "Do not show ad in single posts or tags archives of certain tags" +#: ../list.admin.class.php:254 +msgid "View Ads" msgstr "" -#: editor.admin.class.php:1076 -msgid "" -"Use this setting to not display an ad in single posts or tags archives of " -"certain tags. Enter the names of tags, separated by commas." +#: ../list.admin.class.php:255 +msgid "Create New Ad" msgstr "" -#: editor.admin.class.php:1081 -msgid "" -"Show ad only in custom type single posts or custom post type archives of " -"certain custom post types" +#: ../list.admin.class.php:255 +msgid "New Ad" msgstr "" -#: editor.admin.class.php:1084 editor.admin.class.php:1101 -msgid "Custom post types (comma separated)" +#: ../list.admin.class.php:320 +msgid "Managing Items of Ads Place" msgstr "" -#: editor.admin.class.php:1088 -msgid "" -"Use this setting to display an ad only in custom type single posts or custom " -"post type archives of certain custom post types. Enter the names of custom " -"post types, separated by commas." +#: ../list.admin.class.php:337 ../list.admin.class.php:471 +msgid "Add New Ad" msgstr "" -#: editor.admin.class.php:1098 -msgid "" -"Do not show ad in custom type single posts or custom post type archives of " -"certain custom post types" +#: ../list.admin.class.php:341 ../list.admin.class.php:475 +msgid "Back to Ads Places Management" msgstr "" -#: editor.admin.class.php:1105 -msgid "" -"Use this setting to not display an ad in custom type single posts or custom " -"post type archives of certain custom post types. Enter the names of custom " -"post types, separated by commas." +#: ../list.admin.class.php:432 +msgid "Yes" msgstr "" -#: editor.admin.class.php:1110 -msgid "Use the schedule for this ad" +#: ../list.admin.class.php:433 +msgid "No" msgstr "" -#: editor.admin.class.php:1113 -msgid "Campaign Start Date" +#: ../list.admin.class.php:448 +msgid "Edit this Item of Ads Place" msgstr "" -#: editor.admin.class.php:1117 -msgid "Campaign End Date" +#: ../list.admin.class.php:452 +msgid "Restore this Ad from the Trash" msgstr "" -#: editor.admin.class.php:1121 -msgid "" -"Use these parameters for displaying ad during the certain period of time." +#: ../list.admin.class.php:453 +msgid "Remove this Ad permanently" msgstr "" -#: editor.admin.class.php:1126 -msgid "Use limitation by hits" +#: ../list.admin.class.php:454 +msgid "Move this item to the Trash" msgstr "" -#: editor.admin.class.php:1129 -msgid "Hits Limit" +#: ../updater.class.php:25 +msgid "An error occurred during updating process..." msgstr "" -#: editor.admin.class.php:1133 -msgid "Use this parameter for limiting displaying of ad by hits." +#: ../updater.class.php:39 +msgid "Updated..." msgstr "" -#: editor.admin.class.php:1137 -msgid "Use limitation by clicks" +#: ../widget.class.php:10 +msgid "Ads Place:" msgstr "" -#: editor.admin.class.php:1140 -msgid "Clicks Limit" +#: ../widget.class.php:13 +msgid "Ads Place rotator serviced by Simple Ads Manager." msgstr "" -#: editor.admin.class.php:1144 -msgid "Use this parameter for limiting displaying of ad by clicks." +#: ../widget.class.php:101 ../widget.class.php:240 ../widget.class.php:379 +#: ../widget.class.php:516 +msgid "Title:" msgstr "" -#: editor.admin.class.php:1155 -msgid "Price of ad placement per month" +#: ../widget.class.php:124 ../widget.class.php:263 ../widget.class.php:402 +#: ../widget.class.php:539 +msgid "Hide widget style." msgstr "" -#: editor.admin.class.php:1159 -msgid "Tthis parameter used only for scheduled ads." +#: ../widget.class.php:133 ../widget.class.php:272 ../widget.class.php:411 +msgid "" +"Allow using previously defined \"before\" and \"after\" codes of Ads Place.." msgstr "" -#: editor.admin.class.php:1162 -msgid "Price per Thousand Hits" +#: ../widget.class.php:152 +msgid "Ads Zone selector serviced by Simple Ads Manager." msgstr "" -#: editor.admin.class.php:1166 -msgid "" -"Not only humans visit your blog, bots and crawlers too. In order not to " -"deceive an advertiser, you must enable the detection of bots and crawlers." +#: ../widget.class.php:288 ../js/dialog-ad.php:48 +msgid "Ad" msgstr "" -#: editor.admin.class.php:1169 -msgid "Price per Click" +#: ../widget.class.php:291 +msgid "Non-rotating single ad serviced by Simple Ads Manager." msgstr "" -#: editor.admin.class.php:1173 -msgid "" -"To calculate the earnings on clicks, you must enable counting of clicks for " -"that ad." +#: ../widget.class.php:427 +msgid "Block" msgstr "" -#: editor.admin.class.php:1182 -msgid "Ad Preview" +#: ../widget.class.php:430 +msgid "Ads Block collector serviced by Simple Ads Manager." +msgstr "" + +#: ../widget.class.php:432 ../js/dialog-block.php:48 +msgid "Ads Block" msgstr "" -#: zone.editor.admin.class.php:15 +#: ../zone.editor.admin.class.php:15 msgid "Default" msgstr "" -#: zone.editor.admin.class.php:16 +#: ../zone.editor.admin.class.php:16 msgid "None" msgstr "" -#: zone.editor.admin.class.php:165 +#: ../zone.editor.admin.class.php:169 msgid "Ads Zone Data Updated." msgstr "" -#: zone.editor.admin.class.php:280 +#: ../zone.editor.admin.class.php:286 msgid "New Ads Zone" msgstr "" -#: zone.editor.admin.class.php:280 +#: ../zone.editor.admin.class.php:286 msgid "Edit Ads Zone" msgstr "" -#: zone.editor.admin.class.php:293 +#: ../zone.editor.admin.class.php:306 msgid "Back to Zones List" msgstr "" -#: zone.editor.admin.class.php:299 js/dialog-zone.php:66 +#: ../zone.editor.admin.class.php:313 ../js/dialog-zone.php:66 msgid "Ads Zone ID" msgstr "" -#: zone.editor.admin.class.php:338 +#: ../zone.editor.admin.class.php:360 msgid "Enter description of this Ads Zone." msgstr "" -#: zone.editor.admin.class.php:350 +#: ../zone.editor.admin.class.php:372 msgid "Ads Zone Settings" msgstr "" -#: zone.editor.admin.class.php:353 +#: ../zone.editor.admin.class.php:375 msgid "Default Ads Place" msgstr "" -#: zone.editor.admin.class.php:359 +#: ../zone.editor.admin.class.php:381 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " "\"Default\"." msgstr "" -#: zone.editor.admin.class.php:363 +#: ../zone.editor.admin.class.php:385 msgid "Home Page Ads Place" msgstr "" -#: zone.editor.admin.class.php:369 +#: ../zone.editor.admin.class.php:391 msgid "Default Ads Place for Singular Pages" msgstr "" -#: zone.editor.admin.class.php:376 +#: ../zone.editor.admin.class.php:398 msgid "Single Post Ads Place" msgstr "" -#: zone.editor.admin.class.php:385 +#: ../zone.editor.admin.class.php:407 msgid "Default Ads Place for Single Custom Type Post" msgstr "" -#: zone.editor.admin.class.php:396 +#: ../zone.editor.admin.class.php:418 msgid "Ads Place for Single Post of Custom Type" msgstr "" -#: zone.editor.admin.class.php:405 +#: ../zone.editor.admin.class.php:427 msgid "Page Ads Place" msgstr "" -#: zone.editor.admin.class.php:411 +#: ../zone.editor.admin.class.php:433 msgid "Attachment Ads Place" msgstr "" -#: zone.editor.admin.class.php:418 +#: ../zone.editor.admin.class.php:440 msgid "Search Pages Ads Place" msgstr "" -#: zone.editor.admin.class.php:424 +#: ../zone.editor.admin.class.php:446 msgid "404 Page Ads Place" msgstr "" -#: zone.editor.admin.class.php:430 +#: ../zone.editor.admin.class.php:452 msgid "Default Ads Place for Archive Pages" msgstr "" -#: zone.editor.admin.class.php:437 +#: ../zone.editor.admin.class.php:459 msgid "Default Ads Place for Taxonomies Pages" msgstr "" -#: zone.editor.admin.class.php:444 +#: ../zone.editor.admin.class.php:466 msgid "Default Ads Place for Category Archive Pages" msgstr "" -#: zone.editor.admin.class.php:457 +#: ../zone.editor.admin.class.php:479 msgid "Ads Place for Category" msgstr "" -#: zone.editor.admin.class.php:473 +#: ../zone.editor.admin.class.php:495 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" -#: zone.editor.admin.class.php:483 +#: ../zone.editor.admin.class.php:505 msgid "Ads Place for Custom Type Posts Archive" msgstr "" -#: zone.editor.admin.class.php:492 +#: ../zone.editor.admin.class.php:514 msgid "Tags Archive Pages Ads Place" msgstr "" -#: zone.editor.admin.class.php:499 +#: ../zone.editor.admin.class.php:521 msgid "Default Ads Place for Author Archive Pages" msgstr "" -#: zone.editor.admin.class.php:508 +#: ../zone.editor.admin.class.php:530 msgid "Ads Place for author" msgstr "" -#: zone.editor.admin.class.php:517 +#: ../zone.editor.admin.class.php:539 msgid "Date Archive Pages Ads Place" msgstr "" -#: zone.editor.admin.class.php:524 +#: ../zone.editor.admin.class.php:546 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." msgstr "" -#: js/dialog.php:27 -msgid "Insert Ads Place" -msgstr "" - -#: js/dialog.php:41 js/dialog-zone.php:41 js/dialog-ad.php:41 -#: js/dialog-block.php:41 -msgid "Basic Settings" -msgstr "" - -#: js/dialog.php:48 widget.class.php:15 block.editor.admin.class.php:77 -msgid "Ads Place" +#: ../zone.list.admin.class.php:56 +msgid "Managing Ads Zones" msgstr "" -#: js/dialog.php:69 -msgid "Ads Place Name" +#: ../zone.list.admin.class.php:72 ../zone.list.admin.class.php:146 +msgid "Add New Zone" msgstr "" -#: js/dialog.php:79 js/dialog-zone.php:79 js/dialog-ad.php:79 -msgid "Allow Ads Places predefined codes" +#: ../zone.list.admin.class.php:89 ../zone.list.admin.class.php:95 +msgid "Zone Name" msgstr "" -#: js/dialog.php:92 js/dialog-zone.php:92 js/dialog-ad.php:92 -#: js/dialog-block.php:82 -msgid "Insert" +#: ../zone.list.admin.class.php:123 +msgid "Edit Zone" msgstr "" -#: js/dialog-zone.php:27 -msgid "Insert Ads Zone" +#: ../zone.list.admin.class.php:127 +msgid "Restore this Zone from the Trash" msgstr "" -#: js/dialog-zone.php:48 widget.class.php:149 widget.class.php:154 -#: block.editor.admin.class.php:103 -msgid "Ads Zone" +#: ../zone.list.admin.class.php:128 +msgid "Remove this Zone permanently" msgstr "" -#: js/dialog-zone.php:69 -msgid "Ads Zone Name" +#: ../zone.list.admin.class.php:133 +msgid "Move this Zone to the Trash" msgstr "" -#: js/dialog-ad.php:27 +#: ../js/dialog-ad.php:27 msgid "Insert Single Ad" msgstr "" -#: js/dialog-ad.php:48 widget.class.php:288 -msgid "Ad" +#: ../js/dialog-ad.php:41 ../js/dialog-block.php:41 ../js/dialog-zone.php:41 +#: ../js/dialog.php:41 +msgid "Basic Settings" msgstr "" -#: js/dialog-ad.php:66 +#: ../js/dialog-ad.php:66 msgid "Single Ad ID" msgstr "" -#: js/dialog-ad.php:69 +#: ../js/dialog-ad.php:69 msgid "Single Ad Name" msgstr "" -#: js/dialog-block.php:27 -msgid "Insert Ads Block" +#: ../js/dialog-ad.php:79 ../js/dialog-zone.php:79 ../js/dialog.php:79 +msgid "Allow Ads Places predefined codes" msgstr "" -#: js/dialog-block.php:48 widget.class.php:432 -msgid "Ads Block" +#: ../js/dialog-ad.php:92 ../js/dialog-block.php:82 ../js/dialog-zone.php:92 +#: ../js/dialog.php:92 +msgid "Insert" msgstr "" -#: js/dialog-block.php:66 block.editor.admin.class.php:260 -msgid "Ads Block ID" +#: ../js/dialog-block.php:27 +msgid "Insert Ads Block" msgstr "" -#: js/dialog-block.php:69 +#: ../js/dialog-block.php:69 msgid "Ads Block Name" msgstr "" -#: widget.class.php:10 -msgid "Ads Place:" -msgstr "" - -#: widget.class.php:13 -msgid "Ads Place rotator serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:101 widget.class.php:240 widget.class.php:379 -#: widget.class.php:516 -msgid "Title:" -msgstr "" - -#: widget.class.php:124 widget.class.php:263 widget.class.php:402 -#: widget.class.php:539 -msgid "Hide widget style." -msgstr "" - -#: widget.class.php:133 widget.class.php:272 widget.class.php:411 -msgid "" -"Allow using previously defined \"before\" and \"after\" codes of Ads Place.." -msgstr "" - -#: widget.class.php:152 -msgid "Ads Zone selector serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:291 -msgid "Non-rotating single ad serviced by Simple Ads Manager." -msgstr "" - -#: widget.class.php:293 block.editor.admin.class.php:90 -msgid "Single Ad" -msgstr "" - -#: widget.class.php:427 -msgid "Block" -msgstr "" - -#: widget.class.php:430 -msgid "Ads Block collector serviced by Simple Ads Manager." -msgstr "" - -#: block.editor.admin.class.php:74 -msgid "Item" -msgstr "" - -#: block.editor.admin.class.php:79 block.editor.admin.class.php:92 -#: block.editor.admin.class.php:105 -msgid "Non selected" -msgstr "" - -#: block.editor.admin.class.php:182 -msgid "Ads Block Data Updated." -msgstr "" - -#: block.editor.admin.class.php:241 -msgid "New Ads Block" -msgstr "" - -#: block.editor.admin.class.php:241 -msgid "Edit Ads Block" -msgstr "" - -#: block.editor.admin.class.php:254 -msgid "Back to Blocks List" -msgstr "" - -#: block.editor.admin.class.php:299 block.editor.admin.class.php:386 -msgid "Enter description of this Ads Block." -msgstr "" - -#: block.editor.admin.class.php:311 -msgid "Block Structure" -msgstr "" - -#: block.editor.admin.class.php:313 -msgid "Ads Block Structure Properties." -msgstr "" - -#: block.editor.admin.class.php:315 -msgid "Block Lines" -msgstr "" - -#: block.editor.admin.class.php:319 -msgid "Block Columns" -msgstr "" - -#: block.editor.admin.class.php:322 -msgid "" -"After changing these properties you must save Ads Block settings before " -"using Ads Block Editor." -msgstr "" - -#: block.editor.admin.class.php:329 -msgid "Block Styles" -msgstr "" - -#: block.editor.admin.class.php:331 -msgid "Configure Styles for this Ads Block." -msgstr "" - -#: block.editor.admin.class.php:333 block.editor.admin.class.php:359 -msgid "Margins" -msgstr "" - -#: block.editor.admin.class.php:337 block.editor.admin.class.php:363 -msgid "Padding" -msgstr "" - -#: block.editor.admin.class.php:341 block.editor.admin.class.php:367 -msgid "Background" -msgstr "" - -#: block.editor.admin.class.php:345 block.editor.admin.class.php:371 -msgid "Borders" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "Use Stylesheet rules for defining these properties." -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "For example:" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "for background property or" -msgstr "" - -#: block.editor.admin.class.php:348 block.editor.admin.class.php:374 -msgid "for border property" -msgstr "" - -#: block.editor.admin.class.php:355 -msgid "Block Items Styles" -msgstr "" - -#: block.editor.admin.class.php:357 -msgid "Configure Styles for this Ads Block Items." -msgstr "" - -#: block.editor.admin.class.php:375 -msgid "Important Note" -msgstr "" - -#: block.editor.admin.class.php:375 -msgid "" -"As the Ads Block is the regular structure, predefined styles of individual " -"items for drawing Ads Block's elements aren't used. Define styles for Ads " -"Block Items here!" -msgstr "" - -#: block.editor.admin.class.php:388 -msgid "Block Editor." -msgstr "" - -#. Plugin Name of the plugin/theme -msgid "Simple Ads Manager" -msgstr "" - -#. Plugin URI of the plugin/theme -msgid "http://www.simplelib.com/?p=480" +#: ../js/dialog-zone.php:27 +msgid "Insert Ads Zone" msgstr "" -#. Description of the plugin/theme -msgid "" -"\"Simple Ads Manager\" is easy to use plugin providing a flexible logic of " -"displaying advertisements. Visit SimpleLib blog for more details." +#: ../js/dialog-zone.php:69 +msgid "Ads Zone Name" msgstr "" -#. Author of the plugin/theme -msgid "minimus" +#: ../js/dialog.php:27 +msgid "Insert Ads Place" msgstr "" -#. Author URI of the plugin/theme -msgid "http://blogcoding.ru" +#: ../js/dialog.php:69 +msgid "Ads Place Name" msgstr "" From 9383f0ea59c703d72ace9aaa4d45b9a60151c99b Mon Sep 17 00:00:00 2001 From: minimus Date: Tue, 12 Nov 2013 18:26:06 +0300 Subject: [PATCH 06/18] Some improvements --- admin.class.php | 22 ++++++++-------------- readme.txt | 6 ++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/admin.class.php b/admin.class.php index 1f26b2b..8281372 100644 --- a/admin.class.php +++ b/admin.class.php @@ -987,6 +987,14 @@ public function samAdminPage() {

        +
        + +

        -

        Payoneer:

        -
        - - - -
        -

        - '.__(' You can change it to any value you want!', SAM_DOMAIN).''; - $str = '$200'; - printf($format, $str); - ?> -

        -

        PayPal:

        diff --git a/readme.txt b/readme.txt index 743b601..fd011ee 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,12 @@ No questions now... == Changelog == += 1.8.70 = +* Javascript output of ads (for caching compatibility) is added +* Custom Taxonomies restrictions are added +* Building query for SQL request is optimised +* Admin interface is improved +* Language pack folder is added. = 1.7.63 = * Some bugs (Ads Block style, Click Tracker) are resolved. = 1.7.61 = From 3350033d3607722e07abb42d6a3c8e0921367e60 Mon Sep 17 00:00:00 2001 From: minimus Date: Wed, 27 Nov 2013 18:44:15 +0300 Subject: [PATCH 07/18] Some Changes Updater is fixed and improved. --- README.md | 9 + ad.class.php | 218 +++--- admin.class.php | 384 +++++----- .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 418 -> 0 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 312 -> 0 bytes css/images/ui-bg_flat_10_000000_40x100.png | Bin 205 -> 0 bytes css/images/ui-bg_flat_75_f5f5f5_40x100.png | Bin 0 -> 230 bytes css/images/ui-bg_flat_75_ffffff_40x100.png | Bin 208 -> 0 bytes css/images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 262 -> 0 bytes css/images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 348 -> 0 bytes css/images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 335 -> 0 bytes css/images/ui-bg_glass_65_f5f5f5_1x400.png | Bin 0 -> 262 bytes css/images/ui-bg_glass_65_ffffff_1x400.png | Bin 207 -> 0 bytes css/images/ui-bg_glass_95_fef1ec_1x400.png | Bin 332 -> 0 bytes .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 5815 -> 0 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 278 -> 0 bytes .../ui-bg_highlight-soft_55_fbf3c8_1x100.png | Bin 0 -> 334 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 280 -> 0 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 328 -> 0 bytes .../ui-bg_highlight-soft_95_cccccc_1x100.png | Bin 0 -> 281 bytes .../ui-bg_highlight-soft_95_fcbca3_1x100.png | Bin 0 -> 328 bytes css/images/ui-icons_228ef1_256x240.png | Bin 4549 -> 0 bytes css/images/ui-icons_ef8c08_256x240.png | Bin 4549 -> 0 bytes css/images/ui-icons_ffd27a_256x240.png | Bin 4549 -> 0 bytes css/images/ui-icons_ffffff_256x240.png | Bin 6299 -> 0 bytes css/{jquery-ui.css => jquery-ui-sam.css} | 32 +- css/jquery-ui-sam.min.css | 7 + css/sam-admin-edit.css | 16 +- editor.admin.class.php | 54 +- errorlog.admin.class.php | 35 +- images/ok-32.png | Bin 3747 -> 4313 bytes images/ok.png | Bin 4546 -> 5448 bytes js/sam-admin-edit-item.js | 658 +++++++++++++++++ js/sam-admin-edit-place.js | 113 +++ js/sam-admin-edit.js | 34 + js/sam-errors-list.js | 33 +- {lang => langs}/simple-ads-manager-be_BY.mo | Bin {lang => langs}/simple-ads-manager-be_BY.po | 0 {lang => langs}/simple-ads-manager-de_DE.mo | Bin {lang => langs}/simple-ads-manager-de_DE.po | 0 {lang => langs}/simple-ads-manager-es_ES.mo | Bin {lang => langs}/simple-ads-manager-es_ES.po | 0 {lang => langs}/simple-ads-manager-ru_RU.mo | Bin {lang => langs}/simple-ads-manager-ru_RU.po | 0 {lang => langs}/simple-ads-manager.pot | 0 readme.txt | 2 + sam.class.php | 104 +-- updater.class.php | 664 +++++++++--------- 48 files changed, 1645 insertions(+), 718 deletions(-) delete mode 100644 css/images/ui-bg_diagonals-thick_18_b81900_40x40.png delete mode 100644 css/images/ui-bg_diagonals-thick_20_666666_40x40.png delete mode 100644 css/images/ui-bg_flat_10_000000_40x100.png create mode 100644 css/images/ui-bg_flat_75_f5f5f5_40x100.png delete mode 100644 css/images/ui-bg_flat_75_ffffff_40x100.png delete mode 100644 css/images/ui-bg_glass_100_f6f6f6_1x400.png delete mode 100644 css/images/ui-bg_glass_100_fdf5ce_1x400.png delete mode 100644 css/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 css/images/ui-bg_glass_65_f5f5f5_1x400.png delete mode 100644 css/images/ui-bg_glass_65_ffffff_1x400.png delete mode 100644 css/images/ui-bg_glass_95_fef1ec_1x400.png delete mode 100644 css/images/ui-bg_gloss-wave_35_f6a828_500x100.png delete mode 100644 css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png create mode 100644 css/images/ui-bg_highlight-soft_55_fbf3c8_1x100.png delete mode 100644 css/images/ui-bg_highlight-soft_75_cccccc_1x100.png delete mode 100644 css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png create mode 100644 css/images/ui-bg_highlight-soft_95_cccccc_1x100.png create mode 100644 css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png delete mode 100644 css/images/ui-icons_228ef1_256x240.png delete mode 100644 css/images/ui-icons_ef8c08_256x240.png delete mode 100644 css/images/ui-icons_ffd27a_256x240.png delete mode 100644 css/images/ui-icons_ffffff_256x240.png rename css/{jquery-ui.css => jquery-ui-sam.css} (93%) create mode 100644 css/jquery-ui-sam.min.css create mode 100644 js/sam-admin-edit-item.js create mode 100644 js/sam-admin-edit-place.js rename {lang => langs}/simple-ads-manager-be_BY.mo (100%) rename {lang => langs}/simple-ads-manager-be_BY.po (100%) rename {lang => langs}/simple-ads-manager-de_DE.mo (100%) rename {lang => langs}/simple-ads-manager-de_DE.po (100%) rename {lang => langs}/simple-ads-manager-es_ES.mo (100%) rename {lang => langs}/simple-ads-manager-es_ES.po (100%) rename {lang => langs}/simple-ads-manager-ru_RU.mo (100%) rename {lang => langs}/simple-ads-manager-ru_RU.po (100%) rename {lang => langs}/simple-ads-manager.pot (100%) diff --git a/README.md b/README.md index 2553bf3..585875a 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,15 @@ Do not upgrade this plugin from Update page! Upgrade it from Plugins page! Change log ========== +1.8.70 +* Javascript output of ads (for caching compatibility) is added +* Custom Taxonomies restrictions are added +* Building query for SQL request is optimised +* Admin interface is improved +* Loading/Selecting banners (Image Mode) from Wordpress Media Library is added +* Updater is fixed and improved. +* Language pack folder is added. + 1.7.63 * Some bugs (Ads Block style, Click Tracker) are resolved. diff --git a/ad.class.php b/ad.class.php index 1e24e52..82dce49 100644 --- a/ad.class.php +++ b/ad.class.php @@ -35,34 +35,34 @@ private function buildAd( $args = null, $useCodes = false ) { $aTable = $wpdb->prefix . "sam_ads"; $settings = $this->getSettings(); - if(!empty($args['id'])) $wid = "$aTable.id = {$args['id']}"; - else $wid = "$aTable.name = '{$args['name']}'"; + if(!empty($args['id'])) $wid = "sa.id = {$args['id']}"; + else $wid = "sa.name = '{$args['name']}'"; $output = ''; $aSql = "SELECT - $aTable.id, - $aTable.pid, - $aTable.code_mode, - $aTable.ad_code, - $aTable.ad_img, - $aTable.ad_alt, - $aTable.ad_no, - $aTable.ad_target, - $aTable.ad_swf, - $aTable.ad_swf_flashvars, - $aTable.ad_swf_params, - $aTable.ad_swf_attributes, - $aTable.count_clicks, - $aTable.code_type, - $pTable.code_before, - $pTable.code_after, - $pTable.place_size, - $pTable.place_custom_width, - $pTable.place_custom_height - FROM $aTable - INNER JOIN $pTable - ON $aTable.pid = $pTable.id + sa.id, + sa.pid, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.code_type, + sp.code_before, + sp.code_after, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height + FROM $aTable sa + INNER JOIN $pTable sp + ON sa.pid = sp.id WHERE $wid;"; $ad = $wpdb->get_row($aSql, ARRAY_A); if($ad['code_mode'] == 0) { @@ -215,30 +215,30 @@ private function buildAd( $args = null, $useCodes = false ) { $whereClauseW = $this->clauses['WCW']; $whereClause2W = $this->clauses['WC2W']; - if(!empty($args['id'])) $pId = "$pTable.id = {$args['id']}"; - else $pId = "$pTable.name = '{$args['name']}'"; + if(!empty($args['id'])) $pId = "sp.id = {$args['id']}"; + else $pId = "sp.name = '{$args['name']}'"; $pSql = "SELECT - $pTable.id, - $pTable.name, - $pTable.description, - $pTable.code_before, - $pTable.code_after, - $pTable.place_size, - $pTable.place_custom_width, - $pTable.place_custom_height, - $pTable.patch_img, - $pTable.patch_link, - $pTable.patch_code, - $pTable.patch_adserver, - $pTable.patch_dfp, - $pTable.patch_source, - $pTable.trash, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE) AS ad_count, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClause2W) AS ad_logic_count, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW) AS ad_full_count - FROM $pTable - WHERE $pId AND $pTable.trash IS FALSE;"; + sp.id, + sp.name, + sp.description, + sp.code_before, + sp.code_after, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height, + sp.patch_img, + sp.patch_link, + sp.patch_code, + sp.patch_adserver, + sp.patch_dfp, + sp.patch_source, + sp.trash, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE) AS ad_count, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClause2W) AS ad_logic_count, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW) AS ad_full_count + FROM $pTable sp + WHERE $pId AND sp.trash IS FALSE;"; $place = $wpdb->get_row($pSql, ARRAY_A); @@ -295,25 +295,25 @@ private function buildAd( $args = null, $useCodes = false ) { } $aSql = "SELECT - $aTable.id, - $aTable.pid, - $aTable.code_mode, - $aTable.ad_code, - $aTable.ad_img, - $aTable.ad_alt, - $aTable.ad_no, - $aTable.ad_target, - $aTable.ad_swf, - $aTable.ad_swf_flashvars, - $aTable.ad_swf_params, - $aTable.ad_swf_attributes, - $aTable.count_clicks, - $aTable.code_type, - $aTable.ad_hits, - $aTable.ad_weight_hits, - IF($aTable.ad_weight, ($aTable.ad_weight_hits*10/($aTable.ad_weight*$cycle)), 0) AS ad_cycle - FROM $aTable - WHERE $aTable.pid = {$place['id']} AND $aTable.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW + sa.id, + sa.pid, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.code_type, + sa.ad_hits, + sa.ad_weight_hits, + IF(sa.ad_weight, (sa.ad_weight_hits*10/(sa.ad_weight*$cycle)), 0) AS ad_cycle + FROM $aTable sa + WHERE sa.pid = {$place['id']} AND sa.trash IS FALSE AND $whereClause $whereClauseT $whereClauseW ORDER BY ad_cycle LIMIT 1;"; @@ -423,34 +423,34 @@ private function buildZone($args = null, $useCodes = false, $crawler = false) { $id = 0; // None $output = ''; - if(!empty($args['id'])) $zId = "$zTable.id = {$args['id']}"; - else $zId = "$zTable.name = '{$args['name']}'"; + if(!empty($args['id'])) $zId = "sz.id = {$args['id']}"; + else $zId = "sz.name = '{$args['name']}'"; $zSql = "SELECT - $zTable.id, - $zTable.name, - $zTable.z_default, - $zTable.z_home, - $zTable.z_singular, - $zTable.z_single, - $zTable.z_ct, - $zTable.z_single_ct, - $zTable.z_page, - $zTable.z_attachment, - $zTable.z_search, - $zTable.z_404, - $zTable.z_archive, - $zTable.z_tax, - $zTable.z_category, - $zTable.z_cats, - $zTable.z_tag, - $zTable.z_author, - $zTable.z_authors, - $zTable.z_cts, - $zTable.z_archive_ct, - $zTable.z_date - FROM $zTable - WHERE $zId AND $zTable.trash IS FALSE;"; + sz.id, + sz.name, + sz.z_default, + sz.z_home, + sz.z_singular, + sz.z_single, + sz.z_ct, + sz.z_single_ct, + sz.z_page, + sz.z_attachment, + sz.z_search, + sz.z_404, + sz.z_archive, + sz.z_tax, + sz.z_category, + sz.z_cats, + sz.z_tag, + sz.z_author, + sz.z_authors, + sz.z_cts, + sz.z_archive_ct, + sz.z_date + FROM $zTable sz + WHERE $zId AND sz.trash IS FALSE;"; $zone = $wpdb->get_row($zSql, ARRAY_A); if(!empty($zone)) { $cats = unserialize($zone['z_cats']); @@ -558,26 +558,26 @@ private function buildBlock($args = null, $crawler = false) { $bTable = $wpdb->prefix . "sam_blocks"; $output = ''; - if(!empty($args['id'])) $bId = "$bTable.id = {$args['id']}"; - else $bId = "$bTable.name = '{$args['name']}'"; + if(!empty($args['id'])) $bId = "sb.id = {$args['id']}"; + else $bId = "sb.name = '{$args['name']}'"; $bSql = "SELECT - $bTable.id, - $bTable.name, - $bTable.b_lines, - $bTable.b_cols, - $bTable.block_data, - $bTable.b_margin, - $bTable.b_padding, - $bTable.b_background, - $bTable.b_border, - $bTable.i_margin, - $bTable.i_padding, - $bTable.i_background, - $bTable.i_border, - $bTable.trash - FROM $bTable - WHERE $bId AND $bTable.trash IS FALSE;"; + sb.id, + sb.name, + sb.b_lines, + sb.b_cols, + sb.block_data, + sb.b_margin, + sb.b_padding, + sb.b_background, + sb.b_border, + sb.i_margin, + sb.i_padding, + sb.i_background, + sb.i_border, + sb.trash + FROM $bTable sb + WHERE $bId AND sb.trash IS FALSE;"; $block = $wpdb->get_row($bSql, ARRAY_A); if(!empty($block)) { diff --git a/admin.class.php b/admin.class.php index 8281372..0e20fbe 100644 --- a/admin.class.php +++ b/admin.class.php @@ -18,42 +18,25 @@ public function __construct() { global $wp_version; if ( function_exists( 'load_plugin_textdomain' ) ) - load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/lang/' ); + load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/langs/' ); if(!is_dir(SAM_AD_IMG)) mkdir(SAM_AD_IMG); register_activation_hook(SAM_MAIN_FILE, array(&$this, 'onActivate')); register_deactivation_hook(SAM_MAIN_FILE, array(&$this, 'onDeactivate')); + register_uninstall_hook(SAM_MAIN_FILE, array(&$this, 'onUninstall')); $options = parent::getSettings(false); if(!empty($options['access'])) $access = $options['access']; else $access = 'manage_options'; - /*switch($options) { - case 'SuperAdmin': - $access = 'manage_network'; - break; - case 'Administrator': - $access = 'Plugin menu access by user role'; - break; - case 'Editor': - $access = 'edit_others_posts'; - break; - case 'Author': - $access = 'publish_posts'; - break; - case 'Contributor': - $access = 'edit_posts'; - break; - default: - $access = 'manage_options'; - break; - }*/ + define('SAM_ACCESS', $access); add_action('wp_ajax_upload_ad_image', array(&$this, 'uploadHandler')); add_action('wp_ajax_get_strings', array(&$this, 'getStringsHandler')); add_action('wp_ajax_get_combo_data', array(&$this, 'getComboDataHandler')); add_action('wp_ajax_close_pointer', array(&$this, 'closePointerHandler')); + add_action('wp_ajax_get_error', array(&$this, 'getErrorDataHandler')); add_action('admin_init', array(&$this, 'initSettings')); add_action('admin_menu', array(&$this, 'regAdminPage')); add_filter('tiny_mce_version', array(&$this, 'tinyMCEVersion')); @@ -107,6 +90,26 @@ public function onDeactivate() { } } + public function onUninstall() { + global $wpdb; + $zTable = $wpdb->prefix . "sam_zones"; + $pTable = $wpdb->prefix . "sam_places"; + $aTable = $wpdb->prefix . "sam_ads"; + $bTable = $wpdb->prefix . "sam_blocks"; + + delete_option( SAM_OPTIONS_NAME ); + delete_option('sam_version'); + delete_option('sam_db_version'); + + $sql = 'DROP TABLE IF EXISTS '; + $wpdb->query($sql.$zTable); + $wpdb->query($sql.$pTable); + $wpdb->query($sql.$aTable); + $wpdb->query($sql.$bTable); + + if(is_dir(SAM_AD_IMG)) rmdir(SAM_AD_IMG); + } + public function getPointerOptions($force = false) { if($force) { $pointers = get_option('sam_pointers', ''); @@ -220,26 +223,16 @@ public function regAdminPage() { $menuPage = add_object_page(__('Ads', SAM_DOMAIN), __('Ads', SAM_DOMAIN), SAM_ACCESS, 'sam-list', array(&$this, 'samTablePage'), WP_PLUGIN_URL.'/simple-ads-manager/images/sam-icon.png'); $this->listPage = add_submenu_page('sam-list', __('Ads List', SAM_DOMAIN), __('Ads Places', SAM_DOMAIN), SAM_ACCESS, 'sam-list', array(&$this, 'samTablePage')); - add_action('admin_print_styles-'.$this->listPage, array(&$this, 'adminListStyles')); - $this->editPage = add_submenu_page('sam-list', __('Ad Editor', SAM_DOMAIN), __('New Place', SAM_DOMAIN), SAM_ACCESS, 'sam-edit', array(&$this, 'samEditPage')); - add_action('admin_print_styles-'.$this->editPage, array(&$this, 'adminEditStyles')); - add_action('admin_print_scripts-'.$this->editPage, array(&$this, 'adminEditScripts')); + $this->editPage = add_submenu_page('sam-list', __('Ad Editor', SAM_DOMAIN), __('New Place', SAM_DOMAIN), SAM_ACCESS, 'sam-edit', array(&$this, 'samEditPage')); $this->listZone = add_submenu_page('sam-list', __('Ads Zones List', SAM_DOMAIN), __('Ads Zones', SAM_DOMAIN), SAM_ACCESS, 'sam-zone-list', array(&$this, 'samZoneListPage')); - add_action('admin_print_styles-'.$this->listZone, array(&$this, 'adminListStyles')); $this->editZone = add_submenu_page('sam-list', __('Ads Zone Editor', SAM_DOMAIN), __('New Zone', SAM_DOMAIN), SAM_ACCESS, 'sam-zone-edit', array(&$this, 'samZoneEditPage')); - add_action('admin_print_styles-'.$this->editZone, array(&$this, 'adminEditStyles')); - add_action('admin_print_scripts-'.$this->editZone, array(&$this, 'adminEditZBScripts')); $this->listBlock = add_submenu_page('sam-list', __('Ads Blocks List', SAM_DOMAIN), __('Ads Blocks', SAM_DOMAIN), SAM_ACCESS, 'sam-block-list', array(&$this, 'samBlockListPage')); - add_action('admin_print_styles-'.$this->listBlock, array(&$this, 'adminListStyles')); $this->editBlock = add_submenu_page('sam-list', __('Ads Block Editor', SAM_DOMAIN), __('New Block', SAM_DOMAIN), SAM_ACCESS, 'sam-block-edit', array(&$this, 'samBlockEditPage')); - add_action('admin_print_styles-'.$this->editBlock, array(&$this, 'adminEditStyles')); - add_action('admin_print_scripts-'.$this->editBlock, array(&$this, 'adminEditZBScripts')); - $this->settingsPage = add_submenu_page('sam-list', __('Simple Ads Manager Settings', SAM_DOMAIN), __('Settings', SAM_DOMAIN), 'manage_options', 'sam-settings', array(&$this, 'samAdminPage')); - add_action('admin_print_styles-'.$this->settingsPage, array(&$this, 'adminSettingsStyles')); - add_action('admin_print_scripts-'.$this->settingsPage, array(&$this, 'adminSettingsScripts')); + $this->settingsPage = add_submenu_page('sam-list', __('Simple Ads Manager Settings', SAM_DOMAIN), __('Settings', SAM_DOMAIN), 'manage_options', 'sam-settings', array(&$this, 'samAdminPage')); $this->eLogPage = add_submenu_page('sam-list', __('Simple Ads Manager Error Log', SAM_DOMAIN), __('Error Log', SAM_DOMAIN), SAM_ACCESS, 'sam-errors', array(&$this, 'samErrorLog')); - add_action('admin_print_styles-'.$this->eLogPage, array(&$this, 'adminListStyles')); - add_action('admin_print_scripts-'.$this->eLogPage, array(&$this, 'errorsListScripts')); + + add_action('admin_enqueue_scripts', array(&$this, 'loadScripts')); + if(version_compare($wp_version, '3.3', '>=')) { add_action('load-'.$this->listPage, array(&$this, 'samHelp')); add_action('load-'.$this->editPage, array(&$this, 'samHelp')); @@ -275,139 +268,174 @@ public function help($contextualHelp, $screenId, $screen) { return $help->help($contextualHelp, $screenId, $screen); } - - public function adminEditStyles() { - wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); - wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui.css', false, '1.10.3'); - wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); - wp_enqueue_style('wp-pointer'); - wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); - wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); - } - - public function adminSettingsStyles() { - wp_enqueue_style('adminSettingsLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); - //wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-1.8.9.custom.css', false, '1.8.9'); - wp_enqueue_style('jSlider', SAM_URL.'css/jslider.css', false, '1.1.0'); - wp_enqueue_style('jSlider-plastic', SAM_URL.'css/jslider.round.plastic.css', false, '1.1.0'); - wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); - } - - public function adminListStyles() { - wp_enqueue_style('adminListLayout', SAM_URL.'css/sam-admin-list.css', false, SAM_VERSION); - wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui.css', false, '1.10.3'); - } - - public function adminEditScripts() { - $options = parent::getSettings(); - $pointers = self::getPointerOptions(); - $loc = get_locale(); - if(in_array($loc, array('en_GB', 'fr_CH', 'pt_BR', 'sr_SR', 'zh_CN', 'zh_HK', 'zh_TW'))) - $lc = str_replace('_', '-', $loc); - else $lc = substr($loc, 0, 2); - - if($this->cmsVer === 'low') { - wp_register_script('jquery-effects-core', SAM_URL.'js/jquery.effects.core.min.js', array('jquery'), '1.8.16'); - wp_register_script('jquery-effects-blind', SAM_URL.'js/jquery.effects.blind.min.js', array('jquery', 'jquery-effects-core'), '1.8.16'); + + public function loadScripts($hook) { + if($hook == $this->settingsPage) { + wp_enqueue_style('adminSettingsLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); + wp_enqueue_style('jSlider', SAM_URL.'css/jslider.css', false, '1.1.0'); + wp_enqueue_style('jSlider-plastic', SAM_URL.'css/jslider.round.plastic.css', false, '1.1.0'); + wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + + wp_enqueue_script('jquery'); + wp_enqueue_script('hash-table', SAM_URL.'js/slider/jshashtable-2.1_src.js', array('jquery'), '2.1'); + wp_enqueue_script('number-formatter', SAM_URL.'js/slider/jquery.numberformatter-1.2.3.js', array('jquery'), '1.2.3'); + wp_enqueue_script('templates', SAM_URL.'js/slider/tmpl.js', array('jquery')); + wp_enqueue_script('depend-class', SAM_URL.'js/slider/jquery.dependClass-0.1.js', array('jquery'), '0.1'); + wp_enqueue_script('draggable', SAM_URL.'js/slider/draggable-0.1.js', array('jquery'), '0.1'); + wp_enqueue_script('jSlider', SAM_URL.'js/slider/jquery.slider.js', array('jquery', 'draggable'), '1.1.0'); + + wp_enqueue_script('sam-settings', SAM_URL.'js/sam-settings.js', array('jquery', 'draggable'), SAM_VERSION); + wp_localize_script('sam-settings', 'options', array( + 'roles' => array( + __('Super Admin', SAM_DOMAIN), + __('Administrator', SAM_DOMAIN), + __('Editor', SAM_DOMAIN), + __('Author', SAM_DOMAIN), + __('Contributor', SAM_DOMAIN) + ), + 'values' => array('manage_network', 'manage_options', 'edit_others_posts', 'publish_posts', 'edit_posts') + )); + } + elseif($hook == $this->listPage || $hook == $this->listZone || $hook == $this->listBlock) { + wp_enqueue_style('adminListLayout', SAM_URL.'css/sam-admin-list.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui.css', false, '1.10.3'); } + elseif($hook == $this->editPage) { + $mode = (isset($_GET['mode'])) ? $_GET['mode'] : 'place'; + $pointers = self::getPointerOptions(); + if($mode == 'place') { + wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-sam.css', false, '1.10.3'); + wp_enqueue_style('wp-pointer'); + wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); - if($options['useSWF']) wp_enqueue_script('swfobject'); - wp_enqueue_script('jquery'); - wp_enqueue_script('W2UI', SAM_URL . 'js/w2ui.min.js', array('jquery'), '1.3'); - wp_enqueue_script('jquery-ui-core'); - wp_enqueue_script('jquery-effects-core'); - //wp_enqueue_script('jquery-ui-mouse'); - wp_enqueue_script('jquery-ui-widget'); - wp_enqueue_script('jquery-ui-sortable'); - wp_enqueue_script('jquery-ui-position'); - //wp_enqueue_script('jquery-ui-autocomplete'); - wp_enqueue_script('jquery-ui-tabs'); - wp_enqueue_script('jquery-effects-blind'); - wp_enqueue_script('jquery-ui-datepicker'); - wp_enqueue_script('jquery-ui-tooltip'); - if(file_exists(SAM_PATH.'/js/i18n/jquery.ui.datepicker-'.$lc.'.js')) - wp_enqueue_script('jquery-ui-locale', SAM_URL.'js/i18n/jquery.ui.datepicker-'.$lc.'.js', array('jquery'), '1.8.9'); - wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); - - //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); - wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.2'); - - wp_enqueue_script('wp-pointer'); - wp_localize_script('wp-pointer', 'samPointer', array( - 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), - 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)) - )); - wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); - } + if($this->cmsVer === 'low') { + wp_register_script('jquery-effects-core', SAM_URL.'js/jquery.effects.core.min.js', array('jquery'), '1.8.16'); + wp_register_script('jquery-effects-blind', SAM_URL.'js/jquery.effects.blind.min.js', array('jquery', 'jquery-effects-core'), '1.8.16'); + } - public function adminEditZBScripts() { - $pointers = self::getPointerOptions(); - - wp_enqueue_script('jquery'); - wp_enqueue_script('jquery-ui-core'); - wp_enqueue_script('jquery-effects-core'); - wp_enqueue_script('jquery-ui-widget'); - wp_enqueue_script('jquery-ui-sortable'); - wp_enqueue_script('jquery-ui-position'); - wp_enqueue_script('jquery-effects-blind'); - wp_enqueue_script('jquery-ui-tooltip'); - - wp_enqueue_script('wp-pointer'); - wp_localize_script('wp-pointer', 'samPointer', array( - 'zones' => array('enabled' => $pointers['zones'], 'title' => __('Name of Ads Zone', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), - 'blocks' => array('enabled' => $pointers['blocks'], 'title' => __('Name of Ads Block', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use plugin\'s widgets.', SAM_DOMAIN)) - )); - wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-zb.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); - } + wp_enqueue_script('jquery'); + wp_enqueue_media(); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-effects-core'); + wp_enqueue_script('jquery-ui-widget'); + wp_enqueue_script('jquery-ui-sortable'); + wp_enqueue_script('jquery-ui-position'); + wp_enqueue_script('jquery-ui-tabs'); + wp_enqueue_script('jquery-effects-blind'); + wp_enqueue_script('jquery-ui-tooltip'); + wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); - public function errorsListScripts() { - wp_enqueue_script('jquery'); - wp_enqueue_script('jquery-ui-core'); - wp_enqueue_script('jquery-ui-widget'); - wp_enqueue_script('jquery-ui-button'); - wp_enqueue_script('jquery-ui-draggable'); - wp_enqueue_script('jquery-ui-mouse'); - wp_enqueue_script('jquery-ui-position'); - wp_enqueue_script('jquery-ui-resizable'); - wp_enqueue_script('jquery-ui-dialog'); - wp_enqueue_script('errorsListScript', SAM_URL.'js/sam-errors-list.js', array('jquery', 'jquery-ui-core'), SAM_VERSION); - wp_localize_script('errorsListScript', 'options', array( - 'id' => __('Error ID', SAM_DOMAIN), - 'date' => __('Error Date', SAM_DOMAIN), - 'table' => __('Table', SAM_DOMAIN), - 'msg' => __('Error Message', SAM_DOMAIN), - 'sql' => __('Error SQL', SAM_DOMAIN), - 'etype' => __('Type', SAM_DOMAIN), - 'close' => __('Close', SAM_DOMAIN), - 'imgURL' => SAM_IMG_URL, - 'alts' => array(__('Warning', SAM_DOMAIN), __('Ok', SAM_DOMAIN)) - )); - } + wp_enqueue_script('wp-pointer'); + wp_localize_script('wp-pointer', 'samPointer', array( + 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), + 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), + 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)) + )); + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-place.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + } + if($mode == 'item') { + wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-sam.css', false, '1.10.3'); + wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); + wp_enqueue_style('wp-pointer'); + wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); - public function adminSettingsScripts() { - wp_enqueue_script('jquery'); - //wp_enqueue_script('jquery-ui-core'); - //wp_enqueue_script('jquery-ui-widget'); - //wp_enqueue_script('jquery-ui-mouse'); - //wp_enqueue_script('jquery-ui-slider'); - wp_enqueue_script('hash-table', SAM_URL.'js/slider/jshashtable-2.1_src.js', array('jquery'), '2.1'); - wp_enqueue_script('number-formatter', SAM_URL.'js/slider/jquery.numberformatter-1.2.3.js', array('jquery'), '1.2.3'); - wp_enqueue_script('templates', SAM_URL.'js/slider/tmpl.js', array('jquery')); - wp_enqueue_script('depend-class', SAM_URL.'js/slider/jquery.dependClass-0.1.js', array('jquery'), '0.1'); - wp_enqueue_script('draggable', SAM_URL.'js/slider/draggable-0.1.js', array('jquery'), '0.1'); - wp_enqueue_script('jSlider', SAM_URL.'js/slider/jquery.slider.js', array('jquery', 'draggable'), '1.1.0'); - - wp_enqueue_script('sam-settings', SAM_URL.'js/sam-settings.js', array('jquery', 'draggable'), SAM_VERSION); - wp_localize_script('sam-settings', 'options', array( - 'roles' => array( - __('Super Admin', SAM_DOMAIN), - __('Administrator', SAM_DOMAIN), - __('Editor', SAM_DOMAIN), - __('Author', SAM_DOMAIN), - __('Contributor', SAM_DOMAIN) - ), - 'values' => array('manage_network', 'manage_options', 'edit_others_posts', 'publish_posts', 'edit_posts') - )); + $options = parent::getSettings(); + $loc = get_locale(); + if(in_array($loc, array('en_GB', 'fr_CH', 'pt_BR', 'sr_SR', 'zh_CN', 'zh_HK', 'zh_TW'))) + $lc = str_replace('_', '-', $loc); + else $lc = substr($loc, 0, 2); + + if($this->cmsVer === 'low') { + wp_register_script('jquery-effects-core', SAM_URL.'js/jquery.effects.core.min.js', array('jquery'), '1.8.16'); + wp_register_script('jquery-effects-blind', SAM_URL.'js/jquery.effects.blind.min.js', array('jquery', 'jquery-effects-core'), '1.8.16'); + } + + if($options['useSWF']) wp_enqueue_script('swfobject'); + wp_enqueue_script('jquery'); + wp_enqueue_media(); + wp_enqueue_script('W2UI', SAM_URL . 'js/w2ui.min.js', array('jquery'), '1.3'); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-effects-core'); + //wp_enqueue_script('jquery-ui-mouse'); + wp_enqueue_script('jquery-ui-widget'); + wp_enqueue_script('jquery-ui-sortable'); + wp_enqueue_script('jquery-ui-position'); + //wp_enqueue_script('jquery-ui-autocomplete'); + wp_enqueue_script('jquery-ui-tabs'); + wp_enqueue_script('jquery-effects-blind'); + wp_enqueue_script('jquery-ui-datepicker'); + wp_enqueue_script('jquery-ui-tooltip'); + if(file_exists(SAM_PATH.'/js/i18n/jquery.ui.datepicker-'.$lc.'.js')) + wp_enqueue_script('jquery-ui-locale', SAM_URL.'js/i18n/jquery.ui.datepicker-'.$lc.'.js', array('jquery'), '1.8.9'); + wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); + + //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); + wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.2'); + + wp_enqueue_script('wp-pointer'); + wp_localize_script('wp-pointer', 'samPointer', array( + 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), + 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), + 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)) + )); + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-item.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + } + } + elseif($hook == $this->editZone || $hook == $this->editBlock) { + $pointers = self::getPointerOptions(); + + wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-sam.css', false, '1.10.3'); + //wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); + wp_enqueue_style('wp-pointer'); + wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + //wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); + + wp_enqueue_script('jquery'); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-effects-core'); + wp_enqueue_script('jquery-ui-widget'); + wp_enqueue_script('jquery-ui-sortable'); + wp_enqueue_script('jquery-ui-position'); + wp_enqueue_script('jquery-effects-blind'); + wp_enqueue_script('jquery-ui-tooltip'); + + wp_enqueue_script('wp-pointer'); + wp_localize_script('wp-pointer', 'samPointer', array( + 'zones' => array('enabled' => $pointers['zones'], 'title' => __('Name of Ads Zone', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), + 'blocks' => array('enabled' => $pointers['blocks'], 'title' => __('Name of Ads Block', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use plugin\'s widgets.', SAM_DOMAIN)) + )); + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-zb.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + } + elseif($hook == $this->eLogPage) { + wp_enqueue_style('adminListLayout', SAM_URL.'css/sam-admin-list.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-sam.css', false, '1.10.3'); + + wp_enqueue_script('jquery'); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-ui-widget'); + wp_enqueue_script('jquery-ui-button'); + wp_enqueue_script('jquery-ui-draggable'); + wp_enqueue_script('jquery-ui-mouse'); + wp_enqueue_script('jquery-ui-position'); + wp_enqueue_script('jquery-ui-resizable'); + wp_enqueue_script('jquery-ui-dialog'); + wp_enqueue_script('errorsListScript', SAM_URL.'js/sam-errors-list.js', array('jquery', 'jquery-ui-core'), SAM_VERSION); + wp_localize_script('errorsListScript', 'options', array( + 'id' => __('Error ID', SAM_DOMAIN), + 'date' => __('Error Date', SAM_DOMAIN), + 'table' => __('Table', SAM_DOMAIN), + 'msg' => __('Error Message', SAM_DOMAIN), + 'sql' => __('Error SQL', SAM_DOMAIN), + 'etype' => __('Type', SAM_DOMAIN), + 'close' => __('Close', SAM_DOMAIN), + 'imgURL' => SAM_IMG_URL, + 'alts' => array(__('Warning', SAM_DOMAIN), __('Ok', SAM_DOMAIN)) + )); + } } public function getCategories($valueType = 'array') { @@ -462,6 +490,32 @@ public function closePointerHandler() { else wp_send_json_error(); } + public function getErrorDataHandler() { + global $wpdb; + $eTable = $wpdb->prefix . 'sam_errors'; + $charset = get_bloginfo('charset'); + $eTypes = array(__('Warning', SAM_DOMAIN), __('Update Error', SAM_DOMAIN), __('Output Error', SAM_DOMAIN)); + @header("Content-Type: application/json; charset=$charset"); + if(isset($_REQUEST['id'])) { + $id = $_REQUEST['id']; + $eSql = "SELECT + se.id, + se.error_date, + UNIX_TIMESTAMP(se.error_date) as date, + se.table_name as name, + se.error_type, + se.error_msg as msg, + se.error_sql as es, + se.resolved + FROM $eTable se WHERE se.id = %d"; + $out = $wpdb->get_row($wpdb->prepare($eSql, $id), ARRAY_A); + if(!empty($out['date'])) $out['date'] = date_i18n(get_option('date_format').' '.get_option('time_format'), $out['date']); + $out['type'] = $eTypes[$out['error_type']]; + wp_send_json_success($out); + } + else wp_send_json_error(); + } + public function getComboDataHandler() { global $wpdb; $uTable = $wpdb->prefix . "users"; @@ -788,7 +842,7 @@ public function sanitizeSettings($input) { global $wpdb; $pTable = $wpdb->prefix . "sam_places"; - $sql = "SELECT $pTable.patch_dfp FROM $pTable WHERE $pTable.patch_source = 2"; + $sql = "SELECT sp.patch_dfp FROM $pTable sp WHERE sp.patch_source = 2"; $rows = $wpdb->get_results($sql, ARRAY_A); $blocks = array(); foreach($rows as $value) array_push($blocks, $value['patch_dfp']); diff --git a/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 4ac8be8b9c4976689f0d699d3e363ac828cfa4da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 418 zcmeAS@N?(olHy`uVBq!ia0vp^8Xzpd1SErbK34)Mwj^(Nm;YeE8S(uNP=vFJ#Am<$En9-cLebC{re^wgoll|t(`&s7)9J{YxO^N-aI z$5L3jD^ISzl+wQbw$Cm(|Mhq4jH=@2wI8o7+Gd%b|IIx5*Zn&?>lgCSXrXO^WskXw=UX3LH%8!s;k z#x%*aEGp*Jjm(QM&8zq~)!)n5QqVsS=vUPe*NBpo#FA922>S z4={E+nQaGTRC&5MhIkx*d-b$ng949h;3{8svn*F5o}?c;Kir+G=xvlfb9Ucnx!LzV zKYw1UzcGecb6t~6xWlB=3a51)dX2qx%p0t(H?ll;Xvl-Ua7M6%M)vm*~w}RD4lnZuhbmcl2i$G2U9fNc+T-xj%reP%UwdC`m~y zNwrEYN(E93Mh1q)x&}tNMkXPK7FMRFR>qdP1{PKZ2KfeG9-?T-%}>cptHiBAF4rd( PsDZ)L)z4*}Q$iB}%pz%= diff --git a/css/images/ui-bg_flat_10_000000_40x100.png b/css/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100644 index d742a360b8a39dc4b835fd31d499c8b585011594..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F2qYNp$opRhQcOwS?k)_Bce{j_0C}7R9+AaB z+5?Q;PG;Ky8T_6ujv*T7lM^IZ7dQL@YKdTAEH!H@2TG}yxJHzuB$lLFB^RXvDF!10 zLt|Y7BV8kt5JL+qQ&THrOI-sCD+7akgD($JH00)|WTsW()*zSb6ARS9;OXk;vd$@? F2>>LQFt`8! diff --git a/css/images/ui-bg_flat_75_f5f5f5_40x100.png b/css/images/ui-bg_flat_75_f5f5f5_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..712d72cda3a2ed0d36b76e01f5055f49319ba621 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F0VEhM^6M@GQcOwS?k)`f+xyS#2l6-zJR*yM zv86A@$=l9y`%1a(O9I>1w(ax%zw^*`Mk93 zk}ObPxMpWO8%0BI beoAIqC2kGNle^V{8W=oX{an^LB{Ts5cKktV literal 0 HcmV?d00001 diff --git a/css/images/ui-bg_flat_75_ffffff_40x100.png b/css/images/ui-bg_flat_75_ffffff_40x100.png deleted file mode 100644 index d29011d2afd4cd7d9ba1021abfd1dce95a6565f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F2qYNp$opRhQcOwS?k)_Bce{j_0C}7R9+AaB z+5?Q;PG;Ky8A6^ejv*T7lYj6t@hpC#;TbB#aBAWwna#KLs)4eqC9V-ADTyViR>?)F zK#IZ0z|dIN&_LJ7AjHtp%GA`#$XM6F+{(bf{jcyP6b-rgDVb@NxHXt9Se*ydz~JfX K=d#Wzp$P!!$ux=p diff --git a/css/images/ui-bg_glass_100_f6f6f6_1x400.png b/css/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index bca26939fe67c9e88a105c09df641481b2c3c224..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI&0LWmFTHNUZq?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z#PD=+46!(!{KIr+qDZgOs>S*DCH8q6)|^lLQ8(vdyV&7=Rv!DK5_Nv5 zKU5EWSl#{5ocZwkn6~@klK(Ue|8%DOm~7JJCTPgP@M)6!J>`Xd0YEcVOI#yLQW8s2 zt&)pUffR$0fuXUkfsw9}Nr<6^m8q$fv8Aqog_VIpzQLD=C>nC}Q!>*kachvv^@#;) OVDNPHb6Mw<&;$UM6;LDq diff --git a/css/images/ui-bg_glass_100_fdf5ce_1x400.png b/css/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100644 index 31b742f0887f631428e79dca4ceeef843ec3ac5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI&fCnc6a#?2AmP!?*K(O3p^r= zfwTu0yPeFo12SfLx;Tb-9DjS>o|}bBPw4YFRSXO})J!^(4ctv-3U*RGnKs-FC}~_uP$T#@%5Jf|7eoAIqC2kFJxjwN#4Gf;HelF{r5}E+`?R%*J diff --git a/css/images/ui-bg_glass_55_fbf9ee_1x400.png b/css/images/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100644 index 1558bea510bcd2fa70712e8388c734ca5fb4e913..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI&fCnc6a#?2AmP!?*K(O3p^r= zfwTu0yPeFo12TF&T^vI^j=w#x$i?I+((tf;UXnmgbH|3oY>pC!)f}(GR!16S-u+#{ ze6YEqRkW=8vGl=5qArKM<9}TC-}iEvB{zdaTcX5$wyRTK&ALK>z>% diff --git a/css/images/ui-bg_glass_65_f5f5f5_1x400.png b/css/images/ui-bg_glass_65_f5f5f5_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..faca9ff162f1123418c53f8086bec8f2d274bd29 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI&0LWmFTHNUZq?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z#PD=+46!(!{KIf!qDZgOs>SQ$CHH+auKAqwHw{4rB%42VC^k>h>51;>ONVy(SU`Vc>w`+%vQ##O0)e_f;l9a@f zRIB8oR3OD*WMF8lYiOuzXdYrbP0l+XkKqpehB literal 0 HcmV?d00001 diff --git a/css/images/ui-bg_glass_65_ffffff_1x400.png b/css/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 13140f5211929a95296a82291e78c1d2e78abb9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI2NH8$CE1Q=ADW)WEcNYf6yIsOdfIQ9ukH}&m z?E%JaC$sH<3_(v9#}JM4$r%X}t&0mp9yKsb%{ak$*<@oTP*SzTHKHUXu_VKa&B85rane0hkXAvZrIGp!Q02Dx0HSfB<5Pgg&e IbxsLQ01{dnc6a#?2AmP!?*K(O3p^r= zfwTu0yPeFo12VciT^vI^j=w#>k(V)1qW$CZ|6)SVV-&*#dav<$DMuV&n0Dbpw@a7+PAHnpzne=^B_@85rcV g%D19u$jwj5OsmALK`vssB~Sx{r>mdKI;Vst0B*f;)Bpeg diff --git a/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 7325020bcd5d744df008f1f6f4fdc399ead971bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5815 zcmcgwc|4nG*G}J=PTy)(N6~7FndzkVQi`c1rVFOD452}YHB9YlO(N3iLQzbuRYfbs zSdt)(v?S3=G4@&$L5!l7h$SJ>MEJtYe9Is2zh8d8x(zs>(%B!5aFurwutU!fp#R&E10uqmI=MKv@&q5k6MqRAfp zW>mrthO^_NafHu!$(&GJ)G^2ZZTuNg$O=X?SmLFQXTcq0jGp;CMPcZwpDX+kY6Uu zca&CK|68hQST^tHx{?ZO_BP3aSPZ1Ih< z0bT(3B7*of_+ktL`WflfdelE|bA`ffbO zt7`@eG&nAFPT_4Jt?3}b>jpk_|3?}Oo|6}waWgyZwwN1`4!N@8T3y3;k8$-4J+@v6 zH`H4}VDq~r@;&^K)kf19oMYw5bHd36ut~EhH%s}cO;e0ZpEG-~%0D*#Onu2G*dau5 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 diff --git a/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index 920d979eeb4e45e58b982d4e2ff97140128fb9d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 278 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?s03;ZUuHXC*q?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z$cXTCaSV~TeDu&>UIzz;hKv1@CM62OC7#SEE>lzs88kvL`T3DHyS{YmF8dz8v7~~s# fd5EGRH$NpatrE8exm=%Epaup{S3j3^P6$avlm`aG8Jo#u3dolRPi&aN9IvaYV+d2+gL0_gogU zajr=JsJp4L>FVRYX7=O7W$Vk884uil;QGG##flTI?oWM6-kdzz+8cavQ<={ESSwCV zL0)b5MGFg5{6t(96&h;TPoC8(UAU}7Mosu)n~8yn!C8<`)MX5lF!N|bSSl7@{*U&t~(7?*X*viOI*TBNc kz+hMFlx!3Yx%nxXX_dG&oW7xR9jJl9)78&qol`;+00Z=Rs{jB1 literal 0 HcmV?d00001 diff --git a/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index d819aa58a13773931da0aa8877fcb4ddda94c76e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?s03;ZUuHXC*q?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z$cXZEaSV~ToLo`U+vu0Ue0cG9p8hWqa?gxxGLm=1A1u)Cewe3oSeCaf zI$k30UHXoTXA5lSJe(zTcE%W-S*bfB&J`pw9sa4-R?IGW?p~6`>jMSP&M+u3 zY@9al)zrvpHlQu4C9V-ADTyViR>?)FK#IZ0z|dIN&_LJ7AjHtp%GA`#$XM6F+{(bf i{jcyP6b-rgDVb@NxHXt9Se*ydz~JfX=d#Wzp$Pyqds=h= diff --git a/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100644 index 065c3dbd5da0ffc36bf5a7ceb85fb40dd0a4498a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?szyu^`+!HJTQfx`y?k@kqfHUIz9iRwjfk$L9 zkoEv$x0Bg+Kt`LVi(`n!`KJ>Mxef&gxX1@bahq-QJ@-iVjABv8k}dz1cpvckAS5Q| zCa~sgnvR`g{(^+B71o<|biO4QZ((@QU$9to$Nb3+c9+^q0~7AA&s1G7ldW;K1nZSx z%@1{}Sk7(ZdA*`2jO&K2|NFg5Zyr%7kiMO>_`pxASP`akpQ9dh^WXn}$^S9yv#0i* zg_~-mfG$!kag8WRNi0dVN-jzTQVd20hQ_)EM!H5OA%+%KrlwZLmbwNORt5(7245bc dXvob^$xN%ntwAo=Cl;uI!PC{xWt~$(69BALbE*IU diff --git a/css/images/ui-bg_highlight-soft_95_cccccc_1x100.png b/css/images/ui-bg_highlight-soft_95_cccccc_1x100.png new file mode 100644 index 0000000000000000000000000000000000000000..2f68f0ea6ca75b8149c2f83e91c90af281663be2 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?s03;ZUuHXC*q?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z$cXlIaSV~ToLup9cB9`5k;C2DJm=*NZK{ud_@Z)na#GvzO+5Vl#x?~h zJGOT}TxWRr?N*-cS0wVzr0@9F^zfBRo3;(l^lgSQb50Z-ob_;z^F0P9 zm>5X6)a$7N~*2)78&qol`;+08eCH)c^nh literal 0 HcmV?d00001 diff --git a/css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png b/css/images/ui-bg_highlight-soft_95_fcbca3_1x100.png new file mode 100644 index 0000000000000000000000000000000000000000..ba8a702bb61049a8e89c6bc1cc35d94758f11bd0 GIT binary patch literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?szyu^`+!HJTQfx`y?k@kqfHUIz9iRwjfk$L9 zkoEv$x0Bg+Kt`LVi(`n!`KJ>MxehsqxU}zV`d)ZBHGk=L53A^E{ta@6;{=!wN;q!0 zIa6fyBK3d`Re#LS{Qt1TkDc;515cJtOn;P>?Rr1v=fAi5e=XGJWoFbK zJ#xAU=pxk;*NBpo#FA92UftDnm{r-UW|rAc$; literal 0 HcmV?d00001 diff --git a/css/images/ui-icons_228ef1_256x240.png b/css/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index 3a0140cff67999e0b6daf269723e019335f5fee6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4549 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 F{Rh^YY-Iod diff --git a/css/images/ui-icons_ef8c08_256x240.png b/css/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 036ee072d4aea1db3a78cbede62f8a0ba31972dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4549 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 C(P9<= diff --git a/css/images/ui-icons_ffd27a_256x240.png b/css/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index 8b6c05868b55d63ff932afa2efbd9d7cedd5909a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4549 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 . "sam_places"; - $sql = "SELECT $pTable.patch_dfp FROM $pTable WHERE $pTable.patch_source = 2"; + $sql = "SELECT sp.patch_dfp FROM $pTable sp WHERE sp.patch_source = 2"; $rows = $wpdb->get_results($sql, ARRAY_A); $blocks = array(); foreach($rows as $value) array_push($blocks, $value['patch_dfp']); @@ -972,21 +972,45 @@ public function page() {

        -

        - -    -
        - -

        -

        - - +

        + +
        +

        + +

        + +

        + +

        +
        +
        +

        + +    +

        + +

        + +

        +
        +
        +

        + +

        + -
        - -

        + +

        + +

        +
        +
        diff --git a/errorlog.admin.class.php b/errorlog.admin.class.php index cc2a295..e66439c 100644 --- a/errorlog.admin.class.php +++ b/errorlog.admin.class.php @@ -35,8 +35,8 @@ public function page() { } if($iaction === 'kill-em-all') $wpdb->query("DELETE FROM $eTable"); if($iaction === 'kill-resolved') $wpdb->query("DELETE FROM $eTable WHERE resolved = TRUE;"); - $resolved_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %s WHERE resolved = TRUE", $eTable)); - $active_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %s WHERE resolved = FALSE", $eTable)); + $resolved_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $eTable WHERE resolved = %d", 1)); + $active_num = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $eTable WHERE resolved = %d", 0)); if(is_null($active_num)) $active_num = 0; if(is_null($resolved_num)) $resolved_num = 0; $all_num = $resolved_num + $active_num; @@ -101,16 +101,16 @@ public function page() { get_results($eSql, ARRAY_A); $eTypes = array(__('Warning', SAM_DOMAIN), __('Update Error', SAM_DOMAIN), __('Output Error', SAM_DOMAIN)); @@ -156,12 +156,6 @@ public function page() { ?> - - - - - ' /> -
        @@ -187,6 +181,11 @@ public function page() {
        get_results('DESCRIBE wp_sam_blocks;', ARRAY_A); + foreach($struct as $var) { + $out = " '{$var['Field']}' => array('Type' => \"{$var['Type']}\", 'Null' => '{$var['Null']}', 'Key' => '{$var['Key']}', 'Default' => '{$var['Default']}', 'Extra' => '{$var['Extra']}'),"; + echo $out."
        "; + }*/ } } } diff --git a/images/ok-32.png b/images/ok-32.png index 539ecda2431d23e984cd10d1780854a2e2a2d69e..4c26904cefaff9174bd1bbb5a379178dc2a00182 100644 GIT binary patch delta 4275 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 literal 3747 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 N002ovPDHLkV1l#v2!#Lu diff --git a/images/ok.png b/images/ok.png index 31d09fe386a1d86659e8db9b3176f38e9969c85f..2059d5b55649c9bb9db7e241613c3ce2fb0c4f62 100644 GIT binary patch delta 5419 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 literal 4546 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 gb&xtp9R&V60RB^a$e+e9_5c6?07*qoM6N<$f').appendTo(srcHelp); + if (response == "success") { + $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) + .addClass('updated') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + if (em == 'item') $("#ad_img").val(options.url + file); + else if (em == 'place') $("#patch_img").val(options.url + file); + } + else { + $('#files').text(file + ' ' + response) + .addClass('error') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + } + } + }); + + $('#image_tools').tabs(); + + $('#tabs').tabs({ + activate: function( event, ui ) { + var el = ui.newPanel[0].id; + if(el == 'tabs-1') { + postsGrid.w2render('posts-grid'); + } + if(el == 'tabs-2') { + if($('#rc-ctt').is(':visible')) cttGrid.w2render('ctt-grid'); + if($('#rc-xct').is(':visible')) xcttGrid.w2render('x-ctt-grid'); + if($('#rc-xid').is(':visible')) xpostsGrid.w2render('x-posts-grid'); + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + if($('#rc-ac').is(':visible')) catsGrid.w2render('cats-grid'); + if($('#rc-xc').is(':visible')) xcatsGrid.w2render('x-cats-grid'); + if($('#rc-au').is(':visible')) authGrid.w2render('auth-grid'); + if($('#rc-xa').is(':visible')) xauthGrid.w2render('x-auth-grid'); + if($('#rc-at').is(':visible')) tagsGrid.w2render('tags-grid'); + if($('#rc-xt').is(':visible')) xtagsGrid.w2render('x-tags-grid'); + if($('#rc-cu').is(':visible')) custGrid.w2render('cust-grid'); + if($('#rc-xu').is(':visible')) xcustGrid.w2render('x-cust-grid'); + } + } + }); + + sPointer = samPointer.ads; + sPointer.pointer = 'ads'; + + var samUploader, mediaTexts = samPointer.media; + + $("#ad_start_date, #ad_end_date").datepicker({ + dateFormat:'yy-mm-dd', + showButtonPanel:true + }); + + // Advertiser ComboGrid + $('#adv_nick').combogrid({ + url: ajaxurl+'?action=get_combo_data', + datatype: "json", + munit: 'px', + alternate: true, + colModel: options.users.colModel, + select: function(event, ui) { + $('#adv_nick').val(ui.item.slug); + $('#adv_name').val(ui.item.title); + $('#adv_mail').val(ui.item.email); + return false; + } + }); + + $('#banner-media').click(function(e) { + e.preventDefault(); + + if(samUploader) { + samUploader.open(); + return; + } + + samUploader = wp.media.frames.samBanner = wp.media({ + title: mediaTexts.title, + button: {text: mediaTexts.button}, + library: {type: 'image'}, + multiple: false + }); + + samUploader.on('select', function() { + var + adImg = $('#ad_img'), + adName = $('#title'), + adDesc = $('#item_description'), + adAlt = $('#ad_alt'); + + attachment = samUploader.state().get('selection').first().toJSON(); + adImg.val(attachment.url); // alt, caption, title, description + if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); + if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); + if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); + }); + + samUploader.open(); + }); + + function buildGrid(name, grig, vn, vi, field, gc, gr) { + //grig = $('#' + name); + //vi = $('#' + vn); + var iVal = vi.val(); + grig.w2grid({ + name: name, + show: {selectColumn: true}, + multiSelect: true, + columns: gc, + records: gr, + onSelect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onUnselect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + } + }); + + if(null != iVal && '' != iVal) { + var arr = iVal.split(','); + + $.each(arr, function(i, val) { + $.each(gr, function(index, value) { + var iData = (field == 'id') ? value.id : value.slug; + if(iData == val) { + w2ui[name].select(value.recid); + return false; + } + else return true; + }); + }); + } + } + + // Custom Taxonomies Terms Grid + var cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'); + buildGrid('ctt-grid', cttGrid, 'view-custom-tax-terms', cttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); + + // + var xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x-view-custom-tax-terms'); + buildGrid('x-ctt-grid', xcttGrid, 'x-view-custom-tax-terms', xcttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); + + // Posts Grid + var postsGrid = $('#posts-grid'), postsIn = $('#view_id'); + buildGrid('posts-grid', postsGrid, 'view_id', postsIn, 'id', options.posts.columns, options.posts.posts); + + // Users Grid + var usersGrid = $('#users-grid'), usersIn = $('#x_view_users'); + buildGrid('users-grid', usersGrid, 'x_view_users', usersIn, 'slug', options.users.columns, options.users.users); + + // xPosts Grid + var xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'); + buildGrid('x-posts-grid', xpostsGrid, 'x_view_id', xpostsIn, 'id', options.posts.columns, options.posts.posts); + + // Categories Grid + var catsGrid = $('#cats-grid'), catsIn = $('#view_cats'); + buildGrid('cats-grid', catsGrid, 'view_cats', catsIn, 'slug', options.cats.columns, options.cats.cats); + + // xCats Grid + var xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'); + buildGrid('x-cats-grid', xcatsGrid, 'x_view_cats', xcatsIn, 'slug', options.cats.columns, options.cats.cats); + + // Auth Grid + var authGrid = $('#auth-grid'), authIn = $('#view_authors'); + buildGrid('auth-grid', authGrid, 'view_authors', authIn, 'slug', options.authors.columns, options.authors.authors); + + // xauth Grid + var xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'); + buildGrid('x-auth-grid', xauthGrid, 'x_view_authors', xauthIn, 'slug', options.authors.columns, options.authors.authors); + + // Tags Grid + var tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'); + buildGrid('tags-grid', tagsGrid, 'view_tags', tagsIn, 'slug', options.tags.columns, options.tags.tags); + + // xTags Grid + var xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'); + buildGrid('x-tags-grid', xtagsGrid, 'x_view_tags', xtagsIn, 'slug', options.tags.columns, options.tags.tags); + + // Customs Grid + var custGrid = $('#cust-grid'), custIn = $('#view_custom'); + buildGrid('cust-grid', custGrid, 'view_custom', custIn, 'slug', options.customs.columns, options.customs.customs); + + // xCustoms Grid + var xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); + buildGrid('x-cust-grid', xcustGrid, 'x_view_custom', xcustIn, 'slug', options.customs.columns, options.customs.customs); + + $("#add-file-button").click(function () { + var curFile = options.url + $("select#files_list option:selected").val(); + $("#ad_img").val(curFile); + return false; + }); + + $('#code_mode_false').click(function () { + $("#rc-cmf").show('blind', {direction:'vertical'}, 500); + $("#rc-cmt").hide('blind', {direction:'vertical'}, 500); + }); + + $('#code_mode_true').click(function () { + $("#rc-cmf").hide('blind', {direction:'vertical'}, 500); + $("#rc-cmt").show('blind', {direction:'vertical'}, 500); + }); + + var + rcvt0 = $('#rc-vt0'), + rcvt2 = $('#rc-vt2'), + xId = $('#x_id'), + rcxid = $('#rc-xid'); + + if(2 == $('input:radio[name=view_type]:checked').val()) { + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } + xId.attr('disabled', true); + } + + $("input:radio[name=view_type]").click(function () { + var cval = $('input:radio[name=view_type]:checked').val(); + switch (cval) { + case '0': + if (rcvt0.is(':hidden')) rcvt0.show('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); + break; + case '1': + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); + xId.attr('disabled', false); + break; + case '2': + if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); + if (rcvt2.is(':hidden')) { + rcvt2.show('blind', {direction:'vertical'}, 500, function() { + postsGrid.w2render('posts-grid'); + }); + if(xId.is(':checked')) { + xId.attr('checked', false); + rcxid.hide('blind', {direction:'vertical'}, 500); + } + } + xId.attr('disabled', true); + break; + } + }); + + xId.click(function () { + if (xId.is(':checked')) { + if(2 == $('input:radio[name=view_type]:checked').val()) { + xId.attr('checked', false); + } + else + rcxid.show('blind', {direction:'vertical'}, 500, function() { + xpostsGrid.w2render('x-posts-grid'); + }); + } + else rcxid.hide('blind', {direction:'vertical'}, 500); + }); + + $("input:radio[name=ad_users]").click(function() { + var uval = $('input:radio[name=ad_users]:checked').val(); + if(uval == '0') { + if($('#custom-users').is(':visible')) $('#custom-users').hide('blind', {direction:'vertical'}, 500); + } + else { + if($('#custom-users').is(':hidden')) + $('#custom-users').show('blind', {direction:'vertical'}, 500, function() { + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + }); + } + }); + + $("#ad_users_reg").click(function() { + if($('#ad_users_reg').is(':checked')) + $('#x-reg-users').show('blind', {direction:'vertical'}, 500, function() { + if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + }); + else $('#x-reg-users').hide('blind', {direction:'vertical'}, 500); + }); + + $('#x_ad_users').click(function() { + if($('#x_ad_users').is(':checked')) + $('#x-view-users').show('blind', {direction:'vertical'}, 500, function() { + usersGrid.w2render('users-grid'); + }); + else $('#x-view-users').hide('blind', {direction:'vertical'}, 500); + }); + + $('#ad_swf').click(function() { + if($('#ad_swf').is(':checked')) $('#swf-params').show('blind', {direction:'vertical'}, 500); + else $('#swf-params').hide('blind', {direction:'vertical'}, 500); + }); + + var + adCats = $('#ad_cats'), + rcac = $('#rc-ac'), + acw = $('#acw'), + xCats = $('#x_cats'), + rcxc = $('#rc-xc'); + + if(adCats.is(':checked') && xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } + + adCats.click(function () { + if (adCats.is(':checked')) { + rcac.show('blind', {direction:'vertical'}, 500, function() { + catsGrid.w2render('cats-grid'); + }); + acw.show('blind', {direction:'vertical'}, 500); + if(xCats.is(':checked')) { + xCats.attr('checked', false); + rcxc.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xCats.click(function () { + if (xCats.is(':checked')) { + rcxc.show('blind', {direction:'vertical'}, 500, function() { + xcatsGrid.w2render('x-cats-grid'); + }); + if(adCats.is(':checked')) { + adCats.attr('checked', false); + rcac.hide('blind', {direction:'vertical'}, 500); + acw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxc.hide('blind', {direction:'vertical'}, 500); + }); + + var + actt = $('#ad_custom_tax_terms'), + rcctt = $('#rc-ctt'), + cttw = $('#cttw'), + xacct = $('#x_ad_custom_tax_terms'), + rcxct = $('#rc-xct'); + + if(actt.is(':checked') && xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + + actt.click(function() { + if(actt.is(':checked')) { + rcctt.show('blind', {direction: 'vertical'}, 500, function() { + cttGrid.w2render('ctt-grid'); + }); + cttw.show('blind', {direction:'vertical'}, 500); + if(xacct.is(':checked')) { + xacct.attr('checked', false); + rcxct.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xacct.click(function() { + if(xacct.is(':checked')) { + rcxct.show('blind', {direction: 'vertical'}, 500, function() { + xcttGrid.w2render('x-ctt-grid'); + }); + if(actt.is(':checked')) { + actt.attr('checked', false); + rcctt.hide('blind', {direction:'vertical'}, 500); + cttw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxct.hide('blind', {direction: 'vertical'}, 500); + }); + + var + adAuth = $('#ad_authors'), + rcau = $('#rc-au'), + aaw = $('#aaw'), + xAuth = $('#x_authors'), + rcxa = $('#rc-xa'); + + if(adAuth.is(':checked') && xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } + + adAuth.click(function () { + if (adAuth.is(':checked')) { + rcau.show('blind', {direction:'vertical'}, 500, function() { + authGrid.w2render('auth-grid'); + }); + aaw.show('blind', {direction:'vertical'}, 500); + if(xAuth.is(':checked')) { + xAuth.attr('checked', false); + rcxa.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xAuth.click(function () { + if (xAuth.is(':checked')) { + rcxa.show('blind', {direction:'vertical'}, 500, function() { + xauthGrid.w2render('x-auth-grid'); + }); + if(adAuth.is(':checked')) { + adAuth.attr('checked', false); + rcau.hide('blind', {direction:'vertical'}, 500); + aaw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxa.hide('blind', {direction:'vertical'}, 500); + }); + + var + adTags = $('#ad_tags'), + rcat = $('#rc-at'), + atw = $('#atw'), + xTags = $('#x_tags'), + rcxt = $('#rc-xt'); + + if(adTags.is(':checked') && xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } + + adTags.click(function () { + if (adTags.is(':checked')) { + rcat.show('blind', {direction:'vertical'}, 500, function() { + tagsGrid.w2render('tags-grid'); + }); + atw.show('blind', {direction:'vertical'}, 500); + if(xTags.is(':checked')) { + xTags.attr('checked', false); + rcxt.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xTags.click(function () { + if (xTags.is(':checked')) { + rcxt.show('blind', {direction:'vertical'}, 500, function() { + xtagsGrid.w2render('x-tags-grid'); + }); + if(adTags.is(':checked')) { + adTags.attr('checked', false); + rcat.hide('blind', {direction:'vertical'}, 500); + atw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxt.hide('blind', {direction:'vertical'}, 500); + }); + + var + adCust = $('#ad_custom'), + rccu = $('#rc-cu'), + cuw = $('#cuw'), + xCust = $('#x_custom'), + rcxu = $('#rc-xu'); + + if(adCust.is(':checked') && xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } + + adCust.click(function () { + if (adCust.is(':checked')) { + rccu.show('blind', {direction:'vertical'}, 500, function() { + custGrid.w2render('cust-grid'); + }); + cuw.show('blind', {direction:'vertical'}, 500); + if(xCust.is(':checked')) { + xCust.attr('checked', false); + rcxu.hide('blind', {direction:'vertical'}, 500); + } + } + else { + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); + } + }); + + xCust.click(function () { + if (xCust.is(':checked')) { + rcxu.show('blind', {direction:'vertical'}, 500, function() { + xcustGrid.w2render('x-cust-grid'); + }); + if(adCust.is(':checked')) { + adCust.attr('checked', false); + rccu.hide('blind', {direction:'vertical'}, 500); + cuw.hide('blind', {direction:'vertical'}, 500); + } + } + else rcxu.hide('blind', {direction:'vertical'}, 500); + }); + + $('#ad_schedule').click(function () { + if ($('#ad_schedule').is(':checked')) $('#rc-sc').show('blind', {direction:'vertical'}, 500); + else $('#rc-sc').hide('blind', {direction:'vertical'}, 500); + }); + + $('#limit_hits').click(function () { + if ($('#limit_hits').is(':checked')) $('#rc-hl').show('blind', {direction:'vertical'}, 500); + else $('#rc-hl').hide('blind', {direction:'vertical'}, 500); + }); + + $('#limit_clicks').click(function () { + if ($('#limit_clicks').is(':checked')) $('#rc-cl').show('blind', {direction:'vertical'}, 500); + else $('#rc-cl').hide('blind', {direction:'vertical'}, 500); + }); + + + if(sPointer.enabled || '' == $('#title').val()) { + $('#title').pointer({ + content: '

        ' + sPointer.title + '

        ' + sPointer.content + '

        ', + position: 'top', + close: function() { + $.ajax({ + url: ajaxurl, + data: { + action: 'close_pointer', + pointer: sPointer.pointer + }, + async: true + }); + } + }).pointer('open'); + } + + $('#is_singular').click(function () { + if ($('#is_singular').is(':checked')) + $('#is_single, #is_page, #is_attachment, #is_posttype').attr('checked', true); + }); + + $('#is_single, #is_page, #is_attachment, #is_posttype').click(function () { + if ($('#is_singular').is(':checked') && + (!$('#is_single').is(':checked') || + !$('#is_page').is(':checked') || + !$('#is_attachment').is(':checked') || + !$('#is_posttype').is(':checked') )) { + $('#is_singular').attr('checked', false); + } + else { + if (!$('#is_singular').is(':checked') && + $('#is_single').is(':checked') && + $('#is_posttype').is(':checked') && + $('#is_page').is(':checked') && + $('#is_attachment').is(':checked')) + $('#is_singular').attr('checked', true); + } + }); + + $('#is_archive').click(function () { + if ($('#is_archive').is(':checked')) + $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').attr('checked', true); + }); + + $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').click(function () { + if ($('#is_archive').is(':checked') && + (!$('#is_tax').is(':checked') || + !$('#is_category').is(':checked') || + !$('#is_posttype_archive').is(':checked') || + !$('#is_tag').is(':checked') || + !$('#is_author').is(':checked') || + !$('#is_date').is(':checked'))) { + $('#is_archive').attr('checked', false); + } + else { + if (!$('#is_archive').is(':checked') && + $('#is_tax').is(':checked') && + $('#is_category').is(':checked') && + $('#is_posttype_archive').is(':checked') && + $('#is_tag').is(':checked') && + $('#is_author').is(':checked') && + $('#is_date').is(':checked')) { + $('#is_archive').attr('checked', true); + } + } + }); + + return false; + }); +})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-place.js b/js/sam-admin-edit-place.js new file mode 100644 index 0000000..f6c1958 --- /dev/null +++ b/js/sam-admin-edit-place.js @@ -0,0 +1,113 @@ +/** + * Created by minimus on 17.11.13. + */ + +(function ($) { + $(document).ready(function () { + var em = $('#editor_mode').val(); + + $("#title").tooltip({ + track: true + }); + + var options = $.parseJSON($.ajax({ + url:ajaxurl, + data:{action:'get_strings'}, + async:false, + dataType:'jsonp' + }).responseText); + + var + btnUpload = $("#upload-file-button"), + status = $("#uploading"), + srcHelp = $("#uploading-help"), + loadImg = $('#load_img'), + sPointer, + fileExt = ''; + + var fu = new AjaxUpload(btnUpload, { + action:ajaxurl, + name:'uploadfile', + data:{ + action:'upload_ad_image' + }, + onSubmit:function (file, ext) { + if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { + status.text(options.status); + return false; + } + loadImg.show(); + status.text(options.uploading); + }, + onComplete:function (file, response) { + status.text(''); + loadImg.hide(); + $('
        ').appendTo(srcHelp); + if (response == "success") { + $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) + .addClass('updated') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + if (em == 'item') $("#ad_img").val(options.url + file); + else if (em == 'place') $("#patch_img").val(options.url + file); + } + else { + $('#files').text(file + ' ' + response) + .addClass('error') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + } + } + }); + + sPointer = samPointer.places; + sPointer.pointer = 'places'; + + $("#add-file-button").click(function () { + var curFile = options.url + $("select#files_list option:selected").val(); + $("#patch_img").val(curFile); + return false; + }); + + $('#patch_source_image').click(function () { + if ($('#rc-psi').is(':hidden')) $('#rc-psi').show('blind', {direction:'vertical'}, 500); + if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); + if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); + }); + + $('#patch_source_code').click(function () { + if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); + if ($('#rc-psc').is(':hidden')) $('#rc-psc').show('blind', {direction:'vertical'}, 500); + if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); + }); + + $('#patch_source_dfp').click(function () { + if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); + if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); + if ($('#rc-psd').is(':hidden')) $('#rc-psd').show('blind', {direction:'vertical'}, 500); + }); + + if(sPointer.enabled || '' == $('#title').val()) { + $('#title').pointer({ + content: '

        ' + sPointer.title + '

        ' + sPointer.content + '

        ', + position: 'top', + close: function() { + $.ajax({ + url: ajaxurl, + data: { + action: 'close_pointer', + pointer: sPointer.pointer + }, + async: true + }); + } + }).pointer('open'); + } + + return false; + }); +})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit.js b/js/sam-admin-edit.js index b9b2d97..24b58d1 100644 --- a/js/sam-admin-edit.js +++ b/js/sam-admin-edit.js @@ -68,6 +68,8 @@ sPointer = samPointer.ads; sPointer.pointer = 'ads'; + var samUploader, mediaTexts = samPointer.media; + $("#ad_start_date, #ad_end_date").datepicker({ dateFormat:'yy-mm-dd', showButtonPanel:true @@ -88,6 +90,38 @@ } }); + $('#banner-media').click(function(e) { + e.preventDefault(); + + if(samUploader) { + samUploader.open(); + return; + } + + samUploader = wp.media.frames.samBanner = wp.media({ + title: mediaTexts.title, + button: {text: mediaTexts.button}, + library: {type: 'image'}, + multiple: false + }); + + samUploader.on('select', function() { + var + adImg = $('#ad_img'), + adName = $('#title'), + adDesc = $('#item_description'), + adAlt = $('#ad_alt'); + + attachment = samUploader.state().get('selection').first().toJSON(); + adImg.val(attachment.url); // alt, caption, title, description + if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); + if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); + if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); + }); + + samUploader.open(); + }); + function buildGrid(name, grig, vn, vi, field, gc, gr) { //grig = $('#' + name); //vi = $('#' + vn); diff --git a/js/sam-errors-list.js b/js/sam-errors-list.js index 11e3776..9dc72c5 100644 --- a/js/sam-errors-list.js +++ b/js/sam-errors-list.js @@ -1,8 +1,8 @@ (function($) { $(document).ready(function() { - var cButton = 'Закрыть'; + var cButton = 'Закрыть', dlg = $('#dialog'); - $('#dialog').dialog({ + dlg.dialog({ autoOpen: false, height: 550, width: 400, @@ -22,12 +22,23 @@ var id = $(this).attr('id').split('-'), idn = id[1], - eType = $('#et-'+idn).val(), - eDate = $('#dt-'+idn).val(), - eTable = $('#tn-'+idn).val(), - eMsg = $('#em-'+idn).val(), - eSql = $('#es-'+idn).val(), - eResolved = $('#rs-'+idn).val(), + wOpts = $.parseJSON($.ajax({ + url:ajaxurl, + data:{ + action:'get_error', + id: idn + }, + async:false, + dataType:'jsonp' + }).responseText); + + var + eType = wOpts.data.type, //$('#et-'+idn).val(), + eDate = wOpts.data.date, //$('#dt-'+idn).val(), + eTable = wOpts.data.name, //$('#tn-'+idn).val(), + eMsg = wOpts.data.msg, //$('#em-'+idn).val(), + eSql = wOpts.data.es, //$('#es-'+idn).val(), + eResolved = wOpts.data.resolved, //$('#rs-'+idn).val(), img = options.imgURL + ((eResolved-0) ? 'ok.png' : 'warning.png'), alt = options.alts[eResolved-0], dHTML = ''+alt+'' + @@ -36,10 +47,10 @@ '

        '+options.etype+':
        '+eType+'

        ' + '

        '+options.msg+':
        '+eMsg+'

        ' + '

        '+options.sql+':

        ' + - ' '; + ' '; - $('#dialog').html(dHTML); - $('#dialog').dialog('open'); + dlg.html(dHTML); + dlg.dialog('open'); }); }); })(jQuery); \ No newline at end of file diff --git a/lang/simple-ads-manager-be_BY.mo b/langs/simple-ads-manager-be_BY.mo similarity index 100% rename from lang/simple-ads-manager-be_BY.mo rename to langs/simple-ads-manager-be_BY.mo diff --git a/lang/simple-ads-manager-be_BY.po b/langs/simple-ads-manager-be_BY.po similarity index 100% rename from lang/simple-ads-manager-be_BY.po rename to langs/simple-ads-manager-be_BY.po diff --git a/lang/simple-ads-manager-de_DE.mo b/langs/simple-ads-manager-de_DE.mo similarity index 100% rename from lang/simple-ads-manager-de_DE.mo rename to langs/simple-ads-manager-de_DE.mo diff --git a/lang/simple-ads-manager-de_DE.po b/langs/simple-ads-manager-de_DE.po similarity index 100% rename from lang/simple-ads-manager-de_DE.po rename to langs/simple-ads-manager-de_DE.po diff --git a/lang/simple-ads-manager-es_ES.mo b/langs/simple-ads-manager-es_ES.mo similarity index 100% rename from lang/simple-ads-manager-es_ES.mo rename to langs/simple-ads-manager-es_ES.mo diff --git a/lang/simple-ads-manager-es_ES.po b/langs/simple-ads-manager-es_ES.po similarity index 100% rename from lang/simple-ads-manager-es_ES.po rename to langs/simple-ads-manager-es_ES.po diff --git a/lang/simple-ads-manager-ru_RU.mo b/langs/simple-ads-manager-ru_RU.mo similarity index 100% rename from lang/simple-ads-manager-ru_RU.mo rename to langs/simple-ads-manager-ru_RU.mo diff --git a/lang/simple-ads-manager-ru_RU.po b/langs/simple-ads-manager-ru_RU.po similarity index 100% rename from lang/simple-ads-manager-ru_RU.po rename to langs/simple-ads-manager-ru_RU.po diff --git a/lang/simple-ads-manager.pot b/langs/simple-ads-manager.pot similarity index 100% rename from lang/simple-ads-manager.pot rename to langs/simple-ads-manager.pot diff --git a/readme.txt b/readme.txt index fd011ee..0c4c7d6 100644 --- a/readme.txt +++ b/readme.txt @@ -91,6 +91,8 @@ No questions now... * Custom Taxonomies restrictions are added * Building query for SQL request is optimised * Admin interface is improved +* Loading/Selecting banners from Wordpress Media Library is added +* Updater is fixed and improved. * Language pack folder is added. = 1.7.63 = * Some bugs (Ads Block style, Click Tracker) are resolved. diff --git a/sam.class.php b/sam.class.php index 6e4d473..36694c7 100644 --- a/sam.class.php +++ b/sam.class.php @@ -125,14 +125,31 @@ private function isCustomPostType() { return (in_array(get_post_type(), $this->getCustomPostTypes())); } + private function customTaxonomiesTerms($id) { + $post = get_post($id); + $postType = $post->post_type; + $taxonomies = get_object_taxonomies($postType, 'objects'); + + $out = array(); + foreach ($taxonomies as $tax_slug => $taxonomy) { + $terms = get_the_terms($id, $tax_slug); + if(!empty($terms)) { + foreach($terms as $term) { + $out[] = $term->slug; + } + } + } + return implode(',', $out); + } + public function buildWhereClause() { $settings = $this->getSettings(); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; - $el = (integer)$settings['errorlogFS']; + //$el = (integer)$settings['errorlogFS']; - global $wpdb, $current_user; - $aTable = $wpdb->prefix . "sam_ads"; + global /*$wpdb,*/ $current_user; + //$aTable = $wpdb->prefix . "sam_ads"; $viewPages = 0; $wcc = ''; @@ -147,12 +164,12 @@ public function buildWhereClause() { if(is_user_logged_in()) { get_currentuserinfo(); $uSlug = $current_user->user_login; - $wcul = "IF($aTable.ad_users_reg = 1, IF($aTable.x_ad_users = 1, NOT FIND_IN_SET(\"$uSlug\", $aTable.x_view_users), TRUE) AND IF($aTable.ad_users_adv = 1, ($aTable.adv_nick <> \"$uSlug\"), TRUE), FALSE)"; + $wcul = "IF(sa.ad_users_reg = 1, IF(sa.x_ad_users = 1, NOT FIND_IN_SET(\"$uSlug\", sa.x_view_users), TRUE) AND IF(sa.ad_users_adv = 1, (sa.adv_nick <> \"$uSlug\"), TRUE), FALSE)"; } else { - $wcul = "($aTable.ad_users_unreg = 1)"; + $wcul = "(sa.ad_users_unreg = 1)"; } - $wcu = "(IF($aTable.ad_users = 0, TRUE, $wcul)) AND"; + $wcu = "(IF(sa.ad_users = 0, TRUE, $wcul)) AND"; if(is_home() || is_front_page()) $viewPages += SAM_IS_HOME; if(is_singular()) { @@ -162,8 +179,8 @@ public function buildWhereClause() { $viewPages |= SAM_IS_POST_TYPE; $postType = get_post_type(); - $wct .= " AND IF($aTable.view_type < 2 AND $aTable.ad_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"$postType\", $aTable.view_custom), TRUE)"; - $wcxt .= " AND IF($aTable.view_type < 2 AND $aTable.x_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"$postType\", $aTable.x_view_custom), TRUE)"; + $wct .= " AND IF(sa.view_type < 2 AND sa.ad_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"$postType\", sa.view_custom), TRUE)"; + $wcxt .= " AND IF(sa.view_type < 2 AND sa.x_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"$postType\", sa.x_view_custom), TRUE)"; } if(is_single()) { global $post; @@ -172,17 +189,18 @@ public function buildWhereClause() { $categories = get_the_category($post->ID); $tags = get_the_tags(); $postID = ((!empty($post->ID)) ? $post->ID : 0); + $customTerms = self::customTaxonomiesTerms($postID); if(!empty($categories)) { $wcc_0 = ''; $wcxc_0 = ''; - $wcc = " AND IF($aTable.view_type < 2 AND $aTable.ad_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; - $wcxc = " AND IF($aTable.view_type < 2 AND $aTable.x_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; + $wcc = " AND IF(sa.view_type < 2 AND sa.ad_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxc = " AND IF(sa.view_type < 2 AND sa.x_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; foreach($categories as $category) { - if(empty($wcc_0)) $wcc_0 = " FIND_IN_SET(\"{$category->category_nicename}\", $aTable.view_cats)"; - else $wcc_0 .= " OR FIND_IN_SET(\"{$category->category_nicename}\", $aTable.view_cats)"; - if(empty($wcxc_0)) $wcxc_0 = " (NOT FIND_IN_SET(\"{$category->category_nicename}\", $aTable.x_view_cats))"; - else $wcxc_0 .= " AND (NOT FIND_IN_SET(\"{$category->category_nicename}\", $aTable.x_view_cats))"; + if(empty($wcc_0)) $wcc_0 = " FIND_IN_SET(\"{$category->category_nicename}\", sa.view_cats)"; + else $wcc_0 .= " OR FIND_IN_SET(\"{$category->category_nicename}\", sa.view_cats)"; + if(empty($wcxc_0)) $wcxc_0 = " (NOT FIND_IN_SET(\"{$category->category_nicename}\", sa.x_view_cats))"; + else $wcxc_0 .= " AND (NOT FIND_IN_SET(\"{$category->category_nicename}\", sa.x_view_cats))"; } $wcc .= $wcc_0.", TRUE)"; $wcxc .= $wcxc_0.", TRUE)"; @@ -191,31 +209,31 @@ public function buildWhereClause() { if(!empty($tags)) { $wct_0 = ''; $wcxt_0 = ''; - $wct .= " AND IF($aTable.view_type < 2 AND $aTable.ad_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; - $wcxt .= " AND IF($aTable.view_type < 2 AND $aTable.x_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE),"; + $wct .= " AND IF(sa.view_type < 2 AND sa.ad_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxt .= " AND IF(sa.view_type < 2 AND sa.x_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; foreach($tags as $tag) { - if(empty($wct_0)) $wct_0 = " FIND_IN_SET(\"{$tag->slug}\", $aTable.view_tags)"; - else $wct_0 .= " OR FIND_IN_SET(\"{$tag->slug}\", $aTable.view_tags)"; - if(empty($wcxt_0)) $wcxt_0 = " (NOT FIND_IN_SET(\"{$tag->slug}\", $aTable.x_view_tags))"; - else $wcxt_0 .= " AND (NOT FIND_IN_SET(\"{$tag->slug}\", $aTable.x_view_tags))"; + if(empty($wct_0)) $wct_0 = " FIND_IN_SET(\"{$tag->slug}\", sa.view_tags)"; + else $wct_0 .= " OR FIND_IN_SET(\"{$tag->slug}\", sa.view_tags)"; + if(empty($wcxt_0)) $wcxt_0 = " (NOT FIND_IN_SET(\"{$tag->slug}\", sa.x_view_tags))"; + else $wcxt_0 .= " AND (NOT FIND_IN_SET(\"{$tag->slug}\", sa.x_view_tags))"; } $wct .= $wct_0.", TRUE)"; $wcxt .= $wcxt_0.", TRUE)"; } - $wci = " OR ($aTable.view_type = 2 AND FIND_IN_SET({$postID}, $aTable.view_id))"; - $wcx = " AND IF($aTable.x_id, NOT FIND_IN_SET({$postID}, $aTable.x_view_id), TRUE)"; + $wci = " OR (sa.view_type = 2 AND FIND_IN_SET({$postID}, sa.view_id))"; + $wcx = " AND IF(sa.x_id, NOT FIND_IN_SET({$postID}, sa.x_view_id), TRUE)"; $author = get_userdata($post->post_author); - $wca = " AND IF($aTable.view_type < 2 AND $aTable.ad_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$author->display_name}\", $aTable.view_authors), TRUE)"; - $wcxa = " AND IF($aTable.view_type < 2 AND $aTable.x_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$author->display_name}\", $aTable.x_view_authors), TRUE)"; + $wca = " AND IF(sa.view_type < 2 AND sa.ad_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$author->display_name}\", sa.view_authors), TRUE)"; + $wcxa = " AND IF(sa.view_type < 2 AND sa.x_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$author->display_name}\", sa.x_view_authors), TRUE)"; } if(is_page()) { global $post; $postID = ((!empty($post->ID)) ? $post->ID : 0); $viewPages |= SAM_IS_PAGE; - $wci = " OR ($aTable.view_type = 2 AND FIND_IN_SET({$postID}, $aTable.view_id))"; - $wcx = " AND IF($aTable.x_id, NOT FIND_IN_SET({$postID}, $aTable.x_view_id), TRUE)"; + $wci = " OR (sa.view_type = 2 AND FIND_IN_SET({$postID}, sa.view_id))"; + $wcx = " AND IF(sa.x_id, NOT FIND_IN_SET({$postID}, sa.x_view_id), TRUE)"; } if(is_attachment()) $viewPages |= SAM_IS_ATTACHMENT; } @@ -227,46 +245,46 @@ public function buildWhereClause() { if(is_category()) { $viewPages |= SAM_IS_CATEGORY; $cat = get_category(get_query_var('cat'), false); - $wcc = " AND IF($aTable.view_type < 2 AND $aTable.ad_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$cat->category_nicename}\", $aTable.view_cats), TRUE)"; - $wcxc = " AND IF($aTable.view_type < 2 AND $aTable.x_cats AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$cat->category_nicename}\", $aTable.x_view_cats), TRUE)"; + $wcc = " AND IF(sa.view_type < 2 AND sa.ad_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET(\"{$cat->category_nicename}\", sa.view_cats), TRUE)"; + $wcxc = " AND IF(sa.view_type < 2 AND sa.x_cats AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET(\"{$cat->category_nicename}\", sa.x_view_cats), TRUE)"; } if(is_tag()) { $viewPages |= SAM_IS_TAG; $tag = get_tag(get_query_var('tag_id')); - $wct = " AND IF($aTable.view_type < 2 AND $aTable.ad_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$tag->slug}', $aTable.view_tags), TRUE)"; - $wcxt = " AND IF($aTable.view_type < 2 AND $aTable.x_tags AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$tag->slug}', $aTable.x_view_tags), TRUE)"; + $wct = " AND IF(sa.view_type < 2 AND sa.ad_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$tag->slug}', sa.view_tags), TRUE)"; + $wcxt = " AND IF(sa.view_type < 2 AND sa.x_tags AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$tag->slug}', sa.x_view_tags), TRUE)"; } if(is_author()) { global $wp_query; $viewPages |= SAM_IS_AUTHOR; $author = $wp_query->get_queried_object(); - $wca = " AND IF($aTable.view_type < 2 AND $aTable.ad_authors = 1 AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$author->display_name}', $aTable.view_authors), TRUE)"; - $wcxa = " AND IF($aTable.view_type < 2 AND $aTable.x_authors AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$author->display_name}', $aTable.x_view_authors), TRUE)"; + $wca = " AND IF(sa.view_type < 2 AND sa.ad_authors = 1 AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$author->display_name}', sa.view_authors), TRUE)"; + $wcxa = " AND IF(sa.view_type < 2 AND sa.x_authors AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$author->display_name}', sa.x_view_authors), TRUE)"; } if(is_post_type_archive()) { $viewPages |= SAM_IS_POST_TYPE_ARCHIVE; //$postType = post_type_archive_title( '', false ); $postType = get_post_type(); - $wct = " AND IF($aTable.view_type < 2 AND $aTable.ad_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$postType}', $aTable.view_custom), TRUE)"; - $wcxt = " AND IF($aTable.view_type < 2 AND $aTable.x_custom AND IF($aTable.view_type = 0, $aTable.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$postType}', $aTable.x_view_custom), TRUE)"; + $wct = " AND IF(sa.view_type < 2 AND sa.ad_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$postType}', sa.view_custom), TRUE)"; + $wcxt = " AND IF(sa.view_type < 2 AND sa.x_custom AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$postType}', sa.x_view_custom), TRUE)"; } if(is_date()) $viewPages |= SAM_IS_DATE; } - if(empty($wcc)) $wcc = " AND ($aTable.ad_cats = 0)"; - if(empty($wca)) $wca = " AND ($aTable.ad_authors = 0)"; + if(empty($wcc)) $wcc = " AND (sa.ad_cats = 0)"; + if(empty($wca)) $wca = " AND (sa.ad_authors = 0)"; - $whereClause = "$wcu (($aTable.view_type = 1)"; - $whereClause .= " OR ($aTable.view_type = 0 AND ($aTable.view_pages+0 & $viewPages))"; + $whereClause = "$wcu ((sa.view_type = 1)"; + $whereClause .= " OR (sa.view_type = 0 AND (sa.view_pages+0 & $viewPages))"; $whereClause .= "$wci)"; $whereClause .= "$wcc $wca $wct $wcx $wcxc $wcxa $wcxt"; - $whereClauseT = " AND IF($aTable.ad_schedule, CURDATE() BETWEEN $aTable.ad_start_date AND $aTable.ad_end_date, TRUE)"; - $whereClauseT .= " AND IF($aTable.limit_hits, $aTable.hits_limit > $aTable.ad_hits, TRUE)"; - $whereClauseT .= " AND IF($aTable.limit_clicks, $aTable.clicks_limit > $aTable.ad_clicks, TRUE)"; + $whereClauseT = " AND IF(sa.ad_schedule, CURDATE() BETWEEN sa.ad_start_date AND sa.ad_end_date, TRUE)"; + $whereClauseT .= " AND IF(sa.limit_hits, sa.hits_limit > sa.ad_hits, TRUE)"; + $whereClauseT .= " AND IF(sa.limit_clicks, sa.clicks_limit > sa.ad_clicks, TRUE)"; - $whereClauseW = " AND IF($aTable.ad_weight > 0, ($aTable.ad_weight_hits*10/($aTable.ad_weight*$cycle)) < 1, FALSE)"; - $whereClause2W = "AND ($aTable.ad_weight > 0)"; + $whereClauseW = " AND IF(sa.ad_weight > 0, (sa.ad_weight_hits*10/(sa.ad_weight*$cycle)) < 1, FALSE)"; + $whereClause2W = "AND (sa.ad_weight > 0)"; return array('WC' => $whereClause, 'WCT' => $whereClauseT, 'WCW' => $whereClauseW, 'WC2W' => $whereClause2W); } diff --git a/updater.class.php b/updater.class.php index b1fe069..adebc2a 100644 --- a/updater.class.php +++ b/updater.class.php @@ -5,13 +5,170 @@ class SamUpdater { private $versionsData; private $options; + private $pTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_before' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_after' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_size' => array('Type' => "varchar(25)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_custom_width' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_custom_height' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_img' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_link' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_adserver' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'patch_dfp' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_source' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'patch_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + private $aTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'pid' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => ''), + 'name' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_type' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'code_mode' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '1', 'Extra' => ''), + 'ad_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_img' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_alt' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_title' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_no' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_target' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_swf_flashvars' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf_params' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf_attributes' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'count_clicks' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_type' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '1', 'Extra' => ''), + 'view_pages' => array('Type' => "set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive')", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_unreg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_reg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_view_users' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_adv' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_id' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_schedule' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_start_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_end_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'limit_hits' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'hits_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'limit_clicks' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'clicks_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_clicks' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_weight' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '10', 'Extra' => ''), + 'ad_weight_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'adv_nick' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'adv_name' => array('Type' => "varchar(100)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'adv_mail' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'cpm' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'cpc' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'per_month' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + private $zTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_default' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_home' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_singular' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_single' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_ct' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_single_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_page' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_attachment' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_search' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_404' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_archive' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_tax' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_category' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_cats' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_tag' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_author' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_authors' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_date' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_cts' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_archive_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + private $bTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'b_lines' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), + 'b_cols' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), + 'block_data' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'b_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'b_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'b_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), + 'b_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), + 'i_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'i_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'i_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), + 'i_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + public function __construct($dbVersion, $versionsData, $options = null) { $this->dbVersion = $dbVersion; $this->versionsData = $versionsData; $this->options = $options; } - private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { + private function versionCompare($ver1, $ver2, $arg = '=') { + $version1 = explode('.', $ver1); + $version2 = explode('.', $ver2); + $v1 = (intval($version1[0]) * 1000) + intval($version1[1]) + ((!empty($version1[2])) ? intval($version1[2]) / 100 : 0 ); + $v2 = (intval($version2[0]) * 1000) + intval($version2[1]) + ((!empty($version2[2])) ? intval($version2[2]) / 100 : 0 ); + switch($arg) { + case '=': + $out = $v1 == $v2; + break; + case '<=': + $out = $v1 <= $v2; + break; + case '<': + $out = $v1 < $v2; + break; + case '>': + $out = $v1 > $v2; + break; + case '>=': + $out = $v1 >= $v2; + break; + default: + $out = $v1 == $v2; + break; + } + return $out; + } + + private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null, $lastError = null) { global $wpdb; if(!is_null($eResult)) { @@ -22,7 +179,7 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { 'error_date' => current_time('mysql'), 'table_name' => $rTable, 'error_type' => 1, - 'error_msg' => __('An error occurred during updating process...', SAM_DOMAIN), + 'error_msg' => (empty($lastError)) ? __('An error occurred during updating process...', SAM_DOMAIN) : $lastError, 'error_sql' => $eSql, 'resolved' => 0 ), @@ -36,7 +193,7 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { 'error_date' => current_time('mysql'), 'table_name' => $rTable, 'error_type' => 0, - 'error_msg' => __('Updated...', SAM_DOMAIN), + 'error_msg' => (empty($lastError)) ? __('Updated...', SAM_DOMAIN) : $lastError, 'error_sql' => $eSql, 'resolved' => 1 ), @@ -46,6 +203,138 @@ private function errorWrite($eTable, $rTable, $eSql = null, $eResult = null) { } } + private function getUpdateSql($table, $defTable) { + global $wpdb, $charset_collate; + $dbv = $this->dbVersion; + $curTable = array(); + $add = ''; + $modify = ''; + $out = ''; + $change = ''; + + if(self::versionCompare($dbv, '2.0', '<')) { + $charset = str_replace('DEFAULT ', '', $charset_collate); + $change = "CONVERT TO $charset"; + } + + $ct = $wpdb->get_results("DESCRIBE $table;", ARRAY_A); + foreach($ct as $val) { + $curTable[$val['Field']] = array( + 'Type' => $val['Type'], + 'Null' => $val['Null'], + 'Key' => $val['Key'], + 'Default' => $val['Default'], + 'Extra' => $val['Extra'] + ); + } + + foreach($defTable as $key => $val) { + if(empty($curTable[$key])) + $add .= ((empty($add)) ? '' : ', ') + . $key . ' ' . $val['Type'] + . (($val['Null'] == 'NO') ? ' NOT NULL' : '') + . ((empty($val['Default'])) ? '' : ' DEFAULT ' . (($val['Extra'] == 'str') ? "'{$val['Default']}'" : $val['Default'])); + elseif($curTable[$key]['Type'] != $val['Type']) + $modify .= ((empty($modify)) ? '' : ', ') + . 'MODIFY ' . $key . ' ' . $val['Type'] + . (($val['Null'] == 'NO') ? ' NOT NULL' : ''); + } + $add = (!empty($add)) ? "ADD ($add)" : ''; + if(!empty($change) && !empty($add)) $add = ', ' . $add; + if((!empty($add) || !empty($change)) && !empty($modify)) $modify = ', ' . $modify; + + if(!empty($add) || !empty($modify) || !empty($change)) + $out = "ALTER TABLE $table $change $add $modify;"; + + return $out; + } + + private function adsUpdateData($aTable) { + global $wpdb; + $dbVersion = $this->dbVersion; + + if(self::versionCompare($dbVersion, '0.1', '=')) { + $aSqlU = "UPDATE LOW_PRIORITY $aTable sa SET sa.ad_cats = 1, sa.view_type = 0, sa.view_pages = 4 WHERE sa.view_type = 3;"; + $wpdb->query($aSqlU); + } + + if( self::versionCompare($dbVersion, '2.0', '<=') ) { + $aTerms = array(); + $tTable = $wpdb->prefix . "terms"; + $termSql = "SELECT name, slug FROM $tTable;"; + $terms = $wpdb->get_results($termSql, OBJECT_K); + if($terms) { + foreach($terms as $term) { + $aTerms[$term->slug] = $term->name; + } + } + // Categories + $aSql = "SELECT sa.view_cats FROM $aTable sa WHERE sa.view_cats != '' AND sa.view_cats IS NOT NULL GROUP BY sa.view_cats;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $cats = explode(',', $row->view_cats); + foreach($cats as $cat) { + $slug = array_search($cat, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('view_cats' => $aSlugs), array('view_cats' => $row->view_cats), '%s', '%s'); + } + } + // XCategories + $aSql = "SELECT sa.x_view_cats FROM $aTable sa WHERE sa.x_view_cats != '' AND sa.x_view_cats IS NOT NULL GROUP BY sa.x_view_cats;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $cats = explode(',', $row->x_view_cats); + foreach($cats as $cat) { + $slug = array_search($cat, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('x_view_cats' => $aSlugs), array('x_view_cats' => $row->x_view_cats), '%s', '%s'); + } + } + // Tags + $aSql = "SELECT sa.view_tags FROM $aTable sa WHERE sa.view_tags != '' AND sa.view_tags IS NOT NULL GROUP BY sa.view_tags;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $tags = explode(',', $row->view_tags); + foreach($tags as $tag) { + $slug = array_search($tag, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('view_tags' => $aSlugs), array('view_tags' => $row->view_tags), '%s', '%s'); + } + } + // XTags + $aSql = "SELECT sa.x_view_tags FROM $aTable sa WHERE sa.x_view_tags != '' AND sa.x_view_tags IS NOT NULL GROUP BY sa.x_view_tags;"; + $rows = $wpdb->get_results($aSql, OBJECT_K); + $numRows = $wpdb->num_rows; + if($rows) { + foreach($rows as $row) { + $slugs = array(); + $tags = explode(',', $row->x_view_tags); + foreach($tags as $tag) { + $slug = array_search($tag, $aTerms); + if($slug) array_push($slugs, $slug); + } + $aSlugs = implode(',', $slugs); + $wpdb->update($aTable, array('x_view_tags' => $aSlugs), array('x_view_tags' => $row->x_view_tags), '%s', '%s'); + } + } + } + } + public function update() { global $wpdb, $charset_collate; $pTable = $wpdb->prefix . "sam_places"; @@ -59,9 +348,7 @@ public function update() { require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); - //$versions = $this->versions; - $dbVersion = $this->dbVersion; //$versions['db']; - $vData = $this->versionsData; + $dbVersion = $this->dbVersion; $dbResult = null; @@ -80,6 +367,7 @@ public function update() { dbDelta($eSql); } + // Place Table if($wpdb->get_var("SHOW TABLES LIKE '$pTable'") != $pTable) { $pSql = "CREATE TABLE $pTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -102,24 +390,17 @@ public function update() { ) $charset_collate;"; dbDelta($pSql); } - elseif($dbVersion == '0.1' || $dbVersion == '0.2') { - $pSql = "ALTER TABLE $pTable - CONVERT TO $charset_collate, - ADD COLUMN patch_dfp VARCHAR(255) DEFAULT NULL, - ADD COLUMN patch_adserver TINYINT(1) DEFAULT 0, - ADD COLUMN patch_hits INT(11) DEFAULT 0;"; - $dbResult = $wpdb->query($pSql); - } - elseif($vData['major'] < 2) { - $pSql = "ALTER TABLE $pTable CONVERT TO $charset_collate;"; + else { + $pSql = self::getUpdateSql($pTable, $this->pTableDef); $dbResult = $wpdb->query($pSql); } if($el) { - self::errorWrite($eTable, $pTable, $pSql, $dbResult); + self::errorWrite($eTable, $pTable, $pSql, $dbResult, $wpdb->last_error); $dbResult = null; } + // Ads Table if($wpdb->get_var("SHOW TABLES LIKE '$aTable'") != $aTable) { $aSql = "CREATE TABLE $aTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -143,29 +424,29 @@ public function update() { ad_users_unreg tinyint(1) DEFAULT 0, ad_users_reg tinyint(1) DEFAULT 0, x_ad_users tinyint(1) DEFAULT NULL, - x_view_users varchar(255) DEFAULT NULL, + x_view_users TEXT DEFAULT NULL, ad_users_adv tinyint(1) DEFAULT 0, view_type INT(11) DEFAULT 1, view_pages SET('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') DEFAULT NULL, - view_id VARCHAR(255) DEFAULT NULL, + view_id TEXT DEFAULT NULL, ad_cats TINYINT(1) DEFAULT 0, - view_cats VARCHAR(255) DEFAULT NULL, + view_cats TEXT DEFAULT NULL, ad_authors TINYINT(1) DEFAULT 0, - view_authors VARCHAR(255) DEFAULT NULL, + view_authors TEXT DEFAULT NULL, ad_tags TINYINT(1) DEFAULT 0, - view_tags VARCHAR(255) DEFAULT NULL, + view_tags TEXT DEFAULT NULL, ad_custom TINYINT(1) DEFAULT 0, - view_custom VARCHAR(255) DEFAULT NULL, + view_custom TEXT DEFAULT NULL, x_id TINYINT(1) DEFAULT 0, - x_view_id VARCHAR(255) DEFAULT NULL, + x_view_id TEXT DEFAULT NULL, x_cats TINYINT(1) DEFAULT 0, - x_view_cats VARCHAR(255) DEFAULT NULL, + x_view_cats TEXT DEFAULT NULL, x_authors TINYINT(1) DEFAULT 0, - x_view_authors VARCHAR(255) DEFAULT NULL, + x_view_authors TEXT DEFAULT NULL, x_tags TINYINT(1) DEFAULT 0, - x_view_tags VARCHAR(255) DEFAULT NULL, + x_view_tags TEXT DEFAULT NULL, x_custom TINYINT(1) DEFAULT 0, - x_view_custom VARCHAR(255) DEFAULT NULL, + x_view_custom TEXT DEFAULT NULL, ad_schedule TINYINT(1) DEFAULT 0, ad_start_date DATE DEFAULT NULL, ad_end_date DATE DEFAULT NULL, @@ -188,310 +469,19 @@ public function update() { ) $charset_collate;"; dbDelta($aSql); } - elseif($dbVersion == '0.1') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_cats TINYINT(1) DEFAULT 0, - ADD COLUMN ad_authors TINYINT(1) DEFAULT 0, - ADD COLUMN view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN limit_hits TINYINT(1) DEFAULT 0, - ADD COLUMN hits_limit INT(11) DEFAULT 0, - ADD COLUMN limit_clicks TINYINT(1) DEFAULT 0, - ADD COLUMN clicks_limit INT(11) DEFAULT 0, - ADD COLUMN cpm DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN cpc DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN per_month DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - $aSqlU = "UPDATE LOW_PRIORITY $aTable - SET $aTable.ad_cats = 1, - $aTable.view_type = 0, - $aTable.view_pages = 4 - WHERE $aTable.view_type = 3;"; - $wpdb->query($aSqlU); - } - elseif($dbVersion == '0.2' || $dbVersion == '0.3' || $dbVersion == '0.3.1') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN limit_hits TINYINT(1) DEFAULT 0, - ADD COLUMN hits_limit INT(11) DEFAULT 0, - ADD COLUMN limit_clicks TINYINT(1) DEFAULT 0, - ADD COLUMN clicks_limit INT(11) DEFAULT 0, - ADD COLUMN cpm DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN cpc DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN per_month DECIMAL(10,2) UNSIGNED DEFAULT 0.00, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($dbVersion == '0.4' || $dbVersion == '0.5') { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_id TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_id VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_cats TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_cats VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_authors TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_authors VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($dbVersion == "0.5.1") { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_alt TEXT DEFAULT NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_no TINYINT(1) NOT NULL DEFAULT 0, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_tags TINYINT(1) DEFAULT 0, - ADD COLUMN view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN ad_custom TINYINT(1) DEFAULT 0, - ADD COLUMN view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_tags TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_tags VARCHAR(255) DEFAULT NULL, - ADD COLUMN x_custom TINYINT(1) DEFAULT 0, - ADD COLUMN x_view_custom VARCHAR(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] < 2) { - $aSql = "ALTER TABLE $aTable - CONVERT TO $charset_collate, - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] == 2 && $vData['minor'] == 0) { - $aSql = "ALTER TABLE $aTable - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL, - ADD COLUMN ad_title varchar(255) DEFAULT NULL, - ADD COLUMN ad_swf tinyint(1) DEFAULT 0, - ADD COLUMN ad_swf_flashvars text, - ADD COLUMN ad_swf_params text, - ADD COLUMN ad_swf_attributes text, - ADD COLUMN ad_users tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_unreg tinyint(1) DEFAULT 0, - ADD COLUMN ad_users_reg tinyint(1) DEFAULT 0, - ADD COLUMN x_ad_users tinyint(1) DEFAULT NULL, - ADD COLUMN x_view_users varchar(255) DEFAULT NULL, - ADD COLUMN ad_users_adv tinyint(1) DEFAULT 0, - ADD COLUMN adv_nick varchar(50) DEFAULT NULL, - ADD COLUMN adv_name varchar(100) DEFAULT NULL, - ADD COLUMN adv_mail varchar(50) DEFAULT NULL;"; - $dbResult = $wpdb->query($aSql); - } - elseif($vData['major'] == 2 && $vData['minor'] == 1) { - $aSql = "ALTER TABLE $aTable - MODIFY view_pages set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive') default NULL;"; + else { + $aSql = self::getUpdateSql($aTable, $this->aTableDef); $dbResult = $wpdb->query($aSql); } if($el) { - self::errorWrite($eTable, $aTable, $aSql, $dbResult); + self::errorWrite($eTable, $aTable, $aSql, $dbResult, $wpdb->last_error); $dbResult = null; } - if($vData['major'] < 2 || ($vData['major'] == 2 && $vData['minor'] == 0)) { - $aTerms = array(); - $tTable = $wpdb->prefix . "terms"; - $termSql = "SELECT name, slug FROM $tTable;"; - $terms = $wpdb->get_results($termSql, OBJECT_K); - if($terms) { - foreach($terms as $term) { - $aTerms[$term->slug] = $term->name; - } - } - // Categories - $aSql = "SELECT $aTable.view_cats - FROM $aTable - WHERE $aTable.view_cats != '' AND $aTable.view_cats IS NOT NULL - GROUP BY $aTable.view_cats;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $cats = explode(',', $row->view_cats); - foreach($cats as $cat) { - $slug = array_search($cat, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('view_cats' => $aSlugs), array('view_cats' => $row->view_cats), '%s', '%s'); - } - } - // XCategories - $aSql = "SELECT $aTable.x_view_cats - FROM $aTable - WHERE $aTable.x_view_cats != '' AND $aTable.x_view_cats IS NOT NULL - GROUP BY $aTable.x_view_cats;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $cats = explode(',', $row->x_view_cats); - foreach($cats as $cat) { - $slug = array_search($cat, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('x_view_cats' => $aSlugs), array('x_view_cats' => $row->x_view_cats), '%s', '%s'); - } - } - // Tags - $aSql = "SELECT $aTable.view_tags - FROM $aTable - WHERE $aTable.view_tags != '' AND $aTable.view_tags IS NOT NULL - GROUP BY $aTable.view_tags;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $tags = explode(',', $row->view_tags); - foreach($tags as $tag) { - $slug = array_search($tag, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('view_tags' => $aSlugs), array('view_tags' => $row->view_tags), '%s', '%s'); - } - } - // XTags - $aSql = "SELECT $aTable.x_view_tags - FROM $aTable - WHERE $aTable.x_view_tags != '' AND $aTable.x_view_tags IS NOT NULL - GROUP BY $aTable.x_view_tags;"; - $rows = $wpdb->get_results($aSql, OBJECT_K); - $numRows = $wpdb->num_rows; - if($rows) { - foreach($rows as $row) { - $slugs = array(); - $tags = explode(',', $row->x_view_tags); - foreach($tags as $tag) { - $slug = array_search($tag, $aTerms); - if($slug) array_push($slugs, $slug); - } - $aSlugs = implode(',', $slugs); - $wpdb->update($aTable, array('x_view_tags' => $aSlugs), array('x_view_tags' => $row->x_view_tags), '%s', '%s'); - } - } - } - - if($el) { - self::errorWrite($eTable, $aTable, $aSql, $dbResult); - $dbResult = null; - } + if(is_null($dbResult) || $dbResult !== false) self::adsUpdateData($aTable); + // Zones Table if($wpdb->get_var("SHOW TABLES LIKE '$zTable'") != $zTable) { $zSql = "CREATE TABLE $zTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -522,25 +512,17 @@ public function update() { ) $charset_collate;"; dbDelta($zSql); } - elseif(in_array($dbVersion, array('0.1', '0.2', '0.3', '0.3.1', '0.4', '0.5', '0.5.1'))) { - $zSql = "ALTER TABLE $zTable - CONVERT TO $charset_collate, - ADD COLUMN z_ct INT(11) DEFAULT 0, - ADD COLUMN z_cts INT(11) DEFAULT 0, - ADD COLUMN z_single_ct LONGTEXT DEFAULT NULL, - ADD COLUMN z_archive_ct LONGTEXT DEFAULT NULL;"; - $dbResult = $wpdb->query($zSql); - } - elseif($vData['major'] < 2) { - $zSql = "ALTER TABLE $zTable CONVERT TO $charset_collate;"; + else { + $zSql = self::getUpdateSql($zTable, $this->zTableDef); $dbResult = $wpdb->query($zSql); } if($el) { - self::errorWrite($eTable, $zTable, $zSql, $dbResult); + self::errorWrite($eTable, $zTable, $zSql, $dbResult, $wpdb->last_error); $dbResult = null; } + // Blocks Table if($wpdb->get_var("SHOW TABLES LIKE '$bTable'") != $bTable) { $bSql = "CREATE TABLE $bTable ( id INT(11) NOT NULL AUTO_INCREMENT, @@ -562,17 +544,19 @@ public function update() { ) $charset_collate;"; dbDelta($bSql); } - elseif($vData['major'] < 2) { - $bSql = "ALTER TABLE $bTable CONVERT TO $charset_collate;"; + else { + $bSql = self::getUpdateSql($bTable, $this->bTableDef); $dbResult = $wpdb->query($bSql); } - if($el) self::errorWrite($eTable, $pTable, $bSql, $dbResult); + if($el) { + self::errorWrite($eTable, $pTable, $bSql, $dbResult, $wpdb->last_error); + $dbResult = null; + } update_option('sam_db_version', SAM_DB_VERSION); } update_option('sam_version', SAM_VERSION); - //$this->getVersions(true); } } } From 1d69dcd9de8a49a7d34f8d12c9f7ab008433d985 Mon Sep 17 00:00:00 2001 From: minimus Date: Mon, 2 Dec 2013 11:48:43 +0300 Subject: [PATCH 08/18] Some improvements JS scripts are optimized AJAX requests are optimized Some bugs are fixed --- admin.class.php | 587 +++++++++++++-------------- css/index.html | 9 + editor.admin.class.php | 275 +++++++------ errors.class.php | 106 ++--- images/index.html | 9 + images/ok-32.png | Bin 4313 -> 4639 bytes images/ok.png | Bin 5448 -> 6252 bytes index.html | 9 + js/index.html | 9 + js/sam-admin-edit-item.js | 696 +++++++++++++++++++-------------- js/sam-admin-edit-item.min.js | 1 + js/sam-admin-edit-place.js | 117 ++++-- js/sam-admin-edit-place.min.js | 1 + js/sam-admin-edit.js | 686 -------------------------------- js/sam-admin-edit.min.js | 5 - js/sam-errors-list.js | 12 +- langs/index.html | 9 + sam-ajax-admin.php | 239 +++++++++++ updater.class.php | 139 +------ 19 files changed, 1270 insertions(+), 1639 deletions(-) create mode 100644 css/index.html create mode 100644 images/index.html create mode 100644 index.html create mode 100644 js/index.html create mode 100644 js/sam-admin-edit-item.min.js create mode 100644 js/sam-admin-edit-place.min.js delete mode 100644 js/sam-admin-edit.js delete mode 100644 js/sam-admin-edit.min.js create mode 100644 langs/index.html create mode 100644 sam-ajax-admin.php diff --git a/admin.class.php b/admin.class.php index 0e20fbe..e8c9e85 100644 --- a/admin.class.php +++ b/admin.class.php @@ -15,12 +15,14 @@ class SimpleAdsManagerAdmin extends SimpleAdsManager { public function __construct() { parent::__construct(); - global $wp_version; + global $wp_version, $sam_tables_defs; if ( function_exists( 'load_plugin_textdomain' ) ) load_plugin_textdomain( SAM_DOMAIN, false, basename( SAM_PATH ) . '/langs/' ); if(!is_dir(SAM_AD_IMG)) mkdir(SAM_AD_IMG); + + $sam_tables_defs = self::getTablesDefs(); register_activation_hook(SAM_MAIN_FILE, array(&$this, 'onActivate')); register_deactivation_hook(SAM_MAIN_FILE, array(&$this, 'onDeactivate')); @@ -33,14 +35,13 @@ public function __construct() { define('SAM_ACCESS', $access); add_action('wp_ajax_upload_ad_image', array(&$this, 'uploadHandler')); - add_action('wp_ajax_get_strings', array(&$this, 'getStringsHandler')); - add_action('wp_ajax_get_combo_data', array(&$this, 'getComboDataHandler')); add_action('wp_ajax_close_pointer', array(&$this, 'closePointerHandler')); add_action('wp_ajax_get_error', array(&$this, 'getErrorDataHandler')); add_action('admin_init', array(&$this, 'initSettings')); add_action('admin_menu', array(&$this, 'regAdminPage')); add_filter('tiny_mce_version', array(&$this, 'tinyMCEVersion')); add_action('init', array(&$this, 'addButtons')); + add_filter('image_size_names_choose', array(&$this, 'sizeNamesChoose')); if(version_compare($wp_version, '3.3', '<')) add_filter('contextual_help', array(&$this, 'help'), 10, 3); @@ -170,6 +171,238 @@ private function updateDB() { $this->getVersions(true); } + + public function getTablesDefs() { + $pTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_before' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_after' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_size' => array('Type' => "varchar(25)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_custom_width' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'place_custom_height' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_img' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_link' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_adserver' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'patch_dfp' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'patch_source' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'patch_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + $aTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'pid' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => ''), + 'name' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'code_type' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'code_mode' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '1', 'Extra' => ''), + 'ad_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_img' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_alt' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_title' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_no' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_target' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_swf_flashvars' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf_params' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_swf_attributes' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'count_clicks' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_type' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '1', 'Extra' => ''), + 'view_pages' => array('Type' => "set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive')", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_unreg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_reg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_view_users' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_users_adv' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_id' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'x_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'x_view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_schedule' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_start_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'ad_end_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'limit_hits' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'hits_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'limit_clicks' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'clicks_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_clicks' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'ad_weight' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '10', 'Extra' => ''), + 'ad_weight_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'adv_nick' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'adv_name' => array('Type' => "varchar(100)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'adv_mail' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'cpm' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'cpc' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'per_month' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + $zTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_default' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_home' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_singular' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_single' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_ct' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_single_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_page' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_attachment' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_search' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_404' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_archive' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_tax' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_category' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_cats' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_tag' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_author' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_authors' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'z_date' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_cts' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), + 'z_archive_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + $bTableDef = array( + 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), + 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'b_lines' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), + 'b_cols' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), + 'block_data' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'b_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'b_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'b_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), + 'b_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), + 'i_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'i_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), + 'i_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), + 'i_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), + 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') + ); + + return array('places' => $pTableDef, 'ads' => $aTableDef, 'zones' => $zTableDef, 'blocks' => $bTableDef); + } + + private function getColumnsModels() { + return array( + 'comboGrid' => array( + array('columnName' => 'id', 'width' => '15', 'hidden' => true, 'align' => 'right', 'label' => 'Id'), + array('columnName' => 'title', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser Name', SAM_DOMAIN)), + array('columnName' => 'slug', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser Nick', SAM_DOMAIN)), + array('columnName' => 'email', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser e-mail', SAM_DOMAIN)) + ), + 'cats' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Category Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Category Slug", SAM_DOMAIN), 'size' => '40%') + ), + 'authors' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '40%') + ), + 'tags' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Tag Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Tag Slug", SAM_DOMAIN), 'size' => '40%') + ), + 'customs' => array( + array('field' => 'title', 'caption' => __("Custom Type Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'slug', 'caption' => __("Custom Type Slug", SAM_DOMAIN), 'size' => '50%') + ), + 'posts' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Publication Title", SAM_DOMAIN), 'size' => '50%'), + array('field' => 'type', 'caption' => __("Publication Type", SAM_DOMAIN), 'size' => '40%') + ), + 'users' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), + array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '40%'), + array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '25%'), + array('field' => 'role', 'caption' => __("Role", SAM_DOMAIN), 'size' => '25%') + ), + 'customTaxes' => array( + array('field' => 'term_id', 'caption' => __('ID', SAM_DOMAIN), 'size' => '30px'), + array('field' => 'name', 'caption' => __('Term Name', SAM_DOMAIN), 'size' => '50%'), + array('field' => 'ctax_name', 'caption' => __('Custom Taxonomy Name', SAM_DOMAIN), 'size' => '40%') + ) + ); + } + + public function sizeNamesChoose() { + return array('full' => __('Full Size')); + } + + private function getGridsData() { + global $wpdb, $wp_taxonomies; + + $tTable = $wpdb->prefix . "terms"; + $ttTable = $wpdb->prefix . "term_taxonomy"; + + //Custom Post Types + $args = array('public' => true, '_builtin' => false); + $output = 'objects'; + $operator = 'and'; + $post_types = get_post_types($args, $output, $operator); + $customs = array(); + $sCustoms = array(); + + foreach($post_types as $post_type) { + array_push($customs, array('title' => $post_type->labels->name, 'slug' => $post_type->name)); + array_push($sCustoms, $post_type->name); + } + $k = 0; + foreach($customs as &$val) { + $k++; + $val['recid'] = $k; + } + if(!empty($sCustoms)) $custs = ',' . implode(',', $sCustoms); + else $custs = ''; + + // Custom Taxonomies Terms + $sql = "SELECT wt.term_id, wt.name, wt.slug, wtt.taxonomy + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format');"; + + $cTax = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($cTax as &$val) { + if(isset($wp_taxonomies[$val['taxonomy']])) $val['ctax_name'] = urldecode($wp_taxonomies[$val['taxonomy']]->labels->name); + else $val['ctax_name'] = ''; + $k++; + $val['recid'] = $k; + } + + return array( + 'customs' => $customs, + 'custList' => $custs, + 'cTax' => $cTax + ); + } public function initSettings() { register_setting('samOptions', SAM_OPTIONS_NAME); @@ -315,7 +548,7 @@ public function loadScripts($hook) { } wp_enqueue_script('jquery'); - wp_enqueue_media(); + wp_enqueue_media( array('post' => 999999) ); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-effects-core'); wp_enqueue_script('jquery-ui-widget'); @@ -327,17 +560,25 @@ public function loadScripts($hook) { wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); wp_enqueue_script('wp-pointer'); - wp_localize_script('wp-pointer', 'samPointer', array( + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-place.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + wp_localize_script('adminEditScript', 'samEditorOptions', array( 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), - 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)) + 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)), + 'options' => array( + 'uploading' => __('Uploading', SAM_DOMAIN).' ...', + 'uploaded' => __('Uploaded.', SAM_DOMAIN), + 'status' => __('Only JPG, PNG or GIF files are allowed', SAM_DOMAIN), + 'file' => __('File', SAM_DOMAIN), + 'path' => SAM_AD_IMG, + 'url' => SAM_AD_URL + ) )); - wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-place.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); } if($mode == 'item') { wp_enqueue_style('adminEditLayout', SAM_URL.'css/sam-admin-edit.css', false, SAM_VERSION); wp_enqueue_style('jquery-ui-css', SAM_URL.'css/jquery-ui-sam.css', false, '1.10.3'); - wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.2'); + wp_enqueue_style('ComboGrid', SAM_URL.'css/jquery.ui.combogrid.css', false, '1.6.3'); wp_enqueue_style('wp-pointer'); wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); @@ -373,15 +614,35 @@ public function loadScripts($hook) { wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); - wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.2'); + wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.3'); wp_enqueue_script('wp-pointer'); - wp_localize_script('wp-pointer', 'samPointer', array( + wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-item.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + wp_localize_script('adminEditScript', 'samEditorOptions', array( 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), - 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)) + 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)), + 'samAjaxUrl' => SAM_URL . 'sam-ajax-admin.php', + 'models' => self::getColumnsModels(), + 'data' => self::getGridsData(), + 'strings' => array( + 'uploading' => __('Uploading', SAM_DOMAIN).' ...', + 'uploaded' => __('Uploaded.', SAM_DOMAIN), + 'status' => __('Only JPG, PNG or GIF files are allowed', SAM_DOMAIN), + 'file' => __('File', SAM_DOMAIN), + 'path' => SAM_AD_IMG, + 'url' => SAM_AD_URL, + 'posts' => __('Post', SAM_DOMAIN), + 'page' => __('Page', SAM_DOMAIN), + 'subscriber' => __('Subscriber', SAM_DOMAIN), + 'contributor' => __('Contributor', SAM_DOMAIN), + 'author' => __('Author', SAM_DOMAIN), + 'editor' => __('Editor', SAM_DOMAIN), + 'admin' => __('Administrator', SAM_DOMAIN), + 'superAdmin' => __('Super Admin', SAM_DOMAIN) + ) )); - wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-item.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); + //wp_enqueue_script('samMedia', SAM_URL . 'js/sam-media.js', array('jquery'), SAM_VERSION, true); } } elseif($hook == $this->editZone || $hook == $this->editBlock) { @@ -444,15 +705,15 @@ public function getCategories($valueType = 'array') { $ttTable = $wpdb->prefix . "term_taxonomy"; $sql = "SELECT - $tTable.term_id, - $tTable.name, - $ttTable.taxonomy + wt.term_id, + wt.name, + wtt.taxonomy FROM - $tTable - INNER JOIN $ttTable - ON $tTable.term_id = $ttTable.term_id + $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id WHERE - $ttTable.taxonomy = 'category'"; + wtt.taxonomy = 'category'"; $cats = $wpdb->get_results($sql, ARRAY_A); if($valueType == 'array') $output = $cats; @@ -515,280 +776,6 @@ public function getErrorDataHandler() { } else wp_send_json_error(); } - - public function getComboDataHandler() { - global $wpdb; - $uTable = $wpdb->prefix . "users"; - $page = $_GET['page']; - $rows = $_GET['rows']; - $searchTerm = $_GET['searchTerm']; - $offset = ((int)$page - 1) * (int)$rows; - - $sql = "SELECT - $uTable.id, - $uTable.display_name AS title, - $uTable.user_nicename AS slug, - $uTable.user_email AS email - FROM - $uTable - WHERE $uTable.user_nicename LIKE '".$searchTerm."%' - ORDER BY $uTable.id - LIMIT $offset, $rows;"; - $users = $wpdb->get_results($sql, ARRAY_A); - - $sql = "SELECT - COUNT(*) - FROM $uTable - WHERE $uTable.user_nicename LIKE '".$searchTerm."%';"; - $rTotal = $wpdb->get_var($wpdb->prepare($sql)); - $total = ceil((int)$rTotal/(int)$rows); - - $charset = get_bloginfo('charset'); - - header("Content-type: application/json; charset=$charset"); - exit(json_encode(array( - 'page' => $page, - 'records' => count($users), - 'rows' => $users, - 'total' => $total, - 'offset' => $offset - ))); - } - - public function getStringsHandler() { - global $wpdb, $wp_taxonomies; - $tTable = $wpdb->prefix . "terms"; - $ttTable = $wpdb->prefix . "term_taxonomy"; - $uTable = $wpdb->prefix . "users"; - $umTable = $wpdb->prefix . "usermeta"; - $postTable = $wpdb->prefix . "posts"; - - $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug - FROM $tTable wt - INNER JOIN $ttTable wtt - ON wt.term_id = wtt.term_id - WHERE wtt.taxonomy = 'category' - ORDER BY wt.name;"; - - $cats = $wpdb->get_results($sql, ARRAY_A); - $k = 0; - foreach($cats as &$val) { - $k++; - $val['recid'] = $k; - } - - $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug - FROM $tTable wt - INNER JOIN $ttTable wtt - ON wt.term_id = wtt.term_id - WHERE wtt.taxonomy = 'post_tag' - ORDER BY wt.name;"; - - $tags = $wpdb->get_results($sql, ARRAY_A); - $k = 0; - foreach($tags as &$val) { - $k++; - $val['recid'] = $k; - } - - $sql = "SELECT wtt.taxonomy - FROM wp_term_taxonomy wtt - WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format') - GROUP BY wtt.taxonomy;"; - - $sql = "SELECT wt.term_id, wt.name, wt.slug, wtt.taxonomy - FROM $tTable wt - INNER JOIN $ttTable wtt - ON wt.term_id = wtt.term_id - WHERE NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format');"; - - $cTax = $wpdb->get_results($sql, ARRAY_A); - $k = 0; - foreach($cTax as &$val) { - if(isset($wp_taxonomies[$val['taxonomy']])) $val['ctax_name'] = urldecode($wp_taxonomies[$val['taxonomy']]->labels->name); - else $val['ctax_name'] = ''; - $k++; - $val['recid'] = $k; - } - - $sql = "SELECT - wu.id, - wu.display_name AS title, - wu.user_nicename AS slug - FROM - $uTable wu - INNER JOIN $umTable wum - ON wu.id = wum.user_id - WHERE - wum.meta_key = 'wp_user_level' AND - wum.meta_value > 1 - ORDER BY wu.id;"; - - $auth = $wpdb->get_results($sql, ARRAY_A); - $k = 0; - foreach($auth as &$val) { - $k++; - $val['recid'] = $k; - } - - $roleSubscriber = __('Subscriber', SAM_DOMAIN); - $roleContributor = __('Contributor', SAM_DOMAIN); - $roleAuthor = __('Author', SAM_DOMAIN); - $roleEditor = __('Editor', SAM_DOMAIN); - $roleAdministrator = __('Administrator', SAM_DOMAIN); - $roleSuperAdmin = __('Super Admin', SAM_DOMAIN); - $sql = "SELECT - wu.id, - wu.display_name AS title, - wu.user_nicename AS slug, - (CASE wum.meta_value - WHEN 0 THEN '$roleSubscriber' - WHEN 1 THEN '$roleContributor' - WHEN 2 THEN '$roleAuthor' - ELSE - IF(wum.meta_value > 2 AND wum.meta_value <= 7, '$roleEditor', - IF(wum.meta_value > 7 AND wum.meta_value <= 10, '$roleAdministrator', - IF(wum.meta_value > 10, '$roleSuperAdmin', NULL) - ) - ) - END) AS role - FROM $uTable wu - INNER JOIN $umTable wum - ON wu.id = wum.user_id AND wum.meta_key = 'wp_user_level' - ORDER BY wu.id;"; - $users = $wpdb->get_results($sql, ARRAY_A); - - $k = 0; - foreach($users as &$val) { - $k++; - $val['recid'] = $k; - } - - $args = array('public' => true, '_builtin' => false); - $output = 'objects'; - $operator = 'and'; - $post_types = get_post_types($args, $output, $operator); - $customs = array(); - $sCustoms = array(); - - foreach($post_types as $post_type) { - array_push($customs, array('title' => $post_type->labels->name, 'slug' => $post_type->name)); - array_push($sCustoms, $post_type->name); - } - $k = 0; - foreach($customs as &$val) { - $k++; - $val['recid'] = $k; - } - - if(!empty($sCustoms)) $custs = ',' . implode(',', $sCustoms); - else $custs = ''; - - $sql = "SELECT - wp.id, - wp.post_title AS title, - wp.post_type AS type - FROM - $postTable wp - WHERE - wp.post_status = 'publish' AND - FIND_IN_SET(wp.post_type, 'post,page{$custs}') - ORDER BY wp.id;"; - - $posts = $wpdb->get_results($sql, ARRAY_A); - - $k = 0; - foreach($posts as &$val) { - switch($val['type']) { - case 'post': - $val['type'] = __('Post', SAM_DOMAIN); - break; - case 'page': - $val['type'] = __('Page', SAM_DOMAIN); - break; - default: - $val['type'] = __('Post:', SAM_DOMAIN).' '.$val['type']; - break; - } - $k++; - $val['recid'] = $k; - } - - $output = array( - 'uploading' => __('Uploading', SAM_DOMAIN).' ...', - 'uploaded' => __('Uploaded.', SAM_DOMAIN), - 'status' => __('Only JPG, PNG or GIF files are allowed', SAM_DOMAIN), - 'file' => __('File', SAM_DOMAIN), - 'path' => SAM_AD_IMG, - 'url' => SAM_AD_URL, - 'cats' => array( - 'columns' => array( - array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), - array('field' => 'title', 'caption' => __("Category Title", SAM_DOMAIN), 'size' => '50%'), - array('field' => 'slug', 'caption' => __("Category Slug", SAM_DOMAIN), 'size' => '40%') - ), - 'cats' => $cats - ), - 'authors' => array( - 'columns' => array( - array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), - array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '50%'), - array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '40%') - ), - 'authors' => $auth - ), - 'tags' => array( - 'columns' => array( - array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), - array('field' => 'title', 'caption' => __("Tag Title", SAM_DOMAIN), 'size' => '50%'), - array('field' => 'slug', 'caption' => __("Tag Slug", SAM_DOMAIN), 'size' => '40%') - ), - 'tags' => $tags - ), - 'customs' => array( - 'columns' => array( - array('field' => 'title', 'caption' => __("Custom Type Title", SAM_DOMAIN), 'size' => '50%'), - array('field' => 'slug', 'caption' => __("Custom Type Slug", SAM_DOMAIN), 'size' => '50%') - ), - 'customs' => $customs - ), - 'posts' => array( - 'columns' => array( - array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), - array('field' => 'title', 'caption' => __("Publication Title", SAM_DOMAIN), 'size' => '50%'), - array('field' => 'type', 'caption' => __("Publication Type", SAM_DOMAIN), 'size' => '40%') - ), - 'posts' => $posts - ), - 'users' => array( - 'colModel' => array( - array('columnName' => 'id', 'width' => '15', 'hidden' => true, 'align' => 'right', 'label' => 'Id'), - array('columnName' => 'title', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser Name', SAM_DOMAIN)), - array('columnName' => 'slug', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser Nick', SAM_DOMAIN)), - array('columnName' => 'email', 'width' => '190', 'align' => 'left', 'label' => __('Advertiser e-mail', SAM_DOMAIN)) - ), - 'columns' => array( - array('field' => 'id', 'caption' => 'ID', 'size' => '40px'), - array('field' => 'title', 'caption' => __("Display Name", SAM_DOMAIN), 'size' => '40%'), - array('field' => 'slug', 'caption' => __("User Name", SAM_DOMAIN), 'size' => '25%'), - array('field' => 'role', 'caption' => __("Role", SAM_DOMAIN), 'size' => '25%') - ), - 'users' => $users - ), - 'custom_taxes' => array( - 'taxes' => $cTax, - 'columns' => array( - array('field' => 'term_id', 'caption' => __('ID', SAM_DOMAIN), 'size' => '30px'), - array('field' => 'name', 'caption' => __('Term Name', SAM_DOMAIN), 'size' => '50%'), - array('field' => 'ctax_name', 'caption' => __('Custom Taxonomy Name', SAM_DOMAIN), 'size' => '40%') - ) - ) - ); - $charset = get_bloginfo('charset'); - - header("Content-type: application/json; charset=$charset"); - exit(json_encode($output)); - } public function doSettingsSections($page) { global $wp_settings_sections, $wp_settings_fields; @@ -940,20 +927,6 @@ public function drawRadioOption( $id, $args ) { } } - /*public function drawSliderOption( $id, $args ) { - $options = $args['options']; - $settings = parent::getSettings(); - - ?> - -
        - + + + + + + + + \ No newline at end of file diff --git a/editor.admin.class.php b/editor.admin.class.php index 43501a5..d168bbc 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -218,6 +218,53 @@ private function adSizes($size = '468x60') { +
        +

        +
        + +
        +

        + +

        + +

        + +

        +
        +
        +

        + +    +

        + +

        + +

        +
        +
        +

        + +

        + + + +

        + +

        +
        +
        +
        +
        "> -

        +

        -

        +

        @@ -351,19 +398,19 @@ public function page() {
        - +
        -
        +
        -
        +
        -
        +
        @@ -382,7 +429,7 @@ public function page() { - +
        @@ -396,18 +443,18 @@ public function page() {
        - +
        -

        +

        - +

        @@ -415,7 +462,7 @@ public function page() {
        -

        +

        @@ -424,11 +471,11 @@ public function page() {

        - +

        - +

        @@ -436,50 +483,34 @@ public function page() {
        -

        +

        -      +     

        - + +

        - +

        -
        -

        -

        - -    -
        - -

        -

        - - - -
        - -

        -
        +

        -      +     

        @@ -496,7 +527,7 @@ public function page() {

        -      +     

        @@ -513,17 +544,17 @@ public function page() {

        -

        +

        - +

        - +

        @@ -631,7 +662,7 @@ public function page() { 'limit_hits' => (isset($_POST['limit_hits']) ? $_POST['limit_hits'] : 0), 'hits_limit' => $_POST['hits_limit'], //FIXED 'limit_clicks' => $_POST['limit_clicks'], - 'limit_clicks' => (isset($_POST['limit_clicks']) ? $_POST['limit_hits'] : 0), + 'limit_clicks' => (isset($_POST['limit_clicks']) ? $_POST['limit_clicks'] : 0), 'clicks_limit' => $_POST['clicks_limit'], 'adv_nick' => $_POST['adv_nick'], 'adv_name' => $_POST['adv_name'], @@ -807,7 +838,7 @@ public function page() { ?>
        "> -

        +

        -

        +

        @@ -837,30 +868,30 @@ public function page() {
        - - + +
        - 0) && !$row['trash'] && !$row['expired']) ? __('Ad is Active', SAM_DOMAIN) : __('Ad is Inactive', SAM_DOMAIN); ?>
        + 0) && !$row['trash'] && !$row['expired']) ? __('Ad is Active', SAM_DOMAIN) : __('Ad is Inactive', SAM_DOMAIN); ?>
        -
        +
        -
        +
        -
        +
        - /> -
        - /> + > +
        + >
        @@ -879,7 +910,7 @@ public function page() { - +
        @@ -893,17 +924,17 @@ public function page() {
        - +
        -

        +

        - +

        @@ -920,7 +951,7 @@ public function page() {

        -

        +

        @@ -930,23 +961,24 @@ public function page() {

        - + +

        - +

        - +

        - /> + >

        - /> + >

        @@ -970,48 +1002,7 @@ public function page() {

        -
        -

        -
        -
          -
        • -
        • -
        • -
        -
        -

        - -

        - -

        - -

        -
        -
        -

        - -    -

        - -

        - -

        -
        -
        -

        - -

        - - - -

        - -

        -
        -
        -
        +

        @@ -1030,7 +1021,7 @@ public function page() {

        -

        +

        @@ -1072,38 +1063,38 @@ public function page() {

        checkViewPages($row['view_pages'], SAM_IS_HOME)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_SINGULAR)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_SINGLE)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_PAGE)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_POST_TYPE)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_ATTACHMENT)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_SEARCH)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_404)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_ARCHIVE)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_TAX)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_CATEGORY)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_TAG)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_AUTHOR)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_POST_TYPE_ARCHIVE)); ?>> -
        +
        checkViewPages($row['view_pages'], SAM_IS_DATE)); ?>> -
        +

        @@ -1113,7 +1104,7 @@ public function page() {

        - '/> + '>

        @@ -1129,42 +1120,42 @@ public function page() {
        -

        +

        - /> + >

        - /> + >

        - /> + >

        - /> + >

        - /> + >

        - +

        - /> + >

        @@ -1172,7 +1163,7 @@ public function page() {
        -

        +

        @@ -1182,7 +1173,7 @@ public function page() {

        - +

        @@ -1198,7 +1189,7 @@ public function page() {

        - +
        @@ -1218,7 +1209,7 @@ public function page() {

        - +
        @@ -1266,7 +1257,7 @@ public function page() {

        - +
        @@ -1286,7 +1277,7 @@ public function page() {

        - +
        @@ -1301,7 +1292,7 @@ public function page() {

        - +
        @@ -1321,7 +1312,7 @@ public function page() {

        - +
        @@ -1336,7 +1327,7 @@ public function page() {

        - +
        @@ -1356,7 +1347,7 @@ public function page() {

        - +
        @@ -1417,7 +1408,7 @@ public function page() {
        -

        +

        @@ -1437,7 +1428,7 @@ public function page() {

        -

        +

        @@ -1469,7 +1460,7 @@ public function page() {

        -

        +

        diff --git a/errors.class.php b/errors.class.php index 03e184c..5158f31 100644 --- a/errors.class.php +++ b/errors.class.php @@ -8,66 +8,74 @@ public function __construct($rows = null) { } public function getErrors($rows = array(), $dir = '') { - global $wpdb; - $errors = array( - 'dir' => false, - 'tables' => array( - 'places' => 0, - 'ads' => 0, - 'zones' => 0, - 'blocks' => 0 - ), - 'prefix' => $wpdb->prefix - ); + global $wpdb; + $errors = array( + 'dir' => false, + 'tables' => array( + 'places' => 0, + 'ads' => 0, + 'zones' => 0, + 'blocks' => 0 + ), + 'prefix' => $wpdb->prefix + ); - if(is_null($dir)) $dir = SAM_AD_IMG; - if(!is_dir($dir)) $errors['dir'] = true; + if(is_null($dir)) $dir = SAM_AD_IMG; + if(!is_dir($dir)) $errors['dir'] = true; - foreach($rows as $key => $value) { - $table = $wpdb->prefix . 'sam_' . $key; - if($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) $errors['tables'][$key] = 1; - if($errors['tables'][$key] != 1) { - $result = $wpdb->get_results("DESCRIBE $table", ARRAY_A); - if($rows[$key] != count($result)) $errors['tables'][$key] = 2; + foreach($rows as $key => $value) { + $table = $wpdb->prefix . 'sam_' . $key; + if($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) $errors['tables'][$key] = 1; + if($errors['tables'][$key] != 1) { + $result = $wpdb->get_results("DESCRIBE $table", ARRAY_A); + if($rows[$key] != count($result)) $errors['tables'][$key] = 2; + } } - } - return $errors; - } + return $errors; + } - public function checkShell($rows = null) { - $dirError = ''; - $oError = ''; - $output = ''; + public function checkShell($rows = null) { + global $sam_tables_defs; + + $dirError = ''; + $oError = ''; + $output = ''; - if(is_null($rows)) $rows = array('places' => 16, 'ads' => 62, 'zones' => 24, 'blocks' => 15); - $errors = $this->getErrors($rows, SAM_AD_IMG); - if($errors['dir']) { - $dirError = '

        '.__("Simple Ads Manager Images Folder hasn't been created!", SAM_DOMAIN).'

        '; - $dirError .= '

        '.__("Try to reactivate plugin or create folder manually.", SAM_DOMAIN).'
        '.__("Manually creation: Create folder 'sam-images' in 'wp-content/plugins' folder. Don't forget to set folder's permissions to 777.", SAM_DOMAIN).'

        '; - } + if(is_null($rows)) + $rows = array( + 'places' => count($sam_tables_defs['places']), + 'ads' => count($sam_tables_defs['ads']), + 'zones' => count($sam_tables_defs['zones']), + 'blocks' => count($sam_tables_defs['blocks']) + ); + $errors = self::getErrors($rows, SAM_AD_IMG); + if($errors['dir']) { + $dirError = '

        '.__("Simple Ads Manager Images Folder hasn't been created!", SAM_DOMAIN).'

        '; + $dirError .= '

        '.__("Try to reactivate plugin or create folder manually.", SAM_DOMAIN).'
        '.__("Manually creation: Create folder 'sam-images' in 'wp-content/plugins' folder. Don't forget to set folder's permissions to 777.", SAM_DOMAIN).'

        '; + } - foreach($errors['tables'] as $key => $value) { - $table = $errors['prefix'].'sam_'.$key; - switch($value) { - case 1: - $oError .= '

        '.sprintf(__("Database table %s hasn't been created!", SAM_DOMAIN), $table).'

        '; - break; + foreach($errors['tables'] as $key => $value) { + $table = $errors['prefix'].'sam_'.$key; + switch($value) { + case 1: + $oError .= '

        '.sprintf(__("Database table %s hasn't been created!", SAM_DOMAIN), $table).'

        '; + break; - case 2: - $oError .= '

        '.sprintf(__("Database table %s hasn't been upgraded!", SAM_DOMAIN), $table).'

        '; - break; + case 2: + $oError .= '

        '.sprintf(__("Database table %s hasn't been upgraded!", SAM_DOMAIN), $table).'

        '; + break; - default: - $oError .= ''; - break; + default: + $oError .= ''; + break; + } } - } - if(!empty($oError) || !empty($dirError)) - $output = '
        '.$dirError.$oError.'
        '; - return $output; - } + if(!empty($oError) || !empty($dirError)) + $output = '
        '.$dirError.$oError.'
        '; + return $output; + } } } ?> diff --git a/images/index.html b/images/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/images/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/images/ok-32.png b/images/ok-32.png index 4c26904cefaff9174bd1bbb5a379178dc2a00182..c3e13ba8cdceb515b2f17f72018944ea25828dc0 100644 GIT binary patch delta 1949 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%0Ai-GorW! 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 + + + + + + + + \ No newline at end of file diff --git a/js/index.html b/js/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/js/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/js/sam-admin-edit-item.js b/js/sam-admin-edit-item.js index e5f8529..d2010e5 100644 --- a/js/sam-admin-edit-item.js +++ b/js/sam-admin-edit-item.js @@ -1,156 +1,161 @@ /** * Created by minimus on 17.11.13. */ - +var sam = sam || {}; (function ($) { - $(document).ready(function () { - var em = $('#editor_mode').val(); + var media, mediaTexts = samEditorOptions.media; - $("#title").tooltip({ - track: true - }); + sam.media = media = { + buttonId: '#banner-media', + adUrl: '#ad_img', + adImgId: '#ad_img_id', + adName: '#title', + adDesc: '#item_description', + adAlt: '#ad_alt', - var options = $.parseJSON($.ajax({ - url:ajaxurl, - data:{action:'get_strings'}, - async:false, - dataType:'jsonp' - }).responseText); + init: function() { + $(this.buttonId).on( 'click', this.openMediaDialog ); + }, - var - btnUpload = $("#upload-file-button"), - status = $("#uploading"), - srcHelp = $("#uploading-help"), - loadImg = $('#load_img'), - sPointer, - fileExt = ''; - - var fu = new AjaxUpload(btnUpload, { - action:ajaxurl, - name:'uploadfile', - data:{ - action:'upload_ad_image' - }, - onSubmit:function (file, ext) { - if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { - status.text(options.status); - return false; - } - loadImg.show(); - status.text(options.uploading); - }, - onComplete:function (file, response) { - status.text(''); - loadImg.hide(); - $('
        ').appendTo(srcHelp); - if (response == "success") { - $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) - .addClass('updated') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - if (em == 'item') $("#ad_img").val(options.url + file); - else if (em == 'place') $("#patch_img").val(options.url + file); - } - else { - $('#files').text(file + ' ' + response) - .addClass('error') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - } - } - }); - - $('#image_tools').tabs(); + openMediaDialog: function( e ) { + e.preventDefault(); - $('#tabs').tabs({ - activate: function( event, ui ) { - var el = ui.newPanel[0].id; - if(el == 'tabs-1') { - postsGrid.w2render('posts-grid'); - } - if(el == 'tabs-2') { - if($('#rc-ctt').is(':visible')) cttGrid.w2render('ctt-grid'); - if($('#rc-xct').is(':visible')) xcttGrid.w2render('x-ctt-grid'); - if($('#rc-xid').is(':visible')) xpostsGrid.w2render('x-posts-grid'); - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); - if($('#rc-ac').is(':visible')) catsGrid.w2render('cats-grid'); - if($('#rc-xc').is(':visible')) xcatsGrid.w2render('x-cats-grid'); - if($('#rc-au').is(':visible')) authGrid.w2render('auth-grid'); - if($('#rc-xa').is(':visible')) xauthGrid.w2render('x-auth-grid'); - if($('#rc-at').is(':visible')) tagsGrid.w2render('tags-grid'); - if($('#rc-xt').is(':visible')) xtagsGrid.w2render('x-tags-grid'); - if($('#rc-cu').is(':visible')) custGrid.w2render('cust-grid'); - if($('#rc-xu').is(':visible')) xcustGrid.w2render('x-cust-grid'); - } + if ( this._frame ) { + this._frame.open(); + return; } - }); - sPointer = samPointer.ads; - sPointer.pointer = 'ads'; + var Attachment = wp.media.model.Attachment; - var samUploader, mediaTexts = samPointer.media; + this._frame = media.frame = wp.media({ + title: mediaTexts.title, + button: { + text: mediaTexts.button + }, + multiple: false, + library: { + type: 'image' + }/*, + selection: [ Attachment.get( $(this.adImgId).val() ) ]*/ + }); - $("#ad_start_date, #ad_end_date").datepicker({ - dateFormat:'yy-mm-dd', - showButtonPanel:true - }); + this._frame.on('ready', function() { + // + }); - // Advertiser ComboGrid - $('#adv_nick').combogrid({ - url: ajaxurl+'?action=get_combo_data', - datatype: "json", - munit: 'px', - alternate: true, - colModel: options.users.colModel, - select: function(event, ui) { - $('#adv_nick').val(ui.item.slug); - $('#adv_name').val(ui.item.title); - $('#adv_mail').val(ui.item.email); - return false; - } - }); + this._frame.state( 'library' ).on('select', function() { + var attachment = this.get( 'selection' ).single(); + media.handleMediaAttachment( attachment ); + }); - $('#banner-media').click(function(e) { - e.preventDefault(); + this._frame.open(); + }, - if(samUploader) { - samUploader.open(); - return; - } + handleMediaAttachment: function(a) { + var attechment = a.toJSON(); + $(this.adUrl).val(attechment.url); + $(this.adImgId).val(attechment.id); + if('' == $(this.adName).val() && '' != attechment.title) $(this.adName).val(attechment.title); + if('' == $(this.adDesc).val() && '' != attechment.caption) $(this.adDesc).val(attechment.caption); + if('' == $(this.adAlt).val() && '' != attechment.alt) $(this.adAlt).val(attechment.alt); + } + }; - samUploader = wp.media.frames.samBanner = wp.media({ - title: mediaTexts.title, - button: {text: mediaTexts.button}, - library: {type: 'image'}, - multiple: false - }); + $(document).ready(function () { + var em = $('#editor_mode').val(), options, fu, title = $('#title'); - samUploader.on('select', function() { - var - adImg = $('#ad_img'), - adName = $('#title'), - adDesc = $('#item_description'), - adAlt = $('#ad_alt'); + var + rcvt0 = $('#rc-vt0'), rcvt2 = $('#rc-vt2'), xId = $('#x_id'), rcxid = $('#rc-xid'), + adCats = $('#ad_cats'), rcac = $('#rc-ac'), acw = $('#acw'), xCats = $('#x_cats'), rcxc = $('#rc-xc'), + actt = $('#ad_custom_tax_terms'), rcctt = $('#rc-ctt'), cttw = $('#cttw'), xacct = $('#x_ad_custom_tax_terms'), rcxct = $('#rc-xct'), + adAuth = $('#ad_authors'), rcau = $('#rc-au'), aaw = $('#aaw'), xAuth = $('#x_authors'), rcxa = $('#rc-xa'), + adTags = $('#ad_tags'), rcat = $('#rc-at'), atw = $('#atw'), xTags = $('#x_tags'), rcxt = $('#rc-xt'), + adCust = $('#ad_custom'), rccu = $('#rc-cu'), cuw = $('#cuw'), xCust = $('#x_custom'), rcxu = $('#rc-xu'), + xViewUsers = $('#x-view-users'), custUsers = $('#custom-users'), + + adUsersReg = $("#ad_users_reg"), xRegUsers = $('#x-reg-users'), xAdUsers = $('#x_ad_users'), + + btnUpload = $("#upload-file-button"), status = $("#uploading"), srcHelp = $("#uploading-help"), + loadImg = $('#load_img'), sPointer, + + cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'), + xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x-view-custom-tax-terms'), + postsGrid = $('#posts-grid'), postsIn = $('#view_id'), + usersGrid = $('#users-grid'), usersIn = $('#x_view_users'), + xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'), + catsGrid = $('#cats-grid'), catsIn = $('#view_cats'), + xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'), + authGrid = $('#auth-grid'), authIn = $('#view_authors'), + xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'), + tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'), + xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'), + custGrid = $('#cust-grid'), custIn = $('#view_custom'), + xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); - attachment = samUploader.state().get('selection').first().toJSON(); - adImg.val(attachment.url); // alt, caption, title, description - if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); - if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); - if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); + var + samUploader, mediaTexts = samEditorOptions.media, + samAjaxUrl = samEditorOptions.samAjaxUrl, + models = samEditorOptions.models, + gData = samEditorOptions.data, + samStrs = samEditorOptions.strings, + sPost = encodeURI(samStrs.posts), sPage = encodeURI(samStrs.page); + + function buildLGrid(name, grid, vi, field, gc, url) { + var iVal = vi.val(); + grid.w2grid({ + name: name, + show: {selectColumn: true}, + multiSelect: true, + columns: gc, + url: url, + onSelect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onUnselect: function(event) { + event.onComplete = function() { + var out = '', recs = this.getSelection(), data; + for(var i = 0; i < recs.length; i++) { + var rec = this.get(recs[i]); + data = (field == 'id') ? rec.id : rec.slug; + out += (i == recs.length - 1) ? data : (data + ','); + } + vi.val(out); + } + }, + onLoad: function(event) { + event.onComplete = function() { + if(null != iVal && '' != iVal) { + var arr = iVal.split(','); + + $.each(arr, function(i, val) { + $.each(w2ui[name].records, function(index, value) { + var iData = (field == 'id') ? value.id : value.slug; + if(iData == val) { + w2ui[name].select(value.recid); + return false; + } + else return true; + }); + }); + } + } + } }); + } - samUploader.open(); - }); - - function buildGrid(name, grig, vn, vi, field, gc, gr) { - //grig = $('#' + name); + function buildGrid(name, grid, vi, field, gc, gr) { + //grid = $('#' + name); //vi = $('#' + vn); var iVal = vi.val(); - grig.w2grid({ + grid.w2grid({ name: name, show: {selectColumn: true}, multiSelect: true, @@ -196,64 +201,110 @@ } } - // Custom Taxonomies Terms Grid - var cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'); - buildGrid('ctt-grid', cttGrid, 'view-custom-tax-terms', cttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); - - // - var xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x-view-custom-tax-terms'); - buildGrid('x-ctt-grid', xcttGrid, 'x-view-custom-tax-terms', xcttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); - - // Posts Grid - var postsGrid = $('#posts-grid'), postsIn = $('#view_id'); - buildGrid('posts-grid', postsGrid, 'view_id', postsIn, 'id', options.posts.columns, options.posts.posts); - - // Users Grid - var usersGrid = $('#users-grid'), usersIn = $('#x_view_users'); - buildGrid('users-grid', usersGrid, 'x_view_users', usersIn, 'slug', options.users.columns, options.users.users); - - // xPosts Grid - var xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'); - buildGrid('x-posts-grid', xpostsGrid, 'x_view_id', xpostsIn, 'id', options.posts.columns, options.posts.posts); - - // Categories Grid - var catsGrid = $('#cats-grid'), catsIn = $('#view_cats'); - buildGrid('cats-grid', catsGrid, 'view_cats', catsIn, 'slug', options.cats.columns, options.cats.cats); - - // xCats Grid - var xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'); - buildGrid('x-cats-grid', xcatsGrid, 'x_view_cats', xcatsIn, 'slug', options.cats.columns, options.cats.cats); - - // Auth Grid - var authGrid = $('#auth-grid'), authIn = $('#view_authors'); - buildGrid('auth-grid', authGrid, 'view_authors', authIn, 'slug', options.authors.columns, options.authors.authors); - - // xauth Grid - var xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'); - buildGrid('x-auth-grid', xauthGrid, 'x_view_authors', xauthIn, 'slug', options.authors.columns, options.authors.authors); - - // Tags Grid - var tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'); - buildGrid('tags-grid', tagsGrid, 'view_tags', tagsIn, 'slug', options.tags.columns, options.tags.tags); + title.tooltip({ + track: true + }); + $('#image_tools').tabs(); - // xTags Grid - var xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'); - buildGrid('x-tags-grid', xtagsGrid, 'x_view_tags', xtagsIn, 'slug', options.tags.columns, options.tags.tags); + media.init(); - // Customs Grid - var custGrid = $('#cust-grid'), custIn = $('#view_custom'); - buildGrid('cust-grid', custGrid, 'view_custom', custIn, 'slug', options.customs.columns, options.customs.customs); + fu = new AjaxUpload(btnUpload, { + action:ajaxurl, + name:'uploadfile', + data:{ + action:'upload_ad_image' + }, + onSubmit:function (file, ext) { + if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { + status.text(samStrs.status); + return false; + } + loadImg.show(); + status.text(samStrs.uploading); + return false; + }, + onComplete:function (file, response) { + status.text(''); + loadImg.hide(); + $('
        ').appendTo(srcHelp); + if (response == "success") { + $("#files").text(samStrs.file + ' ' + file + ' ' + samStrs.uploaded) + .addClass('updated') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + if (em == 'item') $("#ad_img").val(samStrs.url + file); + else if (em == 'place') $("#patch_img").val(samStrs.url + file); + } + else { + $('#files').text(file + ' ' + response) + .addClass('error') + .delay(3000) + .fadeOut(1000, function () { + $(this).remove(); + }); + } + } + }); - // xCustoms Grid - var xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); - buildGrid('x-cust-grid', xcustGrid, 'x_view_custom', xcustIn, 'slug', options.customs.columns, options.customs.customs); + // Advertiser ComboGrid + $('#adv_nick').combogrid({ + url: samAjaxUrl + '?action=load_combo_data', + datatype: "json", + munit: 'px', + alternate: true, + colModel: models.comboGrid, + select: function(event, ui) { + $('#adv_nick').val(ui.item.slug); + $('#adv_name').val(ui.item.title); + $('#adv_mail').val(ui.item.email); + return false; + } + }); $("#add-file-button").click(function () { - var curFile = options.url + $("select#files_list option:selected").val(); + var curFile = samStrs.url + $("select#files_list option:selected").val(); $("#ad_img").val(curFile); return false; }); + buildGrid('ctt-grid', cttGrid, cttIn, 'slug', models.customTaxes, gData.cTax); + buildGrid('x-ctt-grid', xcttGrid, xcttIn, 'slug', models.customTaxes, gData.cTax); + buildGrid('cust-grid', custGrid, custIn, 'slug', models.customs, gData.customs); + buildGrid('x-cust-grid', xcustGrid, xcustIn, 'slug', models.customs, gData.customs); + + var + postAjax = + samAjaxUrl + + '?action=load_posts&cstr=' + samEditorOptions.data.custList + + '&sp=' + sPost + '&spg=' + sPage; + buildLGrid('posts-grid', postsGrid, postsIn, 'id', models.posts, postAjax); + buildLGrid('x-posts-grid', xpostsGrid, xpostsIn, 'id', models.posts, postAjax); + + $('#tabs').tabs({ + activate: function( event, ui ) { + var el = ui.newPanel[0].id; + if(el == 'tabs-1') { + if(w2ui['posts-grid']) postsGrid.w2render('posts-grid'); + } + if(el == 'tabs-2') { + if(rcctt.is(':visible') && w2ui['ctt-grid']) cttGrid.w2render('ctt-grid'); + if(rcxct.is(':visible') && w2ui['x-ctt-grid']) xcttGrid.w2render('x-ctt-grid'); + if(rcxid.is(':visible') && w2ui['x-posts-grid']) xpostsGrid.w2render('x-posts-grid'); + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); + if(rcac.is(':visible') && w2ui['cats-grid']) catsGrid.w2render('cats-grid'); + if(rcxc.is(':visible') && w2ui['x-cats-grid']) xcatsGrid.w2render('x-cats-grid'); + if(rcau.is(':visible') && w2ui['auth-grid']) authGrid.w2render('auth-grid'); + if(rcxa.is(':visible') && w2ui['x-auth-grid']) xauthGrid.w2render('x-auth-grid'); + if(rcat.is(':visible') && w2ui['tags-grid']) tagsGrid.w2render('tags-grid'); + if(rcxt.is(':visible') && w2ui['x-tags-grid']) xtagsGrid.w2render('x-tags-grid'); + if(rccu.is(':visible') && w2ui['cust-grid']) custGrid.w2render('cust-grid'); + if(rcxu.is(':visible') && w2ui['xcust-grid']) xcustGrid.w2render('x-cust-grid'); + } + } + }); + $('#code_mode_false').click(function () { $("#rc-cmf").show('blind', {direction:'vertical'}, 500); $("#rc-cmt").hide('blind', {direction:'vertical'}, 500); @@ -264,12 +315,6 @@ $("#rc-cmt").show('blind', {direction:'vertical'}, 500); }); - var - rcvt0 = $('#rc-vt0'), - rcvt2 = $('#rc-vt2'), - xId = $('#x_id'), - rcxid = $('#rc-xid'); - if(2 == $('input:radio[name=view_type]:checked').val()) { if(xId.is(':checked')) { xId.attr('checked', false); @@ -295,7 +340,7 @@ if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); if (rcvt2.is(':hidden')) { rcvt2.show('blind', {direction:'vertical'}, 500, function() { - postsGrid.w2render('posts-grid'); + if(w2ui['posts-grid']) postsGrid.w2render('posts-grid'); }); if(xId.is(':checked')) { xId.attr('checked', false); @@ -307,6 +352,70 @@ } }); + var authRequest = $.ajax({ + url:samAjaxUrl, + data: { + action: 'load_authors', + level: 3 + }, + type: 'POST' + }), authData; + + authRequest.done(function(data) { + authData = data; + buildGrid('auth-grid', authGrid, authIn, 'slug', models.authors, authData); + buildGrid('x-auth-grid', xauthGrid, xauthIn, 'slug', models.authors, authData); + }); + + var usersRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_users', + subscriber: encodeURI(samStrs.subscriber), + contributor: encodeURI(samStrs.contributor), + author: encodeURI(samStrs.author), + editor: encodeURI(samStrs.editor), + admin: encodeURI(samStrs.admin), + sadmin: encodeURI(samStrs.superAdmin) + }, + type: 'POST' + }), usersData; + + usersRequest.done(function(data) { + usersData = data; + buildGrid('users-grid', usersGrid, usersIn, 'slug', models.users, usersData); + }); + + var catsRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_cats', + level: 3 + }, + type: 'POST' + }), catsData; + + catsRequest.done(function(data) { + catsData = data; + buildGrid('cats-grid', catsGrid, catsIn, 'slug', models.cats, catsData); + buildGrid('x-cats-grid', xcatsGrid, xcatsIn, 'slug', models.cats, catsData); + }); + + var tagsRequest = $.ajax({ + url: samAjaxUrl, + data: { + action: 'load_tags', + level: 3 + }, + type: 'POST' + }), tagsData; + + tagsRequest.done(function(data) { + tagsData = data; + buildGrid('tags-grid', tagsGrid, tagsIn, 'slug', models.tags, tagsData); + buildGrid('x-tags-grid', xtagsGrid, xtagsIn, 'slug', models.tags, tagsData); + }); + xId.click(function () { if (xId.is(':checked')) { if(2 == $('input:radio[name=view_type]:checked').val()) { @@ -314,7 +423,7 @@ } else rcxid.show('blind', {direction:'vertical'}, 500, function() { - xpostsGrid.w2render('x-posts-grid'); + if(w2ui['x-posts-grid']) xpostsGrid.w2render('x-posts-grid'); }); } else rcxid.hide('blind', {direction:'vertical'}, 500); @@ -323,30 +432,30 @@ $("input:radio[name=ad_users]").click(function() { var uval = $('input:radio[name=ad_users]:checked').val(); if(uval == '0') { - if($('#custom-users').is(':visible')) $('#custom-users').hide('blind', {direction:'vertical'}, 500); + if(custUsers.is(':visible')) custUsers.hide('blind', {direction:'vertical'}, 500); } else { - if($('#custom-users').is(':hidden')) - $('#custom-users').show('blind', {direction:'vertical'}, 500, function() { - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + if(custUsers.is(':hidden')) + custUsers.show('blind', {direction:'vertical'}, 500, function() { + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); }); } }); - $("#ad_users_reg").click(function() { - if($('#ad_users_reg').is(':checked')) - $('#x-reg-users').show('blind', {direction:'vertical'}, 500, function() { - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); + adUsersReg.click(function() { + if(adUsersReg.is(':checked')) + xRegUsers.show('blind', {direction:'vertical'}, 500, function() { + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); }); - else $('#x-reg-users').hide('blind', {direction:'vertical'}, 500); + else xRegUsers.hide('blind', {direction:'vertical'}, 500); }); - $('#x_ad_users').click(function() { - if($('#x_ad_users').is(':checked')) - $('#x-view-users').show('blind', {direction:'vertical'}, 500, function() { - usersGrid.w2render('users-grid'); + xAdUsers.click(function() { + if(xAdUsers.is(':checked')) + xViewUsers.show('blind', {direction:'vertical'}, 500, function() { + if(w2ui['users-grid']) usersGrid.w2render('users-grid'); }); - else $('#x-view-users').hide('blind', {direction:'vertical'}, 500); + else xViewUsers.hide('blind', {direction:'vertical'}, 500); }); $('#ad_swf').click(function() { @@ -354,13 +463,6 @@ else $('#swf-params').hide('blind', {direction:'vertical'}, 500); }); - var - adCats = $('#ad_cats'), - rcac = $('#rc-ac'), - acw = $('#acw'), - xCats = $('#x_cats'), - rcxc = $('#rc-xc'); - if(adCats.is(':checked') && xCats.is(':checked')) { xCats.attr('checked', false); rcxc.hide('blind', {direction:'vertical'}, 500); @@ -369,7 +471,7 @@ adCats.click(function () { if (adCats.is(':checked')) { rcac.show('blind', {direction:'vertical'}, 500, function() { - catsGrid.w2render('cats-grid'); + if(w2ui['cats-grid']) catsGrid.w2render('cats-grid'); }); acw.show('blind', {direction:'vertical'}, 500); if(xCats.is(':checked')) { @@ -386,7 +488,7 @@ xCats.click(function () { if (xCats.is(':checked')) { rcxc.show('blind', {direction:'vertical'}, 500, function() { - xcatsGrid.w2render('x-cats-grid'); + if(w2ui['x-cats-grid']) xcatsGrid.w2render('x-cats-grid'); }); if(adCats.is(':checked')) { adCats.attr('checked', false); @@ -397,13 +499,6 @@ else rcxc.hide('blind', {direction:'vertical'}, 500); }); - var - actt = $('#ad_custom_tax_terms'), - rcctt = $('#rc-ctt'), - cttw = $('#cttw'), - xacct = $('#x_ad_custom_tax_terms'), - rcxct = $('#rc-xct'); - if(actt.is(':checked') && xacct.is(':checked')) { xacct.attr('checked', false); rcxct.hide('blind', {direction:'vertical'}, 500); @@ -412,7 +507,7 @@ actt.click(function() { if(actt.is(':checked')) { rcctt.show('blind', {direction: 'vertical'}, 500, function() { - cttGrid.w2render('ctt-grid'); + if(w2ui['ctt-grid']) cttGrid.w2render('ctt-grid'); }); cttw.show('blind', {direction:'vertical'}, 500); if(xacct.is(':checked')) { @@ -429,7 +524,7 @@ xacct.click(function() { if(xacct.is(':checked')) { rcxct.show('blind', {direction: 'vertical'}, 500, function() { - xcttGrid.w2render('x-ctt-grid'); + if(w2ui['x-ctt-grid']) xcttGrid.w2render('x-ctt-grid'); }); if(actt.is(':checked')) { actt.attr('checked', false); @@ -440,13 +535,6 @@ else rcxct.hide('blind', {direction: 'vertical'}, 500); }); - var - adAuth = $('#ad_authors'), - rcau = $('#rc-au'), - aaw = $('#aaw'), - xAuth = $('#x_authors'), - rcxa = $('#rc-xa'); - if(adAuth.is(':checked') && xAuth.is(':checked')) { xAuth.attr('checked', false); rcxa.hide('blind', {direction:'vertical'}, 500); @@ -455,7 +543,7 @@ adAuth.click(function () { if (adAuth.is(':checked')) { rcau.show('blind', {direction:'vertical'}, 500, function() { - authGrid.w2render('auth-grid'); + if(w2ui['auth-grid']) authGrid.w2render('auth-grid'); }); aaw.show('blind', {direction:'vertical'}, 500); if(xAuth.is(':checked')) { @@ -472,7 +560,7 @@ xAuth.click(function () { if (xAuth.is(':checked')) { rcxa.show('blind', {direction:'vertical'}, 500, function() { - xauthGrid.w2render('x-auth-grid'); + if(w2ui['x-auth-grid']) xauthGrid.w2render('x-auth-grid'); }); if(adAuth.is(':checked')) { adAuth.attr('checked', false); @@ -483,13 +571,6 @@ else rcxa.hide('blind', {direction:'vertical'}, 500); }); - var - adTags = $('#ad_tags'), - rcat = $('#rc-at'), - atw = $('#atw'), - xTags = $('#x_tags'), - rcxt = $('#rc-xt'); - if(adTags.is(':checked') && xTags.is(':checked')) { xTags.attr('checked', false); rcxt.hide('blind', {direction:'vertical'}, 500); @@ -498,7 +579,7 @@ adTags.click(function () { if (adTags.is(':checked')) { rcat.show('blind', {direction:'vertical'}, 500, function() { - tagsGrid.w2render('tags-grid'); + if(w2ui['tags-grid']) tagsGrid.w2render('tags-grid'); }); atw.show('blind', {direction:'vertical'}, 500); if(xTags.is(':checked')) { @@ -515,7 +596,7 @@ xTags.click(function () { if (xTags.is(':checked')) { rcxt.show('blind', {direction:'vertical'}, 500, function() { - xtagsGrid.w2render('x-tags-grid'); + if(w2ui['x-tags-grid']) xtagsGrid.w2render('x-tags-grid'); }); if(adTags.is(':checked')) { adTags.attr('checked', false); @@ -526,13 +607,6 @@ else rcxt.hide('blind', {direction:'vertical'}, 500); }); - var - adCust = $('#ad_custom'), - rccu = $('#rc-cu'), - cuw = $('#cuw'), - xCust = $('#x_custom'), - rcxu = $('#rc-xu'); - if(adCust.is(':checked') && xCust.is(':checked')) { xCust.attr('checked', false); rcxu.hide('blind', {direction:'vertical'}, 500); @@ -541,7 +615,7 @@ adCust.click(function () { if (adCust.is(':checked')) { rccu.show('blind', {direction:'vertical'}, 500, function() { - custGrid.w2render('cust-grid'); + if(w2ui['cust-grid']) custGrid.w2render('cust-grid'); }); cuw.show('blind', {direction:'vertical'}, 500); if(xCust.is(':checked')) { @@ -558,7 +632,7 @@ xCust.click(function () { if (xCust.is(':checked')) { rcxu.show('blind', {direction:'vertical'}, 500, function() { - xcustGrid.w2render('x-cust-grid'); + if(w2ui['x-cust-grid']) xcustGrid.w2render('x-cust-grid'); }); if(adCust.is(':checked')) { adCust.attr('checked', false); @@ -569,6 +643,49 @@ else rcxu.hide('blind', {direction:'vertical'}, 500); }); + $("#ad_start_date, #ad_end_date").datepicker({ + dateFormat:'yy-mm-dd', + showButtonPanel:true + }); + + /*var + samAttachment = wp.media.model.Attachment, + adImgId = $('#ad_img_id'); + + $('#banner-media').click(function(e) { + e.preventDefault(); + + if(samUploader) { + samUploader.open(); + return; + } + + samUploader = wp.media.frames.samBanner = wp.media({ + title: mediaTexts.title, + button: {text: mediaTexts.button}, + library: {type: 'image'}, + multiple: false, + selection: [samAttachment.get( adImgId.val() )] + }); + + samUploader.on('select', function() { + var + adImg = $('#ad_img'), + adName = $('#title'), + adDesc = $('#item_description'), + adAlt = $('#ad_alt'); + + var attachment = samUploader.state().get('selection').first().toJSON(); + adImg.val(attachment.url); // alt, caption, title, description + adImgId.val(attachment.id); + if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); + if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); + if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); + }); + + samUploader.open(); + });*/ + $('#ad_schedule').click(function () { if ($('#ad_schedule').is(':checked')) $('#rc-sc').show('blind', {direction:'vertical'}, 500); else $('#rc-sc').hide('blind', {direction:'vertical'}, 500); @@ -584,9 +701,11 @@ else $('#rc-cl').hide('blind', {direction:'vertical'}, 500); }); + sPointer = samEditorOptions.ads; + sPointer.pointer = 'ads'; - if(sPointer.enabled || '' == $('#title').val()) { - $('#title').pointer({ + if(sPointer.enabled || '' == title.val()) { + title.pointer({ content: '

        ' + sPointer.title + '

        ' + sPointer.content + '

        ', position: 'top', close: function() { @@ -602,53 +721,60 @@ }).pointer('open'); } - $('#is_singular').click(function () { - if ($('#is_singular').is(':checked')) + var + isSing = $('#is_singular'), isSingle = $('#is_single'), isPage = $('#is_page'), isAttach = $('#is_attachment'), isPostType = $('#is_posttype'); + + isSing.click(function () { + if (isSing.is(':checked')) $('#is_single, #is_page, #is_attachment, #is_posttype').attr('checked', true); }); $('#is_single, #is_page, #is_attachment, #is_posttype').click(function () { - if ($('#is_singular').is(':checked') && - (!$('#is_single').is(':checked') || - !$('#is_page').is(':checked') || - !$('#is_attachment').is(':checked') || - !$('#is_posttype').is(':checked') )) { - $('#is_singular').attr('checked', false); + if (isSing.is(':checked') && + (!isSingle.is(':checked') || + !isPage.is(':checked') || + !isAttach.is(':checked') || + !isPostType.is(':checked') )) { + isSing.attr('checked', false); } else { - if (!$('#is_singular').is(':checked') && - $('#is_single').is(':checked') && - $('#is_posttype').is(':checked') && - $('#is_page').is(':checked') && - $('#is_attachment').is(':checked')) - $('#is_singular').attr('checked', true); + if (!isSing.is(':checked') && + isSingle.is(':checked') && + isPostType.is(':checked') && + isPage.is(':checked') && + isAttach.is(':checked')) + isSing.attr('checked', true); } }); - $('#is_archive').click(function () { - if ($('#is_archive').is(':checked')) - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').attr('checked', true); - }); - - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').click(function () { - if ($('#is_archive').is(':checked') && - (!$('#is_tax').is(':checked') || - !$('#is_category').is(':checked') || - !$('#is_posttype_archive').is(':checked') || - !$('#is_tag').is(':checked') || - !$('#is_author').is(':checked') || - !$('#is_date').is(':checked'))) { - $('#is_archive').attr('checked', false); + var + isArc = $('#is_archive'), isTax = $('#is_tax'), isCat = $('#is_category'), isTag = $('#is_tag'), + isAuthor = $('#is_author'), isDate = $('#is_date'), isPostTypeArc = $('#is_posttype_archive'), + archives = $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive'); + + isArc.click(function () { + if (isArc.is(':checked')) archives.attr('checked', true); + }); + + archives.click(function () { + if (isArc.is(':checked') && + (!isTax.is(':checked') || + !isCat.is(':checked') || + !isPostTypeArc.is(':checked') || + !isTag.is(':checked') || + !isAuthor.is(':checked') || + !isDate.is(':checked'))) { + isArc.attr('checked', false); } else { - if (!$('#is_archive').is(':checked') && - $('#is_tax').is(':checked') && - $('#is_category').is(':checked') && - $('#is_posttype_archive').is(':checked') && - $('#is_tag').is(':checked') && - $('#is_author').is(':checked') && - $('#is_date').is(':checked')) { - $('#is_archive').attr('checked', true); + if (!isArc.is(':checked') && + isTax.is(':checked') && + isCat.is(':checked') && + isPostTypeArc.is(':checked') && + isTag.is(':checked') && + isAuthor.is(':checked') && + isDate.is(':checked')) { + isArc.attr('checked', true); } } }); diff --git a/js/sam-admin-edit-item.min.js b/js/sam-admin-edit-item.min.js new file mode 100644 index 0000000..30d6674 --- /dev/null +++ b/js/sam-admin-edit-item.min.js @@ -0,0 +1 @@ +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#ad_img",adImgId:"#ad_img_id",adName:"#title",adDesc:"#item_description",adAlt:"#ad_alt",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){function ir(t,i,r,u,f,e){var o=r.val();i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:f,url:e,onSelect:function(n){n.onComplete=function(){for(var f,e="",t=this.getSelection(),i,n=0;n<\/div>').appendTo(nu);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),ki=="item"?n("#ad_img").val(i.url+t):ki=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});n("#adv_nick").combogrid({url:y+"?action=load_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:r.comboGrid,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#ad_img").val(t),!1});f("ctt-grid",ii,tu,"slug",r.customTaxes,pt.cTax);f("x-ctt-grid",ri,iu,"slug",r.customTaxes,pt.cTax);f("cust-grid",ai,au,"slug",r.customs,pt.customs);f("x-cust-grid",vi,vu,"slug",r.customs,pt.customs);yi=y+"?action=load_posts&cstr="+samEditorOptions.data.custList+"&sp="+yu+"&spg="+pu;ir("posts-grid",ui,ru,"id",r.posts,yi);ir("x-posts-grid",fi,fu,"id",r.posts,yi);n("#tabs").tabs({activate:function(n,t){var i=t.newPanel[0].id;i=="tabs-1"&&w2ui["posts-grid"]&&ui.w2render("posts-grid");i=="tabs-2"&&(ct.is(":visible")&&w2ui["ctt-grid"]&&ii.w2render("ctt-grid"),nt.is(":visible")&&w2ui["x-ctt-grid"]&&ri.w2render("x-ctt-grid"),b.is(":visible")&&w2ui["x-posts-grid"]&&fi.w2render("x-posts-grid"),ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid"),ht.is(":visible")&&w2ui["cats-grid"]&&ei.w2render("cats-grid"),d.is(":visible")&&w2ui["x-cats-grid"]&&oi.w2render("x-cats-grid"),lt.is(":visible")&&w2ui["auth-grid"]&&si.w2render("auth-grid"),it.is(":visible")&&w2ui["x-auth-grid"]&&hi.w2render("x-auth-grid"),at.is(":visible")&&w2ui["tags-grid"]&&ci.w2render("tags-grid"),ut.is(":visible")&&w2ui["x-tags-grid"]&&li.w2render("x-tags-grid"),vt.is(":visible")&&w2ui["cust-grid"]&&ai.w2render("cust-grid"),et.is(":visible")&&w2ui["xcust-grid"]&&vi.w2render("x-cust-grid"))}});n("#code_mode_false").click(function(){n("#rc-cmf").show("blind",{direction:"vertical"},500);n("#rc-cmt").hide("blind",{direction:"vertical"},500)});n("#code_mode_true").click(function(){n("#rc-cmf").hide("blind",{direction:"vertical"},500);n("#rc-cmt").show("blind",{direction:"vertical"},500)});2==n("input:radio[name=view_type]:checked").val()&&(u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)),u.attr("disabled",!0));n("input:radio[name=view_type]").click(function(){var t=n("input:radio[name=view_type]:checked").val();switch(t){case"0":e.is(":hidden")&&e.show("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"1":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"2":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":hidden")&&(o.show("blind",{direction:"vertical"},500,function(){w2ui["posts-grid"]&&ui.w2render("posts-grid")}),u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)));u.attr("disabled",!0)}});rr=n.ajax({url:y,data:{action:"load_authors",level:3},type:"POST"});rr.done(function(n){pi=n;f("auth-grid",si,su,"slug",r.authors,pi);f("x-auth-grid",hi,hu,"slug",r.authors,pi)});ur=n.ajax({url:y,data:{action:"load_users",subscriber:encodeURI(i.subscriber),contributor:encodeURI(i.contributor),author:encodeURI(i.author),editor:encodeURI(i.editor),admin:encodeURI(i.admin),sadmin:encodeURI(i.superAdmin)},type:"POST"});ur.done(function(n){fr=n;f("users-grid",st,uu,"slug",r.users,fr)});er=n.ajax({url:y,data:{action:"load_cats",level:3},type:"POST"});er.done(function(n){wi=n;f("cats-grid",ei,eu,"slug",r.cats,wi);f("x-cats-grid",oi,ou,"slug",r.cats,wi)});or=n.ajax({url:y,data:{action:"load_tags",level:3},type:"POST"});or.done(function(n){bi=n;f("tags-grid",ci,cu,"slug",r.tags,bi);f("x-tags-grid",li,lu,"slug",r.tags,bi)});u.click(function(){u.is(":checked")?2==n("input:radio[name=view_type]:checked").val()?u.attr("checked",!1):b.show("blind",{direction:"vertical"},500,function(){w2ui["x-posts-grid"]&&fi.w2render("x-posts-grid")}):b.hide("blind",{direction:"vertical"},500)});n("input:radio[name=ad_users]").click(function(){var t=n("input:radio[name=ad_users]:checked").val();t=="0"?yt.is(":visible")&&yt.hide("blind",{direction:"vertical"},500):yt.is(":hidden")&&yt.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")})});di.click(function(){di.is(":checked")?gi.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")}):gi.hide("blind",{direction:"vertical"},500)});nr.click(function(){nr.is(":checked")?ot.show("blind",{direction:"vertical"},500,function(){w2ui["users-grid"]&&st.w2render("users-grid")}):ot.hide("blind",{direction:"vertical"},500)});n("#ad_swf").click(function(){n("#ad_swf").is(":checked")?n("#swf-params").show("blind",{direction:"vertical"},500):n("#swf-params").hide("blind",{direction:"vertical"},500)});k.is(":checked")&&s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500));k.click(function(){k.is(":checked")?(ht.show("blind",{direction:"vertical"},500,function(){w2ui["cats-grid"]&&ei.w2render("cats-grid")}),bt.show("blind",{direction:"vertical"},500),s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500))):(ht.hide("blind",{direction:"vertical"},500),bt.hide("blind",{direction:"vertical"},500))});s.click(function(){s.is(":checked")?(d.show("blind",{direction:"vertical"},500,function(){w2ui["x-cats-grid"]&&oi.w2render("x-cats-grid")}),k.is(":checked")&&(k.attr("checked",!1),ht.hide("blind",{direction:"vertical"},500),bt.hide("blind",{direction:"vertical"},500))):d.hide("blind",{direction:"vertical"},500)});g.is(":checked")&&h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500));g.click(function(){g.is(":checked")?(ct.show("blind",{direction:"vertical"},500,function(){w2ui["ctt-grid"]&&ii.w2render("ctt-grid")}),kt.show("blind",{direction:"vertical"},500),h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500))):(ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))});h.click(function(){h.is(":checked")?(nt.show("blind",{direction:"vertical"},500,function(){w2ui["x-ctt-grid"]&&ri.w2render("x-ctt-grid")}),g.is(":checked")&&(g.attr("checked",!1),ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))):nt.hide("blind",{direction:"vertical"},500)});tt.is(":checked")&&c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500));tt.click(function(){tt.is(":checked")?(lt.show("blind",{direction:"vertical"},500,function(){w2ui["auth-grid"]&&si.w2render("auth-grid")}),dt.show("blind",{direction:"vertical"},500),c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500))):(lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))});c.click(function(){c.is(":checked")?(it.show("blind",{direction:"vertical"},500,function(){w2ui["x-auth-grid"]&&hi.w2render("x-auth-grid")}),tt.is(":checked")&&(tt.attr("checked",!1),lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))):it.hide("blind",{direction:"vertical"},500)});rt.is(":checked")&&l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500));rt.click(function(){rt.is(":checked")?(at.show("blind",{direction:"vertical"},500,function(){w2ui["tags-grid"]&&ci.w2render("tags-grid")}),gt.show("blind",{direction:"vertical"},500),l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500))):(at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))});l.click(function(){l.is(":checked")?(ut.show("blind",{direction:"vertical"},500,function(){w2ui["x-tags-grid"]&&li.w2render("x-tags-grid")}),rt.is(":checked")&&(rt.attr("checked",!1),at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))):ut.hide("blind",{direction:"vertical"},500)});ft.is(":checked")&&a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500));ft.click(function(){ft.is(":checked")?(vt.show("blind",{direction:"vertical"},500,function(){w2ui["cust-grid"]&&ai.w2render("cust-grid")}),ni.show("blind",{direction:"vertical"},500),a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500))):(vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))});a.click(function(){a.is(":checked")?(et.show("blind",{direction:"vertical"},500,function(){w2ui["x-cust-grid"]&&vi.w2render("x-cust-grid")}),ft.is(":checked")&&(ft.attr("checked",!1),vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))):et.hide("blind",{direction:"vertical"},500)});n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0});n("#ad_schedule").click(function(){n("#ad_schedule").is(":checked")?n("#rc-sc").show("blind",{direction:"vertical"},500):n("#rc-sc").hide("blind",{direction:"vertical"},500)});n("#limit_hits").click(function(){n("#limit_hits").is(":checked")?n("#rc-hl").show("blind",{direction:"vertical"},500):n("#rc-hl").hide("blind",{direction:"vertical"},500)});n("#limit_clicks").click(function(){n("#limit_clicks").is(":checked")?n("#rc-cl").show("blind",{direction:"vertical"},500):n("#rc-cl").hide("blind",{direction:"vertical"},500)});v=samEditorOptions.ads;v.pointer="ads";(v.enabled||""==wt.val())&&wt.pointer({content:"

        "+v.title+"<\/h3>

        "+v.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:v.pointer},async:!0})}}).pointer("open");var p=n("#is_singular"),sr=n("#is_single"),hr=n("#is_page"),cr=n("#is_attachment"),lr=n("#is_posttype");p.click(function(){p.is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)});n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!p.is(":checked")||sr.is(":checked")&&hr.is(":checked")&&cr.is(":checked")&&lr.is(":checked")?!p.is(":checked")&&sr.is(":checked")&&lr.is(":checked")&&hr.is(":checked")&&cr.is(":checked")&&p.attr("checked",!0):p.attr("checked",!1)});var w=n("#is_archive"),ar=n("#is_tax"),vr=n("#is_category"),yr=n("#is_tag"),pr=n("#is_author"),wr=n("#is_date"),br=n("#is_posttype_archive"),kr=n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive");return w.click(function(){w.is(":checked")&&kr.attr("checked",!0)}),kr.click(function(){!w.is(":checked")||ar.is(":checked")&&vr.is(":checked")&&br.is(":checked")&&yr.is(":checked")&&pr.is(":checked")&&wr.is(":checked")?!w.is(":checked")&&ar.is(":checked")&&vr.is(":checked")&&br.is(":checked")&&yr.is(":checked")&&pr.is(":checked")&&wr.is(":checked")&&w.attr("checked",!0):w.attr("checked",!1)}),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-admin-edit-place.js b/js/sam-admin-edit-place.js index f6c1958..8b6b081 100644 --- a/js/sam-admin-edit-place.js +++ b/js/sam-admin-edit-place.js @@ -1,21 +1,71 @@ /** * Created by minimus on 17.11.13. */ - +var sam = sam || {}; (function ($) { - $(document).ready(function () { - var em = $('#editor_mode').val(); + var media, mediaTexts = samEditorOptions.media; - $("#title").tooltip({ - track: true - }); + sam.media = media = { + buttonId: '#banner-media', + adUrl: '#patch_img', + adImgId: '#patch_img_id', + adName: '#title', + adDesc: '#description', + //adAlt: '#ad_alt', - var options = $.parseJSON($.ajax({ - url:ajaxurl, - data:{action:'get_strings'}, - async:false, - dataType:'jsonp' - }).responseText); + init: function() { + $(this.buttonId).on( 'click', this.openMediaDialog ); + }, + + openMediaDialog: function( e ) { + e.preventDefault(); + + if ( this._frame ) { + this._frame.open(); + return; + } + + var Attachment = wp.media.model.Attachment; + + this._frame = media.frame = wp.media({ + title: mediaTexts.title, + button: { + text: mediaTexts.button + }, + multiple: false, + library: { + type: 'image' + }/*, + selection: [ Attachment.get( $(this.adImgId).val() ) ]*/ + }); + + this._frame.on('ready', function() { + // + }); + + this._frame.state( 'library' ).on('select', function() { + var attachment = this.get( 'selection' ).single(); + media.handleMediaAttachment( attachment ); + }); + + this._frame.open(); + }, + + handleMediaAttachment: function(a) { + var attechment = a.toJSON(); + $(this.adUrl).val(attechment.url); + $(this.adImgId).val(attechment.id); + if('' == $(this.adName).val() && '' != attechment.title) $(this.adName).val(attechment.title); + if('' == $(this.adDesc).val() && '' != attechment.caption) $(this.adDesc).val(attechment.caption); + if('' == $(this.adAlt).val() && '' != attechment.alt) $(this.adAlt).val(attechment.alt); + } + }; + + $(document).ready(function () { + var em = $('#editor_mode').val(), fu; + + var + rcpsi = $('#rc-psi'), rcpsc = $('#rc-psc'), rcpsd = $('#rc-psd'), title = $("#title"); var btnUpload = $("#upload-file-button"), @@ -25,7 +75,25 @@ sPointer, fileExt = ''; - var fu = new AjaxUpload(btnUpload, { + sPointer = samEditorOptions.places; + sPointer.pointer = 'places'; + + /*var samUploader, mediaTexts = samEditorOptions.media;*/ + + media.init(); + + title.tooltip({ + track: true + }); + + var options = samEditorOptions.options/*$.parseJSON($.ajax({ + url:ajaxurl, + data:{action:'get_strings'}, + async:false, + dataType:'jsonp' + }).responseText)*/; + + fu = new AjaxUpload(btnUpload, { action:ajaxurl, name:'uploadfile', data:{ @@ -64,8 +132,7 @@ } }); - sPointer = samPointer.places; - sPointer.pointer = 'places'; + $('#image_tools').tabs(); $("#add-file-button").click(function () { var curFile = options.url + $("select#files_list option:selected").val(); @@ -74,24 +141,24 @@ }); $('#patch_source_image').click(function () { - if ($('#rc-psi').is(':hidden')) $('#rc-psi').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); + if (rcpsi.is(':hidden')) rcpsi.show('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':visible')) rcpsc.hide('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':visible')) rcpsd.hide('blind', {direction:'vertical'}, 500); }); $('#patch_source_code').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':hidden')) $('#rc-psc').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); + if (rcpsi.is(':visible')) rcpsi.hide('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':hidden')) rcpsc.show('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':visible')) rcpsd.hide('blind', {direction:'vertical'}, 500); }); $('#patch_source_dfp').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':hidden')) $('#rc-psd').show('blind', {direction:'vertical'}, 500); + if (rcpsi.is(':visible')) rcpsi.hide('blind', {direction:'vertical'}, 500); + if (rcpsc.is(':visible')) rcpsc.hide('blind', {direction:'vertical'}, 500); + if (rcpsd.is(':hidden')) rcpsd.show('blind', {direction:'vertical'}, 500); }); - if(sPointer.enabled || '' == $('#title').val()) { + if(sPointer.enabled || '' == title.val()) { $('#title').pointer({ content: '

        ' + sPointer.title + '

        ' + sPointer.content + '

        ', position: 'top', diff --git a/js/sam-admin-edit-place.min.js b/js/sam-admin-edit-place.min.js new file mode 100644 index 0000000..e7edcc2 --- /dev/null +++ b/js/sam-admin-edit-place.min.js @@ -0,0 +1 @@ +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#patch_img",adImgId:"#patch_img_id",adName:"#title",adDesc:"#description",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){var s=n("#editor_mode").val(),l,r=n("#rc-psi"),u=n("#rc-psc"),f=n("#rc-psd"),h=n("#title"),a=n("#upload-file-button"),o=n("#uploading"),v=n("#uploading-help"),c=n("#load_img"),e,i;return e=samEditorOptions.places,e.pointer="places",t.init(),h.tooltip({track:!0}),i=samEditorOptions.options,l=new AjaxUpload(a,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,t){if(!(t&&/^(jpg|png|jpeg|gif|swf)$/.test(t)))return o.text(i.status),!1;c.show();o.text(i.uploading)},onComplete:function(t,r){o.text("");c.hide();n('
        <\/div>').appendTo(v);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),s=="item"?n("#ad_img").val(i.url+t):s=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}}),n("#image_tools").tabs(),n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#patch_img").val(t),!1}),n("#patch_source_image").click(function(){r.is(":hidden")&&r.show("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_code").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":hidden")&&u.show("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_dfp").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":hidden")&&f.show("blind",{direction:"vertical"},500)}),(e.enabled||""==h.val())&&n("#title").pointer({content:"

        "+e.title+"<\/h3>

        "+e.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:e.pointer},async:!0})}}).pointer("open"),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-admin-edit.js b/js/sam-admin-edit.js deleted file mode 100644 index 24b58d1..0000000 --- a/js/sam-admin-edit.js +++ /dev/null @@ -1,686 +0,0 @@ -/** - * @author minimus - * @copyright 2010 - */ -(function ($) { - $(document).ready(function () { - var em = $('#editor_mode').val(); - - $("#title").tooltip({ - track: true - }); - - var options = $.parseJSON($.ajax({ - url:ajaxurl, - data:{action:'get_strings'}, - async:false, - dataType:'jsonp' - }).responseText); - - var - btnUpload = $("#upload-file-button"), - status = $("#uploading"), - srcHelp = $("#uploading-help"), - loadImg = $('#load_img'), - sPointer, - fileExt = ''; - - var fu = new AjaxUpload(btnUpload, { - action:ajaxurl, - name:'uploadfile', - data:{ - action:'upload_ad_image' - }, - onSubmit:function (file, ext) { - if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { - status.text(options.status); - return false; - } - loadImg.show(); - status.text(options.uploading); - }, - onComplete:function (file, response) { - status.text(''); - loadImg.hide(); - $('

        ').appendTo(srcHelp); - if (response == "success") { - $("#files").text(options.file + ' ' + file + ' ' + options.uploaded) - .addClass('updated') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - if (em == 'item') $("#ad_img").val(options.url + file); - else if (em == 'place') $("#patch_img").val(options.url + file); - } - else { - $('#files').text(file + ' ' + response) - .addClass('error') - .delay(3000) - .fadeOut(1000, function () { - $(this).remove(); - }); - } - } - }); - - if (em == 'item') { - sPointer = samPointer.ads; - sPointer.pointer = 'ads'; - - var samUploader, mediaTexts = samPointer.media; - - $("#ad_start_date, #ad_end_date").datepicker({ - dateFormat:'yy-mm-dd', - showButtonPanel:true - }); - - // Advertiser ComboGrid - $('#adv_nick').combogrid({ - url: ajaxurl+'?action=get_combo_data', - datatype: "json", - munit: 'px', - alternate: true, - colModel: options.users.colModel, - select: function(event, ui) { - $('#adv_nick').val(ui.item.slug); - $('#adv_name').val(ui.item.title); - $('#adv_mail').val(ui.item.email); - return false; - } - }); - - $('#banner-media').click(function(e) { - e.preventDefault(); - - if(samUploader) { - samUploader.open(); - return; - } - - samUploader = wp.media.frames.samBanner = wp.media({ - title: mediaTexts.title, - button: {text: mediaTexts.button}, - library: {type: 'image'}, - multiple: false - }); - - samUploader.on('select', function() { - var - adImg = $('#ad_img'), - adName = $('#title'), - adDesc = $('#item_description'), - adAlt = $('#ad_alt'); - - attachment = samUploader.state().get('selection').first().toJSON(); - adImg.val(attachment.url); // alt, caption, title, description - if('' == adName.val() && '' != attachment.caption) adName.val(attachment.caption); - if('' == adDesc.val() && '' != attachment.description) adDesc.val(attachment.description); - if('' == adAlt.val() && '' != attachment.alt) adAlt.val(attachment.alt); - }); - - samUploader.open(); - }); - - function buildGrid(name, grig, vn, vi, field, gc, gr) { - //grig = $('#' + name); - //vi = $('#' + vn); - var iVal = vi.val(); - grig.w2grid({ - name: name, - show: {selectColumn: true}, - multiSelect: true, - columns: gc, - records: gr, - onSelect: function(event) { - event.onComplete = function() { - var out = '', recs = this.getSelection(), data; - for(var i = 0; i < recs.length; i++) { - var rec = this.get(recs[i]); - data = (field == 'id') ? rec.id : rec.slug; - out += (i == recs.length - 1) ? data : (data + ','); - } - vi.val(out); - } - }, - onUnselect: function(event) { - event.onComplete = function() { - var out = '', recs = this.getSelection(), data; - for(var i = 0; i < recs.length; i++) { - var rec = this.get(recs[i]); - data = (field == 'id') ? rec.id : rec.slug; - out += (i == recs.length - 1) ? data : (data + ','); - } - vi.val(out); - } - } - }); - - if(null != iVal && '' != iVal) { - var arr = iVal.split(','); - - $.each(arr, function(i, val) { - $.each(gr, function(index, value) { - var iData = (field == 'id') ? value.id : value.slug; - if(iData == val) { - w2ui[name].select(value.recid); - return false; - } - else return true; - }); - }); - } - } - - // Custom Taxonomies Terms Grid - var cttGrid = $('#ctt-grid'), cttIn = $('#view-custom-tax-terms'); - buildGrid('ctt-grid', cttGrid, 'view-custom-tax-terms', cttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); - - // - var xcttGrid = $('#x-ctt-grid'), xcttIn = $('#x-view-custom-tax-terms'); - buildGrid('x-ctt-grid', xcttGrid, 'x-view-custom-tax-terms', xcttIn, 'slug', options.custom_taxes.columns, options.custom_taxes.taxes); - - // Posts Grid - var postsGrid = $('#posts-grid'), postsIn = $('#view_id'); - buildGrid('posts-grid', postsGrid, 'view_id', postsIn, 'id', options.posts.columns, options.posts.posts); - - // Users Grid - var usersGrid = $('#users-grid'), usersIn = $('#x_view_users'); - buildGrid('users-grid', usersGrid, 'x_view_users', usersIn, 'slug', options.users.columns, options.users.users); - - // xPosts Grid - var xpostsGrid = $('#x-posts-grid'), xpostsIn = $('#x_view_id'); - buildGrid('x-posts-grid', xpostsGrid, 'x_view_id', xpostsIn, 'id', options.posts.columns, options.posts.posts); - - // Categories Grid - var catsGrid = $('#cats-grid'), catsIn = $('#view_cats'); - buildGrid('cats-grid', catsGrid, 'view_cats', catsIn, 'slug', options.cats.columns, options.cats.cats); - - // xCats Grid - var xcatsGrid = $('#x-cats-grid'), xcatsIn = $('#x_view_cats'); - buildGrid('x-cats-grid', xcatsGrid, 'x_view_cats', xcatsIn, 'slug', options.cats.columns, options.cats.cats); - - // Auth Grid - var authGrid = $('#auth-grid'), authIn = $('#view_authors'); - buildGrid('auth-grid', authGrid, 'view_authors', authIn, 'slug', options.authors.columns, options.authors.authors); - - // xauth Grid - var xauthGrid = $('#x-auth-grid'), xauthIn = $('#x_view_authors'); - buildGrid('x-auth-grid', xauthGrid, 'x_view_authors', xauthIn, 'slug', options.authors.columns, options.authors.authors); - - // Tags Grid - var tagsGrid = $('#tags-grid'), tagsIn = $('#view_tags'); - buildGrid('tags-grid', tagsGrid, 'view_tags', tagsIn, 'slug', options.tags.columns, options.tags.tags); - - // xTags Grid - var xtagsGrid = $('#x-tags-grid'), xtagsIn = $('#x_view_tags'); - buildGrid('x-tags-grid', xtagsGrid, 'x_view_tags', xtagsIn, 'slug', options.tags.columns, options.tags.tags); - - // Customs Grid - var custGrid = $('#cust-grid'), custIn = $('#view_custom'); - buildGrid('cust-grid', custGrid, 'view_custom', custIn, 'slug', options.customs.columns, options.customs.customs); - - // xCustoms Grid - var xcustGrid = $('#x-cust-grid'), xcustIn = $('#x_view_custom'); - buildGrid('x-cust-grid', xcustGrid, 'x_view_custom', xcustIn, 'slug', options.customs.columns, options.customs.customs); - - $('#tabs').tabs({ - activate: function( event, ui ) { - var el = ui.newPanel[0].id; - if(el == 'tabs-1') { - postsGrid.w2render('posts-grid'); - } - if(el == 'tabs-2') { - if($('#rc-ctt').is(':visible')) cttGrid.w2render('ctt-grid'); - if($('#rc-xct').is(':visible')) xcttGrid.w2render('x-ctt-grid'); - if($('#rc-xid').is(':visible')) xpostsGrid.w2render('x-posts-grid'); - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); - if($('#rc-ac').is(':visible')) catsGrid.w2render('cats-grid'); - if($('#rc-xc').is(':visible')) xcatsGrid.w2render('x-cats-grid'); - if($('#rc-au').is(':visible')) authGrid.w2render('auth-grid'); - if($('#rc-xa').is(':visible')) xauthGrid.w2render('x-auth-grid'); - if($('#rc-at').is(':visible')) tagsGrid.w2render('tags-grid'); - if($('#rc-xt').is(':visible')) xtagsGrid.w2render('x-tags-grid'); - if($('#rc-cu').is(':visible')) custGrid.w2render('cust-grid'); - if($('#rc-xu').is(':visible')) xcustGrid.w2render('x-cust-grid'); - } - } - }); - - $("#add-file-button").click(function () { - var curFile = options.url + $("select#files_list option:selected").val(); - $("#ad_img").val(curFile); - return false; - }); - - $('#code_mode_false').click(function () { - $("#rc-cmf").show('blind', {direction:'vertical'}, 500); - $("#rc-cmt").hide('blind', {direction:'vertical'}, 500); - }); - - $('#code_mode_true').click(function () { - $("#rc-cmf").hide('blind', {direction:'vertical'}, 500); - $("#rc-cmt").show('blind', {direction:'vertical'}, 500); - }); - - var - rcvt0 = $('#rc-vt0'), - rcvt2 = $('#rc-vt2'), - xId = $('#x_id'), - rcxid = $('#rc-xid'); - - if(2 == $('input:radio[name=view_type]:checked').val()) { - if(xId.is(':checked')) { - xId.attr('checked', false); - rcxid.hide('blind', {direction:'vertical'}, 500); - } - xId.attr('disabled', true); - } - - $("input:radio[name=view_type]").click(function () { - var cval = $('input:radio[name=view_type]:checked').val(); - switch (cval) { - case '0': - if (rcvt0.is(':hidden')) rcvt0.show('blind', {direction:'vertical'}, 500); - if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); - xId.attr('disabled', false); - break; - case '1': - if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); - if (rcvt2.is(':visible')) rcvt2.hide('blind', {direction:'vertical'}, 500); - xId.attr('disabled', false); - break; - case '2': - if (rcvt0.is(':visible')) rcvt0.hide('blind', {direction:'vertical'}, 500); - if (rcvt2.is(':hidden')) { - rcvt2.show('blind', {direction:'vertical'}, 500, function() { - postsGrid.w2render('posts-grid'); - }); - if(xId.is(':checked')) { - xId.attr('checked', false); - rcxid.hide('blind', {direction:'vertical'}, 500); - } - } - xId.attr('disabled', true); - break; - } - }); - - xId.click(function () { - if (xId.is(':checked')) { - if(2 == $('input:radio[name=view_type]:checked').val()) { - xId.attr('checked', false); - } - else - rcxid.show('blind', {direction:'vertical'}, 500, function() { - xpostsGrid.w2render('x-posts-grid'); - }); - } - else rcxid.hide('blind', {direction:'vertical'}, 500); - }); - - $("input:radio[name=ad_users]").click(function() { - var uval = $('input:radio[name=ad_users]:checked').val(); - if(uval == '0') { - if($('#custom-users').is(':visible')) $('#custom-users').hide('blind', {direction:'vertical'}, 500); - } - else { - if($('#custom-users').is(':hidden')) - $('#custom-users').show('blind', {direction:'vertical'}, 500, function() { - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); - }); - } - }); - - $("#ad_users_reg").click(function() { - if($('#ad_users_reg').is(':checked')) - $('#x-reg-users').show('blind', {direction:'vertical'}, 500, function() { - if($('#x-view-users').is(':visible')) usersGrid.w2render('users-grid'); - }); - else $('#x-reg-users').hide('blind', {direction:'vertical'}, 500); - }); - - $('#x_ad_users').click(function() { - if($('#x_ad_users').is(':checked')) - $('#x-view-users').show('blind', {direction:'vertical'}, 500, function() { - usersGrid.w2render('users-grid'); - }); - else $('#x-view-users').hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_swf').click(function() { - if($('#ad_swf').is(':checked')) $('#swf-params').show('blind', {direction:'vertical'}, 500); - else $('#swf-params').hide('blind', {direction:'vertical'}, 500); - }); - - var - adCats = $('#ad_cats'), - rcac = $('#rc-ac'), - acw = $('#acw'), - xCats = $('#x_cats'), - rcxc = $('#rc-xc'); - - if(adCats.is(':checked') && xCats.is(':checked')) { - xCats.attr('checked', false); - rcxc.hide('blind', {direction:'vertical'}, 500); - } - - adCats.click(function () { - if (adCats.is(':checked')) { - rcac.show('blind', {direction:'vertical'}, 500, function() { - catsGrid.w2render('cats-grid'); - }); - acw.show('blind', {direction:'vertical'}, 500); - if(xCats.is(':checked')) { - xCats.attr('checked', false); - rcxc.hide('blind', {direction:'vertical'}, 500); - } - } - else { - rcac.hide('blind', {direction:'vertical'}, 500); - acw.hide('blind', {direction:'vertical'}, 500); - } - }); - - xCats.click(function () { - if (xCats.is(':checked')) { - rcxc.show('blind', {direction:'vertical'}, 500, function() { - xcatsGrid.w2render('x-cats-grid'); - }); - if(adCats.is(':checked')) { - adCats.attr('checked', false); - rcac.hide('blind', {direction:'vertical'}, 500); - acw.hide('blind', {direction:'vertical'}, 500); - } - } - else rcxc.hide('blind', {direction:'vertical'}, 500); - }); - - var - actt = $('#ad_custom_tax_terms'), - rcctt = $('#rc-ctt'), - cttw = $('#cttw'), - xacct = $('#x_ad_custom_tax_terms'), - rcxct = $('#rc-xct'); - - if(actt.is(':checked') && xacct.is(':checked')) { - xacct.attr('checked', false); - rcxct.hide('blind', {direction:'vertical'}, 500); - } - - actt.click(function() { - if(actt.is(':checked')) { - rcctt.show('blind', {direction: 'vertical'}, 500, function() { - cttGrid.w2render('ctt-grid'); - }); - cttw.show('blind', {direction:'vertical'}, 500); - if(xacct.is(':checked')) { - xacct.attr('checked', false); - rcxct.hide('blind', {direction:'vertical'}, 500); - } - } - else { - rcctt.hide('blind', {direction:'vertical'}, 500); - cttw.hide('blind', {direction:'vertical'}, 500); - } - }); - - xacct.click(function() { - if(xacct.is(':checked')) { - rcxct.show('blind', {direction: 'vertical'}, 500, function() { - xcttGrid.w2render('x-ctt-grid'); - }); - if(actt.is(':checked')) { - actt.attr('checked', false); - rcctt.hide('blind', {direction:'vertical'}, 500); - cttw.hide('blind', {direction:'vertical'}, 500); - } - } - else rcxct.hide('blind', {direction: 'vertical'}, 500); - }); - - var - adAuth = $('#ad_authors'), - rcau = $('#rc-au'), - aaw = $('#aaw'), - xAuth = $('#x_authors'), - rcxa = $('#rc-xa'); - - if(adAuth.is(':checked') && xAuth.is(':checked')) { - xAuth.attr('checked', false); - rcxa.hide('blind', {direction:'vertical'}, 500); - } - - adAuth.click(function () { - if (adAuth.is(':checked')) { - rcau.show('blind', {direction:'vertical'}, 500, function() { - authGrid.w2render('auth-grid'); - }); - aaw.show('blind', {direction:'vertical'}, 500); - if(xAuth.is(':checked')) { - xAuth.attr('checked', false); - rcxa.hide('blind', {direction:'vertical'}, 500); - } - } - else { - rcau.hide('blind', {direction:'vertical'}, 500); - aaw.hide('blind', {direction:'vertical'}, 500); - } - }); - - xAuth.click(function () { - if (xAuth.is(':checked')) { - rcxa.show('blind', {direction:'vertical'}, 500, function() { - xauthGrid.w2render('x-auth-grid'); - }); - if(adAuth.is(':checked')) { - adAuth.attr('checked', false); - rcau.hide('blind', {direction:'vertical'}, 500); - aaw.hide('blind', {direction:'vertical'}, 500); - } - } - else rcxa.hide('blind', {direction:'vertical'}, 500); - }); - - var - adTags = $('#ad_tags'), - rcat = $('#rc-at'), - atw = $('#atw'), - xTags = $('#x_tags'), - rcxt = $('#rc-xt'); - - if(adTags.is(':checked') && xTags.is(':checked')) { - xTags.attr('checked', false); - rcxt.hide('blind', {direction:'vertical'}, 500); - } - - adTags.click(function () { - if (adTags.is(':checked')) { - rcat.show('blind', {direction:'vertical'}, 500, function() { - tagsGrid.w2render('tags-grid'); - }); - atw.show('blind', {direction:'vertical'}, 500); - if(xTags.is(':checked')) { - xTags.attr('checked', false); - rcxt.hide('blind', {direction:'vertical'}, 500); - } - } - else { - rcat.hide('blind', {direction:'vertical'}, 500); - atw.hide('blind', {direction:'vertical'}, 500); - } - }); - - xTags.click(function () { - if (xTags.is(':checked')) { - rcxt.show('blind', {direction:'vertical'}, 500, function() { - xtagsGrid.w2render('x-tags-grid'); - }); - if(adTags.is(':checked')) { - adTags.attr('checked', false); - rcat.hide('blind', {direction:'vertical'}, 500); - atw.hide('blind', {direction:'vertical'}, 500); - } - } - else rcxt.hide('blind', {direction:'vertical'}, 500); - }); - - var - adCust = $('#ad_custom'), - rccu = $('#rc-cu'), - cuw = $('#cuw'), - xCust = $('#x_custom'), - rcxu = $('#rc-xu'); - - if(adCust.is(':checked') && xCust.is(':checked')) { - xCust.attr('checked', false); - rcxu.hide('blind', {direction:'vertical'}, 500); - } - - adCust.click(function () { - if (adCust.is(':checked')) { - rccu.show('blind', {direction:'vertical'}, 500, function() { - custGrid.w2render('cust-grid'); - }); - cuw.show('blind', {direction:'vertical'}, 500); - if(xCust.is(':checked')) { - xCust.attr('checked', false); - rcxu.hide('blind', {direction:'vertical'}, 500); - } - } - else { - rccu.hide('blind', {direction:'vertical'}, 500); - cuw.hide('blind', {direction:'vertical'}, 500); - } - }); - - xCust.click(function () { - if (xCust.is(':checked')) { - rcxu.show('blind', {direction:'vertical'}, 500, function() { - xcustGrid.w2render('x-cust-grid'); - }); - if(adCust.is(':checked')) { - adCust.attr('checked', false); - rccu.hide('blind', {direction:'vertical'}, 500); - cuw.hide('blind', {direction:'vertical'}, 500); - } - } - else rcxu.hide('blind', {direction:'vertical'}, 500); - }); - - $('#ad_schedule').click(function () { - if ($('#ad_schedule').is(':checked')) $('#rc-sc').show('blind', {direction:'vertical'}, 500); - else $('#rc-sc').hide('blind', {direction:'vertical'}, 500); - }); - - $('#limit_hits').click(function () { - if ($('#limit_hits').is(':checked')) $('#rc-hl').show('blind', {direction:'vertical'}, 500); - else $('#rc-hl').hide('blind', {direction:'vertical'}, 500); - }); - - $('#limit_clicks').click(function () { - if ($('#limit_clicks').is(':checked')) $('#rc-cl').show('blind', {direction:'vertical'}, 500); - else $('#rc-cl').hide('blind', {direction:'vertical'}, 500); - }); - } - - if (em == 'place') { - sPointer = samPointer.places; - sPointer.pointer = 'places'; - - $("#add-file-button").click(function () { - var curFile = options.url + $("select#files_list option:selected").val(); - $("#patch_img").val(curFile); - return false; - }); - - $('#patch_source_image').click(function () { - if ($('#rc-psi').is(':hidden')) $('#rc-psi').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); - }); - - $('#patch_source_code').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':hidden')) $('#rc-psc').show('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':visible')) $('#rc-psd').hide('blind', {direction:'vertical'}, 500); - }); - - $('#patch_source_dfp').click(function () { - if ($('#rc-psi').is(':visible')) $('#rc-psi').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psc').is(':visible')) $('#rc-psc').hide('blind', {direction:'vertical'}, 500); - if ($('#rc-psd').is(':hidden')) $('#rc-psd').show('blind', {direction:'vertical'}, 500); - }); - } - - if(sPointer.enabled || '' == $('#title').val()) { - $('#title').pointer({ - content: '

        ' + sPointer.title + '

        ' + sPointer.content + '

        ', - position: 'top', - close: function() { - $.ajax({ - url: ajaxurl, - data: { - action: 'close_pointer', - pointer: sPointer.pointer - }, - async: true - }); - } - }).pointer('open'); - } - - $('#is_singular').click(function () { - if ($('#is_singular').is(':checked')) - $('#is_single, #is_page, #is_attachment, #is_posttype').attr('checked', true); - }); - - $('#is_single, #is_page, #is_attachment, #is_posttype').click(function () { - if ($('#is_singular').is(':checked') && - (!$('#is_single').is(':checked') || - !$('#is_page').is(':checked') || - !$('#is_attachment').is(':checked') || - !$('#is_posttype').is(':checked') )) { - $('#is_singular').attr('checked', false); - } - else { - if (!$('#is_singular').is(':checked') && - $('#is_single').is(':checked') && - $('#is_posttype').is(':checked') && - $('#is_page').is(':checked') && - $('#is_attachment').is(':checked')) - $('#is_singular').attr('checked', true); - } - }); - - $('#is_archive').click(function () { - if ($('#is_archive').is(':checked')) - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').attr('checked', true); - }); - - $('#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive').click(function () { - if ($('#is_archive').is(':checked') && - (!$('#is_tax').is(':checked') || - !$('#is_category').is(':checked') || - !$('#is_posttype_archive').is(':checked') || - !$('#is_tag').is(':checked') || - !$('#is_author').is(':checked') || - !$('#is_date').is(':checked'))) { - $('#is_archive').attr('checked', false); - } - else { - if (!$('#is_archive').is(':checked') && - $('#is_tax').is(':checked') && - $('#is_category').is(':checked') && - $('#is_posttype_archive').is(':checked') && - $('#is_tag').is(':checked') && - $('#is_author').is(':checked') && - $('#is_date').is(':checked')) { - $('#is_archive').attr('checked', true); - } - } - }); - - return false; - }); -})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit.min.js b/js/sam-admin-edit.min.js deleted file mode 100644 index c8e4c07..0000000 --- a/js/sam-admin-edit.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @author minimus - * @copyright 2010 - 2013 - */ -(function(n){n(document).ready(function(){var at=n("#editor_mode").val(),ct,oi,lt,wi,yt,bi,h,di,ot,li,st,hi,ht,vi,vt,pi,pt,ei,nt,ki,k,ci,d,ai,g,yi;n("#title").tooltip({track:!0});var t=n.parseJSON(n.ajax({url:ajaxurl,data:{action:"get_strings"},async:!1,dataType:"jsonp"}).responseText),gi=n("#upload-file-button"),ti=n("#uploading"),nr=n("#uploading-help"),si=n("#load_img"),u,tr="",ir=new AjaxUpload(gi,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,i){if(!(i&&/^(jpg|png|jpeg|gif|swf)$/.test(i)))return ti.text(t.status),!1;si.show(),ti.text(t.uploading)},onComplete:function(i,r){ti.text(""),si.hide(),n('
        ').appendTo(nr),r=="success"?(n("#files").text(t.file+" "+i+" "+t.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),at=="item"?n("#ad_img").val(t.url+i):at=="place"&&n("#patch_img").val(t.url+i)):n("#files").text(i+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});if(at=="item"){u=samPointer.ads,u.pointer="ads",n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0}),n("#adv_nick").combogrid({url:ajaxurl+"?action=get_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:t.users.colModel,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});function i(t,i,r,u,f,e,o){var s=u.val(),h;i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:e,records:o,onSelect:function(n){n.onComplete=function(){for(var e="",r=this.getSelection(),i,t,n=0;n"+u.title+"

        "+u.content+"

        ",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:u.pointer},async:!0})}}).pointer("open"),n("#is_singular").click(function(){n("#is_singular").is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)}),n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!n("#is_singular").is(":checked")||n("#is_single").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_posttype").is(":checked")?!n("#is_singular").is(":checked")&&n("#is_single").is(":checked")&&n("#is_posttype").is(":checked")&&n("#is_page").is(":checked")&&n("#is_attachment").is(":checked")&&n("#is_singular").attr("checked",!0):n("#is_singular").attr("checked",!1)}),n("#is_archive").click(function(){n("#is_archive").is(":checked")&&n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").attr("checked",!0)}),n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive").click(function(){!n("#is_archive").is(":checked")||n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")?!n("#is_archive").is(":checked")&&n("#is_tax").is(":checked")&&n("#is_category").is(":checked")&&n("#is_posttype_archive").is(":checked")&&n("#is_tag").is(":checked")&&n("#is_author").is(":checked")&&n("#is_date").is(":checked")&&n("#is_archive").attr("checked",!0):n("#is_archive").attr("checked",!1)}),!1})})(jQuery); \ No newline at end of file diff --git a/js/sam-errors-list.js b/js/sam-errors-list.js index 9dc72c5..dd0c571 100644 --- a/js/sam-errors-list.js +++ b/js/sam-errors-list.js @@ -33,12 +33,12 @@ }).responseText); var - eType = wOpts.data.type, //$('#et-'+idn).val(), - eDate = wOpts.data.date, //$('#dt-'+idn).val(), - eTable = wOpts.data.name, //$('#tn-'+idn).val(), - eMsg = wOpts.data.msg, //$('#em-'+idn).val(), - eSql = wOpts.data.es, //$('#es-'+idn).val(), - eResolved = wOpts.data.resolved, //$('#rs-'+idn).val(), + eType = wOpts.data.type, + eDate = wOpts.data.date, + eTable = wOpts.data.name, + eMsg = wOpts.data.msg, + eSql = wOpts.data.es, + eResolved = wOpts.data.resolved, img = options.imgURL + ((eResolved-0) ? 'ok.png' : 'warning.png'), alt = options.alts[eResolved-0], dHTML = ''+alt+'' + diff --git a/langs/index.html b/langs/index.html new file mode 100644 index 0000000..25d941d --- /dev/null +++ b/langs/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/sam-ajax-admin.php b/sam-ajax-admin.php new file mode 100644 index 0000000..bf9b9f0 --- /dev/null +++ b/sam-ajax-admin.php @@ -0,0 +1,239 @@ +prefix . "terms"; +$ttTable = $wpdb->prefix . "term_taxonomy"; +$uTable = $wpdb->base_prefix . "users"; +$umTable = $wpdb->base_prefix . "usermeta"; +$postTable = $wpdb->prefix . "posts"; + +$oTable = $wpdb->prefix . 'options'; +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +//Typical headers +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_REQUEST['action']) ? 'sam_ajax_' . stripslashes($_REQUEST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_cats', + 'sam_ajax_load_tags', + 'sam_ajax_load_authors', + 'sam_ajax_load_posts', + 'sam_ajax_load_users', + 'sam_ajax_load_combo_data' +); +$out = array(); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_cats': + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'category' + ORDER BY wt.name;"; + + $cats = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($cats as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $cats; + break; + + case 'sam_ajax_load_tags': + $sql = "SELECT wt.term_id AS id, wt.name AS title, wt.slug + FROM $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id + WHERE wtt.taxonomy = 'post_tag' + ORDER BY wt.name;"; + + $tags = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($tags as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $tags; + break; + + case 'sam_ajax_load_authors': + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug + FROM + $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id + WHERE + wum.meta_key = 'wp_user_level' AND + wum.meta_value > 1 + ORDER BY wu.id;"; + + $auth = $wpdb->get_results($sql, ARRAY_A); + $k = 0; + foreach($auth as &$val) { + $k++; + $val['recid'] = $k; + } + $out = $auth; + break; + + case 'sam_ajax_load_posts': + $custs = (isset($_REQUEST['cstr'])) ? $_REQUEST['cstr'] : ''; + $sPost = (isset($_REQUEST['sp'])) ? urldecode( $_REQUEST['sp'] ) : 'Post'; + $sPage = (isset($_REQUEST['spg'])) ? urldecode( $_REQUEST['spg'] ) : 'Page'; + + //set @row_num = 0; + //SELECT @row_num := @row_num + 1 AS recid + $sql = "SELECT + wp.id, + wp.post_title AS title, + wp.post_type AS type + FROM + $postTable wp + WHERE + wp.post_status = 'publish' AND + FIND_IN_SET(wp.post_type, 'post,page{$custs}') + ORDER BY wp.id;"; + + $posts = $wpdb->get_results($sql, ARRAY_A); + + $k = 0; + foreach($posts as &$val) { + switch($val['type']) { + case 'post': + $val['type'] = $sPost; + break; + case 'page': + $val['type'] = $sPage; + break; + default: + $val['type'] = $sPost . ': '.$val['type']; + break; + } + $k++; + $val['recid'] = $k; + } + $out = array( + 'status' => 'success', + 'total' => count($posts), + 'records' => $posts + ); + break; + + case 'sam_ajax_load_users': + $roleSubscriber = (isset($_REQUEST['subscriber'])) ? urldecode($_REQUEST['subscriber']) : 'Subscriber'; + $roleContributor = (isset($_REQUEST['contributor'])) ? urldecode($_REQUEST['contributor']) : 'Contributor'; + $roleAuthor = (isset($_REQUEST['author'])) ? urldecode($_REQUEST['author']) : 'Author'; + $roleEditor = (isset($_REQUEST['editor'])) ? urldecode($_REQUEST['editor']) : 'Editor'; + $roleAdministrator = (isset($_REQUEST["admin"])) ? urldecode($_REQUEST["admin"]) : 'Administrator'; + $roleSuperAdmin = (isset($_REQUEST['sadmin'])) ? urldecode($_REQUEST['sadmin']) : 'Super Admin'; + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug, + (CASE wum.meta_value + WHEN 0 THEN '$roleSubscriber' + WHEN 1 THEN '$roleContributor' + WHEN 2 THEN '$roleAuthor' + ELSE + IF(wum.meta_value > 2 AND wum.meta_value <= 7, '$roleEditor', + IF(wum.meta_value > 7 AND wum.meta_value <= 10, '$roleAdministrator', + IF(wum.meta_value > 10, '$roleSuperAdmin', NULL) + ) + ) + END) AS role + FROM $uTable wu + INNER JOIN $umTable wum + ON wu.id = wum.user_id AND wum.meta_key = 'wp_user_level' + ORDER BY wu.id;"; + $users = $wpdb->get_results($sql, ARRAY_A); + + $k = 0; + foreach($users as &$val) { + $k++; + $val['recid'] = $k; + } + + $out = $users; + break; + + case 'sam_ajax_load_combo_data': + $page = $_GET['page']; + $rows = $_GET['rows']; + $searchTerm = $_GET['searchTerm']; + $offset = ((int)$page - 1) * (int)$rows; + + $sql = "SELECT + wu.id, + wu.display_name AS title, + wu.user_nicename AS slug, + wu.user_email AS email + FROM + $uTable wu + WHERE wu.user_nicename LIKE '".$searchTerm."%' + ORDER BY wu.id + LIMIT $offset, $rows;"; + $users = $wpdb->get_results($sql, ARRAY_A); + + $sql = "SELECT + COUNT(*) + FROM $uTable wu + WHERE wu.user_nicename LIKE '".$searchTerm."%';"; + $rTotal = $wpdb->get_var($wpdb->prepare($sql)); + $total = ceil((int)$rTotal/(int)$rows); + + $out = array( + 'page' => $page, + 'records' => count($users), + 'rows' => $users, + 'total' => $total, + 'offset' => $offset + ); + + break; + + default: + $out = array("status" => "error", "message" => "Error"); + break; + } + echo json_encode( $out ); wp_die(); +} +else $out = array("status" => "error", "message" => "Error"); +//exit(json_encode($output)); +wp_send_json_error($out); diff --git a/updater.class.php b/updater.class.php index adebc2a..bd0bbaf 100644 --- a/updater.class.php +++ b/updater.class.php @@ -5,135 +5,6 @@ class SamUpdater { private $versionsData; private $options; - private $pTableDef = array( - 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), - 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'code_before' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'code_after' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'place_size' => array('Type' => "varchar(25)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'place_custom_width' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'place_custom_height' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'patch_img' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'patch_link' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'patch_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'patch_adserver' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'patch_dfp' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'patch_source' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'patch_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') - ); - - private $aTableDef = array( - 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), - 'pid' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => ''), - 'name' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'code_type' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'code_mode' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '1', 'Extra' => ''), - 'ad_code' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_img' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_alt' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_title' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_no' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_target' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_swf' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_swf_flashvars' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_swf_params' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_swf_attributes' => array('Type' => "text", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'count_clicks' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'view_type' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '1', 'Extra' => ''), - 'view_pages' => array('Type' => "set('isHome','isSingular','isSingle','isPage','isAttachment','isSearch','is404','isArchive','isTax','isCategory','isTag','isAuthor','isDate','isPostType','isPostTypeArchive')", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_users_unreg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_users_reg' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_ad_users' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_view_users' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_users_adv' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_id' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'x_view_id' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_cats' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'x_view_cats' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_authors' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'x_view_authors' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_tags' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'x_view_tags' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'x_custom' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'x_view_custom' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_schedule' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_start_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'ad_end_date' => array('Type' => "date", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'limit_hits' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'hits_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'limit_clicks' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'clicks_limit' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_clicks' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'ad_weight' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '10', 'Extra' => ''), - 'ad_weight_hits' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'adv_nick' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'adv_name' => array('Type' => "varchar(100)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'adv_mail' => array('Type' => "varchar(50)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'cpm' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), - 'cpc' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), - 'per_month' => array('Type' => "decimal(10,2) unsigned", 'Null' => 'YES', 'Key' => '', 'Default' => '0.00', 'Extra' => ''), - 'trash' => array('Type' => "tinyint(1)", 'Null' => 'NO', 'Key' => '', 'Default' => '0', 'Extra' => '') - ); - - private $zTableDef = array( - 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), - 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'z_default' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_home' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_singular' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_single' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_ct' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_single_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'z_page' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_attachment' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_search' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_404' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_archive' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_tax' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_category' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_cats' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'z_tag' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_author' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_authors' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'z_date' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_cts' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => ''), - 'z_archive_ct' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') - ); - - private $bTableDef = array( - 'id' => array('Type' => "int(11)", 'Null' => 'NO', 'Key' => 'PRI', 'Default' => '', 'Extra' => 'auto_increment'), - 'name' => array('Type' => "varchar(255)", 'Null' => 'NO', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'description' => array('Type' => "varchar(255)", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'b_lines' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), - 'b_cols' => array('Type' => "int(11)", 'Null' => 'YES', 'Key' => '', 'Default' => '2', 'Extra' => ''), - 'block_data' => array('Type' => "longtext", 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), - 'b_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), - 'b_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), - 'b_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), - 'b_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), - 'i_margin' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), - 'i_padding' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '5px 5px 5px 5px', 'Extra' => 'str'), - 'i_background' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '#FFFFFF', 'Extra' => 'str'), - 'i_border' => array('Type' => "varchar(30)", 'Null' => 'YES', 'Key' => '', 'Default' => '0px solid #333333', 'Extra' => 'str'), - 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') - ); - public function __construct($dbVersion, $versionsData, $options = null) { $this->dbVersion = $dbVersion; $this->versionsData = $versionsData; @@ -336,7 +207,7 @@ private function adsUpdateData($aTable) { } public function update() { - global $wpdb, $charset_collate; + global $wpdb, $charset_collate, $sam_tables_defs; $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; $zTable = $wpdb->prefix . "sam_zones"; @@ -391,7 +262,7 @@ public function update() { dbDelta($pSql); } else { - $pSql = self::getUpdateSql($pTable, $this->pTableDef); + $pSql = self::getUpdateSql($pTable, $sam_tables_defs['places']); $dbResult = $wpdb->query($pSql); } @@ -470,7 +341,7 @@ public function update() { dbDelta($aSql); } else { - $aSql = self::getUpdateSql($aTable, $this->aTableDef); + $aSql = self::getUpdateSql($aTable, $sam_tables_defs['ads']); $dbResult = $wpdb->query($aSql); } @@ -513,7 +384,7 @@ public function update() { dbDelta($zSql); } else { - $zSql = self::getUpdateSql($zTable, $this->zTableDef); + $zSql = self::getUpdateSql($zTable, $sam_tables_defs['zones']); $dbResult = $wpdb->query($zSql); } @@ -545,7 +416,7 @@ public function update() { dbDelta($bSql); } else { - $bSql = self::getUpdateSql($bTable, $this->bTableDef); + $bSql = self::getUpdateSql($bTable, $sam_tables_defs['blocks']); $dbResult = $wpdb->query($bSql); } From 85a4243bf0ce96df18883c3375a809661490fe24 Mon Sep 17 00:00:00 2001 From: minimus Date: Fri, 6 Dec 2013 14:07:55 +0300 Subject: [PATCH 09/18] New hits tracker --- ad.class.php | 34 ++++++--- admin.class.php | 3 + editor.admin.class.php | 139 +++++++++++++++++++------------------ js/sam-layout.js | 16 +++++ list.admin.class.php | 81 +++++++++------------- sam-ajax.php | 38 ++++++++--- simple-ads-manager.php | 7 +- widget.class.php | 152 +++++++++++++++++++---------------------- 8 files changed, 250 insertions(+), 220 deletions(-) diff --git a/ad.class.php b/ad.class.php index 82dce49..20f5646 100644 --- a/ad.class.php +++ b/ad.class.php @@ -35,6 +35,7 @@ private function buildAd( $args = null, $useCodes = false ) { $aTable = $wpdb->prefix . "sam_ads"; $settings = $this->getSettings(); + $rId = rand(1111, 9999); if(!empty($args['id'])) $wid = "sa.id = {$args['id']}"; else $wid = "sa.name = '{$args['name']}'"; @@ -90,7 +91,7 @@ private function buildAd( $args = null, $useCodes = false ) { "; } else { - $outId = ((int) $ad['count_clicks'] == 1) ? " id='a".rand(10, 99)."_".$ad['id']."' class='sam_ad'" : ''; + $outId = ((int) $ad['count_clicks'] == 1) ? " id='a".$rId."_".$ad['id']."' class='sam_ad'" : ''; $aStart =''; $aEnd =''; $iTag = ''; @@ -115,8 +116,9 @@ private function buildAd( $args = null, $useCodes = false ) { } else $output = $ad['ad_code']; } - if(!$this->crawler && !is_admin()) - $wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1 WHERE $aTable.id = {$ad['id']};"); + $output = "
        " . $output . "
        "; + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1 WHERE $aTable.id = {$ad['id']};"); if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $ad['code_before'].$output.$ad['code_after']; @@ -199,8 +201,10 @@ private function buildAd( $args = null, $useCodes = false ) { if(is_null($args)) return ''; if(empty($args['id']) && empty($args['name'])) return ''; if( is_null($this->clauses) ) return ''; + if(is_admin()) return ''; $settings = $this->getSettings(); + $rId = rand(1111, 9999); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; $el = (integer)$settings['errorlogFS']; @@ -255,10 +259,12 @@ private function buildAd( $args = null, $useCodes = false ) { $output .= ""."\n"; if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; + + $output = "
        " . $output . "
        "; } else $output = ''; - if(!$this->crawler) - $wpdb->query("UPDATE {$pTable} SET {$pTable}.patch_hits = {$pTable}.patch_hits+1 WHERE {$pTable}.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE {$pTable} SET {$pTable}.patch_hits = {$pTable}.patch_hits+1 WHERE {$pTable}.id = {$place['id']}"); return $output; } @@ -266,8 +272,9 @@ private function buildAd( $args = null, $useCodes = false ) { $output = $place['patch_code']; if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; - if(!$this->crawler) - $wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + $output = "
        " . $output . "
        "; return $output; } @@ -286,8 +293,12 @@ private function buildAd( $args = null, $useCodes = false ) { $output = $aStart.$iTag.$aEnd; } else $output = $place['patch_code']; - if(!$this->crawler) - $wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); + $output = "
        " . $output . "
        "; + if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; + elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; + return $output; } if((abs($place['ad_logic_count']) > 0) && (abs($place['ad_full_count']) == 0)) { @@ -375,8 +386,9 @@ private function buildAd( $args = null, $useCodes = false ) { } else $output = $ad['ad_code']; } - if(!$this->crawler && !is_admin()) - $wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1, $aTable.ad_weight_hits = $aTable.ad_weight_hits+1 WHERE $aTable.id = {$ad['id']}"); + //if(!$this->crawler && !is_admin()) + //$wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1, $aTable.ad_weight_hits = $aTable.ad_weight_hits+1 WHERE $aTable.id = {$ad['id']}"); + $output = "
        " . $output . "
        "; } if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; diff --git a/admin.class.php b/admin.class.php index e8c9e85..04143f5 100644 --- a/admin.class.php +++ b/admin.class.php @@ -1029,6 +1029,9 @@ function affiliateLink(str){ str = unescape(str); var r = ''; for(var i = 0; i < printf($format, $str); ?>

        +
        + Click here to lend your support to: Funds to complete the development of plugin Simple Ads Manager 2 and make a donation at pledgie.com ! +
        diff --git a/editor.admin.class.php b/editor.admin.class.php index d168bbc..005c324 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -693,72 +693,77 @@ public function page() { if($action !== 'new') { $row = $wpdb->get_row( - "SELECT id, - pid, - name, - description, - code_type, - code_mode, - ad_code, - ad_img, - ad_alt, - ad_no, - ad_target, - ad_swf, - ad_swf_flashvars, - ad_swf_params, - ad_swf_attributes, - count_clicks, - ad_users, - ad_users_unreg, - ad_users_reg, - x_ad_users, - x_view_users, - ad_users_adv, - (SELECT place_size FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_size, - (SELECT place_custom_width FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_custom_width, - (SELECT place_custom_height FROM $pTable WHERE $pTable.id = $aTable.pid) AS ad_custom_height, - view_type, - (view_pages+0) AS view_pages, - view_id, - ad_cats, - view_cats, - ad_authors, - view_authors, - ad_tags, - view_tags, - ad_custom, - view_custom, - x_id, - x_view_id, - x_cats, - x_view_cats, - x_authors, - x_view_authors, - x_tags, - x_view_tags, - x_custom, - x_view_custom, - ad_start_date, - ad_end_date, - ad_schedule, - limit_hits, - hits_limit, - limit_clicks, - clicks_limit, - ad_hits, - ad_clicks, - ad_weight, - ad_weight_hits, - adv_nick, - adv_name, - adv_mail, - cpm, - cpc, - per_month, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable WHERE id = $item", + "SELECT sa.id, + sa.pid, + sa.name, + sa.description, + sa.code_type, + sa.code_mode, + sa.ad_code, + sa.ad_img, + sa.ad_alt, + sa.ad_no, + sa.ad_target, + sa.ad_swf, + sa.ad_swf_flashvars, + sa.ad_swf_params, + sa.ad_swf_attributes, + sa.count_clicks, + sa.ad_users, + sa.ad_users_unreg, + sa.ad_users_reg, + sa.x_ad_users, + sa.x_view_users, + sa.ad_users_adv, + sp.place_size AS ad_size, + sp.place_custom_width AS ad_custom_width, + sp.place_custom_height AS ad_custom_height, + sa.view_type, + (sa.view_pages+0) AS view_pages, + sa.view_id, + sa.ad_cats, + sa.view_cats, + sa.ad_authors, + sa.view_authors, + sa.ad_tags, + sa.view_tags, + sa.ad_custom, + sa.view_custom, + sa.x_id, + sa.x_view_id, + sa.x_cats, + sa.x_view_cats, + sa.x_authors, + sa.x_view_authors, + sa.x_tags, + sa.x_view_tags, + sa.x_custom, + sa.x_view_custom, + sa.ad_start_date, + sa.ad_end_date, + sa.ad_schedule, + sa.limit_hits, + sa.hits_limit, + sa.limit_clicks, + sa.clicks_limit, + sa.ad_hits, + sa.ad_clicks, + sa.ad_weight, + sa.ad_weight_hits, + sa.adv_nick, + sa.adv_name, + sa.adv_mail, + sa.cpm, + sa.cpc, + sa.per_month, + sa.trash, + IF(DATEDIFF(sa.ad_end_date, NOW()) IS NULL OR DATEDIFF(sa.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired, + sp.code_before, + sp.code_after + FROM $aTable sa + INNER JOIN $pTable sp + ON sa.pid = sp.id + WHERE sa.id = $item", ARRAY_A); if($row['ad_size'] === 'custom') $aSize = $this->getAdSize($row['ad_size'], $row['ad_custom_width'], $row['ad_custom_height']); @@ -1465,7 +1470,7 @@ public function page() {
        (integer) $row['id']), true, false); + $sample = new SamAd(array('id' => (integer) $row['id']), true, true); echo $sample->ad; ?>
        diff --git a/js/sam-layout.js b/js/sam-layout.js index 3005c0a..53e455a 100644 --- a/js/sam-layout.js +++ b/js/sam-layout.js @@ -22,5 +22,21 @@ e.preventDefault(); }); + + $('div.sam-container').each(function(index) { + var + ids = this.id.split('_'), + id = ids[1], + ad = $(this).hasClass('sam-ad') ? 'ad' : 'place'; + $.ajax({ + url: samAjax.ajaxurl, + data: { + action: 'sam_hit', + id: id, + ad: ad + }, + type: 'POST' + }); + }); }); })(jQuery); \ No newline at end of file diff --git a/list.admin.class.php b/list.admin.class.php index 63d12bf..0ba925c 100644 --- a/list.admin.class.php +++ b/list.admin.class.php @@ -192,25 +192,25 @@ public function page() { 0, ad_hits*cpm/1000, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_cpm, - (IFNULL((SELECT SUM(IF(cpc > 0, ad_clicks*cpc, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_cpc, - (IFNULL((SELECT SUM(IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) FROM $aTable WHERE $aTable.pid = $pTable.id), 0)) AS e_month, - $pTable.trash, - (SELECT COUNT(*) FROM $aTable WHERE $aTable.pid = $pTable.id) AS items - FROM $pTable". - (($mode !== 'all') ? " WHERE $pTable.trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE') : ''). + sp.id, + sp.name, + sp.description, + sp.place_size, + sp.place_custom_width, + sp.place_custom_height, + IFNULL(sp.patch_hits, 0) AS patch_hits, + (IFNULL((SELECT sum(sa.ad_hits) FROM $aTable sa WHERE sa.pid = sp.id), 0) + IFNULL(sp.patch_hits, 0)) as total_ad_hits, + (IFNULL((SELECT SUM(IF(cpm > 0, ad_hits*cpm/1000, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpm, + (IFNULL((SELECT SUM(IF(cpc > 0, ad_clicks*cpc, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpc, + (IFNULL((SELECT SUM(IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_month, + sp.trash, + (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id) AS items + FROM $pTable sp". + (($mode !== 'all') ? " WHERE sp.trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE') : ''). " LIMIT $offset, $places_per_page"; $places = $wpdb->get_results($pSql, ARRAY_A); $i = 0; - if(!is_array($places) || empty ($places)) { + if(!is_array($places) || empty($places)) { ?> @@ -376,40 +376,25 @@ public function page() { 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) AS e_month, - (cpm * ad_hits / 1000) AS e_cpm, - (cpc * ad_clicks) AS e_cpc, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable - WHERE (pid = $item) AND (trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE').") - LIMIT $offset, $items_per_page"; - else - $aSql = "SELECT - id, - pid, - name, - description, - ad_hits, - ad_clicks, - ad_weight, - (IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) AS e_month, - (cpm * ad_hits / 1000) AS e_cpm, - (cpc * ad_clicks) AS e_cpc, - trash, - IF(DATEDIFF($aTable.ad_end_date, NOW()) IS NULL OR DATEDIFF($aTable.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired - FROM $aTable - WHERE pid = $item + sa.id, + sa.pid, + sa.name, + sa.description, + sa.ad_hits, + sa.ad_clicks, + sa.ad_weight, + (IF(sa.ad_schedule AND sa.per_month > 0, DATEDIFF(CURDATE(), sa.ad_start_date)*sa.per_month/30, 0)) AS e_month, + (sa.cpm * sa.ad_hits / 1000) AS e_cpm, + (sa.cpc * sa.ad_clicks) AS e_cpc, + sa.trash, + IF(DATEDIFF(sa.ad_end_date, NOW()) IS NULL OR DATEDIFF(sa.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired + FROM $aTable sa + WHERE (pid = $item) $trash LIMIT $offset, $items_per_page"; + $items = $wpdb->get_results($aSql, ARRAY_A); $i = 0; if(!is_array($items) || empty($items)) { diff --git a/sam-ajax.php b/sam-ajax.php index 3c3faf7..7c99174 100644 --- a/sam-ajax.php +++ b/sam-ajax.php @@ -26,6 +26,8 @@ $oTable = $wpdb->prefix . 'options'; $oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; $charset = $wpdb->get_var($oSql); +$aTable = $wpdb->prefix . "sam_ads"; +$pTable = $wpdb->prefix . 'sam_places'; //Typical headers @header("Content-Type: application/json; charset=$charset"); @@ -39,7 +41,7 @@ //A bit of security $allowed_actions = array( 'sam_ajax_sam_click', - 'sam_ajax_sam_show' + 'sam_ajax_sam_hit' ); if(in_array($action, $allowed_actions)){ @@ -54,22 +56,36 @@ else $id = -100; if($id > 0) { - $aTable = $wpdb->prefix . "sam_ads"; - - $aSql = "UPDATE $aTable SET $aTable.ad_clicks = $aTable.ad_clicks+1 WHERE $aTable.id = %d;"; + $aSql = "UPDATE $aTable sa SET sa.ad_clicks = sa.ad_clicks + 1 WHERE sa.id = %d;"; $result = $wpdb->query($wpdb->prepare($aSql, $id)); if($result === 1) { - $out = array('id' => $id, 'result' => $result, 'charset' => $charset); - wp_send_json_success( $out ); + $out = array('success' => true, 'id' => $id, 'result' => $result, 'charset' => $charset); + echo json_encode( $out ); } - else wp_send_json_error(array('id' => $id, 'sql' => $wpdb->last_query, 'error' => $wpdb->last_error)); + else echo json_encode(array('success' => false, 'id' => $id, 'sql' => $wpdb->last_query, 'error' => $wpdb->last_error)); } - else wp_send_json_error(array('id' => $id)); + else echo json_encode(array('success' => false, 'id' => $id)); break; - case 'sam_ajax_sam_show': - + case 'sam_ajax_sam_hit': + if(isset($_POST['id']) && isset($_POST['ad'])) { + $id = $_POST['id']; + $ad = $_POST['ad']; + if($ad == 'ad') + $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1 WHERE sa.id = %d;"; + elseif($ad == 'place') + $sql = "UPDATE $pTable sp SET sp.patch_hits = sp.patch_hits + 1 WHERE sp.id = %d;"; + else $sql = ''; + if(!empty($sql)) $result = $wpdb->query($wpdb->prepare($sql, $id)); + if($result === 1) echo json_encode(array('success' => true, 'id' => $id)); + else echo json_encode(array('success' => false, 'id' => $id)); + } + else echo json_encode(array('success' => false)); + break; + default: + echo json_encode(array('success' => false, 'error' => 'Data error')); break; } } -else wp_send_json_error(array('error' => 'Not allowed action')); \ No newline at end of file +else echo json_encode(array('success' => false, 'error' => 'Not allowed')); +wp_die(); diff --git a/simple-ads-manager.php b/simple-ads-manager.php index 4ef5f75..45506f8 100644 --- a/simple-ads-manager.php +++ b/simple-ads-manager.php @@ -28,12 +28,13 @@ global $samObject, $SAM_Query; define('SAM_MAIN_FILE', __FILE__); +if(is_admin()) define('SAM_IS_ADMIN', true); include_once('ad.class.php'); include_once('sam.class.php'); if (is_admin()) { - include_once('admin.class.php'); + include_once('admin.class.php'); if (class_exists("SimpleAdsManagerAdmin") && class_exists("SimpleAdsManager")) $samObject = new SimpleAdsManagerAdmin(); } @@ -42,8 +43,8 @@ } include_once('widget.class.php'); -if(class_exists('simple_ads_manager_widget')) - add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_widget");')); +if(class_exists('simple_ads_manager_widget')) + add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_widget");')); if(class_exists('simple_ads_manager_zone_widget')) add_action('widgets_init', create_function('', 'return register_widget("simple_ads_manager_zone_widget");')); if(class_exists('simple_ads_manager_ad_widget')) diff --git a/widget.class.php b/widget.class.php index 04bbe47..d5f95ec 100644 --- a/widget.class.php +++ b/widget.class.php @@ -1,18 +1,19 @@ crawler = $this->isCrawler(); $this->aTitle = __('Ads Place:', SAM_DOMAIN); $this->wTable = 'sam_places'; $widget_ops = array( 'classname' => 'simple_ads_manager_widget', 'description' => __('Ads Place rotator serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_widget' ); - $this->WP_Widget( 'simple_ads_manager_widget', __('Ads Place', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_widget', __('Ads Place', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -20,7 +21,7 @@ function getSettings() { return $options; } - private function isCrawler() { + protected function isCrawler() { $options = $this->getSettings(); $crawler = false; @@ -31,19 +32,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': include_once('browser.php'); $browser = new Browser(); - $crawler = $browser->isRobot(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -52,25 +53,27 @@ private function isCrawler() { } function widget( $args, $instance ) { - extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); $adp_id = $instance['adp_id']; $hide_style = $instance['hide_style']; $place_codes = $instance['place_codes']; - - $ad = new SamAdPlace(array('id' => $adp_id), $place_codes, $this->crawler); - $content = $ad->ad; + + if(!is_admin()) { + $ad = new SamAdPlace(array('id' => $adp_id), $place_codes, $this->crawler); + $content = $ad->ad; + } + else $content = ''; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } } - + function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); @@ -79,79 +82,77 @@ function update( $new_instance, $old_instance ) { $instance['place_codes'] = isset($new_instance['place_codes']); return $instance; } - + function form( $instance ) { global $wpdb; $pTable = $wpdb->prefix . $this->wTable; - + $ids = $wpdb->get_results("SELECT $pTable.id, $pTable.name FROM $pTable WHERE $pTable.trash IS FALSE", ARRAY_A); - - $instance = wp_parse_args((array) $instance, + + $instance = wp_parse_args((array) $instance, array( - 'title' => '', - 'adp_id' => '', + 'title' => '', + 'adp_id' => '', 'parse' => false ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $place_codes = $instance['place_codes']; ?>

        - +

        - -

        +

        - /> 

        - /> 

        - crawler = $this->isCrawler(); $this->aTitle = __('Ads Zone', SAM_DOMAIN).':'; $this->wTable = 'sam_zones'; $widget_ops = array( 'classname' => 'simple_ads_manager_zone_widget', 'description' => __('Ads Zone selector serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_zone_widget' ); - $this->WP_Widget( 'simple_ads_manager_zone_widget', __('Ads Zone', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_zone_widget', __('Ads Zone', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -170,19 +171,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': include_once('browser.php'); $browser = new Browser(); - $crawler = $browser->isRobot(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -191,7 +192,6 @@ private function isCrawler() { } function widget( $args, $instance ) { - extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); $adp_id = $instance['adp_id']; $hide_style = $instance['hide_style']; @@ -201,10 +201,10 @@ function widget( $args, $instance ) { $content = $ad->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -233,9 +233,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $place_codes = $instance['place_codes']; ?>

        crawler = $this->isCrawler(); $this->aTitle = __('Ad', SAM_DOMAIN).':'; $this->wTable = 'sam_ads'; $widget_ops = array( 'classname' => 'simple_ads_manager_ad_widget', 'description' => __('Non-rotating single ad serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_ad_widget' ); - $this->WP_Widget( 'simple_ads_manager_ad_widget', __('Single Ad', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_ad_widget', __('Single Ad', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -309,19 +307,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': include_once('browser.php'); $browser = new Browser(); - $crawler = $browser->isRobot(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -340,10 +338,10 @@ function widget( $args, $instance ) { $content = $ad->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -372,9 +370,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $ad_codes = $instance['ad_codes']; ?>

        crawler = $this->isCrawler(); $this->aTitle = __('Block', SAM_DOMAIN).':'; $this->wTable = 'sam_blocks'; $widget_ops = array( 'classname' => 'simple_ads_manager_block_widget', 'description' => __('Ads Block collector serviced by Simple Ads Manager.', SAM_DOMAIN)); $control_ops = array( 'id_base' => 'simple_ads_manager_block_widget' ); - $this->WP_Widget( 'simple_ads_manager_block_widget', __('Ads Block', SAM_DOMAIN), $widget_ops, $control_ops ); + parent::__construct( 'simple_ads_manager_block_widget', __('Ads Block', SAM_DOMAIN), $widget_ops, $control_ops ); } function getSettings() { @@ -448,19 +444,19 @@ private function isCrawler() { $_SERVER['HTTP_ACCEPT'] == '' || $_SERVER['HTTP_ACCEPT_ENCODING'] == '' || $_SERVER['HTTP_ACCEPT_LANGUAGE'] == '' || - $_SERVER['HTTP_CONNECTION']=='') $crawler == true; + $_SERVER['HTTP_CONNECTION']=='' || is_admin()) $crawler = true; break; case 'exact': if(!class_exists('Browser')) include_once('browser.php'); $browser = new Browser(); - $crawler = $browser->isRobot(); + $crawler = $browser->isRobot() || is_admin(); break; case 'more': if(ini_get("browscap")) { $browser = get_browser(null, true); - $crawler = $browser['crawler']; + $crawler = $browser['crawler'] || is_admin(); } break; } @@ -478,10 +474,10 @@ function widget( $args, $instance ) { $content = $block->ad; if(!empty($content)) { if ( !$hide_style ) { - echo $before_widget; - if ( !empty( $title ) ) echo $before_title . $title . $after_title; + echo $args['before_widget']; + if ( !empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; echo $content; - echo $after_widget; + echo $args['after_widget']; } else echo $content; } @@ -509,9 +505,6 @@ function form( $instance ) { ) ); $title = strip_tags($instance['title']); - $adp_id = $instance['adp_id']; - $hide_style = $instance['hide_style']; - $ad_codes = $instance['ad_codes']; ?>

        From 85b1511bf8bdde235f6a40110827de4d229ffd10 Mon Sep 17 00:00:00 2001 From: minimus Date: Sun, 8 Dec 2013 21:32:53 +0300 Subject: [PATCH 10/18] Cache plugins compatibility --- .idea/simple-ads-manager.iml | 2 + ad.class.php | 43 +- admin.class.php | 44 +- css/sam-admin-edit.css | 22 +- js/sam-layout.js | 111 ++- js/sam-layout.min.js | 1 + js/sam-settings.js | 2 +- langs/simple-ads-manager-ru_RU.mo | Bin 82522 -> 83677 bytes langs/simple-ads-manager-ru_RU.po | 1106 +++++++++++++++-------------- langs/simple-ads-manager.pot | 1063 ++++++++++++++------------- sam-ajax-admin.php | 3 +- sam-ajax-loader.php | 23 +- sam-ajax.php | 28 +- sam.class.php | 12 +- 14 files changed, 1356 insertions(+), 1104 deletions(-) create mode 100644 js/sam-layout.min.js diff --git a/.idea/simple-ads-manager.iml b/.idea/simple-ads-manager.iml index ca73188..a273e97 100644 --- a/.idea/simple-ads-manager.iml +++ b/.idea/simple-ads-manager.iml @@ -4,6 +4,8 @@ + + diff --git a/ad.class.php b/ad.class.php index 20f5646..6d192f2 100644 --- a/ad.class.php +++ b/ad.class.php @@ -4,6 +4,9 @@ class SamAd { private $args = array(); private $useCodes = false; private $crawler = false; + public $id = null; + public $pid = null; + public $cid = null; public $ad = ''; public function __construct($args = null, $useCodes = false, $crawler = false) { @@ -66,9 +69,14 @@ private function buildAd( $args = null, $useCodes = false ) { ON sa.pid = sp.id WHERE $wid;"; $ad = $wpdb->get_row($aSql, ARRAY_A); + + $this->id = $ad['id']; + $this->pid = $ad['pid']; + $this->cid = "c{$rId}_{$ad['id']}_{$ad['pid']}"; + if($ad['code_mode'] == 0) { if((int)$ad['ad_swf']) { - $id = "ad-".$ad['id'].'-'.rand(1111, 9999); + $id = "ad-".$ad['id'].'-'.$rId; $file = $ad['ad_img']; $sizes = self::getSize($ad['place_size'], $ad['place_custom_width'], $ad['place_custom_height']); $width = $sizes['width']; @@ -116,7 +124,7 @@ private function buildAd( $args = null, $useCodes = false ) { } else $output = $ad['ad_code']; } - $output = "

        " . $output . "
        "; + $output = "
        {$output}
        "; //if(!$this->crawler && !is_admin()) //$wpdb->query("UPDATE $aTable SET $aTable.ad_hits = $aTable.ad_hits+1 WHERE $aTable.id = {$ad['id']};"); @@ -133,6 +141,9 @@ class SamAdPlace { private $useCodes = false; private $crawler = false; public $ad = ''; + public $id = null; + public $pid = null; + public $cid = null; private $clauses; private $force; @@ -201,9 +212,9 @@ private function buildAd( $args = null, $useCodes = false ) { if(is_null($args)) return ''; if(empty($args['id']) && empty($args['name'])) return ''; if( is_null($this->clauses) ) return ''; - if(is_admin()) return ''; $settings = $this->getSettings(); + $data = intval($useCodes); $rId = rand(1111, 9999); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; @@ -260,7 +271,7 @@ private function buildAd( $args = null, $useCodes = false ) { if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; - $output = "
        " . $output . "
        "; + $output = "
        {$output}
        "; } else $output = ''; //if(!$this->crawler && !is_admin()) @@ -274,9 +285,18 @@ private function buildAd( $args = null, $useCodes = false ) { elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; //if(!$this->crawler && !is_admin()) //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); - $output = "
        " . $output . "
        "; + $output = "
        {$output}
        "; return $output; } + + if(($settings['adShow'] == 'js') && !$this->force) { + //$data = "{id: 0, pid: {$place['id']}, codes: $codes}"; + return "
        "; + } + + $this->pid = $place['id']; + $this->id = 0; + $this->cid = "c{$rId}_0_{$this->pid}"; if((abs($place['ad_count']) == 0) || (abs($place['ad_logic_count']) == 0)) { if($place['patch_source'] == 0) { @@ -295,7 +315,8 @@ private function buildAd( $args = null, $useCodes = false ) { else $output = $place['patch_code']; //if(!$this->crawler && !is_admin()) //$wpdb->query("UPDATE $pTable SET $pTable.patch_hits = $pTable.patch_hits+1 WHERE $pTable.id = {$place['id']}"); - $output = "
        " . $output . "
        "; + //$data = "{id: 0, pid: {$place['id']}, codes: $codes}"; + $output = "
        {$output}
        "; if(is_array($useCodes)) $output = $useCodes['before'].$output.$useCodes['after']; elseif($useCodes) $output = $place['code_before'].$output.$place['code_after']; return $output; @@ -336,9 +357,12 @@ private function buildAd( $args = null, $useCodes = false ) { return ''; } + $this->id = $ad['id']; + $this->cid = "c{$rId}_{$this->id}_{$this->pid}"; + if($ad['code_mode'] == 0) { if((int)$ad['ad_swf']) { - $id = "ad-".$ad['id'].'-'.rand(1111, 9999); + $id = "ad-".$ad['id'].'-'.$rId; $file = $ad['ad_img']; $sizes = self::getSize($place['place_size'], $place['place_custom_width'], $place['place_custom_height']); $width = $sizes['width']; @@ -346,7 +370,7 @@ private function buildAd( $args = null, $useCodes = false ) { $flashvars = (!empty($ad['ad_swf_flashvars'])) ? $ad['ad_swf_flashvars'] : '{}'; $params = (!empty($ad['ad_swf_params'])) ? $ad['ad_swf_params'] : '{}'; $attributes = (!empty($ad['ad_swf_attributes'])) ? $ad['ad_swf_attributes'] : '{}'; - $text = __('Flash ad').' ID:'.$ad['id']; + $text = 'Flash ad ID:'.$ad['id']; //__('Flash ad').' ID:'.$ad['id']; $output = " + diff --git a/js/dialog-block.php b/js/dialog-block.php index 53ee236..67ec3f6 100644 --- a/js/dialog-block.php +++ b/js/dialog-block.php @@ -32,6 +32,11 @@ + diff --git a/js/dialog-zone.php b/js/dialog-zone.php index f8d10a1..18d7107 100644 --- a/js/dialog-zone.php +++ b/js/dialog-zone.php @@ -32,6 +32,11 @@ + diff --git a/js/dialog.php b/js/dialog.php index a2b9571..7edea20 100644 --- a/js/dialog.php +++ b/js/dialog.php @@ -32,6 +32,11 @@ + diff --git a/readme.txt b/readme.txt index b130898..d6b5e99 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://load.payoneer.com/LoadToPage.aspx?email=minimus@simplelib.c Tags: ad, adbrite, adgridwork, adify, admin, adpinion, adroll, ads, adsense, adserver, advertisement, advertising, affiliate, banner, banners, chitika, cj, commercial, commission, crispads, dfp, google, income, junction, link, manager, media, money, plugin, random, referral, revenue, rotator, seo, server, shoppingads, widget, widgetbucks, yahoo, ypn Requires at least: 3.5 Tested up to: 3.8 -Stable tag: 1.8.70-SE +Stable tag: 1.8.71 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -86,14 +86,15 @@ No questions now... == Changelog == -= 1.8.70 = += 1.8.71 = * Javascript output of ads (for caching compatibility) is added * Custom Taxonomies restrictions are added * Building query for SQL request is optimised * Admin interface is improved * Loading/Selecting banners from Wordpress Media Library is added -* Updater is fixed and improved. -* Language pack folder is added. +* Updater is fixed and improved +* Language pack folder is added +* bbPress support is added = 1.7.63 = * Some bugs (Ads Block style, Click Tracker) are resolved. = 1.7.61 = diff --git a/sam-ajax.php b/sam-ajax.php index 8569a04..7d6737d 100644 --- a/sam-ajax.php +++ b/sam-ajax.php @@ -76,7 +76,8 @@ $pid = $_POST['pid']; $cid = ($id == 0) ? $pid : $id; $result = 0; - if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1, sa.ad_weight_hits = sa.ad_weight_hits + 1 WHERE sa.id = %d;"; + //if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1, sa.ad_weight_hits = sa.ad_weight_hits + 1 WHERE sa.id = %d;"; + if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1 WHERE sa.id = %d;"; elseif($id == 0) $sql = "UPDATE $pTable sp SET sp.patch_hits = sp.patch_hits + 1 WHERE sp.id = %d;"; else $sql = ''; if(!empty($sql)) $result = $wpdb->query($wpdb->prepare($sql, $cid)); diff --git a/sam.class.php b/sam.class.php index fc288cf..1f5aea4 100644 --- a/sam.class.php +++ b/sam.class.php @@ -1,7 +1,7 @@ null, 'db' => null); private $crawler = false; public $samNonce; @@ -19,12 +19,17 @@ class SimpleAdsManager { 'beforePost' => 0, 'bpAdsId' => 0, 'bpUseCodes' => 0, + 'bpExcerpt' => 0, + 'bbpBeforePost' => 0, + 'bbpList' => 0, 'middlePost' => 0, 'mpAdsId' => 0, 'mpUseCodes' => 0, + 'bbpMiddlePost' => 0, 'afterPost' => 0, 'apAdsId' => 0, 'apUseCodes' => 0, + 'bbpAfterPost' => 0, 'useDFP' => 0, 'detectBots' => 0, 'detectingMode' => 'inexact', @@ -35,14 +40,16 @@ class SimpleAdsManager { 'useSWF' => 0, 'access' => 'manage_options', 'errorlog' => 1, - 'errorlogFS' => 1 + 'errorlogFS' => 1, + 'bbpActive' => 0, + 'bbpEnabled' => 0 ); public function __construct() { - define('SAM_VERSION', '1.8.70'); + define('SAM_VERSION', '1.8.71'); define('SAM_DB_VERSION', '2.3'); define('SAM_PATH', dirname( __FILE__ )); - define('SAM_URL', plugins_url('/' . str_replace( basename( __FILE__), "", plugin_basename( __FILE__ ) )) ); + define('SAM_URL', plugins_url( '/', __FILE__ ) ); define('SAM_IMG_URL', SAM_URL.'images/'); define('SAM_DOMAIN', 'simple-ads-manager'); define('SAM_OPTIONS_NAME', 'samPluginOptions'); @@ -78,6 +85,16 @@ public function __construct() { add_shortcode('sam_zone', array(&$this, 'doZoneShortcode')); add_shortcode('sam_block', array(&$this, 'doBlockShortcode')); add_filter('the_content', array(&$this, 'addContentAds'), 8); + // SE begin + add_filter('get_the_excerpt', array(&$this, 'addExcerptAds'), 10); + if( $this->samOptions['bbpActive'] && $this->samOptions['bbpEnabled'] ) { + add_filter('bbp_get_reply_content', array(&$this, 'addBbpContentAds'), 39, 2); + add_filter('bbp_get_topic_content', array(&$this, 'addBbpContentAds'), 39, 2); + add_action('bbp_theme_after_forum_sub_forums', array(&$this, 'addBbpForumAds')); + add_action('bbp_theme_before_topic_started_by', array(&$this, 'addBbpForumAds')); + } + //SE end + // For backward compatibility add_shortcode('sam-ad', array(&$this, 'doAdShortcode')); add_shortcode('sam-zone', array(&$this, 'doZoneShortcode')); @@ -139,7 +156,7 @@ private function customTaxonomiesTerms($id) { } } } - return implode(',', $out); + return $out; } private function customTaxonomiesTerms2($id) { @@ -165,10 +182,8 @@ public function buildWhereClause() { $settings = $this->getSettings(); if($settings['adCycle'] == 0) $cycle = 1000; else $cycle = $settings['adCycle']; - //$el = (integer)$settings['errorlogFS']; - global /*$wpdb,*/ $current_user; - //$aTable = $wpdb->prefix . "sam_ads"; + global $current_user; $viewPages = 0; $wcc = ''; @@ -179,6 +194,8 @@ public function buildWhereClause() { $wcxc = ''; $wcxa = ''; $wcxt = ''; + $wcct = ''; + $wcxct = ''; if(is_user_logged_in()) { get_currentuserinfo(); @@ -240,6 +257,21 @@ public function buildWhereClause() { $wcxt .= $wcxt_0.", TRUE)"; } + if(!empty($customTerms)) { + $wcct_0 = ''; + $wcxct_0 = ''; + $wcct .= " AND IF(sa.view_type < 2 AND sa.ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + $wcxct .= " AND IF(sa.view_type < 2 AND sa.x_ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE),"; + foreach($customTerms as $cTerm) { + if(empty($wcct_0)) $wcct_0 = " FIND_IN_SET(\"{$cTerm}\", sa.view_custom_tax_terms)"; + else $wcct_0 .= " OR FIND_IN_SET(\"{$cTerm}\", sa.view_custom_tax_terms)"; + if(empty($wcxct_0)) $wcxct_0 = " (NOT FIND_IN_SET(\"{$cTerm}\", sa.x_view_custom_tax_terms))"; + else $wcxct_0 .= " AND (NOT FIND_IN_SET(\"{$cTerm}\", sa.x_view_custom_tax_terms))"; + } + $wcct .= $wcct_0 . ", TRUE)"; + $wcxct .= $wcxct_0 . ", TRUE)"; + } + $wci = " OR (sa.view_type = 2 AND FIND_IN_SET({$postID}, sa.view_id))"; $wcx = " AND IF(sa.x_id, NOT FIND_IN_SET({$postID}, sa.x_view_id), TRUE)"; $author = get_userdata($post->post_author); @@ -260,7 +292,12 @@ public function buildWhereClause() { if(is_404()) $viewPages |= SAM_IS_404; if(is_archive()) { $viewPages |= SAM_IS_ARCHIVE; - if(is_tax()) $viewPages |= SAM_IS_TAX; + if(is_tax()) { + $viewPages |= SAM_IS_TAX; + $term = get_query_var('term'); + $wcct = " AND IF(sa.view_type < 2 AND sa.ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), FIND_IN_SET('{$term}', sa.view_custom_tax_terms), TRUE)"; + $wcxct = " AND IF(sa.view_type < 2 AND sa.x_ad_custom_tax_terms AND IF(sa.view_type = 0, sa.view_pages+0 & $viewPages, TRUE), NOT FIND_IN_SET('{$term}', sa.x_view_custom_tax_terms), TRUE)"; + } if(is_category()) { $viewPages |= SAM_IS_CATEGORY; $cat = get_category(get_query_var('cat'), false); @@ -297,7 +334,7 @@ public function buildWhereClause() { $whereClause = "$wcu ((sa.view_type = 1)"; $whereClause .= " OR (sa.view_type = 0 AND (sa.view_pages+0 & $viewPages))"; $whereClause .= "$wci)"; - $whereClause .= "$wcc $wca $wct $wcx $wcxc $wcxa $wcxt"; + $whereClause .= "$wcc $wca $wct $wcct $wcx $wcxc $wcxa $wcxt $wcxct"; $whereClauseT = " AND IF(sa.ad_schedule, CURDATE() BETWEEN sa.ad_start_date AND sa.ad_end_date, TRUE)"; $whereClauseT .= " AND IF(sa.limit_hits, sa.hits_limit > sa.ad_hits, TRUE)"; $whereClauseT .= " AND IF(sa.limit_clicks, sa.clicks_limit > sa.ad_clicks, TRUE)"; @@ -313,11 +350,10 @@ public function headerScripts() { $this->samNonce = wp_create_nonce('samNonce'); $options = self::getSettings(); - $this->whereClauses = self::buildWhereClause(); + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); $SAM_Query = array('clauses' => $this->whereClauses); $clauses64 = base64_encode(serialize($SAM_Query['clauses'])); - //$dClauses64 = unserialize(base64_decode($clauses64)); wp_enqueue_script('jquery'); if($options['useSWF']) wp_enqueue_script('swfobject'); @@ -327,8 +363,7 @@ public function headerScripts() { 'loadurl' => SAM_URL . 'sam-ajax-loader.php', 'load' => ($this->samOptions['adShow'] == 'js'), 'level' => count(explode('/', str_replace( ABSPATH, '', dirname( __FILE__ ) ))), - //'queries' => $dClauses64, - 'clauses' => $clauses64 //$this->whereClauses + 'clauses' => $clauses64 ) ); } @@ -457,31 +492,31 @@ public function buildAdBlock( $args = null ) { } public function doAdShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAd(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAd(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doShortcode( $atts ) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAdPlace(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAdPlace(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doZoneShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts )); - $ad = new SamAdPlaceZone(array('id' => $id, 'name' => $name), ($codes == 'true'), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => '', 'codes' => ''), $atts ); + $ad = new SamAdPlaceZone(array('id' => $atts['id'], 'name' => $atts['name']), ($atts['codes'] == 'true'), $this->crawler); return $ad->ad; } public function doBlockShortcode($atts) { - extract(shortcode_atts( array( 'id' => '', 'name' => ''), $atts )); - $block = new SamAdBlock(array('id' => $id, 'name' => $name), $this->crawler); + shortcode_atts( array( 'id' => '', 'name' => ''), $atts ); + $block = new SamAdBlock(array('id' => $atts['id'], 'name' => $atts['name']), $this->crawler); return $block->ad; } public function addContentAds( $content ) { - $options = $this->getSettings(); + $options = self::getSettings(); $bpAd = ''; $apAd = ''; $mpAd = ''; @@ -494,6 +529,11 @@ public function addContentAds( $content ) { if(!empty($options['afterPost']) && !empty($options['apAdsId'])) $apAd = $this->buildAd(array('id' => $options['apAdsId']), $options['apUseCodes']); } + //SE + else { + if(!empty($options['beforePost']) && !empty($options['bpAdsId'])) + $bpAd = $this->buildAd(array('id' => $options['bpAdsId']), $options['bpUseCodes']); + } if(!empty($mpAd)) { $xc = explode("\r\n", $content); @@ -505,6 +545,71 @@ public function addContentAds( $content ) { } else return $bpAd.$content.$apAd; } + + public function addExcerptAds( $excerpt ) { + $options = self::getSettings(); + $bpAd = ''; + if(!is_single()) { + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['beforePost']) && !empty($options['bpExcerpt']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + + return $bpAd.$excerpt; + } + else return $excerpt; + } + + // SE begin + public function addBbpContentAds( $content, $reply_id ) { + $options = self::getSettings(); + $bpAd = ''; + $apAd = ''; + $mpAd = ''; + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['bbpBeforePost']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + if(!empty($options['bbpMiddlePost']) && !empty($options['mpAdsId'])) { + $oMpAd = new SamAdPlace(array('id' => $options['mpAdsId']), $options['mpUseCodes'], false, $this->whereClauses); + $mpAd = $oMpAd->ad; + } + if(!empty($options['bbpAfterPost']) && !empty($options['apAdsId'])) { + $oApAd = new SamAdPlace(array('id' => $options['apAdsId']), $options['apUseCodes'], false, $this->whereClauses); + $apAd = $oApAd->ad; + } + + if(!empty($mpAd)) { + $xc = explode("\r\n", $content); + if(count($xc) < 3) return $bpAd.$content.$apAd; + else { + $hm = ceil(count($xc)/2); + $cntFirst = implode("\r\n", array_slice($xc, 0, $hm)); + $cntLast = implode("\r\n", array_slice($xc, $hm)); + + return $bpAd.$cntFirst.$mpAd.$cntLast.$apAd; + } + } + else return $bpAd.$content.$apAd; + } + + public function addBbpForumAds() { + $options = self::getSettings(); + $bpAd = ''; + if(empty($this->whereClauses)) $this->whereClauses = self::buildWhereClause(); + + if(!empty($options['bbpList']) && !empty($options['bpAdsId'])) { + $oBpAd = new SamAdPlace(array('id' => $options['bpAdsId']), $options['bpUseCodes'], false, $this->whereClauses); + $bpAd = $oBpAd->ad; + } + + echo $bpAd; + } + // SE end } // end of class definition } // end of if not class SimpleAdsManager exists ?> \ No newline at end of file diff --git a/simple-ads-manager.php b/simple-ads-manager.php index 45506f8..329ad4e 100644 --- a/simple-ads-manager.php +++ b/simple-ads-manager.php @@ -3,7 +3,7 @@ Plugin Name: Simple Ads Manager Plugin URI: http://www.simplelib.com/?p=480 Description: "Simple Ads Manager" is easy to use plugin providing a flexible logic of displaying advertisements. Visit SimpleLib blog for more details. -Version: 1.8.70-SE +Version: 1.8.71 Author: minimus Author URI: http://blogcoding.ru */ From 0d77e2dd040611a74c3221e1d7a300e3a2b7f004 Mon Sep 17 00:00:00 2001 From: minimus Date: Tue, 17 Dec 2013 15:27:42 +0300 Subject: [PATCH 14/18] 1.8.71: Some Improvements --- admin.class.php | 25 ++++++++++++++++++------- js/sam-settings.js | 24 +++++++++++++++++++++++- js/sam-settings.min.js | 1 + 3 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 js/sam-settings.min.js diff --git a/admin.class.php b/admin.class.php index 49a824a..cc91164 100644 --- a/admin.class.php +++ b/admin.class.php @@ -131,6 +131,11 @@ public function checkBbpForum() { update_option( SAM_OPTIONS_NAME, $settings ); } + public function hideBbpOptions() { + $options = parent::getSettings(); + return !( SAM_BBP && $options['bbpEnabled']); + } + private function getWarningString( $mode = '' ) { if(empty($mode)) return ''; @@ -489,16 +494,16 @@ public function initSettings() { add_settings_field('bpAdsId', __("Ads Place before content", SAM_DOMAIN), array(&$this, 'drawSelectOptionX'), 'sam-settings', 'sam_single_section', array('description' => '')); add_settings_field('beforePost', __("Allow Ads Place auto inserting before post/page content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'beforePost', 'checkbox' => true)); add_settings_field('bpExcerpt', __('Allow Ads Place auto inserting before post/page excerpt (in the loop)', SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bpExcerpt', 'checkbox' => true)); - add_settings_field('bbpBeforePost', __("Allow Ads Place auto inserting before bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpBeforePost', 'checkbox' => true)); - add_settings_field('bbpList', __("Allow Ads Place auto inserting into bbPress Forum forums/topics lists", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpList', 'checkbox' => true)); + add_settings_field('bbpBeforePost', __("Allow Ads Place auto inserting before bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpBeforePost', 'checkbox' => true, 'hide' => self::hideBbpOptions())); + add_settings_field('bbpList', __("Allow Ads Place auto inserting into bbPress Forum forums/topics lists", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpList', 'checkbox' => true, 'hide' => self::hideBbpOptions())); add_settings_field('bpUseCodes', __("Allow using predefined Ads Place HTML codes (before and after codes)", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bpUseCodes', 'checkbox' => true)); add_settings_field('mpAdsId', __("Ads Place in the middle of content", SAM_DOMAIN), array(&$this, 'drawSelectOptionX'), 'sam-settings', 'sam_single_section', array('description' => '')); add_settings_field('middlePost', __("Allow Ads Place auto inserting into the middle of post/page content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'middlePost', 'checkbox' => true)); - add_settings_field('bbpMiddlePost', __("Allow Ads Place auto inserting into the middle of bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpMiddlePost', 'checkbox' => true)); + add_settings_field('bbpMiddlePost', __("Allow Ads Place auto inserting into the middle of bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpMiddlePost', 'checkbox' => true, 'hide' => self::hideBbpOptions())); add_settings_field('mpUseCodes', __("Allow using predefined Ads Place HTML codes (before and after codes)", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'mpUseCodes', 'checkbox' => true)); add_settings_field('apAdsId', __("Ads Place after content", SAM_DOMAIN), array(&$this, 'drawSelectOptionX'), 'sam-settings', 'sam_single_section', array('description' => '')); add_settings_field('afterPost', __("Allow Ads Place auto inserting after post/page content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'afterPost', 'checkbox' => true)); - add_settings_field('bbpAfterPost', __("Allow Ads Place auto inserting after bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpAfterPost', 'checkbox' => true)); + add_settings_field('bbpAfterPost', __("Allow Ads Place auto inserting after bbPress Forum topic content", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'bbpAfterPost', 'checkbox' => true, 'hide' => self::hideBbpOptions())); add_settings_field('apUseCodes', __("Allow using predefined Ads Place HTML codes (before and after codes)", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_single_section', array('label_for' => 'apUseCodes', 'checkbox' => true)); add_settings_field('useSWF', __('I use (plan to use) my own flash (SWF) banners. In other words, allow loading the script "SWFObject" on the pages of the blog.', SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_ext_section', array('label_for' => 'useSWF', 'checkbox' => true)); @@ -585,6 +590,9 @@ public function loadScripts($hook) { wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); wp_enqueue_script('jquery'); + wp_enqueue_script('jquery-ui-core'); + wp_enqueue_script('jquery-effects-core'); + wp_enqueue_script('jquery-effects-blind'); wp_enqueue_script('hash-table', SAM_URL.'js/slider/jshashtable-2.1_src.js', array('jquery'), '2.1'); wp_enqueue_script('number-formatter', SAM_URL.'js/slider/jquery.numberformatter-1.2.3.js', array('jquery'), '1.2.3'); wp_enqueue_script('templates', SAM_URL.'js/slider/tmpl.js', array('jquery')); @@ -592,7 +600,7 @@ public function loadScripts($hook) { wp_enqueue_script('draggable', SAM_URL.'js/slider/draggable-0.1.js', array('jquery'), '0.1'); wp_enqueue_script('jSlider', SAM_URL.'js/slider/jquery.slider.js', array('jquery', 'draggable'), '1.1.0'); - wp_enqueue_script('sam-settings', SAM_URL.'js/sam-settings.js', array('jquery', 'draggable'), SAM_VERSION); + wp_enqueue_script('sam-settings', SAM_URL.'js/sam-settings.min.js', array('jquery', 'draggable'), SAM_VERSION); wp_localize_script('sam-settings', 'options', array( 'roles' => array( __('Super Admin', SAM_DOMAIN), @@ -883,7 +891,7 @@ public function doSettingsFields($page, $section) { echo '

        '; if ( !empty($field['args']['checkbox']) ) { call_user_func($field['callback'], $field['id'], $field['args']); - echo ''; + echo ''; echo '

        '; } else { @@ -959,13 +967,16 @@ public function drawTextOption( $id, $args ) { public function drawCheckboxOption( $id, $args ) { $settings = parent::getSettings(); $disabled = ''; + $hide = ''; if(isset($args['enabled'])) $disabled = (($args['enabled']) ? '' : 'disabled'); + if(isset($args['hide'])) $hide = ( ($args['hide']) ? " style='display: none;'" : ''); ?> name="" type="checkbox" - value="1" > + value="1" + > Date: Sun, 22 Dec 2013 22:14:18 +0300 Subject: [PATCH 15/18] New Statistic System --- admin.class.php | 40 +- css/sam-admin-edit.css | 25 + editor.admin.class.php | 373 +++++---- js/jquery.flot.categories.min.js | 1 + js/jquery.flot.min.js | 2 + js/jquery.flot.resize.min.js | 1 + js/sam-admin-edit-item.js | 90 ++- js/sam-admin-edit-item.min.js | 2 +- js/sam-admin-edit-place.js | 122 ++- js/sam-admin-edit-place.min.js | 2 +- js/sam-layout.js | 1 + js/sam-layout.min.js | 2 +- langs/simple-ads-manager-ru_RU.mo | Bin 83676 -> 86305 bytes langs/simple-ads-manager-ru_RU.po | 1182 ++++++++++++++++------------- langs/simple-ads-manager.pot | 1159 +++++++++++++++------------- list.admin.class.php | 21 +- sam-ajax-admin-stats.php | 182 +++++ sam-ajax-admin.php | 33 +- sam-ajax.php | 14 +- sam.class.php | 2 +- updater.class.php | 25 +- zone.editor.admin.class.php | 50 +- 22 files changed, 2077 insertions(+), 1252 deletions(-) create mode 100644 js/jquery.flot.categories.min.js create mode 100644 js/jquery.flot.min.js create mode 100644 js/jquery.flot.resize.min.js create mode 100644 sam-ajax-admin-stats.php diff --git a/admin.class.php b/admin.class.php index cc91164..53997b0 100644 --- a/admin.class.php +++ b/admin.class.php @@ -373,7 +373,20 @@ public function getTablesDefs() { 'trash' => array('Type' => "tinyint(1)", 'Null' => 'YES', 'Key' => '', 'Default' => '0', 'Extra' => '') ); - return array('places' => $pTableDef, 'ads' => $aTableDef, 'zones' => $zTableDef, 'blocks' => $bTableDef); + $sTableDef = array( + 'id' => array('Type' => 'int(10) unsigned', 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'pid' => array('Type' => 'int(10) unsigned', 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'event_time' => array('Type' => 'datetime', 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => ''), + 'event_type' => array('Type' => 'tinyint(1)', 'Null' => 'YES', 'Key' => '', 'Default' => '', 'Extra' => '') + ); + + return array( + 'places' => $pTableDef, + 'ads' => $aTableDef, + 'zones' => $zTableDef, + 'blocks' => $bTableDef, + 'stats' => $sTableDef + ); } private function getColumnsModels() { @@ -624,6 +637,7 @@ public function loadScripts($hook) { wp_enqueue_style('jquery-ui-css', $jqCSS, false, '1.10.3'); wp_enqueue_style('wp-pointer'); wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + wp_enqueue_style('W2UI', SAM_URL . 'css/w2ui.min.css', false, '1.3'); if($this->cmsVer === 'low') { wp_register_script('jquery-effects-core', SAM_URL.'js/jquery.effects.core.min.js', array('jquery'), '1.8.16'); @@ -641,6 +655,11 @@ public function loadScripts($hook) { wp_enqueue_script('jquery-effects-blind'); wp_enqueue_script('jquery-ui-tooltip'); wp_enqueue_script('AjaxUpload', SAM_URL.'js/ajaxupload.js', array('jquery'), '3.9'); + wp_enqueue_script('W2UI', SAM_URL . 'js/w2ui.min.js', array('jquery'), '1.3'); + + wp_enqueue_script('flot', SAM_URL.'js/jquery.flot.min.js', array('jquery'), '0.8.1'); + wp_enqueue_script('flotCategories', SAM_URL.'js/jquery.flot.categories.min.js', array('jquery'), '0.8.1'); + wp_enqueue_script('flotResize', SAM_URL.'js/jquery.flot.resize.min.js', array('jquery'), '0.8.1'); wp_enqueue_script('wp-pointer'); wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-place.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); @@ -648,6 +667,8 @@ public function loadScripts($hook) { 'places' => array('enabled' => $pointers['places'], 'title' => __('Name of Ads Place', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks, plugin\'s widgets or autoinserting of ads.', SAM_DOMAIN)), 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)), + + 'samStatsUrl' => SAM_URL . 'sam-ajax-admin-stats.php', 'options' => array( 'uploading' => __('Uploading', SAM_DOMAIN).' ...', 'uploaded' => __('Uploaded.', SAM_DOMAIN), @@ -655,6 +676,16 @@ public function loadScripts($hook) { 'file' => __('File', SAM_DOMAIN), 'path' => SAM_AD_IMG, 'url' => SAM_AD_URL + ), + 'labels' => array('hits' => __('Hits', SAM_DOMAIN), 'clicks' => __('Clicks', SAM_DOMAIN)), + 'columns' => array( + array('field' => 'id', 'caption' => 'ID', 'size' => '40px', 'render' => 'int'), + array('field' => 'name', 'caption' => __("Name", SAM_DOMAIN), 'size' => '40%'), + array('field' => 'ad_hits', 'caption' => __("Hits", SAM_DOMAIN), 'size' => '10%', 'render' => 'int'), + array('field' => 'ad_clicks', 'caption' => __('Clicks', SAM_DOMAIN), 'size' => '10%', 'render' => 'int'), + array('field' => 'e_cpm', 'caption' => 'CPM', 'size' => '10%', 'render' => 'float:2'), + array('field' => 'e_cpc', 'caption' => 'CPC', 'size' => '10%', 'render' => 'float:2'), + array('field' => 'e_ctr', 'caption' => 'CTR', 'size' => '10%', 'render' => 'percent') ) )); } @@ -698,6 +729,9 @@ public function loadScripts($hook) { //wp_enqueue_script('cg-props', SAM_URL.'js/jquery.i18n.properties-1.0.9.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '1.0.9'); wp_enqueue_script('ComboGrid', SAM_URL.'js/jquery.ui.combogrid-1.6.3.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'/*, 'cg-props'*/), '1.6.3'); + wp_enqueue_script('flot', SAM_URL.'js/jquery.flot.min.js', array('jquery'), '0.8.1'); + wp_enqueue_script('flotCategories', SAM_URL.'js/jquery.flot.categories.min.js', array('jquery'), '0.8.1'); + wp_enqueue_script('flotResize', SAM_URL.'js/jquery.flot.resize.min.js', array('jquery'), '0.8.1'); wp_enqueue_script('wp-pointer'); wp_enqueue_script('adminEditScript', SAM_URL.'js/sam-admin-edit-item.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), SAM_VERSION); @@ -706,6 +740,7 @@ public function loadScripts($hook) { 'ads' => array('enabled' => $pointers['ads'], 'title' => __('Name of Ad', SAM_DOMAIN), 'content' => __('This is not required parameter. But it is strongly recommended to define it if you plan to use Ads Blocks or plugin\'s widgets.', SAM_DOMAIN)), 'media' => array('title' => __('Select Banner Image', SAM_DOMAIN), 'button' => __('Select', SAM_DOMAIN)), 'samAjaxUrl' => SAM_URL . 'sam-ajax-admin.php', + 'samStatsUrl' => SAM_URL . 'sam-ajax-admin-stats.php', 'models' => self::getColumnsModels(), 'data' => self::getGridsData(), 'strings' => array( @@ -722,7 +757,8 @@ public function loadScripts($hook) { 'author' => __('Author', SAM_DOMAIN), 'editor' => __('Editor', SAM_DOMAIN), 'admin' => __('Administrator', SAM_DOMAIN), - 'superAdmin' => __('Super Admin', SAM_DOMAIN) + 'superAdmin' => __('Super Admin', SAM_DOMAIN), + 'labels' => array('hits' => __('Hits', SAM_DOMAIN), 'clicks' => __('Clicks', SAM_DOMAIN)) ) )); //wp_enqueue_script('samMedia', SAM_URL . 'js/sam-media.js', array('jquery'), SAM_VERSION, true); diff --git a/css/sam-admin-edit.css b/css/sam-admin-edit.css index 3b9a494..fca0688 100644 --- a/css/sam-admin-edit.css +++ b/css/sam-admin-edit.css @@ -207,6 +207,31 @@ input.button-primary, input.button-secondary, font-size: 11px; } +.totals { + display: block; + margin: 15px; +} + +.graph-container { + box-sizing: border-box; + /*width: 850px; + height: 450px;*/ + padding: 20px 15px 15px 15px; + margin: 15px auto 30px auto; + border: 1px solid #ddd; + background: #fff; + background: linear-gradient(#f6f6f6 0, #fff 50px); + background: -o-linear-gradient(#f6f6f6 0, #fff 50px); + background: -ms-linear-gradient(#f6f6f6 0, #fff 50px); + background: -moz-linear-gradient(#f6f6f6 0, #fff 50px); + background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px); + box-shadow: 0 3px 10px rgba(0,0,0,0.15); + -o-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -ms-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -moz-box-shadow: 0 3px 10px rgba(0,0,0,0.1); + -webkit-box-shadow: 0 3px 10px rgba(0,0,0,0.1); +} + /*.itab { width: 100%; height: 400px; diff --git a/editor.admin.class.php b/editor.admin.class.php index 49082ac..ab615b6 100644 --- a/editor.admin.class.php +++ b/editor.admin.class.php @@ -219,6 +219,24 @@ private function adSizes($size = '468x60') { } + private function getMonthName( $month ) { + $months = array( + __('January', SAM_DOMAIN), + __('February', SAM_DOMAIN), + __('Mart', SAM_DOMAIN), + __('April', SAM_DOMAIN), + __('May', SAM_DOMAIN), + __('June', SAM_DOMAIN), + __('July', SAM_DOMAIN), + __('August', SAM_DOMAIN), + __('September', SAM_DOMAIN), + __('October', SAM_DOMAIN), + __('November', SAM_DOMAIN), + __('December', SAM_DOMAIN), + ); + return $months[$month - 1]; + } + private function drawImageTools() { ?>
        @@ -270,6 +288,7 @@ public function page() { global $wpdb; $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; + $sTable = $wpdb->prefix . "sam_stats"; $options = $this->settings; @@ -294,21 +313,16 @@ public function page() { 'code_before' => stripslashes($_POST['code_before']), 'code_after' => stripslashes($_POST['code_after']), 'place_size' => $_POST['place_size'], - //FIXED 'place_custom_width' => $_POST['place_custom_width'], 'place_custom_width' => (isset($_POST['place_custom_width']) ? $_POST['place_custom_width'] : 0), - //FIXED 'place_custom_height' => $_POST['place_custom_height'], 'place_custom_height' => (isset($_POST['place_custom_height']) ? $_POST['place_custom_height'] : 0), 'patch_img' => $_POST['patch_img'], 'patch_link' => stripslashes($_POST['patch_link']), 'patch_code' => stripslashes($_POST['patch_code']), - //FIXED 'patch_adserver' => $_POST['patch_adserver'], 'patch_adserver' => (isset($_POST['patch_adserver']) ? 1 : 0), 'patch_dfp' => $_POST['patch_dfp'], 'patch_source' => $_POST['patch_source'], - //FIXED 'trash' => ($_POST['trash'] === 'true') 'trash' => ($_POST['trash'] === 'true' ? 1 : 0) ); - //FIXED $formatRow = array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d'); $formatRow = array( '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%d'); if($placeId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($pTable, $updateRow); @@ -460,103 +474,148 @@ public function page() {
        -
        -
        -

        -

        -
        -

        -

        - adSizes($row['place_size']); ?> -

        -

        - - -

        -

        - - -

        -

        +
        +
          +
        • +
        • +
        • +
        +
        +
        +
        +

        +

        +
        +

        +

        + adSizes($row['place_size']); ?> +

        +

        + + +

        +

        + + +

        +

        +
        +
        -
        -
        -
        -
        -

        -

        -
        -

        -

        -      -

        -
        -

        - - - -

        -

        - -

        -

        - - -

        -

        - -

        - +
        +
        +

        +

        +
        +

        +

        + + +

        +

        + + +

        +

        +
        -
        -

        -      -

        -
        -

        - - -

        -

        - > - -

        -

        - -

        +
        +
        +
        +
        +
        +

        +

        +
        +

        +

        +      +

        +
        +

        + + + +

        +

        + +

        +

        + + +

        +

        + +

        + +
        +
        +

        +      +

        +
        +

        + + +

        +

        + > + +

        +

        + +

        +
        +
        +

        +      +

        +
        +

        + + '> +

        +

        + +

        +
        +

        +
        -
        -

        -      -

        -
        -

        - - '> -

        -

        - -

        -
        -

        +
        +

        + + + +

        +
        +
        +
        +

        +
        + :
        + :
        +

        +
        -
        +

        -

        +

        -

        -

        - - -

        -

        - - -

        -

        +
        @@ -733,8 +792,8 @@ public function page() { sa.hits_limit, sa.limit_clicks, sa.clicks_limit, - sa.ad_hits, - sa.ad_clicks, + (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, sa.ad_weight, sa.ad_weight_hits, sa.adv_nick, @@ -754,7 +813,7 @@ public function page() { FROM $aTable sa INNER JOIN $pTable sp ON sa.pid = sp.id - WHERE sa.id = $item", + WHERE sa.id = $item;", ARRAY_A); if($row['ad_size'] === 'custom') $aSize = $this->getAdSize($row['ad_size'], $row['ad_custom_width'], $row['ad_custom_height']); @@ -946,7 +1005,9 @@ public function page() {
        • -
        • +
        • +
        • +
        @@ -1119,49 +1180,7 @@ public function page() {
        -
        -

        -

        -
        -

        -

        - > - -

        -
        -

        - > - -

        -
        -

        - > - -

        -

        - > - -

        -
        -

        - > - -

        -
        - - -
        -
        -
        -
        -

        - > - -

        -
        -
        -
        -
        +

        @@ -1406,6 +1425,53 @@ public function page() {
        +
        +
        +

        +

        +
        +

        +

        + > + +

        +
        +

        + > + +

        +
        +

        + > + +

        +

        + > + +

        +
        +

        + > + +

        +
        + + +
        +
        +
        +
        +

        + > + +

        +
        +
        +
        +
        +
        +
        +

        @@ -1456,6 +1522,33 @@ public function page() {
        +
        +
        +

        + + + +

        +
        +
        +
        +

        +
        + :
        + :
        +

        +
        +
        diff --git a/js/jquery.flot.categories.min.js b/js/jquery.flot.categories.min.js new file mode 100644 index 0000000..552dd90 --- /dev/null +++ b/js/jquery.flot.categories.min.js @@ -0,0 +1 @@ +(function($){var options={xaxis:{categories:null},yaxis:{categories:null}};function processRawData(plot,series,data,datapoints){var xCategories=series.xaxis.options.mode=="categories",yCategories=series.yaxis.options.mode=="categories";if(!(xCategories||yCategories))return;var format=datapoints.format;if(!format){var s=series;format=[];format.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}}datapoints.format=format}for(var m=0;mindex)index=categories[v];return index+1}function categoriesTickGenerator(axis){var res=[];for(var label in axis.categories){var v=axis.categories[label];if(v>=axis.min&&v<=axis.max)res.push([v,label])}res.sort(function(a,b){return a[0]-b[0]});return res}function setupCategoriesForAxis(series,axis,datapoints){if(series[axis].options.mode!="categories")return;if(!series[axis].categories){var c={},o=series[axis].options.categories||{};if($.isArray(o)){for(var i=0;i=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){var hasOwnProperty=Object.prototype.hasOwnProperty;function Canvas(cls,container){var element=container.children("."+cls)[0];if(element==null){element=document.createElement("canvas");element.className=cls;$(element).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(container);if(!element.getContext){if(window.G_vmlCanvasManager){element=window.G_vmlCanvasManager.initElement(element)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=element;var context=this.context=element.getContext("2d");var devicePixelRatio=window.devicePixelRatio||1,backingStoreRatio=context.webkitBackingStorePixelRatio||context.mozBackingStorePixelRatio||context.msBackingStorePixelRatio||context.oBackingStorePixelRatio||context.backingStorePixelRatio||1;this.pixelRatio=devicePixelRatio/backingStoreRatio;this.resize(container.width(),container.height());this.textContainer=null;this.text={};this._textCache={}}Canvas.prototype.resize=function(width,height){if(width<=0||height<=0){throw new Error("Invalid dimensions for plot, width = "+width+", height = "+height)}var element=this.element,context=this.context,pixelRatio=this.pixelRatio;if(this.width!=width){element.width=width*pixelRatio;element.style.width=width+"px";this.width=width}if(this.height!=height){element.height=height*pixelRatio;element.style.height=height+"px";this.height=height}context.restore();context.save();context.scale(pixelRatio,pixelRatio)};Canvas.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};Canvas.prototype.render=function(){var cache=this._textCache;for(var layerKey in cache){if(hasOwnProperty.call(cache,layerKey)){var layer=this.getTextLayer(layerKey),layerCache=cache[layerKey];layer.hide();for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){if(position.active){if(!position.rendered){layer.append(position.element);position.rendered=true}}else{positions.splice(i--,1);if(position.rendered){position.element.detach()}}}if(positions.length==0){delete styleCache[key]}}}}}layer.show()}}};Canvas.prototype.getTextLayer=function(classes){var layer=this.text[classes];if(layer==null){if(this.textContainer==null){this.textContainer=$("
        ").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)}layer=this.text[classes]=$("
        ").addClass(classes).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)}return layer};Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){var textStyle,layerCache,styleCache,info;text=""+text;if(typeof font==="object"){textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px/"+font.lineHeight+"px "+font.family}else{textStyle=font}layerCache=this._textCache[layer];if(layerCache==null){layerCache=this._textCache[layer]={}}styleCache=layerCache[textStyle];if(styleCache==null){styleCache=layerCache[textStyle]={}}info=styleCache[text];if(info==null){var element=$("
        ").html(text).css({position:"absolute","max-width":width,top:-9999}).appendTo(this.getTextLayer(layer));if(typeof font==="object"){element.css({font:textStyle,color:font.color})}else if(typeof font==="string"){element.addClass(font)}info=styleCache[text]={width:element.outerWidth(true),height:element.outerHeight(true),element:element,positions:[]};element.detach()}return info};Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions;if(halign=="center"){x-=info.width/2}else if(halign=="right"){x-=info.width}if(valign=="middle"){y-=info.height/2}else if(valign=="bottom"){y-=info.height}for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=true;return}}position={active:true,rendered:false,element:positions.length?info.element.clone():info.element,x:x,y:y};positions.push(position);position.element.css({top:Math.round(y),left:Math.round(x),"text-align":halign})};Canvas.prototype.removeText=function(layer,x,y,text,font,angle){if(text==null){var layerCache=this._textCache[layer];if(layerCache!=null){for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey];for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var positions=styleCache[key].positions;for(var i=0,position;position=positions[i];i++){position.active=false}}}}}}}else{var positions=this.getTextInfo(layer,text,font,angle).positions;for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=false}}}};function Plot(placeholder,data_,options_,plugins){var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},surface=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},plot=this;plot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder};plot.getCanvas=function(){return surface.element};plot.getPlotOffset=function(){return plotOffset};plot.width=function(){return plotWidth};plot.height=function(){return plotHeight};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o};plot.getData=function(){return series};plot.getAxes=function(){var res={},i;$.each(xaxes.concat(yaxes),function(_,axis){if(axis)res[axis.direction+(axis.n!=1?axis.n:"")+"axis"]=axis});return res};plot.getXAxes=function(){return xaxes};plot.getYAxes=function(){return yaxes};plot.c2p=canvasToAxisCoords;plot.p2c=axisToCanvasCoords;plot.getOptions=function(){return options};plot.highlight=highlight;plot.unhighlight=unhighlight;plot.triggerRedrawOverlay=triggerRedrawOverlay;plot.pointOffset=function(point){return{left:parseInt(xaxes[axisNumber(point,"x")-1].p2c(+point.x)+plotOffset.left,10),top:parseInt(yaxes[axisNumber(point,"y")-1].p2c(+point.y)+plotOffset.top,10)}};plot.shutdown=shutdown;plot.destroy=function(){shutdown();placeholder.removeData("plot").empty();series=[];options=null;surface=null;overlay=null;eventHolder=null;ctx=null;octx=null;xaxes=[];yaxes=[];hooks=null;highlights=[];plot=null};plot.resize=function(){var width=placeholder.width(),height=placeholder.height();surface.resize(width,height);overlay.resize(width,height)};plot.hooks=hooks;initPlugins(plot);parseOptions(options_);setupCanvases();setData(data_);setupGrid();draw();bindEvents();function executeHooks(hook,args){args=[plot].concat(args);for(var i=0;imaxIndex){maxIndex=sc}}}if(neededColors<=maxIndex){neededColors=maxIndex+1}var c,colors=[],colorPool=options.colors,colorPoolSize=colorPool.length,variation=0;for(i=0;i=0){if(variation<.5){variation=-variation-.2}else variation=0}else variation=-variation}colors[i]=c.scale("rgb",1+variation)}var colori=0,s;for(i=0;iaxis.datamax&&max!=fakeInfinity)axis.datamax=max}$.each(allAxes(),function(_,axis){axis.datamin=topSentry;axis.datamax=bottomSentry;axis.used=false});for(i=0;i0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){for(m=0;mxmax)xmax=val}if(f.y){if(valymax)ymax=val}}}if(s.bars.show){var delta;switch(s.bars.align){case"left":delta=0;break;case"right":delta=-s.bars.barWidth;break;default:delta=-s.bars.barWidth/2}if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth}else{xmin+=delta;xmax+=delta+s.bars.barWidth}}updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax)}$.each(allAxes(),function(_,axis){if(axis.datamin==topSentry)axis.datamin=null;if(axis.datamax==bottomSentry)axis.datamax=null})}function setupCanvases(){placeholder.css("padding",0).children().filter(function(){return!$(this).hasClass("flot-overlay")&&!$(this).hasClass("flot-base")}).remove();if(placeholder.css("position")=="static")placeholder.css("position","relative");surface=new Canvas("flot-base",placeholder);overlay=new Canvas("flot-overlay",placeholder);ctx=surface.context;octx=overlay.context;eventHolder=$(overlay.element).unbind();var existing=placeholder.data("plot");if(existing){existing.shutdown();overlay.clear()}placeholder.data("plot",plot)}function bindEvents(){if(options.grid.hoverable){eventHolder.mousemove(onMouseMove);eventHolder.bind("mouseleave",onMouseLeave)}if(options.grid.clickable)eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder])}function shutdown(){if(redrawTimeout)clearTimeout(redrawTimeout);eventHolder.unbind("mousemove",onMouseMove);eventHolder.unbind("mouseleave",onMouseLeave);eventHolder.unbind("click",onClick);executeHooks(hooks.shutdown,[eventHolder])}function setTransformationHelpers(axis){function identity(x){return x}var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform;if(axis.direction=="x"){s=axis.scale=plotWidth/Math.abs(t(axis.max)-t(axis.min));m=Math.min(t(axis.max),t(axis.min))}else{s=axis.scale=plotHeight/Math.abs(t(axis.max)-t(axis.min));s=-s;m=Math.max(t(axis.max),t(axis.min))}if(t==identity)axis.p2c=function(p){return(p-m)*s};else axis.p2c=function(p){return(t(p)-m)*s};if(!it)axis.c2p=function(c){return m+c/s};else axis.c2p=function(c){return it(m+c/s)}}function measureTickLabels(axis){var opts=axis.options,ticks=axis.ticks||[],labelWidth=opts.labelWidth||0,labelHeight=opts.labelHeight||0,maxWidth=labelWidth||(axis.direction=="x"?Math.floor(surface.width/(ticks.length||1)):null),legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=opts.font||"flot-tick-label tickLabel";for(var i=0;i=0;--i)allocateAxisBoxFirstPhase(allocatedAxes[i]);adjustLayoutForThingsStickingOut();$.each(allocatedAxes,function(_,axis){allocateAxisBoxSecondPhase(axis)})}plotWidth=surface.width-plotOffset.left-plotOffset.right;plotHeight=surface.height-plotOffset.bottom-plotOffset.top;$.each(axes,function(_,axis){setTransformationHelpers(axis)});if(showGrid){drawAxisLabels()}insertLegend()}function setRange(axis){var opts=axis.options,min=+(opts.min!=null?opts.min:axis.datamin),max=+(opts.max!=null?opts.max:axis.datamax),delta=max-min;if(delta==0){var widen=max==0?1:.01;if(opts.min==null)min-=widen;if(opts.max==null||opts.min!=null)max+=widen}else{var margin=opts.autoscaleMargin;if(margin!=null){if(opts.min==null){min-=delta*margin;if(min<0&&axis.datamin!=null&&axis.datamin>=0)min=0}if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0)max=0}}}axis.min=min;axis.max=max}function setupTickGeneration(axis){var opts=axis.options;var noTicks;if(typeof opts.ticks=="number"&&opts.ticks>0)noTicks=opts.ticks;else noTicks=.3*Math.sqrt(axis.direction=="x"?surface.width:surface.height);var delta=(axis.max-axis.min)/noTicks,dec=-Math.floor(Math.log(delta)/Math.LN10),maxDec=opts.tickDecimals;if(maxDec!=null&&dec>maxDec){dec=maxDec}var magn=Math.pow(10,-dec),norm=delta/magn,size;if(norm<1.5){size=1}else if(norm<3){size=2;if(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec}}else if(norm<7.5){size=5}else{size=10}size*=magn;if(opts.minTickSize!=null&&size0){if(opts.min==null)axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1)axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1])}axis.tickGenerator=function(axis){var ticks=[],v,i;for(i=0;i1&&/\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec))))axis.tickDecimals=extraDec}}}}function setTicks(axis){var oticks=axis.options.ticks,ticks=[];if(oticks==null||typeof oticks=="number"&&oticks>0)ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks))ticks=oticks(axis);else ticks=oticks}var i,v;axis.ticks=[];for(i=0;i1)label=t[1]}else v=+t;if(label==null)label=axis.tickFormatter(v,axis);if(!isNaN(v))axis.ticks.push({v:v,label:label})}}function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){if(axis.options.min==null)axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1)axis.max=Math.max(axis.max,ticks[ticks.length-1].v)}}function draw(){surface.clear();executeHooks(hooks.drawBackground,[ctx]);var grid=options.grid;if(grid.show&&grid.backgroundColor)drawBackground();if(grid.show&&!grid.aboveData){drawGrid()}for(var i=0;ito){var tmp=from;from=to;to=tmp}return{from:from,to:to,axis:axis}}function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore()}function drawGrid(){var i,axes,bw,bc;ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var markings=options.grid.markings;if(markings){if($.isFunction(markings)){axes=plot.getAxes();axes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes)}for(i=0;ixrange.axis.max||yrange.toyrange.axis.max)continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max); +yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);if(xrange.from==xrange.to&&yrange.from==yrange.to)continue;xrange.from=xrange.axis.p2c(xrange.from);xrange.to=xrange.axis.p2c(xrange.to);yrange.from=yrange.axis.p2c(yrange.from);yrange.to=yrange.axis.p2c(yrange.to);if(xrange.from==xrange.to||yrange.from==yrange.to){ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth;ctx.moveTo(xrange.from,yrange.from);ctx.lineTo(xrange.to,yrange.to);ctx.stroke()}else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to)}}}axes=allAxes();bw=options.grid.borderWidth;for(var j=0;jaxis.max||t=="full"&&(typeof bw=="object"&&bw[axis.position]>0||bw>0)&&(v==axis.min||v==axis.max))continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top")yoff=-yoff}else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left")xoff=-xoff}if(ctx.lineWidth==1){if(axis.direction=="x")x=Math.floor(x)+.5;else y=Math.floor(y)+.5}ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff)}ctx.stroke()}if(bw){bc=options.grid.borderColor;if(typeof bw=="object"||typeof bc=="object"){if(typeof bw!=="object"){bw={top:bw,right:bw,bottom:bw,left:bw}}if(typeof bc!=="object"){bc={top:bc,right:bc,bottom:bc,left:bc}}if(bw.top>0){ctx.strokeStyle=bc.top;ctx.lineWidth=bw.top;ctx.beginPath();ctx.moveTo(0-bw.left,0-bw.top/2);ctx.lineTo(plotWidth,0-bw.top/2);ctx.stroke()}if(bw.right>0){ctx.strokeStyle=bc.right;ctx.lineWidth=bw.right;ctx.beginPath();ctx.moveTo(plotWidth+bw.right/2,0-bw.top);ctx.lineTo(plotWidth+bw.right/2,plotHeight);ctx.stroke()}if(bw.bottom>0){ctx.strokeStyle=bc.bottom;ctx.lineWidth=bw.bottom;ctx.beginPath();ctx.moveTo(plotWidth+bw.right,plotHeight+bw.bottom/2);ctx.lineTo(0,plotHeight+bw.bottom/2);ctx.stroke()}if(bw.left>0){ctx.strokeStyle=bc.left;ctx.lineWidth=bw.left;ctx.beginPath();ctx.moveTo(0-bw.left/2,plotHeight+bw.bottom);ctx.lineTo(0-bw.left/2,0);ctx.stroke()}}else{ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw)}}ctx.restore()}function drawAxisLabels(){$.each(allAxes(),function(_,axis){var box=axis.box,legacyStyles=axis.direction+"Axis "+axis.direction+axis.n+"Axis",layer="flot-"+axis.direction+"-axis flot-"+axis.direction+axis.n+"-axis "+legacyStyles,font=axis.options.font||"flot-tick-label tickLabel",tick,x,y,halign,valign;surface.removeText(layer);if(!axis.show||axis.ticks.length==0)return;for(var i=0;iaxis.max)continue;if(axis.direction=="x"){halign="center";x=plotOffset.left+axis.p2c(tick.v);if(axis.position=="bottom"){y=box.top+box.padding}else{y=box.top+box.height-box.padding;valign="bottom"}}else{valign="middle";y=plotOffset.top+axis.p2c(tick.v);if(axis.position=="left"){x=box.left+box.width-box.padding;halign="right"}else{x=box.left+box.padding}}surface.addText(layer,x,y,tick.label,font,null,null,halign,valign)}})}function drawSeries(series){if(series.lines.show)drawSeriesLines(series);if(series.bars.show)drawSeriesBars(series);if(series.points.show)drawSeriesPoints(series)}function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i=y2&&y1>axisy.max){if(y2>axisy.max)continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(x1!=prevx||y1!=prevy)ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset)}ctx.stroke()}function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0;while(true){if(ps>0&&i>points.length+ps)break;i+=ps;var x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){segmentEnd=i;ps=-ps;ypos=2;continue}if(ps<0&&i==segmentStart+ps){ctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue}}if(x1==null||x2==null)continue;if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max)continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max}else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max}if(!areaOpen){ctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true}if(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue}else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue}var x1old=x1,x2old=x2;if(y1<=y2&&y1=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min}else if(y2<=y1&&y2=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min}if(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max}else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max}if(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1))}ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));if(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2))}}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin="round";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw;ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis)}if(lw>0)plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore()}function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;iaxisx.max||yaxisy.max)continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol=="circle")ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill()}ctx.stroke()}}ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;if(lw==0)lw=1e-4;if(lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle="rgba(0,0,0,0.2)";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol)}ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore()}function drawBar(x,y,b,barLeft,barRight,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;if(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;if(rightaxisx.max||topaxisy.max)return;if(leftaxisx.max){right=axisx.max;drawRight=false}if(bottomaxisy.max){top=axisy.max;drawTop=false}left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);if(fillStyleCallback){c.fillStyle=fillStyleCallback(bottom,top);c.fillRect(left,top,right-left,bottom-top)}if(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath();c.moveTo(left,bottom);if(drawLeft)c.lineTo(left,top);else c.moveTo(left,top);if(drawTop)c.lineTo(right,top);else c.moveTo(right,top);if(drawRight)c.lineTo(right,bottom);else c.moveTo(right,bottom);if(drawBottom)c.lineTo(left,bottom);else c.moveTo(left,bottom);c.stroke()}}function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i");fragments.push("");rowStarted=true}fragments.push('
        '+''+entry.label+"")}if(rowStarted)fragments.push("");if(fragments.length==0)return;var table=''+fragments.join("")+"
        ";if(options.legend.container!=null)$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;if(m[0]==null)m=[m,m];if(p.charAt(0)=="n")pos+="top:"+(m[1]+plotOffset.top)+"px;";else if(p.charAt(0)=="s")pos+="bottom:"+(m[1]+plotOffset.bottom)+"px;";if(p.charAt(1)=="e")pos+="right:"+(m[0]+plotOffset.right)+"px;";else if(p.charAt(1)=="w")pos+="left:"+(m[0]+plotOffset.left)+"px;";var legend=$('
        '+table.replace('style="','style="position:absolute;'+pos+";")+"
        ").appendTo(placeholder);if(options.legend.backgroundOpacity!=0){var c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c=="string")c=$.color.parse(c);else c=$.color.extract(legend,"background-color");c.a=1;c=c.toString()}var div=legend.children();$('
        ').prependTo(legend).css("opacity",options.legend.backgroundOpacity)}}}var highlights=[],redrawTimeout=null;function findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j,ps;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i]))continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;ps=s.datapoints.pointsize;if(axisx.options.inverseTransform)maxx=Number.MAX_VALUE;if(axisy.options.inverseTransform)maxy=Number.MAX_VALUE;if(s.lines.show||s.points.show){for(j=0;jmaxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)continue;var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;if(dist=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight:mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))item=[i,j/ps]}}}if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i}}return null}function onMouseMove(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return s["hoverable"]!=false})}function onMouseLeave(e){if(options.grid.hoverable)triggerClickHoverEvent("plothover",e,function(s){return false})}function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return s["clickable"]!=false})}function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left,10);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top,10)}if(options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max)return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=highlightColor;var radius=1.5*pointRadius;x=axisx.p2c(x);y=axisy.p2c(y);octx.beginPath();if(series.points.symbol=="circle")octx.arc(x,y,radius,0,2*Math.PI,false);else series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke()}function drawBarHighlight(series,point){var highlightColor=typeof series.highlightColor==="string"?series.highlightColor:$.color.parse(series.color).scale("a",.5).toString(),fillStyle=highlightColor,barLeft;switch(series.bars.align){case"left":barLeft=0;break;case"right":barLeft=-series.bars.barWidth;break;default:barLeft=-series.bars.barWidth/2}octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=highlightColor;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,function(){return fillStyle},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth)}function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec=="string")return spec;else{var gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i=0;n--){var o=$(r[n]);if(o[0]==t||o.is(":visible")){var h=o.width(),d=o.height(),v=o.data(a);!v||h===v.w&&d===v.h?i[f]=i[l]:(i[f]=i[c],o.trigger(u,[v.w=h,v.h=d]))}else v=o.data(a),v.w=0,v.h=0}s!==null&&(s=t.requestAnimationFrame(p))}var r=[],i=$.resize=$.extend($.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="pendingDelay",c="activeDelay",h="throttleWindow";i[l]=250,i[c]=20,i[f]=i[l],i[h]=!0,$.event.special[u]={setup:function(){if(!i[h]&&this[o])return!1;var t=$(this);r.push(this),t.data(a,{w:t.width(),h:t.height()}),r.length===1&&(s=n,p())},teardown:function(){if(!i[h]&&this[o])return!1;var t=$(this);for(var n=r.length-1;n>=0;n--)if(r[n]==this){r.splice(n,1);break}t.removeData(a),r.length||(cancelAnimationFrame(s),s=null)},add:function(t){function s(t,i,s){var o=$(this),u=o.data(a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[h]&&this[o])return!1;var r;if($.isFunction(t))return r=t,s;r=t.handler,t.handler=s}},t.requestAnimationFrame||(t.requestAnimationFrame=function(){return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,n){return t.setTimeout(e,i[f])}}()),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(){return t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}())})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-item.js b/js/sam-admin-edit-item.js index 5f733cf..dac6aaf 100644 --- a/js/sam-admin-edit-item.js +++ b/js/sam-admin-edit-item.js @@ -95,11 +95,14 @@ var sam = sam || {}; var //samUploader, mediaTexts = samEditorOptions.media, samAjaxUrl = samEditorOptions.samAjaxUrl, + samStatsUrl = samEditorOptions.samStatsUrl, models = samEditorOptions.models, gData = samEditorOptions.data, samStrs = samEditorOptions.strings, sPost = encodeURI(samStrs.posts), sPage = encodeURI(samStrs.page); + var stats, statsData, itemId = $('#item_id').val(), sMonth = 0; + function buildLGrid(name, grid, vi, field, gc, url) { var iVal = vi.val(); grid.w2grid({ @@ -208,6 +211,37 @@ var sam = sam || {}; media.init(); + stats = $.post(samStatsUrl, { + action: 'load_item_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: samStrs.labels.hits, data: data.hits}, + clicks = {label: samStrs.labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + fu = new AjaxUpload(btnUpload, { action:ajaxurl, name:'uploadfile', @@ -292,7 +326,6 @@ var sam = sam || {}; if(rcctt.is(':visible') && w2ui['ctt-grid']) cttGrid.w2render('ctt-grid'); if(rcxct.is(':visible') && w2ui['x-ctt-grid']) xcttGrid.w2render('x-ctt-grid'); if(rcxid.is(':visible') && w2ui['x-posts-grid']) xpostsGrid.w2render('x-posts-grid'); - if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); if(rcac.is(':visible') && w2ui['cats-grid']) catsGrid.w2render('cats-grid'); if(rcxc.is(':visible') && w2ui['x-cats-grid']) xcatsGrid.w2render('x-cats-grid'); if(rcau.is(':visible') && w2ui['auth-grid']) authGrid.w2render('auth-grid'); @@ -302,6 +335,27 @@ var sam = sam || {}; if(rccu.is(':visible') && w2ui['cust-grid']) custGrid.w2render('cust-grid'); if(rcxu.is(':visible') && w2ui['xcust-grid']) xcustGrid.w2render('x-cust-grid'); } + if(el == 'tabs-3') + if(xViewUsers.is(':visible') && w2ui['users-grid']) usersGrid.w2render('users-grid'); + if(el == 'tabs-5') + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); } }); @@ -779,6 +833,40 @@ var sam = sam || {}; } }); + $('#stats_month').change(function() { + sMonth = $(this).val(); + $.post(samStatsUrl, { + action: 'load_item_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: samStrs.labels.hits, data: data.hits}, + clicks = {label: samStrs.labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + }); + return false; }); })(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-item.min.js b/js/sam-admin-edit-item.min.js index a8eac91..2fef696 100644 --- a/js/sam-admin-edit-item.min.js +++ b/js/sam-admin-edit-item.min.js @@ -1 +1 @@ -var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#ad_img",adImgId:"#ad_img_id",adName:"#title",adDesc:"#item_description",adAlt:"#ad_alt",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){function ur(t,i,r,u,f,e){var o=r.val();i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:f,url:e,onSelect:function(n){n.onComplete=function(){for(var f,e="",t=this.getSelection(),i,n=0;n<\/div>').appendTo(iu);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),ki=="item"?n("#ad_img").val(i.url+t):ki=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});n("#adv_nick").combogrid({url:y+"?action=load_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:r.comboGrid,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#ad_img").val(t),!1});f("ctt-grid",ii,ru,"slug",r.customTaxes,pt.cTax);f("x-ctt-grid",ri,uu,"slug",r.customTaxes,pt.cTax);f("cust-grid",ai,yu,"slug",r.customs,pt.customs);f("x-cust-grid",vi,pu,"slug",r.customs,pt.customs);yi=y+"?action=load_posts&cstr="+samEditorOptions.data.custList+"&sp="+wu+"&spg="+bu;ur("posts-grid",ui,fu,"id",r.posts,yi);ur("x-posts-grid",fi,ou,"id",r.posts,yi);n("#tabs").tabs({activate:function(n,t){var i=t.newPanel[0].id;i=="tabs-1"&&w2ui["posts-grid"]&&ui.w2render("posts-grid");i=="tabs-2"&&(ct.is(":visible")&&w2ui["ctt-grid"]&&ii.w2render("ctt-grid"),nt.is(":visible")&&w2ui["x-ctt-grid"]&&ri.w2render("x-ctt-grid"),b.is(":visible")&&w2ui["x-posts-grid"]&&fi.w2render("x-posts-grid"),ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid"),ht.is(":visible")&&w2ui["cats-grid"]&&ei.w2render("cats-grid"),d.is(":visible")&&w2ui["x-cats-grid"]&&oi.w2render("x-cats-grid"),lt.is(":visible")&&w2ui["auth-grid"]&&si.w2render("auth-grid"),it.is(":visible")&&w2ui["x-auth-grid"]&&hi.w2render("x-auth-grid"),at.is(":visible")&&w2ui["tags-grid"]&&ci.w2render("tags-grid"),ut.is(":visible")&&w2ui["x-tags-grid"]&&li.w2render("x-tags-grid"),vt.is(":visible")&&w2ui["cust-grid"]&&ai.w2render("cust-grid"),et.is(":visible")&&w2ui["xcust-grid"]&&vi.w2render("x-cust-grid"))}});n("#code_mode_false").click(function(){di.show("blind",{direction:"vertical"},500);gi.hide("blind",{direction:"vertical"},500)});n("#code_mode_true").click(function(){di.hide("blind",{direction:"vertical"},500);gi.show("blind",{direction:"vertical"},500)});2==n("input:radio[name=view_type]:checked").val()&&(u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)),u.attr("disabled",!0));n("input:radio[name=view_type]").click(function(){var t=n("input:radio[name=view_type]:checked").val();switch(t){case"0":e.is(":hidden")&&e.show("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"1":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"2":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":hidden")&&(o.show("blind",{direction:"vertical"},500,function(){w2ui["posts-grid"]&&ui.w2render("posts-grid")}),u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)));u.attr("disabled",!0)}});fr=n.ajax({url:y,data:{action:"load_authors",level:3},type:"POST"});fr.done(function(n){pi=n;f("auth-grid",si,cu,"slug",r.authors,pi);f("x-auth-grid",hi,lu,"slug",r.authors,pi)});er=n.ajax({url:y,data:{action:"load_users",subscriber:encodeURI(i.subscriber),contributor:encodeURI(i.contributor),author:encodeURI(i.author),editor:encodeURI(i.editor),admin:encodeURI(i.admin),sadmin:encodeURI(i.superAdmin)},type:"POST"});er.done(function(n){or=n;f("users-grid",st,eu,"slug",r.users,or)});sr=n.ajax({url:y,data:{action:"load_cats",level:3},type:"POST"});sr.done(function(n){wi=n;f("cats-grid",ei,su,"slug",r.cats,wi);f("x-cats-grid",oi,hu,"slug",r.cats,wi)});hr=n.ajax({url:y,data:{action:"load_tags",level:3},type:"POST"});hr.done(function(n){bi=n;f("tags-grid",ci,au,"slug",r.tags,bi);f("x-tags-grid",li,vu,"slug",r.tags,bi)});u.click(function(){u.is(":checked")?2==n("input:radio[name=view_type]:checked").val()?u.attr("checked",!1):b.show("blind",{direction:"vertical"},500,function(){w2ui["x-posts-grid"]&&fi.w2render("x-posts-grid")}):b.hide("blind",{direction:"vertical"},500)});n("input:radio[name=ad_users]").click(function(){var t=n("input:radio[name=ad_users]:checked").val();t=="0"?yt.is(":visible")&&yt.hide("blind",{direction:"vertical"},500):yt.is(":hidden")&&yt.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")})});nr.click(function(){nr.is(":checked")?tr.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")}):tr.hide("blind",{direction:"vertical"},500)});ir.click(function(){ir.is(":checked")?ot.show("blind",{direction:"vertical"},500,function(){w2ui["users-grid"]&&st.w2render("users-grid")}):ot.hide("blind",{direction:"vertical"},500)});n("#ad_swf").click(function(){n("#ad_swf").is(":checked")?n("#swf-params").show("blind",{direction:"vertical"},500):n("#swf-params").hide("blind",{direction:"vertical"},500)});k.is(":checked")&&s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500));k.click(function(){k.is(":checked")?(ht.show("blind",{direction:"vertical"},500,function(){w2ui["cats-grid"]&&ei.w2render("cats-grid")}),bt.show("blind",{direction:"vertical"},500),s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500))):(ht.hide("blind",{direction:"vertical"},500),bt.hide("blind",{direction:"vertical"},500))});s.click(function(){s.is(":checked")?(d.show("blind",{direction:"vertical"},500,function(){w2ui["x-cats-grid"]&&oi.w2render("x-cats-grid")}),k.is(":checked")&&(k.attr("checked",!1),ht.hide("blind",{direction:"vertical"},500),bt.hide("blind",{direction:"vertical"},500))):d.hide("blind",{direction:"vertical"},500)});g.is(":checked")&&h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500));g.click(function(){g.is(":checked")?(ct.show("blind",{direction:"vertical"},500,function(){w2ui["ctt-grid"]&&ii.w2render("ctt-grid")}),kt.show("blind",{direction:"vertical"},500),h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500))):(ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))});h.click(function(){h.is(":checked")?(nt.show("blind",{direction:"vertical"},500,function(){w2ui["x-ctt-grid"]&&ri.w2render("x-ctt-grid")}),g.is(":checked")&&(g.attr("checked",!1),ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))):nt.hide("blind",{direction:"vertical"},500)});tt.is(":checked")&&c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500));tt.click(function(){tt.is(":checked")?(lt.show("blind",{direction:"vertical"},500,function(){w2ui["auth-grid"]&&si.w2render("auth-grid")}),dt.show("blind",{direction:"vertical"},500),c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500))):(lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))});c.click(function(){c.is(":checked")?(it.show("blind",{direction:"vertical"},500,function(){w2ui["x-auth-grid"]&&hi.w2render("x-auth-grid")}),tt.is(":checked")&&(tt.attr("checked",!1),lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))):it.hide("blind",{direction:"vertical"},500)});rt.is(":checked")&&l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500));rt.click(function(){rt.is(":checked")?(at.show("blind",{direction:"vertical"},500,function(){w2ui["tags-grid"]&&ci.w2render("tags-grid")}),gt.show("blind",{direction:"vertical"},500),l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500))):(at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))});l.click(function(){l.is(":checked")?(ut.show("blind",{direction:"vertical"},500,function(){w2ui["x-tags-grid"]&&li.w2render("x-tags-grid")}),rt.is(":checked")&&(rt.attr("checked",!1),at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))):ut.hide("blind",{direction:"vertical"},500)});ft.is(":checked")&&a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500));ft.click(function(){ft.is(":checked")?(vt.show("blind",{direction:"vertical"},500,function(){w2ui["cust-grid"]&&ai.w2render("cust-grid")}),ni.show("blind",{direction:"vertical"},500),a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500))):(vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))});a.click(function(){a.is(":checked")?(et.show("blind",{direction:"vertical"},500,function(){w2ui["x-cust-grid"]&&vi.w2render("x-cust-grid")}),ft.is(":checked")&&(ft.attr("checked",!1),vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))):et.hide("blind",{direction:"vertical"},500)});n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0});n("#ad_schedule").click(function(){n("#ad_schedule").is(":checked")?n("#rc-sc").show("blind",{direction:"vertical"},500):n("#rc-sc").hide("blind",{direction:"vertical"},500)});n("#limit_hits").click(function(){n("#limit_hits").is(":checked")?n("#rc-hl").show("blind",{direction:"vertical"},500):n("#rc-hl").hide("blind",{direction:"vertical"},500)});n("#limit_clicks").click(function(){n("#limit_clicks").is(":checked")?n("#rc-cl").show("blind",{direction:"vertical"},500):n("#rc-cl").hide("blind",{direction:"vertical"},500)});v=samEditorOptions.ads;v.pointer="ads";(v.enabled||""==wt.val())&&wt.pointer({content:"

        "+v.title+"<\/h3>

        "+v.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:v.pointer},async:!0})}}).pointer("open");var p=n("#is_singular"),cr=n("#is_single"),lr=n("#is_page"),ar=n("#is_attachment"),vr=n("#is_posttype");p.click(function(){p.is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)});n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!p.is(":checked")||cr.is(":checked")&&lr.is(":checked")&&ar.is(":checked")&&vr.is(":checked")?!p.is(":checked")&&cr.is(":checked")&&vr.is(":checked")&&lr.is(":checked")&&ar.is(":checked")&&p.attr("checked",!0):p.attr("checked",!1)});var w=n("#is_archive"),yr=n("#is_tax"),pr=n("#is_category"),wr=n("#is_tag"),br=n("#is_author"),kr=n("#is_date"),dr=n("#is_posttype_archive"),gr=n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive");return w.click(function(){w.is(":checked")&&gr.attr("checked",!0)}),gr.click(function(){!w.is(":checked")||yr.is(":checked")&&pr.is(":checked")&&dr.is(":checked")&&wr.is(":checked")&&br.is(":checked")&&kr.is(":checked")?!w.is(":checked")&&yr.is(":checked")&&pr.is(":checked")&&dr.is(":checked")&&wr.is(":checked")&&br.is(":checked")&&kr.is(":checked")&&w.attr("checked",!0):w.attr("checked",!1)}),!1})})(jQuery) \ No newline at end of file +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#ad_img",adImgId:"#ad_img_id",adName:"#title",adDesc:"#item_description",adAlt:"#ad_alt",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){function sr(t,i,r,u,f,e){var o=r.val();i.w2grid({name:t,show:{selectColumn:!0},multiSelect:!0,columns:f,url:e,onSelect:function(n){n.onComplete=function(){for(var f,e="",t=this.getSelection(),i,n=0;n<\/div>').appendTo(eu);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),gi=="item"?n("#ad_img").val(i.url+t):gi=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}});n("#adv_nick").combogrid({url:y+"?action=load_combo_data",datatype:"json",munit:"px",alternate:!0,colModel:r.comboGrid,select:function(t,i){return n("#adv_nick").val(i.item.slug),n("#adv_name").val(i.item.title),n("#adv_mail").val(i.item.email),!1}});n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#ad_img").val(t),!1});f("ctt-grid",ri,ou,"slug",r.customTaxes,wt.cTax);f("x-ctt-grid",ui,su,"slug",r.customTaxes,wt.cTax);f("cust-grid",vi,ku,"slug",r.customs,wt.customs);f("x-cust-grid",yi,du,"slug",r.customs,wt.customs);wi=y+"?action=load_posts&cstr="+samEditorOptions.data.custList+"&sp="+gu+"&spg="+nf;sr("posts-grid",fi,hu,"id",r.posts,wi);sr("x-posts-grid",ei,lu,"id",r.posts,wi);n("#tabs").tabs({activate:function(t,i){var r=i.newPanel[0].id;r=="tabs-1"&&w2ui["posts-grid"]&&fi.w2render("posts-grid");r=="tabs-2"&&(lt.is(":visible")&&w2ui["ctt-grid"]&&ri.w2render("ctt-grid"),nt.is(":visible")&&w2ui["x-ctt-grid"]&&ui.w2render("x-ctt-grid"),b.is(":visible")&&w2ui["x-posts-grid"]&&ei.w2render("x-posts-grid"),ct.is(":visible")&&w2ui["cats-grid"]&&oi.w2render("cats-grid"),d.is(":visible")&&w2ui["x-cats-grid"]&&si.w2render("x-cats-grid"),at.is(":visible")&&w2ui["auth-grid"]&&hi.w2render("auth-grid"),it.is(":visible")&&w2ui["x-auth-grid"]&&ci.w2render("x-auth-grid"),vt.is(":visible")&&w2ui["tags-grid"]&&li.w2render("tags-grid"),ut.is(":visible")&&w2ui["x-tags-grid"]&&ai.w2render("x-tags-grid"),yt.is(":visible")&&w2ui["cust-grid"]&&vi.w2render("cust-grid"),et.is(":visible")&&w2ui["xcust-grid"]&&yi.w2render("x-cust-grid"));r=="tabs-3"&&ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid");r=="tabs-5"&&n.plot("#graph",ht,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}});n("#code_mode_false").click(function(){nr.show("blind",{direction:"vertical"},500);tr.hide("blind",{direction:"vertical"},500)});n("#code_mode_true").click(function(){nr.hide("blind",{direction:"vertical"},500);tr.show("blind",{direction:"vertical"},500)});2==n("input:radio[name=view_type]:checked").val()&&(u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)),u.attr("disabled",!0));n("input:radio[name=view_type]").click(function(){var t=n("input:radio[name=view_type]:checked").val();switch(t){case"0":e.is(":hidden")&&e.show("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"1":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":visible")&&o.hide("blind",{direction:"vertical"},500);u.attr("disabled",!1);break;case"2":e.is(":visible")&&e.hide("blind",{direction:"vertical"},500);o.is(":hidden")&&(o.show("blind",{direction:"vertical"},500,function(){w2ui["posts-grid"]&&fi.w2render("posts-grid")}),u.is(":checked")&&(u.attr("checked",!1),b.hide("blind",{direction:"vertical"},500)));u.attr("disabled",!0)}});hr=n.ajax({url:y,data:{action:"load_authors",level:3},type:"POST"});hr.done(function(n){bi=n;f("auth-grid",hi,yu,"slug",r.authors,bi);f("x-auth-grid",ci,pu,"slug",r.authors,bi)});cr=n.ajax({url:y,data:{action:"load_users",subscriber:encodeURI(i.subscriber),contributor:encodeURI(i.contributor),author:encodeURI(i.author),editor:encodeURI(i.editor),admin:encodeURI(i.admin),sadmin:encodeURI(i.superAdmin)},type:"POST"});cr.done(function(n){lr=n;f("users-grid",st,cu,"slug",r.users,lr)});ar=n.ajax({url:y,data:{action:"load_cats",level:3},type:"POST"});ar.done(function(n){ki=n;f("cats-grid",oi,au,"slug",r.cats,ki);f("x-cats-grid",si,vu,"slug",r.cats,ki)});vr=n.ajax({url:y,data:{action:"load_tags",level:3},type:"POST"});vr.done(function(n){di=n;f("tags-grid",li,wu,"slug",r.tags,di);f("x-tags-grid",ai,bu,"slug",r.tags,di)});u.click(function(){u.is(":checked")?2==n("input:radio[name=view_type]:checked").val()?u.attr("checked",!1):b.show("blind",{direction:"vertical"},500,function(){w2ui["x-posts-grid"]&&ei.w2render("x-posts-grid")}):b.hide("blind",{direction:"vertical"},500)});n("input:radio[name=ad_users]").click(function(){var t=n("input:radio[name=ad_users]:checked").val();t=="0"?pt.is(":visible")&&pt.hide("blind",{direction:"vertical"},500):pt.is(":hidden")&&pt.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")})});ir.click(function(){ir.is(":checked")?rr.show("blind",{direction:"vertical"},500,function(){ot.is(":visible")&&w2ui["users-grid"]&&st.w2render("users-grid")}):rr.hide("blind",{direction:"vertical"},500)});ur.click(function(){ur.is(":checked")?ot.show("blind",{direction:"vertical"},500,function(){w2ui["users-grid"]&&st.w2render("users-grid")}):ot.hide("blind",{direction:"vertical"},500)});n("#ad_swf").click(function(){n("#ad_swf").is(":checked")?n("#swf-params").show("blind",{direction:"vertical"},500):n("#swf-params").hide("blind",{direction:"vertical"},500)});k.is(":checked")&&s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500));k.click(function(){k.is(":checked")?(ct.show("blind",{direction:"vertical"},500,function(){w2ui["cats-grid"]&&oi.w2render("cats-grid")}),kt.show("blind",{direction:"vertical"},500),s.is(":checked")&&(s.attr("checked",!1),d.hide("blind",{direction:"vertical"},500))):(ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))});s.click(function(){s.is(":checked")?(d.show("blind",{direction:"vertical"},500,function(){w2ui["x-cats-grid"]&&si.w2render("x-cats-grid")}),k.is(":checked")&&(k.attr("checked",!1),ct.hide("blind",{direction:"vertical"},500),kt.hide("blind",{direction:"vertical"},500))):d.hide("blind",{direction:"vertical"},500)});g.is(":checked")&&h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500));g.click(function(){g.is(":checked")?(lt.show("blind",{direction:"vertical"},500,function(){w2ui["ctt-grid"]&&ri.w2render("ctt-grid")}),dt.show("blind",{direction:"vertical"},500),h.is(":checked")&&(h.attr("checked",!1),nt.hide("blind",{direction:"vertical"},500))):(lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))});h.click(function(){h.is(":checked")?(nt.show("blind",{direction:"vertical"},500,function(){w2ui["x-ctt-grid"]&&ui.w2render("x-ctt-grid")}),g.is(":checked")&&(g.attr("checked",!1),lt.hide("blind",{direction:"vertical"},500),dt.hide("blind",{direction:"vertical"},500))):nt.hide("blind",{direction:"vertical"},500)});tt.is(":checked")&&c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500));tt.click(function(){tt.is(":checked")?(at.show("blind",{direction:"vertical"},500,function(){w2ui["auth-grid"]&&hi.w2render("auth-grid")}),gt.show("blind",{direction:"vertical"},500),c.is(":checked")&&(c.attr("checked",!1),it.hide("blind",{direction:"vertical"},500))):(at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))});c.click(function(){c.is(":checked")?(it.show("blind",{direction:"vertical"},500,function(){w2ui["x-auth-grid"]&&ci.w2render("x-auth-grid")}),tt.is(":checked")&&(tt.attr("checked",!1),at.hide("blind",{direction:"vertical"},500),gt.hide("blind",{direction:"vertical"},500))):it.hide("blind",{direction:"vertical"},500)});rt.is(":checked")&&l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500));rt.click(function(){rt.is(":checked")?(vt.show("blind",{direction:"vertical"},500,function(){w2ui["tags-grid"]&&li.w2render("tags-grid")}),ni.show("blind",{direction:"vertical"},500),l.is(":checked")&&(l.attr("checked",!1),ut.hide("blind",{direction:"vertical"},500))):(vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))});l.click(function(){l.is(":checked")?(ut.show("blind",{direction:"vertical"},500,function(){w2ui["x-tags-grid"]&&ai.w2render("x-tags-grid")}),rt.is(":checked")&&(rt.attr("checked",!1),vt.hide("blind",{direction:"vertical"},500),ni.hide("blind",{direction:"vertical"},500))):ut.hide("blind",{direction:"vertical"},500)});ft.is(":checked")&&a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500));ft.click(function(){ft.is(":checked")?(yt.show("blind",{direction:"vertical"},500,function(){w2ui["cust-grid"]&&vi.w2render("cust-grid")}),ti.show("blind",{direction:"vertical"},500),a.is(":checked")&&(a.attr("checked",!1),et.hide("blind",{direction:"vertical"},500))):(yt.hide("blind",{direction:"vertical"},500),ti.hide("blind",{direction:"vertical"},500))});a.click(function(){a.is(":checked")?(et.show("blind",{direction:"vertical"},500,function(){w2ui["x-cust-grid"]&&yi.w2render("x-cust-grid")}),ft.is(":checked")&&(ft.attr("checked",!1),yt.hide("blind",{direction:"vertical"},500),ti.hide("blind",{direction:"vertical"},500))):et.hide("blind",{direction:"vertical"},500)});n("#ad_start_date, #ad_end_date").datepicker({dateFormat:"yy-mm-dd",showButtonPanel:!0});n("#ad_schedule").click(function(){n("#ad_schedule").is(":checked")?n("#rc-sc").show("blind",{direction:"vertical"},500):n("#rc-sc").hide("blind",{direction:"vertical"},500)});n("#limit_hits").click(function(){n("#limit_hits").is(":checked")?n("#rc-hl").show("blind",{direction:"vertical"},500):n("#rc-hl").hide("blind",{direction:"vertical"},500)});n("#limit_clicks").click(function(){n("#limit_clicks").is(":checked")?n("#rc-cl").show("blind",{direction:"vertical"},500):n("#rc-cl").hide("blind",{direction:"vertical"},500)});v=samEditorOptions.ads;v.pointer="ads";(v.enabled||""==bt.val())&&bt.pointer({content:"

        "+v.title+"<\/h3>

        "+v.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:v.pointer},async:!0})}}).pointer("open");var p=n("#is_singular"),yr=n("#is_single"),pr=n("#is_page"),wr=n("#is_attachment"),br=n("#is_posttype");p.click(function(){p.is(":checked")&&n("#is_single, #is_page, #is_attachment, #is_posttype").attr("checked",!0)});n("#is_single, #is_page, #is_attachment, #is_posttype").click(function(){!p.is(":checked")||yr.is(":checked")&&pr.is(":checked")&&wr.is(":checked")&&br.is(":checked")?!p.is(":checked")&&yr.is(":checked")&&br.is(":checked")&&pr.is(":checked")&&wr.is(":checked")&&p.attr("checked",!0):p.attr("checked",!1)});var w=n("#is_archive"),kr=n("#is_tax"),dr=n("#is_category"),gr=n("#is_tag"),nu=n("#is_author"),tu=n("#is_date"),iu=n("#is_posttype_archive"),ru=n("#is_tax, #is_category, #is_tag, #is_author, #is_date, #is_posttype_archive");return w.click(function(){w.is(":checked")&&ru.attr("checked",!0)}),ru.click(function(){!w.is(":checked")||kr.is(":checked")&&dr.is(":checked")&&iu.is(":checked")&&gr.is(":checked")&&nu.is(":checked")&&tu.is(":checked")?!w.is(":checked")&&kr.is(":checked")&&dr.is(":checked")&&iu.is(":checked")&&gr.is(":checked")&&nu.is(":checked")&&tu.is(":checked")&&w.attr("checked",!0):w.attr("checked",!1)}),n("#stats_month").change(function(){pi=n(this).val();n.post(er,{action:"load_item_stats",id:or,sm:pi}).done(function(t){var r={label:i.labels.hits,data:t.hits},u={label:i.labels.clicks,data:t.clicks};ht=[r,u];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",ht,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})})}),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-admin-edit-place.js b/js/sam-admin-edit-place.js index 8b6b081..3768e76 100644 --- a/js/sam-admin-edit-place.js +++ b/js/sam-admin-edit-place.js @@ -68,11 +68,15 @@ var sam = sam || {}; rcpsi = $('#rc-psi'), rcpsc = $('#rc-psc'), rcpsd = $('#rc-psd'), title = $("#title"); var + itemId = $('#place_id').val(), btnUpload = $("#upload-file-button"), status = $("#uploading"), srcHelp = $("#uploading-help"), loadImg = $('#load_img'), - sPointer, + sPointer, statsData, sMonth = 0, + grid = $('#ads-grid'), + samStatsUrl = samEditorOptions.samStatsUrl, + labels = samEditorOptions.labels, fileExt = ''; sPointer = samEditorOptions.places; @@ -86,12 +90,7 @@ var sam = sam || {}; track: true }); - var options = samEditorOptions.options/*$.parseJSON($.ajax({ - url:ajaxurl, - data:{action:'get_strings'}, - async:false, - dataType:'jsonp' - }).responseText)*/; + var options = samEditorOptions.options; fu = new AjaxUpload(btnUpload, { action:ajaxurl, @@ -99,7 +98,7 @@ var sam = sam || {}; data:{ action:'upload_ad_image' }, - onSubmit:function (file, ext) { + onSubmit: function (file, ext) { if (!(ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext))) { status.text(options.status); return false; @@ -132,8 +131,81 @@ var sam = sam || {}; } }); + $.post(samStatsUrl, { + action: 'load_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: labels.hits, data: data.hits}, + clicks = {label: labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + + $('#tabs').tabs({ + activate: function(ev, ui) { + var el = ui.newPanel[0].id; + if(el == 'tabs-3') { + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + } + } + }); $('#image_tools').tabs(); + $.post(samStatsUrl, { + action: 'load_ads', + id: itemId, + sm: 0 + }).done(function(data) { + var records = data.records; + grid.w2grid({ + name: 'ads', + show: {selectColumn: false}, + multiSelect: false, + columns: samEditorOptions.columns, + records: records + }); + }); + /*var url = samStatsUrl + '?action=load_ads&id=' + itemId + '&sm=0'; + grid.w2render('ads-grid');*/ + $("#add-file-button").click(function () { var curFile = options.url + $("select#files_list option:selected").val(); $("#patch_img").val(curFile); @@ -175,6 +247,40 @@ var sam = sam || {}; }).pointer('open'); } + $('#stats_month').change(function() { + sMonth = $(this).val(); + $.post(samStatsUrl, { + action: 'load_stats', + id: itemId, + sm: sMonth + }).done(function(data) { + var + hits = {label: labels.hits, data: data.hits}, + clicks = {label: labels.clicks, data: data.clicks}; + statsData = [hits, clicks]; + $('#total_hits').text(data.total.hits); + $('#total_clicks').text(data.total.clicks); + $.plot('#graph', statsData, { + series: { + lines: { show: true }, + points: { show: true } + }, + xaxis: { + mode: "categories", + tickLength: 0 + }, + legend: { + backgroundColor: 'rgb(235, 233, 233)' + }, + grid: { + backgroundColor: { colors: ["#FFFFFF", "#DDDDDD"] }, + borderWidth: 1, + borderColor: '#DFDFDF' + } + }); + }); + }); + return false; }); })(jQuery); \ No newline at end of file diff --git a/js/sam-admin-edit-place.min.js b/js/sam-admin-edit-place.min.js index e7edcc2..fb2bc06 100644 --- a/js/sam-admin-edit-place.min.js +++ b/js/sam-admin-edit-place.min.js @@ -1 +1 @@ -var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#patch_img",adImgId:"#patch_img_id",adName:"#title",adDesc:"#description",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){var s=n("#editor_mode").val(),l,r=n("#rc-psi"),u=n("#rc-psc"),f=n("#rc-psd"),h=n("#title"),a=n("#upload-file-button"),o=n("#uploading"),v=n("#uploading-help"),c=n("#load_img"),e,i;return e=samEditorOptions.places,e.pointer="places",t.init(),h.tooltip({track:!0}),i=samEditorOptions.options,l=new AjaxUpload(a,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,t){if(!(t&&/^(jpg|png|jpeg|gif|swf)$/.test(t)))return o.text(i.status),!1;c.show();o.text(i.uploading)},onComplete:function(t,r){o.text("");c.hide();n('

        <\/div>').appendTo(v);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),s=="item"?n("#ad_img").val(i.url+t):s=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}}),n("#image_tools").tabs(),n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#patch_img").val(t),!1}),n("#patch_source_image").click(function(){r.is(":hidden")&&r.show("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_code").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":hidden")&&u.show("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_dfp").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":hidden")&&f.show("blind",{direction:"vertical"},500)}),(e.enabled||""==h.val())&&n("#title").pointer({content:"

        "+e.title+"<\/h3>

        "+e.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:e.pointer},async:!0})}}).pointer("open"),!1})})(jQuery) \ No newline at end of file +var sam=sam||{};(function(n){var t,i=samEditorOptions.media;sam.media=t={buttonId:"#banner-media",adUrl:"#patch_img",adImgId:"#patch_img_id",adName:"#title",adDesc:"#description",init:function(){n(this.buttonId).on("click",this.openMediaDialog)},openMediaDialog:function(n){if(n.preventDefault(),this._frame){this._frame.open();return}var r=wp.media.model.Attachment;this._frame=t.frame=wp.media({title:i.title,button:{text:i.button},multiple:!1,library:{type:"image"}});this._frame.on("ready",function(){});this._frame.state("library").on("select",function(){var n=this.get("selection").single();t.handleMediaAttachment(n)});this._frame.open()},handleMediaAttachment:function(t){var i=t.toJSON();n(this.adUrl).val(i.url);n(this.adImgId).val(i.id);""==n(this.adName).val()&&""!=i.title&&n(this.adName).val(i.title);""==n(this.adDesc).val()&&""!=i.caption&&n(this.adDesc).val(i.caption);""==n(this.adAlt).val()&&""!=i.alt&&n(this.adAlt).val(i.alt)}};n(document).ready(function(){var v=n("#editor_mode").val(),w,r=n("#rc-psi"),u=n("#rc-psc"),f=n("#rc-psd"),y=n("#title"),h=n("#place_id").val(),b=n("#upload-file-button"),c=n("#uploading"),k=n("#uploading-help"),p=n("#load_img"),e,o,l=0,d=n("#ads-grid"),a=samEditorOptions.samStatsUrl,s=samEditorOptions.labels,i;return e=samEditorOptions.places,e.pointer="places",t.init(),y.tooltip({track:!0}),i=samEditorOptions.options,w=new AjaxUpload(b,{action:ajaxurl,name:"uploadfile",data:{action:"upload_ad_image"},onSubmit:function(n,t){if(!(t&&/^(jpg|png|jpeg|gif|swf)$/.test(t)))return c.text(i.status),!1;p.show();c.text(i.uploading)},onComplete:function(t,r){c.text("");p.hide();n('

        <\/div>').appendTo(k);r=="success"?(n("#files").text(i.file+" "+t+" "+i.uploaded).addClass("updated").delay(3e3).fadeOut(1e3,function(){n(this).remove()}),v=="item"?n("#ad_img").val(i.url+t):v=="place"&&n("#patch_img").val(i.url+t)):n("#files").text(t+" "+r).addClass("error").delay(3e3).fadeOut(1e3,function(){n(this).remove()})}}),n.post(a,{action:"load_stats",id:h,sm:l}).done(function(t){var i={label:s.hits,data:t.hits},r={label:s.clicks,data:t.clicks};o=[i,r];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}),n("#tabs").tabs({activate:function(t,i){var r=i.newPanel[0].id;r=="tabs-3"&&n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})}}),n("#image_tools").tabs(),n.post(a,{action:"load_ads",id:h,sm:0}).done(function(n){var t=n.records;d.w2grid({name:"ads",show:{selectColumn:!1},multiSelect:!1,columns:samEditorOptions.columns,records:t})}),n("#add-file-button").click(function(){var t=i.url+n("select#files_list option:selected").val();return n("#patch_img").val(t),!1}),n("#patch_source_image").click(function(){r.is(":hidden")&&r.show("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_code").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":hidden")&&u.show("blind",{direction:"vertical"},500);f.is(":visible")&&f.hide("blind",{direction:"vertical"},500)}),n("#patch_source_dfp").click(function(){r.is(":visible")&&r.hide("blind",{direction:"vertical"},500);u.is(":visible")&&u.hide("blind",{direction:"vertical"},500);f.is(":hidden")&&f.show("blind",{direction:"vertical"},500)}),(e.enabled||""==y.val())&&n("#title").pointer({content:"

        "+e.title+"<\/h3>

        "+e.content+"<\/p>",position:"top",close:function(){n.ajax({url:ajaxurl,data:{action:"close_pointer",pointer:e.pointer},async:!0})}}).pointer("open"),n("#stats_month").change(function(){l=n(this).val();n.post(a,{action:"load_stats",id:h,sm:l}).done(function(t){var i={label:s.hits,data:t.hits},r={label:s.clicks,data:t.clicks};o=[i,r];n("#total_hits").text(t.total.hits);n("#total_clicks").text(t.total.clicks);n.plot("#graph",o,{series:{lines:{show:!0},points:{show:!0}},xaxis:{mode:"categories",tickLength:0},legend:{backgroundColor:"rgb(235, 233, 233)"},grid:{backgroundColor:{colors:["#FFFFFF","#DDDDDD"]},borderWidth:1,borderColor:"#DFDFDF"}})})}),!1})})(jQuery) \ No newline at end of file diff --git a/js/sam-layout.js b/js/sam-layout.js index 9531403..91bb43e 100644 --- a/js/sam-layout.js +++ b/js/sam-layout.js @@ -33,6 +33,7 @@ $.post(samAjax.ajaxurl, { action: 'sam_click', id: data.id, + pid: data.pid, level: samAjax.level }); }); diff --git a/js/sam-layout.min.js b/js/sam-layout.min.js index 71caf9a..305e120 100644 --- a/js/sam-layout.min.js +++ b/js/sam-layout.min.js @@ -1 +1 @@ -(function(n){n(document).ready(function(){samAjax.load?(n("div.sam-place").each(function(t,i){var r=n(i).data("sam");"undefined"==typeof r&&(r=0);var u=this.id.split("_"),f=u[1],e=u[2];n.ajax({url:samAjax.loadurl,data:{action:"load_place",id:f,pid:e,codes:r,wc:samAjax.clauses,level:samAjax.level},type:"POST",crossDomain:!0}).done(function(t){n(i).replaceWith(t.ad);n.post(samAjax.ajaxurl,{action:"sam_hit",id:t.id,pid:t.pid,level:samAjax.level});n("#"+t.cid).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:t.id,level:samAjax.level})})})}),n("div.sam-ad").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})):n("div.sam-container").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})})})(jQuery) \ No newline at end of file +(function(n){n(document).ready(function(){samAjax.load?(n("div.sam-place").each(function(t,i){var r=n(i).data("sam");"undefined"==typeof r&&(r=0);var u=this.id.split("_"),f=u[1],e=u[2];n.ajax({url:samAjax.loadurl,data:{action:"load_place",id:f,pid:e,codes:r,wc:samAjax.clauses,level:samAjax.level},type:"POST",crossDomain:!0}).done(function(t){n(i).replaceWith(t.ad);n.post(samAjax.ajaxurl,{action:"sam_hit",id:t.id,pid:t.pid,level:samAjax.level});n("#"+t.cid).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:t.id,pid:t.pid,level:samAjax.level})})})}),n("div.sam-ad").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})):n("div.sam-container").each(function(t,i){var r=this.id.split("_"),u=r[1],f=r[2];n.post(samAjax.ajaxurl,{action:"sam_hit",id:u,pid:f,level:samAjax.level});n(i).find("a").bind("click",function(){n.post(samAjax.ajaxurl,{action:"sam_click",id:u,pid:f,level:samAjax.level})})})})})(jQuery) \ No newline at end of file diff --git a/langs/simple-ads-manager-ru_RU.mo b/langs/simple-ads-manager-ru_RU.mo index cba9c00ca993cd2a8264f5ef1871a67f0c02d522..d8a55db80e972eb3407f2dc9167b6e3fe7769044 100644 GIT binary patch delta 13967 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 delta 12464 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 diff --git a/langs/simple-ads-manager-ru_RU.po b/langs/simple-ads-manager-ru_RU.po index 3dfdba0..bfa44c3 100644 --- a/langs/simple-ads-manager-ru_RU.po +++ b/langs/simple-ads-manager-ru_RU.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Simple Ads Manager\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-08 22:16+0300\n" +"POT-Creation-Date: 2013-12-22 21:49+0300\n" "PO-Revision-Date: \n" "Last-Translator: minimus \n" "Language-Team: minimus \n" @@ -19,7 +19,7 @@ msgstr "" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" "_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" "X-Poedit-Basepath: .\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.6.3\n" "X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-1: ..\n" @@ -27,147 +27,151 @@ msgstr "" msgid "Flash ad" msgstr "Флеш объявление" -#: ../ad.class.php:201 +#: ../ad.class.php:208 msgid "Empty data..." msgstr "Нет данных ..." -#: ../admin.class.php:126 +#: ../admin.class.php:148 msgid "Active W3 Total Cache plugin detected." msgstr "Обнаружен активный плагин W3 Total Cache." -#: ../admin.class.php:127 +#: ../admin.class.php:149 msgid "Active WP Super Cache plugin detected." msgstr "Обнаружен активный плагин WP Super Cache." -#: ../admin.class.php:142 +#: ../admin.class.php:154 +msgid "Active bbPress Forum plugin detected." +msgstr "Обнаружен активный плагин bbPress." + +#: ../admin.class.php:173 msgid "Cache of WP Super Cache plugin is flushed." msgstr "Кэш плагина WP Super Cache обновлён." -#: ../admin.class.php:146 +#: ../admin.class.php:177 msgid "Cache of W3 Total Cache plugin is flushed." msgstr "Кэш плагина W3 Total Cache обновлён." -#: ../admin.class.php:348 ../editor.admin.class.php:1424 +#: ../admin.class.php:396 ../editor.admin.class.php:1485 msgid "Advertiser Name" msgstr "Имя рекламодателя" -#: ../admin.class.php:349 +#: ../admin.class.php:397 msgid "Advertiser Nick" msgstr "Ник рекламодателя" -#: ../admin.class.php:350 ../editor.admin.class.php:1428 +#: ../admin.class.php:398 ../editor.admin.class.php:1489 msgid "Advertiser e-mail" msgstr "e-mail рекламодателя" -#: ../admin.class.php:354 +#: ../admin.class.php:402 msgid "Category Title" msgstr "Наименование рубрики" -#: ../admin.class.php:355 +#: ../admin.class.php:403 msgid "Category Slug" msgstr "Ярлык рубрики" -#: ../admin.class.php:359 ../admin.class.php:378 +#: ../admin.class.php:407 ../admin.class.php:426 msgid "Display Name" msgstr "Показываемое имя" -#: ../admin.class.php:360 ../admin.class.php:379 +#: ../admin.class.php:408 ../admin.class.php:427 msgid "User Name" msgstr "Имя пользователя" -#: ../admin.class.php:364 +#: ../admin.class.php:412 msgid "Tag Title" msgstr "Название метки" -#: ../admin.class.php:365 +#: ../admin.class.php:413 msgid "Tag Slug" msgstr "Ярлык метки" -#: ../admin.class.php:368 +#: ../admin.class.php:416 msgid "Custom Type Title" msgstr "Заголовок пользовательского типа" -#: ../admin.class.php:369 +#: ../admin.class.php:417 msgid "Custom Type Slug" msgstr "Ярлык пользовательского типа" -#: ../admin.class.php:373 +#: ../admin.class.php:421 msgid "Publication Title" msgstr "Заголовок публикации" -#: ../admin.class.php:374 +#: ../admin.class.php:422 msgid "Publication Type" msgstr "Тип публикации" -#: ../admin.class.php:380 +#: ../admin.class.php:428 msgid "Role" msgstr "Роль" -#: ../admin.class.php:383 ../block.list.admin.class.php:88 +#: ../admin.class.php:431 ../block.list.admin.class.php:88 #: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 -#: ../errorlog.admin.class.php:93 ../list.admin.class.php:172 -#: ../list.admin.class.php:183 ../list.admin.class.php:359 -#: ../list.admin.class.php:369 ../zone.list.admin.class.php:88 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 +#: ../list.admin.class.php:184 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 ../zone.list.admin.class.php:88 #: ../zone.list.admin.class.php:94 msgid "ID" msgstr "ID" -#: ../admin.class.php:384 +#: ../admin.class.php:432 msgid "Term Name" msgstr "Имя термина" -#: ../admin.class.php:385 +#: ../admin.class.php:433 msgid "Custom Taxonomy Name" msgstr "Имя пользовательской таксономии" -#: ../admin.class.php:391 +#: ../admin.class.php:439 msgid "Full Size" msgstr "Полный размер" -#: ../admin.class.php:445 +#: ../admin.class.php:493 msgid "General Settings" msgstr "Основные параметры" -#: ../admin.class.php:446 +#: ../admin.class.php:494 msgid "Auto Inserting Settings" msgstr "Параметры автовставки" -#: ../admin.class.php:447 +#: ../admin.class.php:495 msgid "Extended Options" msgstr "Дополнительные параметры" -#: ../admin.class.php:448 +#: ../admin.class.php:496 msgid "Google DFP Settings" msgstr "Параметры Google DFP" -#: ../admin.class.php:449 ../help.class.php:68 ../help.class.php:195 +#: ../admin.class.php:497 ../help.class.php:68 ../help.class.php:195 msgid "Statistics Settings" msgstr "Параметры статистики" -#: ../admin.class.php:450 +#: ../admin.class.php:498 msgid "Admin Layout" msgstr "Параметры административных страниц" -#: ../admin.class.php:451 +#: ../admin.class.php:499 msgid "Plugin Deactivating" msgstr "Деактивация плагина" -#: ../admin.class.php:453 +#: ../admin.class.php:501 msgid "Views per Cycle" msgstr "Показов в цикле" -#: ../admin.class.php:453 +#: ../admin.class.php:501 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" "Количество показов одного рекламного объявления за полный цикл ротации при " "максимальной активности (см. \"вес объявления\")." -#: ../admin.class.php:454 +#: ../admin.class.php:502 msgid "Minimum Level for access to menu" msgstr "Минимальный уровень для доступа к меню" -#: ../admin.class.php:454 +#: ../admin.class.php:502 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " @@ -177,31 +181,31 @@ msgstr "" "необходимый для доступа к меню плагина. В любом случае, доступ к меню " "настроек плагина имеют только Администратор и Супер Администратор." -#: ../admin.class.php:454 ../admin.class.php:559 ../admin.class.php:678 +#: ../admin.class.php:502 ../admin.class.php:619 ../admin.class.php:760 msgid "Super Admin" msgstr "Супер Админ" -#: ../admin.class.php:454 ../admin.class.php:560 ../admin.class.php:677 +#: ../admin.class.php:502 ../admin.class.php:620 ../admin.class.php:759 msgid "Administrator" msgstr "Администратор" -#: ../admin.class.php:454 ../admin.class.php:561 ../admin.class.php:676 +#: ../admin.class.php:502 ../admin.class.php:621 ../admin.class.php:758 msgid "Editor" msgstr "Редактор" -#: ../admin.class.php:454 ../admin.class.php:562 ../admin.class.php:675 +#: ../admin.class.php:502 ../admin.class.php:622 ../admin.class.php:757 msgid "Author" msgstr "Автор" -#: ../admin.class.php:454 ../admin.class.php:563 ../admin.class.php:674 +#: ../admin.class.php:502 ../admin.class.php:623 ../admin.class.php:756 msgid "Contributor" msgstr "Участник" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Ad Output Mode" msgstr "Режим вывода объявления" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "" "Standard (PHP) mode is more faster but is not compatible with caching " "plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " @@ -217,67 +221,101 @@ msgstr "" "плагинов. Режим Javascript неплохо решает проблему совместной работы с " "плагинами кэширования." -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Standard (PHP)" msgstr "Стандартный (PHP)" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Caching Compatible (Javascript)" msgstr "Совместимость с кэшированием (Javascript)" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Display Ad Source in" msgstr "Открывать ссылку в" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Target wintow (tab) for advetisement source." msgstr "Открытие окна (вкладки) для рекламного объявления." -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "New Window (Tab)" msgstr "Новое окно (вкладка)" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Current Window (Tab)" msgstr "Текущее окно (вкладка)" -#: ../admin.class.php:458 +#: ../admin.class.php:505 +msgid "Allow displaying ads on bbPress forum pages" +msgstr "Разрешить показ объявленийна страницах форумов bbPress" + +#: ../admin.class.php:507 msgid "Ads Place before content" msgstr "Рекламное место до контента" -#: ../admin.class.php:459 +#: ../admin.class.php:508 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места перед контентом статьи/" "страницы" -#: ../admin.class.php:460 ../admin.class.php:463 ../admin.class.php:466 +#: ../admin.class.php:509 +msgid "Allow Ads Place auto inserting before post/page excerpt (in the loop)" +msgstr "" +"Разрешить автоматическую вставку рекламного места перед анонсом (в цикле)" + +#: ../admin.class.php:510 +msgid "Allow Ads Place auto inserting before bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места перед контентом форумов " +"bbPress" + +#: ../admin.class.php:511 +msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" +msgstr "" +"Разрешить автоматическую вставку рекламного места в на страницах списков " +"форумов/топиков bbPress" + +#: ../admin.class.php:512 ../admin.class.php:516 ../admin.class.php:520 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" "Использовать заранее заданные коды рекламного места (коды рекламного места " "\"до\" и \"после\")" -#: ../admin.class.php:461 +#: ../admin.class.php:513 msgid "Ads Place in the middle of content" msgstr "Рекламное место в средней части контента" -#: ../admin.class.php:462 +#: ../admin.class.php:514 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места в середину контента статьи/" "страницы" -#: ../admin.class.php:464 +#: ../admin.class.php:515 +msgid "" +"Allow Ads Place auto inserting into the middle of bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места в середину контента топика " +"форумов bbPress" + +#: ../admin.class.php:517 msgid "Ads Place after content" msgstr "Рекламное место после контента" -#: ../admin.class.php:465 +#: ../admin.class.php:518 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места после контента статьи/" "страницы" -#: ../admin.class.php:468 +#: ../admin.class.php:519 +msgid "Allow Ads Place auto inserting after bbPress Forum topic content" +msgstr "" +"Разрешить автоматическую вставку рекламного места после контента топика " +"форумов bbPress" + +#: ../admin.class.php:522 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." @@ -285,35 +323,35 @@ msgstr "" "Я использую (планирую использовать) мои собственные флеш (SWF) баннеры. " "Другими словами, разрешить загрузку скрипта \"SWFObject\" на страницах блога." -#: ../admin.class.php:469 +#: ../admin.class.php:523 msgid "Turn on/off the error log." msgstr "Включить/выключить журнал ошибок." -#: ../admin.class.php:470 +#: ../admin.class.php:524 msgid "Turn on/off the error log for Face Side." msgstr "Включить/выключить журнал ошибок для Face Side." -#: ../admin.class.php:472 +#: ../admin.class.php:526 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "Разрешить использование кодов Google DoubleClick for Publishers (DFP)" -#: ../admin.class.php:473 +#: ../admin.class.php:527 msgid "Google DFP Pub Code" msgstr "Pub-код Google DFP" -#: ../admin.class.php:473 +#: ../admin.class.php:527 msgid "Your Google DFP Pub code. i.e:" msgstr "Ваш pub-код Google DFP. Например:" -#: ../admin.class.php:475 +#: ../admin.class.php:529 msgid "Allow Bots and Crawlers detection" msgstr "Разрешить обнаружение ботов и сканеров" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Accuracy of Bots and Crawlers Detection" msgstr "Точность обнаружения ботов и сканеров" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." @@ -321,23 +359,23 @@ msgstr "" "Если обнаружен бот, показы объявлений не будут защитаны. Используйте с " "осторожностью! Чем точнее определение, тем больше ресурсов сервера требуется." -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Inexact detection" msgstr "Неточное определение" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Exact detection" msgstr "Точное определение" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "More exact detection" msgstr "Более точное определение" -#: ../admin.class.php:477 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "Показ валюты" -#: ../admin.class.php:477 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." @@ -346,23 +384,23 @@ msgstr "" "валюты из параметров настройки блога. Доллары США, Евро - принудительное " "отображение валюты в долларах США или евро." -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "Auto" msgstr "Автоопределение" -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "USD" msgstr "Доллары США" -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "EUR" msgstr "Евро" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "TinyMCE Editor Button Mode" msgstr "Режим кнопки плагина в редакторе TinyMCE" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " @@ -373,19 +411,19 @@ msgstr "" "можете использовать классические кнопки TinyMCE. В этом случае выберите " "\"Классические кнопки TinyMCE\"." -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "Modern TinyMCE Button" msgstr "Современная кнопка TinyMCE" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "Classic TinyMCE Buttons" msgstr "Классические кнопки TinyMCE" -#: ../admin.class.php:480 +#: ../admin.class.php:534 msgid "Ads Places per Page" msgstr "Рекламных мест на страницу" -#: ../admin.class.php:480 +#: ../admin.class.php:534 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." @@ -393,11 +431,11 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных мест. Сколько " "рекламных мест будет показано в таблице на одной странице." -#: ../admin.class.php:481 +#: ../admin.class.php:535 msgid "Ads per Page" msgstr "Объявлений на страницу" -#: ../admin.class.php:481 +#: ../admin.class.php:535 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." @@ -405,92 +443,92 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных объявлений. Сколько " "рекламных объявлений будет показано в таблице на одной странице." -#: ../admin.class.php:483 +#: ../admin.class.php:537 msgid "Delete plugin options during deactivating plugin" msgstr "Удалить параметры плагина при деактивации" -#: ../admin.class.php:484 +#: ../admin.class.php:538 msgid "Delete database tables of plugin during deactivating plugin" msgstr "Удалить таблицы базы данных плагина во время деактивации" -#: ../admin.class.php:485 +#: ../admin.class.php:539 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" "Удалить папку пользовательских изображений плагина во время деактивации" -#: ../admin.class.php:493 +#: ../admin.class.php:547 msgid "Ads" msgstr "Реклама" -#: ../admin.class.php:494 +#: ../admin.class.php:548 msgid "Ads List" msgstr "Список рекламных объявлений" -#: ../admin.class.php:494 +#: ../admin.class.php:548 msgid "Ads Places" msgstr "Рекламные места" -#: ../admin.class.php:495 +#: ../admin.class.php:549 msgid "Ad Editor" msgstr "Редактор рекламного объявления" -#: ../admin.class.php:495 +#: ../admin.class.php:549 msgid "New Place" msgstr "Новое место" -#: ../admin.class.php:496 +#: ../admin.class.php:550 msgid "Ads Zones List" msgstr "Список зон рекламных объявлений" -#: ../admin.class.php:496 +#: ../admin.class.php:550 msgid "Ads Zones" msgstr "Рекламные зоны" -#: ../admin.class.php:497 +#: ../admin.class.php:551 msgid "Ads Zone Editor" msgstr "Редактор рекламной зоны" -#: ../admin.class.php:497 +#: ../admin.class.php:551 msgid "New Zone" msgstr "Новая зона" -#: ../admin.class.php:498 +#: ../admin.class.php:552 msgid "Ads Blocks List" msgstr "Список блоков рекламных объявлений" -#: ../admin.class.php:498 +#: ../admin.class.php:552 msgid "Ads Blocks" msgstr "Рекламные блоки" -#: ../admin.class.php:499 ../block.editor.admin.class.php:402 +#: ../admin.class.php:553 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "Редактор рекламного блока" -#: ../admin.class.php:499 +#: ../admin.class.php:553 msgid "New Block" msgstr "Новый блок" -#: ../admin.class.php:500 ../admin.class.php:999 +#: ../admin.class.php:554 ../admin.class.php:1087 msgid "Simple Ads Manager Settings" msgstr "Параметры Simple Ads Manager" -#: ../admin.class.php:500 +#: ../admin.class.php:554 msgid "Settings" msgstr "Параметры" -#: ../admin.class.php:501 +#: ../admin.class.php:555 msgid "Simple Ads Manager Error Log" msgstr "Журнал ошибок Simple Ads Manager" -#: ../admin.class.php:501 ../errorlog.admin.class.php:57 +#: ../admin.class.php:555 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "Журнал ошибок" -#: ../admin.class.php:601 ../admin.class.php:658 ../editor.admin.class.php:446 +#: ../admin.class.php:667 ../admin.class.php:739 ../editor.admin.class.php:460 msgid "Name of Ads Place" msgstr "Имя рекламного места" -#: ../admin.class.php:601 ../admin.class.php:658 +#: ../admin.class.php:667 ../admin.class.php:739 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." @@ -499,11 +537,11 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений, виджеты плагина " "или автовставку объявлений." -#: ../admin.class.php:602 ../admin.class.php:659 ../editor.admin.class.php:932 +#: ../admin.class.php:668 ../admin.class.php:740 ../editor.admin.class.php:986 msgid "Name of Ad" msgstr "Имя рекламного объявления" -#: ../admin.class.php:602 ../admin.class.php:659 ../admin.class.php:705 +#: ../admin.class.php:668 ../admin.class.php:740 ../admin.class.php:788 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." @@ -512,51 +550,73 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений или виджеты " "плагина." -#: ../admin.class.php:603 ../admin.class.php:660 +#: ../admin.class.php:669 ../admin.class.php:741 msgid "Select Banner Image" msgstr "Выбор изображения баннера" -#: ../admin.class.php:603 ../admin.class.php:660 +#: ../admin.class.php:669 ../admin.class.php:741 msgid "Select" msgstr "Выбрать" -#: ../admin.class.php:605 ../admin.class.php:665 +#: ../admin.class.php:673 ../admin.class.php:747 msgid "Uploading" msgstr "Загружается" -#: ../admin.class.php:606 ../admin.class.php:666 +#: ../admin.class.php:674 ../admin.class.php:748 msgid "Uploaded." msgstr "загружен." -#: ../admin.class.php:607 ../admin.class.php:667 +#: ../admin.class.php:675 ../admin.class.php:749 msgid "Only JPG, PNG or GIF files are allowed" msgstr "Разрешается загрузка файлов формата JPG, PNG или GIF" -#: ../admin.class.php:608 ../admin.class.php:668 +#: ../admin.class.php:676 ../admin.class.php:750 msgid "File" msgstr "Файл" -#: ../admin.class.php:671 +#: ../admin.class.php:680 ../admin.class.php:684 ../admin.class.php:761 +#: ../editor.admin.class.php:608 ../editor.admin.class.php:937 +#: ../editor.admin.class.php:1547 ../list.admin.class.php:176 +#: ../list.admin.class.php:187 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:425 +msgid "Hits" +msgstr "Показы" + +#: ../admin.class.php:680 ../admin.class.php:685 ../admin.class.php:761 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1548 ../list.admin.class.php:236 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:426 +msgid "Clicks" +msgstr "Клики" + +#: ../admin.class.php:683 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:355 +msgid "Name" +msgstr "Наименование" + +#: ../admin.class.php:753 msgid "Post" msgstr "Статья" -#: ../admin.class.php:672 ../editor.admin.class.php:1078 +#: ../admin.class.php:754 ../editor.admin.class.php:1134 msgid "Page" msgstr "Страница" -#: ../admin.class.php:673 +#: ../admin.class.php:755 msgid "Subscriber" msgstr "Подписчик" -#: ../admin.class.php:705 ../zone.editor.admin.class.php:352 +#: ../admin.class.php:788 ../zone.editor.admin.class.php:356 msgid "Name of Ads Zone" msgstr "Имя рекламной зоны" -#: ../admin.class.php:706 ../block.editor.admin.class.php:309 +#: ../admin.class.php:789 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "Имя рекламного блока" -#: ../admin.class.php:706 +#: ../admin.class.php:789 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." @@ -564,58 +624,58 @@ msgstr "" "Необязательный параметр. Однако, настоятельно рекомендуется определить его, " "если вы планируете использовать виджеты плагина." -#: ../admin.class.php:725 +#: ../admin.class.php:808 msgid "Error ID" msgstr "ID ошибки" -#: ../admin.class.php:726 +#: ../admin.class.php:809 msgid "Error Date" msgstr "Дата ошибки" -#: ../admin.class.php:727 ../errorlog.admin.class.php:86 +#: ../admin.class.php:810 ../errorlog.admin.class.php:86 #: ../errorlog.admin.class.php:96 msgid "Table" msgstr "Таблица" -#: ../admin.class.php:728 +#: ../admin.class.php:811 msgid "Error Message" msgstr "Сообщение об ошибке" -#: ../admin.class.php:729 +#: ../admin.class.php:812 msgid "Error SQL" msgstr "SQL вызвавший ошибку" -#: ../admin.class.php:730 ../errorlog.admin.class.php:87 +#: ../admin.class.php:813 ../errorlog.admin.class.php:87 #: ../errorlog.admin.class.php:97 msgid "Type" msgstr "Тип ошибки" -#: ../admin.class.php:731 +#: ../admin.class.php:814 msgid "Close" msgstr "Закрыть" -#: ../admin.class.php:733 ../admin.class.php:794 +#: ../admin.class.php:816 ../admin.class.php:877 #: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 msgid "Warning" msgstr "Внимание" -#: ../admin.class.php:733 ../errorlog.admin.class.php:136 +#: ../admin.class.php:816 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "Ok" -#: ../admin.class.php:794 ../errorlog.admin.class.php:116 +#: ../admin.class.php:877 ../errorlog.admin.class.php:116 msgid "Update Error" msgstr "Ошибка обновления" -#: ../admin.class.php:794 ../errorlog.admin.class.php:116 +#: ../admin.class.php:877 ../errorlog.admin.class.php:116 msgid "Output Error" msgstr "Ошибка вывода" -#: ../admin.class.php:880 +#: ../admin.class.php:963 msgid "There are general options." msgstr "Основные параметры плагина." -#: ../admin.class.php:884 +#: ../admin.class.php:967 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" @@ -625,75 +685,75 @@ msgstr "" "Используйте эти параметры для разрешения/определения рекламных мест, которые " "будут автоматически вставлены до/после контента статьи/страницы." -#: ../admin.class.php:892 +#: ../admin.class.php:975 msgid "Adjust parameters of your Google DFP account." msgstr "Настройте параметры вашей учётной записи Google DFP." -#: ../admin.class.php:896 +#: ../admin.class.php:979 msgid "Adjust parameters of plugin statistics." msgstr "Настройте параметры статистики плагина." -#: ../admin.class.php:900 +#: ../admin.class.php:983 msgid "This options define layout for Ads Managin Pages." msgstr "" "Эти параметры определяют внешний вид страниц управления рекламными " "объявлениями и рекламными местами." -#: ../admin.class.php:904 +#: ../admin.class.php:987 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "Вы разрешаете выполнение этих деиствий в ходе деактивации плагина?" -#: ../admin.class.php:1013 +#: ../admin.class.php:1101 msgid "Simple Ads Manager Settings Updated." msgstr "Параметры Simple Ads Manager сохранены." -#: ../admin.class.php:1021 +#: ../admin.class.php:1109 msgid "System Info" msgstr "Системная информация" -#: ../admin.class.php:1028 +#: ../admin.class.php:1116 msgid "Wordpress Version" msgstr "Версия Wordpress" -#: ../admin.class.php:1029 +#: ../admin.class.php:1117 msgid "SAM Version" msgstr "Версия плагина" -#: ../admin.class.php:1030 +#: ../admin.class.php:1118 msgid "SAM DB Version" msgstr "Версия таблиц БД плагина" -#: ../admin.class.php:1031 +#: ../admin.class.php:1119 msgid "PHP Version" msgstr "Версия PHP" -#: ../admin.class.php:1032 +#: ../admin.class.php:1120 msgid "MySQL Version" msgstr "Версия MySQL" -#: ../admin.class.php:1033 +#: ../admin.class.php:1121 msgid "Memory Limit" msgstr "Лимит памяти" -#: ../admin.class.php:1037 +#: ../admin.class.php:1125 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" "Обратите внимание! Если вы обнаружили ошибку, не забудьте включить эти " "данные в отчет об ошибке." -#: ../admin.class.php:1042 +#: ../admin.class.php:1130 msgid "Resources" msgstr "Ресурсы" -#: ../admin.class.php:1045 +#: ../admin.class.php:1133 msgid "Wordpress Plugin Page" msgstr "Страница плагина на Wordpress" -#: ../admin.class.php:1046 +#: ../admin.class.php:1134 msgid "Author Plugin Page" msgstr "Страница плагина" -#: ../admin.class.php:1047 ../help.class.php:34 ../help.class.php:51 +#: ../admin.class.php:1135 ../help.class.php:34 ../help.class.php:51 #: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 #: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 #: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 @@ -701,15 +761,15 @@ msgstr "Страница плагина" msgid "Support Forum" msgstr "Форум поддержки" -#: ../admin.class.php:1048 +#: ../admin.class.php:1136 msgid "Author's Blog" msgstr "Блог автора" -#: ../admin.class.php:1053 +#: ../admin.class.php:1141 msgid "Donations" msgstr "Пожертвования" -#: ../admin.class.php:1065 +#: ../admin.class.php:1153 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " @@ -719,28 +779,28 @@ msgstr "" "%s, чтобы поддержать дальнейшие работы по разработке плагина. Ваша поддержка " "будет оценена по достоинству. Спасибо!" -#: ../admin.class.php:1066 +#: ../admin.class.php:1154 msgid "Donate Now!" msgstr "Пожертвовать!" -#: ../admin.class.php:1066 +#: ../admin.class.php:1154 msgid "donation" msgstr "пожертвование" -#: ../admin.class.php:1084 +#: ../admin.class.php:1172 msgid "Another Plugins" msgstr "Другие плагины" -#: ../admin.class.php:1088 +#: ../admin.class.php:1176 #, php-format msgid "Another plugins from %s" msgstr "Другие плагины от %s'а" -#: ../admin.class.php:1094 +#: ../admin.class.php:1182 msgid "Highlights any portion of text as text in the colored boxes." msgstr "Подсветка любой части текста в виде текста в цветной рамке." -#: ../admin.class.php:1095 +#: ../admin.class.php:1183 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." @@ -748,21 +808,21 @@ msgstr "" "Добавляет бейджик счётчиков (подписчики Feedburner и последователи Twitter) " "на все страницы блога." -#: ../admin.class.php:1096 +#: ../admin.class.php:1184 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "Wordpress оболочка для плагина FloatBox от Байрона МакГрегора." -#: ../admin.class.php:1097 +#: ../admin.class.php:1185 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" "Добавляет строку уведомления об авторском праве в конец каждой статьи блога." -#: ../admin.class.php:1113 +#: ../admin.class.php:1201 msgctxt "Copyright String" msgid "Simple Ads Manager plugin for Wordpress." msgstr "Wordpress плагин Simple Ads Manager" -#: ../admin.class.php:1113 +#: ../admin.class.php:1201 msgctxt "Copyright String" msgid "All rights reserved." msgstr "Все права защищены." @@ -770,15 +830,16 @@ msgstr "Все права защищены." #: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 #: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 #: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 -#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:382 -#: ../editor.admin.class.php:451 ../editor.admin.class.php:465 -#: ../editor.admin.class.php:486 ../editor.admin.class.php:547 -#: ../editor.admin.class.php:857 ../editor.admin.class.php:937 -#: ../editor.admin.class.php:959 ../editor.admin.class.php:1029 -#: ../editor.admin.class.php:1128 ../editor.admin.class.php:1171 -#: ../editor.admin.class.php:1416 ../editor.admin.class.php:1436 -#: ../editor.admin.class.php:1468 ../zone.editor.admin.class.php:296 -#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:371 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 +#: ../editor.admin.class.php:465 ../editor.admin.class.php:486 +#: ../editor.admin.class.php:507 ../editor.admin.class.php:527 +#: ../editor.admin.class.php:615 ../editor.admin.class.php:911 +#: ../editor.admin.class.php:991 ../editor.admin.class.php:1015 +#: ../editor.admin.class.php:1085 ../editor.admin.class.php:1185 +#: ../editor.admin.class.php:1430 ../editor.admin.class.php:1477 +#: ../editor.admin.class.php:1497 ../editor.admin.class.php:1556 +#: ../zone.editor.admin.class.php:300 ../zone.editor.admin.class.php:361 +#: ../zone.editor.admin.class.php:375 msgid "Click to toggle" msgstr "Кликнуть для переключения" @@ -787,7 +848,7 @@ msgid "Item" msgstr "Элемент" #: ../block.editor.admin.class.php:77 ../help.class.php:125 -#: ../widget.class.php:16 ../js/dialog.php:48 +#: ../widget.class.php:16 ../js/dialog.php:53 msgid "Ads Place" msgstr "Рекламное место" @@ -801,19 +862,19 @@ msgid "Single Ad" msgstr "Рекламное объявление" #: ../block.editor.admin.class.php:103 ../widget.class.php:150 -#: ../widget.class.php:155 ../js/dialog-zone.php:48 +#: ../widget.class.php:155 ../js/dialog-zone.php:53 msgid "Ads Zone" msgstr "Рекламная зона" #: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 -#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:313 -#: ../editor.admin.class.php:345 ../editor.admin.class.php:362 -#: ../editor.admin.class.php:363 ../editor.admin.class.php:364 -#: ../editor.admin.class.php:372 ../editor.admin.class.php:679 -#: ../editor.admin.class.php:774 ../editor.admin.class.php:838 -#: ../editor.admin.class.php:839 ../editor.admin.class.php:840 -#: ../zone.editor.admin.class.php:158 ../zone.editor.admin.class.php:253 -#: ../zone.editor.admin.class.php:286 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 +#: ../editor.admin.class.php:359 ../editor.admin.class.php:376 +#: ../editor.admin.class.php:377 ../editor.admin.class.php:378 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:725 +#: ../editor.admin.class.php:824 ../editor.admin.class.php:892 +#: ../editor.admin.class.php:893 ../editor.admin.class.php:894 +#: ../zone.editor.admin.class.php:162 ../zone.editor.admin.class.php:257 +#: ../zone.editor.admin.class.php:290 msgid "Undefined" msgstr "Не определено" @@ -829,9 +890,9 @@ msgstr "Новый рекламный блок" msgid "Edit Ads Block" msgstr "Изменить рекламный блок" -#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:383 -#: ../editor.admin.class.php:858 ../errorlog.admin.class.php:84 -#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:297 +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 +#: ../editor.admin.class.php:912 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:301 msgid "Status" msgstr "Статус" @@ -839,59 +900,54 @@ msgstr "Статус" msgid "Back to Blocks List" msgstr "Назад, к списку блоков" -#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:66 +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:71 msgid "Ads Block ID" msgstr "ID рекламного блока" -#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:413 -#: ../zone.editor.admin.class.php:319 +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:323 msgid "Is Active" msgstr "Активно" -#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:414 -#: ../editor.admin.class.php:900 ../zone.editor.admin.class.php:320 +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 +#: ../editor.admin.class.php:954 ../zone.editor.admin.class.php:324 msgid "Is In Trash" msgstr "В корзине" #: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 -#: ../editor.admin.class.php:421 ../editor.admin.class.php:426 -#: ../editor.admin.class.php:907 ../editor.admin.class.php:912 -#: ../zone.editor.admin.class.php:327 ../zone.editor.admin.class.php:333 -#: ../js/dialog-ad.php:89 ../js/dialog-block.php:79 ../js/dialog-zone.php:89 -#: ../js/dialog.php:89 +#: ../editor.admin.class.php:435 ../editor.admin.class.php:440 +#: ../editor.admin.class.php:961 ../editor.admin.class.php:966 +#: ../zone.editor.admin.class.php:331 ../zone.editor.admin.class.php:337 +#: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 +#: ../js/dialog.php:94 msgid "Cancel" msgstr "Отмена" #: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 -#: ../editor.admin.class.php:430 ../editor.admin.class.php:432 -#: ../editor.admin.class.php:916 ../editor.admin.class.php:918 -#: ../zone.editor.admin.class.php:330 ../zone.editor.admin.class.php:337 +#: ../editor.admin.class.php:444 ../editor.admin.class.php:446 +#: ../editor.admin.class.php:970 ../editor.admin.class.php:972 +#: ../zone.editor.admin.class.php:334 ../zone.editor.admin.class.php:341 msgid "Save" msgstr "Сохранить" -#: ../block.editor.admin.class.php:308 ../editor.admin.class.php:445 -#: ../zone.editor.admin.class.php:351 -msgid "Name" -msgstr "Наименование" - -#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:932 -#: ../zone.editor.admin.class.php:352 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:986 +#: ../zone.editor.admin.class.php:356 msgid "Required for SAM widgets." msgstr "Требуется для виджетов плагина." #: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 -#: ../editor.admin.class.php:452 ../editor.admin.class.php:456 -#: ../editor.admin.class.php:941 ../zone.editor.admin.class.php:358 -#: ../zone.editor.admin.class.php:362 +#: ../editor.admin.class.php:466 ../editor.admin.class.php:470 +#: ../editor.admin.class.php:995 ../zone.editor.admin.class.php:362 +#: ../zone.editor.admin.class.php:366 msgid "Description" msgstr "Описание" -#: ../block.editor.admin.class.php:317 ../block.editor.admin.class.php:404 +#: ../block.editor.admin.class.php:317 msgid "Enter description of this Ads Block." msgstr "Введите описание для этого рекламного блока." -#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:459 -#: ../editor.admin.class.php:945 ../zone.editor.admin.class.php:365 +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 +#: ../editor.admin.class.php:999 ../zone.editor.admin.class.php:369 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -988,18 +1044,22 @@ msgstr "" "Блока Рекламных Объявлений не используются. Определите стили для элементов " "Блока Рекламных Объявлений здесь!" +#: ../block.editor.admin.class.php:404 +msgid "Adjust items settings of this Ads Block." +msgstr "Настройте элементы для этого рекламного блока." + #: ../block.editor.admin.class.php:406 msgid "Block Editor." msgstr "Редактор рекламного блока." #: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 -#: ../list.admin.class.php:129 ../list.admin.class.php:312 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 #: ../zone.list.admin.class.php:48 msgid "«" msgstr "«" #: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 -#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../list.admin.class.php:131 ../list.admin.class.php:314 #: ../zone.list.admin.class.php:49 msgid "»" msgstr "»" @@ -1009,25 +1069,25 @@ msgid "Managing Ads Blocks" msgstr "Управление рекламными блоками" #: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 -#: ../list.admin.class.php:144 ../list.admin.class.php:327 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 #: ../zone.list.admin.class.php:63 msgid "All" msgstr "Все" #: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 -#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../list.admin.class.php:146 ../list.admin.class.php:329 #: ../zone.list.admin.class.php:64 msgid "Active" msgstr "Активные" -#: ../block.list.admin.class.php:65 ../list.admin.class.php:146 -#: ../list.admin.class.php:329 ../zone.list.admin.class.php:65 +#: ../block.list.admin.class.php:65 ../list.admin.class.php:147 +#: ../list.admin.class.php:330 ../zone.list.admin.class.php:65 msgid "Trash" msgstr "Корзина" #: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 -#: ../list.admin.class.php:151 ../list.admin.class.php:271 -#: ../list.admin.class.php:335 ../list.admin.class.php:454 +#: ../list.admin.class.php:152 ../list.admin.class.php:272 +#: ../list.admin.class.php:336 ../list.admin.class.php:455 #: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 msgid "Clear Trash" msgstr "Очистить корзину" @@ -1038,8 +1098,8 @@ msgstr "Добавить новый блок" #: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 #: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:173 -#: ../list.admin.class.php:160 ../list.admin.class.php:280 -#: ../list.admin.class.php:345 ../list.admin.class.php:463 +#: ../list.admin.class.php:161 ../list.admin.class.php:281 +#: ../list.admin.class.php:346 ../list.admin.class.php:464 #: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 #, php-format msgid "Displaying %s–%s of %s" @@ -1050,13 +1110,13 @@ msgid "Block Name" msgstr "Имя блока" #: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 -#: ../list.admin.class.php:216 ../list.admin.class.php:403 +#: ../list.admin.class.php:217 ../list.admin.class.php:404 #: ../zone.list.admin.class.php:113 msgid "There are no data ..." msgstr "Нет данных для показа ..." -#: ../block.list.admin.class.php:121 ../list.admin.class.php:241 -#: ../list.admin.class.php:431 ../zone.list.admin.class.php:121 +#: ../block.list.admin.class.php:121 ../list.admin.class.php:242 +#: ../list.admin.class.php:432 ../zone.list.admin.class.php:121 msgid "in Trash" msgstr "в корзине" @@ -1064,8 +1124,8 @@ msgstr "в корзине" msgid "Edit Block" msgstr "Изменить рекламный блок" -#: ../block.list.admin.class.php:123 ../list.admin.class.php:243 -#: ../list.admin.class.php:433 ../zone.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 ../list.admin.class.php:244 +#: ../list.admin.class.php:434 ../zone.list.admin.class.php:123 msgid "Edit" msgstr "Изменить" @@ -1073,8 +1133,8 @@ msgstr "Изменить" msgid "Restore this Block from the Trash" msgstr "Восстановить этот блок из корзины" -#: ../block.list.admin.class.php:127 ../list.admin.class.php:247 -#: ../list.admin.class.php:437 ../zone.list.admin.class.php:127 +#: ../block.list.admin.class.php:127 ../list.admin.class.php:248 +#: ../list.admin.class.php:438 ../zone.list.admin.class.php:127 msgid "Restore" msgstr "Восстановить" @@ -1083,7 +1143,7 @@ msgid "Remove this Block permanently" msgstr "Удалить этот рекламный блок навсегда" #: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 -#: ../list.admin.class.php:248 ../list.admin.class.php:438 +#: ../list.admin.class.php:249 ../list.admin.class.php:439 #: ../zone.list.admin.class.php:128 msgid "Remove permanently" msgstr "Удалить навсегда" @@ -1092,8 +1152,8 @@ msgstr "Удалить навсегда" msgid "Move this Block to the Trash" msgstr "Поместить этот блок в корзину" -#: ../block.list.admin.class.php:133 ../list.admin.class.php:253 -#: ../list.admin.class.php:439 ../zone.list.admin.class.php:133 +#: ../block.list.admin.class.php:133 ../list.admin.class.php:254 +#: ../list.admin.class.php:440 ../zone.list.admin.class.php:133 msgid "Delete" msgstr "Удалить" @@ -1302,31 +1362,79 @@ msgstr "Вертикальные" msgid "Custom width and height" msgstr "Пользовательские высота и ширина" +#: ../editor.admin.class.php:224 +msgid "January" +msgstr "Январь" + #: ../editor.admin.class.php:225 +msgid "February" +msgstr "Февраль" + +#: ../editor.admin.class.php:226 +msgid "Mart" +msgstr "Март" + +#: ../editor.admin.class.php:227 +msgid "April" +msgstr "Апрель" + +#: ../editor.admin.class.php:228 +msgid "May" +msgstr "Май" + +#: ../editor.admin.class.php:229 +msgid "June" +msgstr "Июнь" + +#: ../editor.admin.class.php:230 +msgid "July" +msgstr "Июль" + +#: ../editor.admin.class.php:231 +msgid "August" +msgstr "Август" + +#: ../editor.admin.class.php:232 +msgid "September" +msgstr "Сентябрь" + +#: ../editor.admin.class.php:233 +msgid "October" +msgstr "Октябрь" + +#: ../editor.admin.class.php:234 +msgid "November" +msgstr "Ноябрь" + +#: ../editor.admin.class.php:235 +msgid "December" +msgstr "Декабрь" + +#: ../editor.admin.class.php:243 msgid "Image Tools" msgstr "Инструменты" -#: ../editor.admin.class.php:228 +#: ../editor.admin.class.php:246 msgid "Media Library" msgstr "Медиафайлы" -#: ../editor.admin.class.php:229 +#: ../editor.admin.class.php:247 msgid "Server" msgstr "Сервер" -#: ../editor.admin.class.php:230 +#: ../editor.admin.class.php:248 msgid "Local Computer" msgstr "Компьютер" -#: ../editor.admin.class.php:234 +#: ../editor.admin.class.php:252 msgid "Select Image from Media Library" msgstr "Выберите изображение из библиотеки медиафайлов" -#: ../editor.admin.class.php:236 +#: ../editor.admin.class.php:254 msgid "Select or Upload" msgstr "Выбрать или загрузить" -#: ../editor.admin.class.php:238 +#: ../editor.admin.class.php:256 msgid "" "You can upload your banners to Wordpress Media Library or select banner " "image from it." @@ -1334,88 +1442,100 @@ msgstr "" "Вы можете загрузить Ваши баннеры в библиотеку медиафайлов Wordpress или " "выбрать баннер из медиабиблиотеки." -#: ../editor.admin.class.php:243 +#: ../editor.admin.class.php:261 msgid "Select File" msgstr "Выберите файл" -#: ../editor.admin.class.php:248 +#: ../editor.admin.class.php:266 msgid "Apply" msgstr "Применить" -#: ../editor.admin.class.php:250 +#: ../editor.admin.class.php:268 msgid "Select file from your blog server." msgstr "Выберите файл, расположенный на сервере Вашего блога." -#: ../editor.admin.class.php:255 +#: ../editor.admin.class.php:273 msgid "Upload File" msgstr "Загрузить файл" -#: ../editor.admin.class.php:257 +#: ../editor.admin.class.php:275 msgid "Upload" msgstr "Загрузить" -#: ../editor.admin.class.php:261 +#: ../editor.admin.class.php:279 msgid "Select and upload file from your local computer." msgstr "Выберите и загрузите файл на сервер с Вашего локального компьютера." -#: ../editor.admin.class.php:326 +#: ../editor.admin.class.php:340 msgid "Ads Place Data Updated." msgstr "Данные рекламного места сохранены." -#: ../editor.admin.class.php:372 +#: ../editor.admin.class.php:386 msgid "New Ads Place" msgstr "Новое рекламное место" -#: ../editor.admin.class.php:372 +#: ../editor.admin.class.php:386 msgid "Edit Ads Place" msgstr "Изменить рекламное место" -#: ../editor.admin.class.php:392 +#: ../editor.admin.class.php:406 msgid "Back to Places List" msgstr "Назад, к списку мест" -#: ../editor.admin.class.php:399 ../js/dialog.php:66 +#: ../editor.admin.class.php:413 ../js/dialog.php:71 msgid "Ads Place ID" msgstr "ID рекламного места" -#: ../editor.admin.class.php:405 ../editor.admin.class.php:889 -#: ../list.admin.class.php:174 ../list.admin.class.php:185 +#: ../editor.admin.class.php:419 ../editor.admin.class.php:943 +#: ../list.admin.class.php:175 ../list.admin.class.php:186 msgid "Size" msgstr "Размеры" -#: ../editor.admin.class.php:407 ../editor.admin.class.php:891 +#: ../editor.admin.class.php:421 ../editor.admin.class.php:945 msgid "Width" msgstr "Ширина" -#: ../editor.admin.class.php:409 ../editor.admin.class.php:893 +#: ../editor.admin.class.php:423 ../editor.admin.class.php:947 msgid "Height" msgstr "Высота" -#: ../editor.admin.class.php:446 +#: ../editor.admin.class.php:460 msgid "Required for SAM widgets and settings." msgstr "Требуется для виджетов и параметров плагина." -#: ../editor.admin.class.php:454 +#: ../editor.admin.class.php:468 msgid "Enter description of this Ads Place." msgstr "Введите описание для этого рекламного места." -#: ../editor.admin.class.php:466 +#: ../editor.admin.class.php:479 ../editor.admin.class.php:1006 +msgid "General" +msgstr "Основные параметры" + +#: ../editor.admin.class.php:480 +msgid "Default Ad" +msgstr "Объявление по умолчанию" + +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1010 +msgid "Statistic" +msgstr "Статистика" + +#: ../editor.admin.class.php:487 msgid "Ads Place Size" msgstr "Размеры рекламного места" -#: ../editor.admin.class.php:468 +#: ../editor.admin.class.php:489 msgid "Select size of this Ads Place." msgstr "Выберите размеры для этого рекламного места." -#: ../editor.admin.class.php:473 +#: ../editor.admin.class.php:494 msgid "Custom Width" msgstr "Ширина, заданная пользователем" -#: ../editor.admin.class.php:477 +#: ../editor.admin.class.php:498 msgid "Custom Height" msgstr "Высота, заданная пользователем" -#: ../editor.admin.class.php:480 +#: ../editor.admin.class.php:501 msgid "" "These values are not used and are added solely for the convenience of " "advertising management. Will be used in the future..." @@ -1423,22 +1543,46 @@ msgstr "" "Эти значения нигде не используется и введены исключительно для удобства в " "уравлении рекламными объявлениями. Будут использоваться в будущем ..." -#: ../editor.admin.class.php:487 +#: ../editor.admin.class.php:508 +msgid "Codes" +msgstr "Коды" + +#: ../editor.admin.class.php:510 +msgid "Enter the code to output before and after the codes of Ads Place." +msgstr "Введите коды для вывода до и после кода места рекламных объявлений." + +#: ../editor.admin.class.php:512 +msgid "Code Before" +msgstr "Код до" + +#: ../editor.admin.class.php:516 +msgid "Code After" +msgstr "Код после" + +#: ../editor.admin.class.php:519 +msgid "" +"You can enter any HTML codes here for the further withdrawal of their before " +"and after the code of Ads Place." +msgstr "" +"Вы можете ввести здесь любой HTML код для дальнейшего вывода его до и после " +"кода рекламного места." + +#: ../editor.admin.class.php:528 msgid "Ads Place Patch" msgstr "Заглушка рекламного места" -#: ../editor.admin.class.php:489 +#: ../editor.admin.class.php:530 msgid "" "Select type of the code of a patch and fill data entry fields with the " "appropriate data." msgstr "" "Выберите тип заплатки и заполните нужные поля соответствующими данными." -#: ../editor.admin.class.php:491 ../editor.admin.class.php:495 +#: ../editor.admin.class.php:532 ../editor.admin.class.php:536 msgid "Image" msgstr "Изображение" -#: ../editor.admin.class.php:500 +#: ../editor.admin.class.php:541 msgid "" "This image is a patch for advertising space. This may be an image with the " "text \"Place your ad here\"." @@ -1446,24 +1590,24 @@ msgstr "" "Введите путь к изображению для заплатки рекламного места. Это может быть " "изображение содержащее текст \"Разместите своё рекламное объявление здесь\"." -#: ../editor.admin.class.php:503 +#: ../editor.admin.class.php:544 msgid "Target" msgstr "Цель" -#: ../editor.admin.class.php:507 +#: ../editor.admin.class.php:548 msgid "This is a link to a page where are your suggestions for advertisers." msgstr "" "Это ссылка на страницу, на которой размещены Ваши предложения рекламодателям." -#: ../editor.admin.class.php:513 +#: ../editor.admin.class.php:554 msgid "HTML or Javascript Code" msgstr "Код HTML или Javascript" -#: ../editor.admin.class.php:517 +#: ../editor.admin.class.php:558 msgid "Patch Code" msgstr "Код заглушки" -#: ../editor.admin.class.php:522 +#: ../editor.admin.class.php:563 msgid "" "This is one-block code of third-party AdServer rotator. Selecting this " "checkbox prevents displaying contained ads." @@ -1472,7 +1616,7 @@ msgstr "" "Выбор этого параметра останавливает показ содержащихся в рекламном месте " "объявлений для показа только этого кода." -#: ../editor.admin.class.php:525 +#: ../editor.admin.class.php:566 msgid "" "This is a HTML-code patch of advertising space. For example: use the code to " "display AdSense advertisement. " @@ -1480,19 +1624,19 @@ msgstr "" "Это HTML-код заплатки рекламного места. Например: используйте код показа " "рекламы от AdSense." -#: ../editor.admin.class.php:530 +#: ../editor.admin.class.php:571 msgid "Google DFP" msgstr "Блок Google DFP" -#: ../editor.admin.class.php:534 +#: ../editor.admin.class.php:575 msgid "DFP Block Name" msgstr "Имя блока DFP" -#: ../editor.admin.class.php:538 +#: ../editor.admin.class.php:579 msgid "This is name of Google DFP block!" msgstr "Это имя блока от Google DFP!" -#: ../editor.admin.class.php:541 +#: ../editor.admin.class.php:582 msgid "" "The patch (default advertisement) will be shown that if the logic of the " "plugin can not show any contained advertisement on the current page of the " @@ -1502,129 +1646,113 @@ msgstr "" "когда логика плагина не позволяет показать какое-либо рекламное объявление " "на текущей странице документа." -#: ../editor.admin.class.php:548 -msgid "Codes" -msgstr "Коды" +#: ../editor.admin.class.php:597 ../editor.admin.class.php:1536 +msgid "Select Period" +msgstr "Выбрать период" -#: ../editor.admin.class.php:550 -msgid "Enter the code to output before and after the codes of Ads Place." -msgstr "Введите коды для вывода до и после кода места рекламных объявлений." +#: ../editor.admin.class.php:599 ../editor.admin.class.php:1538 +msgid "This Month" +msgstr "Этот месяц" -#: ../editor.admin.class.php:552 -msgid "Code Before" -msgstr "Код до" +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1539 +msgid "Previous Month" +msgstr "Предыдущий месяц" -#: ../editor.admin.class.php:556 -msgid "Code After" -msgstr "Код после" +#: ../editor.admin.class.php:607 ../editor.admin.class.php:1546 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 +msgid "Total" +msgstr "Всего" -#: ../editor.admin.class.php:559 -msgid "" -"You can enter any HTML codes here for the further withdrawal of their before " -"and after the code of Ads Place." -msgstr "" -"Вы можете ввести здесь любой HTML код для дальнейшего вывода его до и после " -"кода рекламного места." +#: ../editor.admin.class.php:616 +msgid "Contained Ads" +msgstr "Объявления рекламного места" -#: ../editor.admin.class.php:690 +#: ../editor.admin.class.php:736 msgid "Ad Data Updated." msgstr "Данные рекламного объявления сохранены." -#: ../editor.admin.class.php:847 +#: ../editor.admin.class.php:901 msgid "New advertisement" msgstr "Новое рекламное объявление" -#: ../editor.admin.class.php:847 +#: ../editor.admin.class.php:901 msgid "Edit advertisement" msgstr "Изменить рекламное объявление" -#: ../editor.admin.class.php:867 +#: ../editor.admin.class.php:921 msgid "Back to Ads List" msgstr "Назад, к списку объявлений" -#: ../editor.admin.class.php:874 +#: ../editor.admin.class.php:928 msgid "Advertisement ID" msgstr "ID объявления" -#: ../editor.admin.class.php:881 ../list.admin.class.php:361 -#: ../list.admin.class.php:371 +#: ../editor.admin.class.php:935 ../list.admin.class.php:362 +#: ../list.admin.class.php:372 msgid "Activity" msgstr "Активность" -#: ../editor.admin.class.php:882 +#: ../editor.admin.class.php:936 msgid "Ad is Active" msgstr "Активно" -#: ../editor.admin.class.php:882 +#: ../editor.admin.class.php:936 msgid "Ad is Inactive" msgstr "Неактивно" -#: ../editor.admin.class.php:883 ../list.admin.class.php:175 -#: ../list.admin.class.php:186 ../list.admin.class.php:234 -#: ../list.admin.class.php:362 ../list.admin.class.php:372 -#: ../list.admin.class.php:424 -msgid "Hits" -msgstr "Показы" - -#: ../editor.admin.class.php:885 ../list.admin.class.php:235 -#: ../list.admin.class.php:363 ../list.admin.class.php:373 -#: ../list.admin.class.php:425 -msgid "Clicks" -msgstr "Клики" - -#: ../editor.admin.class.php:898 +#: ../editor.admin.class.php:952 msgid "Is in Rotation" msgstr "В ротации" -#: ../editor.admin.class.php:931 +#: ../editor.admin.class.php:985 msgid "Title" msgstr "Имя" -#: ../editor.admin.class.php:938 +#: ../editor.admin.class.php:992 msgid "Advertisement Description" msgstr "Описание рекламного объявления" -#: ../editor.admin.class.php:952 -msgid "General" -msgstr "Основные параметры" - -#: ../editor.admin.class.php:953 +#: ../editor.admin.class.php:1007 msgid "Extended Restrictions" msgstr "Дополнительные ограничения" -#: ../editor.admin.class.php:954 +#: ../editor.admin.class.php:1008 +msgid "Targeting" +msgstr "Таргетинг" + +#: ../editor.admin.class.php:1009 msgid "Earnings settings" msgstr "Параметры доходов" -#: ../editor.admin.class.php:960 ../editor.admin.class.php:1019 +#: ../editor.admin.class.php:1016 ../editor.admin.class.php:1075 msgid "Ad Code" msgstr "Код рекламного объявления" -#: ../editor.admin.class.php:964 +#: ../editor.admin.class.php:1020 msgid "Image Mode" msgstr "Режим изображения" -#: ../editor.admin.class.php:968 +#: ../editor.admin.class.php:1024 msgid "Ad Image" msgstr "Изображение объявления" -#: ../editor.admin.class.php:973 +#: ../editor.admin.class.php:1029 msgid "Ad Target" msgstr "Ссылка объявления" -#: ../editor.admin.class.php:977 +#: ../editor.admin.class.php:1033 msgid "Ad Alternative Text" msgstr "Альтернативный текст" -#: ../editor.admin.class.php:982 +#: ../editor.admin.class.php:1038 msgid "Count clicks for this advertisement" msgstr "Считать клики для этого рекламного объявления" -#: ../editor.admin.class.php:984 +#: ../editor.admin.class.php:1040 msgid "Use carefully!" msgstr "Используйте крайне осторожно!" -#: ../editor.admin.class.php:984 +#: ../editor.admin.class.php:1040 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " @@ -1634,83 +1762,83 @@ msgstr "" "этом случае, во время Ajax запроса посетителю будет предложено ввести имя " "пользователя и пароль." -#: ../editor.admin.class.php:987 +#: ../editor.admin.class.php:1043 msgid "This is flash (SWF) banner" msgstr "Это флеш (SWF) баннер" -#: ../editor.admin.class.php:990 +#: ../editor.admin.class.php:1046 msgid "Flash banner \"flashvars\"" msgstr "Параметр \"flashvars\"" -#: ../editor.admin.class.php:992 +#: ../editor.admin.class.php:1048 msgid "Insert \"flashvars\" parameters between braces..." msgstr "Вставьте параметры \"flashvars\" между фигурными скобками" -#: ../editor.admin.class.php:993 +#: ../editor.admin.class.php:1049 msgid "Flash banner \"params\"" msgstr "Параметр \"params\"" -#: ../editor.admin.class.php:995 +#: ../editor.admin.class.php:1051 msgid "Insert \"params\" parameters between braces..." msgstr "Вставьте параметры \"params\" между фигурными скобками" -#: ../editor.admin.class.php:996 +#: ../editor.admin.class.php:1052 msgid "Flash banner \"attributes\"" msgstr "Параметр \"attributes\"" -#: ../editor.admin.class.php:998 +#: ../editor.admin.class.php:1054 msgid "Insert \"attributes\" parameters between braces..." msgstr "Вставьте параметры \"attributes\" между фигурными скобками" -#: ../editor.admin.class.php:1001 +#: ../editor.admin.class.php:1057 msgid "Add to ad" msgstr "Добавить теги" -#: ../editor.admin.class.php:1003 +#: ../editor.admin.class.php:1059 msgid "Non Selected" msgstr "Не выбрано" -#: ../editor.admin.class.php:1004 +#: ../editor.admin.class.php:1060 msgid "nofollow" msgstr "nofollow" -#: ../editor.admin.class.php:1005 +#: ../editor.admin.class.php:1061 msgid "noindex" msgstr "noindex" -#: ../editor.admin.class.php:1006 +#: ../editor.admin.class.php:1062 msgid "nofollow and noindex" msgstr "nofollow и noindex" -#: ../editor.admin.class.php:1015 +#: ../editor.admin.class.php:1071 msgid "Code Mode" msgstr "Режим кода" -#: ../editor.admin.class.php:1021 +#: ../editor.admin.class.php:1077 msgid "This code of ad contains PHP script" msgstr "Этот код объявления содержит PHP скрипт" -#: ../editor.admin.class.php:1030 +#: ../editor.admin.class.php:1086 msgid "Restrictions of advertisements showing" msgstr "Ограничения показа объявления" -#: ../editor.admin.class.php:1033 +#: ../editor.admin.class.php:1089 msgid "Ad Weight" msgstr "Вес объявления" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1096 msgid "Inactive" msgstr "Неактивно" -#: ../editor.admin.class.php:1041 +#: ../editor.admin.class.php:1097 msgid "Minimal Activity" msgstr "Минимальная активность" -#: ../editor.admin.class.php:1042 +#: ../editor.admin.class.php:1098 msgid "Maximal Activity" msgstr "Максимальная активность" -#: ../editor.admin.class.php:1052 +#: ../editor.admin.class.php:1108 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." @@ -1718,79 +1846,79 @@ msgstr "" "Вес рекламного объявления является коэффициентом частоты показа рекламного " "объявления за однин цикл ротации." -#: ../editor.admin.class.php:1054 +#: ../editor.admin.class.php:1110 msgid "0 - ad is inactive" msgstr "0 - объявление не активно" -#: ../editor.admin.class.php:1055 +#: ../editor.admin.class.php:1111 msgid "1 - minimal activity of this advertisement" msgstr "1 - минимальная активность этого объявления" -#: ../editor.admin.class.php:1057 +#: ../editor.admin.class.php:1113 msgid "10 - maximal activity of this ad." msgstr "10 - максимальная активность данного объявления" -#: ../editor.admin.class.php:1063 ../help.class.php:20 ../help.class.php:161 +#: ../editor.admin.class.php:1119 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "Показывать объявление на всех страницах блога" -#: ../editor.admin.class.php:1067 +#: ../editor.admin.class.php:1123 msgid "Show ad only on pages of this type" msgstr "Показывать объявление только на страницах данного типа" -#: ../editor.admin.class.php:1071 +#: ../editor.admin.class.php:1127 msgid "Home Page (Home or Front Page)" msgstr "Главная страница (главная или фронтальная страница)" -#: ../editor.admin.class.php:1073 +#: ../editor.admin.class.php:1129 msgid "Singular Pages" msgstr "Сингулярные страницы" -#: ../editor.admin.class.php:1076 +#: ../editor.admin.class.php:1132 msgid "Single Post" msgstr "Страница статьи" -#: ../editor.admin.class.php:1080 +#: ../editor.admin.class.php:1136 msgid "Custom Post Type" msgstr "Пользовательский тип статьи" -#: ../editor.admin.class.php:1082 +#: ../editor.admin.class.php:1138 msgid "Attachment" msgstr "Приложение" -#: ../editor.admin.class.php:1085 +#: ../editor.admin.class.php:1141 msgid "Search Page" msgstr "Страница вывода результата поиска" -#: ../editor.admin.class.php:1087 +#: ../editor.admin.class.php:1143 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "Страница \"Не найдено\" (ошибка HTTP 404)" -#: ../editor.admin.class.php:1089 +#: ../editor.admin.class.php:1145 msgid "Archive Pages" msgstr "Страницы архивов" -#: ../editor.admin.class.php:1092 +#: ../editor.admin.class.php:1148 msgid "Taxonomy Archive Pages" msgstr "Страницы архивов таксономий" -#: ../editor.admin.class.php:1094 +#: ../editor.admin.class.php:1150 msgid "Category Archive Pages" msgstr "Страницы архивов рубрик" -#: ../editor.admin.class.php:1096 +#: ../editor.admin.class.php:1152 msgid "Tag Archive Pages" msgstr "Страницы архивов меток" -#: ../editor.admin.class.php:1098 +#: ../editor.admin.class.php:1154 msgid "Author Archive Pages" msgstr "Страницы архивов авторов" -#: ../editor.admin.class.php:1100 +#: ../editor.admin.class.php:1156 msgid "Custom Post Type Archive Pages" msgstr "Страницы архивов пользовательскии типов" -#: ../editor.admin.class.php:1102 +#: ../editor.admin.class.php:1158 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" @@ -1798,15 +1926,15 @@ msgstr "" "Страницы архивов по датам (любые основанные на датах страницы архивов, " "другими словами, архивы по месяцам, по годам, по дням и по времени)" -#: ../editor.admin.class.php:1107 +#: ../editor.admin.class.php:1163 msgid "Show ad only in certain posts/pages" msgstr "Показывать объявление только в определённых статьях/страницах" -#: ../editor.admin.class.php:1111 ../editor.admin.class.php:1180 +#: ../editor.admin.class.php:1167 ../editor.admin.class.php:1194 msgid "Posts/Pages" msgstr "Статьи/Страницы" -#: ../editor.admin.class.php:1118 +#: ../editor.admin.class.php:1174 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." @@ -1814,47 +1942,15 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: ../editor.admin.class.php:1129 -msgid "Users" -msgstr "Пользователи" - -#: ../editor.admin.class.php:1131 -msgid "Show this ad for" -msgstr "Показывать это рекламное объявление для" - -#: ../editor.admin.class.php:1134 -msgid "all users" -msgstr "всех пользователей" - -#: ../editor.admin.class.php:1139 -msgid "these users" -msgstr "этих пользователей" - -#: ../editor.admin.class.php:1144 -msgid "Unregistered Users" -msgstr "Незарегистрированные пользователи" - -#: ../editor.admin.class.php:1148 ../editor.admin.class.php:1156 -msgid "Registered Users" -msgstr "Зарегистрированные пользователи" - -#: ../editor.admin.class.php:1153 -msgid "Exclude these users" -msgstr "Исключая этих пользователей" - -#: ../editor.admin.class.php:1164 -msgid "Do not show this ad for advertiser" -msgstr "Не показывать объявление рекламодателю" - -#: ../editor.admin.class.php:1172 +#: ../editor.admin.class.php:1186 msgid "Extended restrictions of advertisements showing" msgstr "Дополнительные ограничения показа объявления" -#: ../editor.admin.class.php:1176 +#: ../editor.admin.class.php:1190 msgid "Do not show ad on certain posts/pages" msgstr "Не показывать объявление в определённых статьях/страницах" -#: ../editor.admin.class.php:1188 +#: ../editor.admin.class.php:1202 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." @@ -1862,17 +1958,17 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: ../editor.admin.class.php:1193 +#: ../editor.admin.class.php:1207 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных рубрик" -#: ../editor.admin.class.php:1196 ../editor.admin.class.php:1216 +#: ../editor.admin.class.php:1210 ../editor.admin.class.php:1230 msgid "Categories" msgstr "Рубрики" -#: ../editor.admin.class.php:1203 +#: ../editor.admin.class.php:1217 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." @@ -1880,9 +1976,9 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных рубрик." -#: ../editor.admin.class.php:1207 ../editor.admin.class.php:1241 -#: ../editor.admin.class.php:1275 ../editor.admin.class.php:1310 -#: ../editor.admin.class.php:1345 +#: ../editor.admin.class.php:1221 ../editor.admin.class.php:1255 +#: ../editor.admin.class.php:1289 ../editor.admin.class.php:1324 +#: ../editor.admin.class.php:1359 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " @@ -1893,12 +1989,12 @@ msgstr "" "объявление только на страницах данного типа\". В противном случае, параметр " "будет проигнорирован." -#: ../editor.admin.class.php:1213 +#: ../editor.admin.class.php:1227 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "Не показывать объявление в одиночных статьях и архивах заданных рубрик" -#: ../editor.admin.class.php:1223 +#: ../editor.admin.class.php:1237 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." @@ -1906,14 +2002,14 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных рубрик." -#: ../editor.admin.class.php:1228 +#: ../editor.admin.class.php:1242 msgid "" "Show ad only in single posts or archives of certain Custom Taxonomies Terms" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных терминов " "пользовательских таксономий" -#: ../editor.admin.class.php:1237 +#: ../editor.admin.class.php:1251 msgid "" "Use this setting to display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." @@ -1921,14 +2017,14 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных терминов пользовательских таксономий." -#: ../editor.admin.class.php:1247 +#: ../editor.admin.class.php:1261 msgid "" "Do not show ad in single posts or archives of certain Custom Taxonomies Terms" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных терминов " "пользовательских таксономий" -#: ../editor.admin.class.php:1256 +#: ../editor.admin.class.php:1270 msgid "" "Use this setting to not display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." @@ -1936,16 +2032,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных терминов пользовательских таксономий." -#: ../editor.admin.class.php:1261 +#: ../editor.admin.class.php:1275 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных авторов" -#: ../editor.admin.class.php:1264 ../editor.admin.class.php:1284 +#: ../editor.admin.class.php:1278 ../editor.admin.class.php:1298 msgid "Authors" msgstr "Авторы" -#: ../editor.admin.class.php:1271 +#: ../editor.admin.class.php:1285 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." @@ -1953,12 +2049,12 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных авторов." -#: ../editor.admin.class.php:1281 +#: ../editor.admin.class.php:1295 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных авторов" -#: ../editor.admin.class.php:1291 +#: ../editor.admin.class.php:1305 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." @@ -1966,16 +2062,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных авторов." -#: ../editor.admin.class.php:1296 +#: ../editor.admin.class.php:1310 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных меток" -#: ../editor.admin.class.php:1299 ../editor.admin.class.php:1319 +#: ../editor.admin.class.php:1313 ../editor.admin.class.php:1333 msgid "Tags" msgstr "Метки" -#: ../editor.admin.class.php:1306 +#: ../editor.admin.class.php:1320 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." @@ -1983,11 +2079,11 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных меток." -#: ../editor.admin.class.php:1316 +#: ../editor.admin.class.php:1330 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "Не показывать объявление в одиночных статьях и архивах заданных меток" -#: ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1340 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." @@ -1995,7 +2091,7 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных меток." -#: ../editor.admin.class.php:1331 +#: ../editor.admin.class.php:1345 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" @@ -2003,11 +2099,11 @@ msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных " "пользовательских типов" -#: ../editor.admin.class.php:1334 ../editor.admin.class.php:1354 +#: ../editor.admin.class.php:1348 ../editor.admin.class.php:1368 msgid "Custom post types" msgstr "Пользовательские типы" -#: ../editor.admin.class.php:1341 +#: ../editor.admin.class.php:1355 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." @@ -2015,7 +2111,7 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных пользовательских типов." -#: ../editor.admin.class.php:1351 +#: ../editor.admin.class.php:1365 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" @@ -2023,7 +2119,7 @@ msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных " "пользовательских типов" -#: ../editor.admin.class.php:1361 +#: ../editor.admin.class.php:1375 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." @@ -2031,76 +2127,108 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных пользовательских типов." -#: ../editor.admin.class.php:1366 +#: ../editor.admin.class.php:1380 msgid "Use the schedule for this ad" msgstr "Использовать расписание для этого объявления" -#: ../editor.admin.class.php:1370 +#: ../editor.admin.class.php:1384 msgid "Campaign Start Date" msgstr "Дата начала кампании" -#: ../editor.admin.class.php:1374 +#: ../editor.admin.class.php:1388 msgid "Campaign End Date" msgstr "Дата окончания кампании" -#: ../editor.admin.class.php:1379 +#: ../editor.admin.class.php:1393 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" "Используйте эти параметры для показа объявления в течение определенного " "периода времени." -#: ../editor.admin.class.php:1384 +#: ../editor.admin.class.php:1398 msgid "Use limitation by hits" msgstr "Использовать ограничение по показам" -#: ../editor.admin.class.php:1388 +#: ../editor.admin.class.php:1402 msgid "Hits Limit" msgstr "Лимит показов" -#: ../editor.admin.class.php:1393 +#: ../editor.admin.class.php:1407 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" "Используйте этот параметр для ограничения показа объявлений по просмотрам." -#: ../editor.admin.class.php:1398 +#: ../editor.admin.class.php:1412 msgid "Use limitation by clicks" msgstr "Использовать ограничение по кликам" -#: ../editor.admin.class.php:1402 +#: ../editor.admin.class.php:1416 msgid "Clicks Limit" msgstr "Лимит кликов" -#: ../editor.admin.class.php:1407 +#: ../editor.admin.class.php:1421 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "Используйте этот параметр для ограничения показа объявлений по кликам." -#: ../editor.admin.class.php:1417 +#: ../editor.admin.class.php:1431 +msgid "Users" +msgstr "Пользователи" + +#: ../editor.admin.class.php:1433 +msgid "Show this ad for" +msgstr "Показывать это рекламное объявление для" + +#: ../editor.admin.class.php:1436 +msgid "all users" +msgstr "всех пользователей" + +#: ../editor.admin.class.php:1441 +msgid "these users" +msgstr "этих пользователей" + +#: ../editor.admin.class.php:1446 +msgid "Unregistered Users" +msgstr "Незарегистрированные пользователи" + +#: ../editor.admin.class.php:1450 ../editor.admin.class.php:1458 +msgid "Registered Users" +msgstr "Зарегистрированные пользователи" + +#: ../editor.admin.class.php:1455 +msgid "Exclude these users" +msgstr "Исключая этих пользователей" + +#: ../editor.admin.class.php:1466 +msgid "Do not show this ad for advertiser" +msgstr "Не показывать объявление рекламодателю" + +#: ../editor.admin.class.php:1478 msgid "Advertiser" msgstr "Рекламодатель" -#: ../editor.admin.class.php:1420 +#: ../editor.admin.class.php:1481 msgid "Advertiser Nick Name" msgstr "Ник рекламодателя" -#: ../editor.admin.class.php:1437 ../help.class.php:32 ../help.class.php:180 +#: ../editor.admin.class.php:1498 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "Расценки" -#: ../editor.admin.class.php:1440 +#: ../editor.admin.class.php:1501 msgid "Price of ad placement per month" msgstr "Цена размещения в месяц" -#: ../editor.admin.class.php:1444 +#: ../editor.admin.class.php:1505 msgid "Tthis parameter used only for scheduled ads." msgstr "" "Этот параметр используется только для объявлений, показываемых по расписанию." -#: ../editor.admin.class.php:1447 +#: ../editor.admin.class.php:1508 msgid "Price per Thousand Hits" msgstr "Цена за тысячу показов" -#: ../editor.admin.class.php:1451 +#: ../editor.admin.class.php:1512 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." @@ -2108,11 +2236,11 @@ msgstr "" "Не только люди посещают Ваш блог ... Включите обнаружение ботов и сканеров " "для того, чтобы правильно считать показы и не обманывать рекламодателя." -#: ../editor.admin.class.php:1454 +#: ../editor.admin.class.php:1515 msgid "Price per Click" msgstr "Цена за клик" -#: ../editor.admin.class.php:1458 +#: ../editor.admin.class.php:1519 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." @@ -2120,7 +2248,7 @@ msgstr "" "Для подсчёта заработка по кликам, необходимо включить подсчёт кликов для " "этого объявления." -#: ../editor.admin.class.php:1469 +#: ../editor.admin.class.php:1557 msgid "Ad Preview" msgstr "Предварительный просмотр объявления" @@ -2518,8 +2646,8 @@ msgstr "" "ограничения показа, от “показывать на всех страницах” до “показывать в " "статьях с ID …” и показывать с … по (расписание)." -#: ../help.class.php:151 ../list.admin.class.php:360 -#: ../list.admin.class.php:370 +#: ../help.class.php:151 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 msgid "Advertisement" msgstr "Рекламное объявление" @@ -2531,112 +2659,108 @@ msgstr "Доплнительные ограничения" msgid "Additional Parameters" msgstr "Доплнительные параметры" -#: ../list.admin.class.php:137 +#: ../list.admin.class.php:138 msgid "Managing Ads Places" msgstr "Управление рекламными местами" -#: ../list.admin.class.php:153 ../list.admin.class.php:273 +#: ../list.admin.class.php:154 ../list.admin.class.php:274 msgid "Add New Place" msgstr "Добавить новое место" -#: ../list.admin.class.php:157 ../list.admin.class.php:277 +#: ../list.admin.class.php:158 ../list.admin.class.php:278 msgid "Reset Statistics" msgstr "Очистить статистику" -#: ../list.admin.class.php:173 ../list.admin.class.php:184 +#: ../list.admin.class.php:174 ../list.admin.class.php:185 msgid "Place Name" msgstr "Имя места" -#: ../list.admin.class.php:176 ../list.admin.class.php:187 +#: ../list.admin.class.php:177 ../list.admin.class.php:188 msgid "Total Hits" msgstr "Всего показов" -#: ../list.admin.class.php:177 ../list.admin.class.php:188 +#: ../list.admin.class.php:178 ../list.admin.class.php:189 msgid "Total Ads" msgstr "Объявлений" -#: ../list.admin.class.php:178 ../list.admin.class.php:189 -#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:179 ../list.admin.class.php:190 +#: ../list.admin.class.php:365 ../list.admin.class.php:375 msgid "Earnings" msgstr "Доходы" -#: ../list.admin.class.php:233 ../list.admin.class.php:423 +#: ../list.admin.class.php:234 ../list.admin.class.php:424 msgid "Placement" msgstr "Размещение" -#: ../list.admin.class.php:236 ../list.admin.class.php:426 -msgid "Total" -msgstr "Всего" - -#: ../list.admin.class.php:236 ../list.admin.class.php:426 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 msgid "N/A" msgstr "Нет" -#: ../list.admin.class.php:243 +#: ../list.admin.class.php:244 msgid "Edit Place" msgstr "Изменить рекламное место" -#: ../list.admin.class.php:247 +#: ../list.admin.class.php:248 msgid "Restore this Place from the Trash" msgstr "Восстановить это место из корзины" -#: ../list.admin.class.php:248 +#: ../list.admin.class.php:249 msgid "Remove this Place permanently" msgstr "Удалить это рекламное место навсегда" -#: ../list.admin.class.php:253 +#: ../list.admin.class.php:254 msgid "Move this Place to the Trash" msgstr "Поместить это место в корзину" -#: ../list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View List of Place Ads" msgstr "Показать список рекламных мест" -#: ../list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View Ads" msgstr "Объявления" -#: ../list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "Create New Ad" msgstr "Создать новое объявление" -#: ../list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "New Ad" msgstr "Новое объявление" -#: ../list.admin.class.php:320 +#: ../list.admin.class.php:321 msgid "Managing Items of Ads Place" msgstr "Управление объявлениями рекламного места" -#: ../list.admin.class.php:337 ../list.admin.class.php:456 +#: ../list.admin.class.php:338 ../list.admin.class.php:457 msgid "Add New Ad" msgstr "Добавить новое рекламное объявление" -#: ../list.admin.class.php:341 ../list.admin.class.php:460 +#: ../list.admin.class.php:342 ../list.admin.class.php:461 msgid "Back to Ads Places Management" msgstr "Назад, к списку мест" -#: ../list.admin.class.php:417 +#: ../list.admin.class.php:418 msgid "Yes" msgstr "Да" -#: ../list.admin.class.php:418 +#: ../list.admin.class.php:419 msgid "No" msgstr "Нет" -#: ../list.admin.class.php:433 +#: ../list.admin.class.php:434 msgid "Edit this Item of Ads Place" msgstr "Изменить этот элемент рекламного места" -#: ../list.admin.class.php:437 +#: ../list.admin.class.php:438 msgid "Restore this Ad from the Trash" msgstr "Восстановить это объявление из корзины" -#: ../list.admin.class.php:438 +#: ../list.admin.class.php:439 msgid "Remove this Ad permanently" msgstr "Удалить это рекламное объявление навсегда" -#: ../list.admin.class.php:439 +#: ../list.admin.class.php:440 msgid "Move this item to the Trash" msgstr "Поместить этот элемент в корзину" @@ -2680,7 +2804,7 @@ msgstr "" "Селектор \"Зона рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: ../widget.class.php:286 ../js/dialog-ad.php:48 +#: ../widget.class.php:286 ../js/dialog-ad.php:53 msgid "Ad" msgstr "Рекламное объявление" @@ -2700,7 +2824,7 @@ msgstr "" "Коллектор \"Блок рекламных объявлений\", обслуживаемый плагином Simple Ads " "Manager." -#: ../widget.class.php:428 ../js/dialog-block.php:48 +#: ../widget.class.php:428 ../js/dialog-block.php:53 msgid "Ads Block" msgstr "Рекламный блок" @@ -2712,39 +2836,39 @@ msgstr "По умолчанию" msgid "None" msgstr "Нет" -#: ../zone.editor.admin.class.php:169 +#: ../zone.editor.admin.class.php:173 msgid "Ads Zone Data Updated." msgstr "Данные рекламной зоны сохранены." -#: ../zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:290 msgid "New Ads Zone" msgstr "Новая рекламная зона" -#: ../zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:290 msgid "Edit Ads Zone" msgstr "Изменить рекламную зону" -#: ../zone.editor.admin.class.php:306 +#: ../zone.editor.admin.class.php:310 msgid "Back to Zones List" msgstr "Назад, к списку зон" -#: ../zone.editor.admin.class.php:313 ../js/dialog-zone.php:66 +#: ../zone.editor.admin.class.php:317 ../js/dialog-zone.php:71 msgid "Ads Zone ID" msgstr "ID рекламноой зоны" -#: ../zone.editor.admin.class.php:360 +#: ../zone.editor.admin.class.php:364 msgid "Enter description of this Ads Zone." msgstr "Введите описание для этой рекламной зоны." -#: ../zone.editor.admin.class.php:372 +#: ../zone.editor.admin.class.php:376 msgid "Ads Zone Settings" msgstr "Параметры зоны рекламных объявлений" -#: ../zone.editor.admin.class.php:375 +#: ../zone.editor.admin.class.php:379 msgid "Default Ads Place" msgstr "Рекламное место по умолчанию" -#: ../zone.editor.admin.class.php:381 +#: ../zone.editor.admin.class.php:385 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " @@ -2754,85 +2878,85 @@ msgstr "" "экран для тех страниц, для которых параметр рекламного места установлен в " "значение \"По умолчанию\"." -#: ../zone.editor.admin.class.php:385 +#: ../zone.editor.admin.class.php:389 msgid "Home Page Ads Place" msgstr "Рекламное место главной страницы" -#: ../zone.editor.admin.class.php:391 +#: ../zone.editor.admin.class.php:395 msgid "Default Ads Place for Singular Pages" msgstr "Рекламное место по умолчанию для сингулярных страниц" -#: ../zone.editor.admin.class.php:398 +#: ../zone.editor.admin.class.php:402 msgid "Single Post Ads Place" msgstr "Рекламное место статьи" -#: ../zone.editor.admin.class.php:407 +#: ../zone.editor.admin.class.php:411 msgid "Default Ads Place for Single Custom Type Post" msgstr "" "Рекламное место по умолчанию для одиночных статей пользовательских типов" -#: ../zone.editor.admin.class.php:418 +#: ../zone.editor.admin.class.php:422 msgid "Ads Place for Single Post of Custom Type" msgstr "Рекламное место для одиночной статьи пользовательского типа" -#: ../zone.editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:431 msgid "Page Ads Place" msgstr "Рекламное место страницы" -#: ../zone.editor.admin.class.php:433 +#: ../zone.editor.admin.class.php:437 msgid "Attachment Ads Place" msgstr "Рекламное место страницы вложения" -#: ../zone.editor.admin.class.php:440 +#: ../zone.editor.admin.class.php:444 msgid "Search Pages Ads Place" msgstr "Рекламное место страницы вывода результата поиска" -#: ../zone.editor.admin.class.php:446 +#: ../zone.editor.admin.class.php:450 msgid "404 Page Ads Place" msgstr "Рекламное место страницы ошибки 404" -#: ../zone.editor.admin.class.php:452 +#: ../zone.editor.admin.class.php:456 msgid "Default Ads Place for Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов" -#: ../zone.editor.admin.class.php:459 +#: ../zone.editor.admin.class.php:463 msgid "Default Ads Place for Taxonomies Pages" msgstr "Рекламное место по умолчанию для странц таксономий" -#: ../zone.editor.admin.class.php:466 +#: ../zone.editor.admin.class.php:470 msgid "Default Ads Place for Category Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов рубрик" -#: ../zone.editor.admin.class.php:479 +#: ../zone.editor.admin.class.php:483 msgid "Ads Place for Category" msgstr "Рекламное место для рубрики" -#: ../zone.editor.admin.class.php:495 +#: ../zone.editor.admin.class.php:499 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" "Рекламное место по умолчанию для страниц архивов пользовательских типов" -#: ../zone.editor.admin.class.php:505 +#: ../zone.editor.admin.class.php:509 msgid "Ads Place for Custom Type Posts Archive" msgstr "Рекламное место по умолчанию для страниц архива пользовательского типа" -#: ../zone.editor.admin.class.php:514 +#: ../zone.editor.admin.class.php:518 msgid "Tags Archive Pages Ads Place" msgstr "Рекламное место страницы архивов меток" -#: ../zone.editor.admin.class.php:521 +#: ../zone.editor.admin.class.php:525 msgid "Default Ads Place for Author Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов авторов" -#: ../zone.editor.admin.class.php:530 +#: ../zone.editor.admin.class.php:534 msgid "Ads Place for author" msgstr "Рекламное место для автора" -#: ../zone.editor.admin.class.php:539 +#: ../zone.editor.admin.class.php:543 msgid "Date Archive Pages Ads Place" msgstr "Рекламное место страницы архивов дат" -#: ../zone.editor.admin.class.php:546 +#: ../zone.editor.admin.class.php:550 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." @@ -2873,25 +2997,25 @@ msgstr "Поместить эту зону в корзину" msgid "Insert Single Ad" msgstr "Вставить рекламное объявление" -#: ../js/dialog-ad.php:41 ../js/dialog-block.php:41 ../js/dialog-zone.php:41 -#: ../js/dialog.php:41 +#: ../js/dialog-ad.php:46 ../js/dialog-block.php:46 ../js/dialog-zone.php:46 +#: ../js/dialog.php:46 msgid "Basic Settings" msgstr "Основные параметры" -#: ../js/dialog-ad.php:66 +#: ../js/dialog-ad.php:71 msgid "Single Ad ID" msgstr "ID объявления" -#: ../js/dialog-ad.php:69 +#: ../js/dialog-ad.php:74 msgid "Single Ad Name" msgstr "Имя объявления" -#: ../js/dialog-ad.php:79 ../js/dialog-zone.php:79 ../js/dialog.php:79 +#: ../js/dialog-ad.php:84 ../js/dialog-zone.php:84 ../js/dialog.php:84 msgid "Allow Ads Places predefined codes" msgstr "Использовать заданные коды рекламного места" -#: ../js/dialog-ad.php:92 ../js/dialog-block.php:82 ../js/dialog-zone.php:92 -#: ../js/dialog.php:92 +#: ../js/dialog-ad.php:97 ../js/dialog-block.php:87 ../js/dialog-zone.php:97 +#: ../js/dialog.php:97 msgid "Insert" msgstr "Вставить" @@ -2899,7 +3023,7 @@ msgstr "Вставить" msgid "Insert Ads Block" msgstr "Вставить блок объявлений" -#: ../js/dialog-block.php:69 +#: ../js/dialog-block.php:74 msgid "Ads Block Name" msgstr "Имя блока" @@ -2907,7 +3031,7 @@ msgstr "Имя блока" msgid "Insert Ads Zone" msgstr "Вставить рекламную зону" -#: ../js/dialog-zone.php:69 +#: ../js/dialog-zone.php:74 msgid "Ads Zone Name" msgstr "Имя зоны" @@ -2915,7 +3039,7 @@ msgstr "Имя зоны" msgid "Insert Ads Place" msgstr "Вставить рекламное место" -#: ../js/dialog.php:69 +#: ../js/dialog.php:74 msgid "Ads Place Name" msgstr "Имя места" diff --git a/langs/simple-ads-manager.pot b/langs/simple-ads-manager.pot index 99f8d9b..ddec876 100644 --- a/langs/simple-ads-manager.pot +++ b/langs/simple-ads-manager.pot @@ -4,14 +4,14 @@ msgid "" msgstr "" "Project-Id-Version: Simple Ads Manager 1.8.70\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-ads-manager\n" -"POT-Creation-Date: 2013-12-08 22:18+0300\n" -"PO-Revision-Date: 2013-12-08 22:18+0300\n" +"POT-Creation-Date: 2013-12-22 22:01+0300\n" +"PO-Revision-Date: 2013-12-22 22:01+0300\n" "Last-Translator: minimus \n" "Language-Team: \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" +"X-Generator: Poedit 1.6.3\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;__ngettext_noop:1,2;__ngettext;" "_n:1,2;_nc:4c,1,2;esc_attr__;_en:1,2;_ex:1,2c;_x:1,2c\n" @@ -22,176 +22,180 @@ msgstr "" msgid "Flash ad" msgstr "" -#: ../ad.class.php:201 +#: ../ad.class.php:208 msgid "Empty data..." msgstr "" -#: ../admin.class.php:126 +#: ../admin.class.php:148 msgid "Active W3 Total Cache plugin detected." msgstr "" -#: ../admin.class.php:127 +#: ../admin.class.php:149 msgid "Active WP Super Cache plugin detected." msgstr "" -#: ../admin.class.php:142 +#: ../admin.class.php:154 +msgid "Active bbPress Forum plugin detected." +msgstr "" + +#: ../admin.class.php:173 msgid "Cache of WP Super Cache plugin is flushed." msgstr "" -#: ../admin.class.php:146 +#: ../admin.class.php:177 msgid "Cache of W3 Total Cache plugin is flushed." msgstr "" -#: ../admin.class.php:348 ../editor.admin.class.php:1424 +#: ../admin.class.php:396 ../editor.admin.class.php:1485 msgid "Advertiser Name" msgstr "" -#: ../admin.class.php:349 +#: ../admin.class.php:397 msgid "Advertiser Nick" msgstr "" -#: ../admin.class.php:350 ../editor.admin.class.php:1428 +#: ../admin.class.php:398 ../editor.admin.class.php:1489 msgid "Advertiser e-mail" msgstr "" -#: ../admin.class.php:354 +#: ../admin.class.php:402 msgid "Category Title" msgstr "" -#: ../admin.class.php:355 +#: ../admin.class.php:403 msgid "Category Slug" msgstr "" -#: ../admin.class.php:359 ../admin.class.php:378 +#: ../admin.class.php:407 ../admin.class.php:426 msgid "Display Name" msgstr "" -#: ../admin.class.php:360 ../admin.class.php:379 +#: ../admin.class.php:408 ../admin.class.php:427 msgid "User Name" msgstr "" -#: ../admin.class.php:364 +#: ../admin.class.php:412 msgid "Tag Title" msgstr "" -#: ../admin.class.php:365 +#: ../admin.class.php:413 msgid "Tag Slug" msgstr "" -#: ../admin.class.php:368 +#: ../admin.class.php:416 msgid "Custom Type Title" msgstr "" -#: ../admin.class.php:369 +#: ../admin.class.php:417 msgid "Custom Type Slug" msgstr "" -#: ../admin.class.php:373 +#: ../admin.class.php:421 msgid "Publication Title" msgstr "" -#: ../admin.class.php:374 +#: ../admin.class.php:422 msgid "Publication Type" msgstr "" -#: ../admin.class.php:380 +#: ../admin.class.php:428 msgid "Role" msgstr "" -#: ../admin.class.php:383 ../block.list.admin.class.php:88 +#: ../admin.class.php:431 ../block.list.admin.class.php:88 #: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 -#: ../errorlog.admin.class.php:93 ../list.admin.class.php:172 -#: ../list.admin.class.php:183 ../list.admin.class.php:359 -#: ../list.admin.class.php:369 ../zone.list.admin.class.php:88 +#: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 +#: ../list.admin.class.php:184 ../list.admin.class.php:360 +#: ../list.admin.class.php:370 ../zone.list.admin.class.php:88 #: ../zone.list.admin.class.php:94 msgid "ID" msgstr "" -#: ../admin.class.php:384 +#: ../admin.class.php:432 msgid "Term Name" msgstr "" -#: ../admin.class.php:385 +#: ../admin.class.php:433 msgid "Custom Taxonomy Name" msgstr "" -#: ../admin.class.php:391 +#: ../admin.class.php:439 msgid "Full Size" msgstr "" -#: ../admin.class.php:445 +#: ../admin.class.php:493 msgid "General Settings" msgstr "" -#: ../admin.class.php:446 +#: ../admin.class.php:494 msgid "Auto Inserting Settings" msgstr "" -#: ../admin.class.php:447 +#: ../admin.class.php:495 msgid "Extended Options" msgstr "" -#: ../admin.class.php:448 +#: ../admin.class.php:496 msgid "Google DFP Settings" msgstr "" -#: ../admin.class.php:449 ../help.class.php:68 ../help.class.php:195 +#: ../admin.class.php:497 ../help.class.php:68 ../help.class.php:195 msgid "Statistics Settings" msgstr "" -#: ../admin.class.php:450 +#: ../admin.class.php:498 msgid "Admin Layout" msgstr "" -#: ../admin.class.php:451 +#: ../admin.class.php:499 msgid "Plugin Deactivating" msgstr "" -#: ../admin.class.php:453 +#: ../admin.class.php:501 msgid "Views per Cycle" msgstr "" -#: ../admin.class.php:453 +#: ../admin.class.php:501 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" -#: ../admin.class.php:454 +#: ../admin.class.php:502 msgid "Minimum Level for access to menu" msgstr "" -#: ../admin.class.php:454 +#: ../admin.class.php:502 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " "of SAM Plugin." msgstr "" -#: ../admin.class.php:454 ../admin.class.php:559 ../admin.class.php:678 +#: ../admin.class.php:502 ../admin.class.php:619 ../admin.class.php:760 msgid "Super Admin" msgstr "" -#: ../admin.class.php:454 ../admin.class.php:560 ../admin.class.php:677 +#: ../admin.class.php:502 ../admin.class.php:620 ../admin.class.php:759 msgid "Administrator" msgstr "" -#: ../admin.class.php:454 ../admin.class.php:561 ../admin.class.php:676 +#: ../admin.class.php:502 ../admin.class.php:621 ../admin.class.php:758 msgid "Editor" msgstr "" -#: ../admin.class.php:454 ../admin.class.php:562 ../admin.class.php:675 +#: ../admin.class.php:502 ../admin.class.php:622 ../admin.class.php:757 msgid "Author" msgstr "" -#: ../admin.class.php:454 ../admin.class.php:563 ../admin.class.php:674 +#: ../admin.class.php:502 ../admin.class.php:623 ../admin.class.php:756 msgid "Contributor" msgstr "" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Ad Output Mode" msgstr "" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "" "Standard (PHP) mode is more faster but is not compatible with caching " "plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " @@ -200,444 +204,491 @@ msgid "" "of special support of these plugins." msgstr "" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Standard (PHP)" msgstr "" -#: ../admin.class.php:455 +#: ../admin.class.php:503 msgid "Caching Compatible (Javascript)" msgstr "" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Display Ad Source in" msgstr "" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Target wintow (tab) for advetisement source." msgstr "" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "New Window (Tab)" msgstr "" -#: ../admin.class.php:456 +#: ../admin.class.php:504 msgid "Current Window (Tab)" msgstr "" -#: ../admin.class.php:458 +#: ../admin.class.php:505 +msgid "Allow displaying ads on bbPress forum pages" +msgstr "" + +#: ../admin.class.php:507 msgid "Ads Place before content" msgstr "" -#: ../admin.class.php:459 +#: ../admin.class.php:508 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" -#: ../admin.class.php:460 ../admin.class.php:463 ../admin.class.php:466 +#: ../admin.class.php:509 +msgid "Allow Ads Place auto inserting before post/page excerpt (in the loop)" +msgstr "" + +#: ../admin.class.php:510 +msgid "Allow Ads Place auto inserting before bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:511 +msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" +msgstr "" + +#: ../admin.class.php:512 ../admin.class.php:516 ../admin.class.php:520 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" -#: ../admin.class.php:461 +#: ../admin.class.php:513 msgid "Ads Place in the middle of content" msgstr "" -#: ../admin.class.php:462 +#: ../admin.class.php:514 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" -#: ../admin.class.php:464 +#: ../admin.class.php:515 +msgid "" +"Allow Ads Place auto inserting into the middle of bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:517 msgid "Ads Place after content" msgstr "" -#: ../admin.class.php:465 +#: ../admin.class.php:518 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" -#: ../admin.class.php:468 +#: ../admin.class.php:519 +msgid "Allow Ads Place auto inserting after bbPress Forum topic content" +msgstr "" + +#: ../admin.class.php:522 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." msgstr "" -#: ../admin.class.php:469 +#: ../admin.class.php:523 msgid "Turn on/off the error log." msgstr "" -#: ../admin.class.php:470 +#: ../admin.class.php:524 msgid "Turn on/off the error log for Face Side." msgstr "" -#: ../admin.class.php:472 +#: ../admin.class.php:526 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "" -#: ../admin.class.php:473 +#: ../admin.class.php:527 msgid "Google DFP Pub Code" msgstr "" -#: ../admin.class.php:473 +#: ../admin.class.php:527 msgid "Your Google DFP Pub code. i.e:" msgstr "" -#: ../admin.class.php:475 +#: ../admin.class.php:529 msgid "Allow Bots and Crawlers detection" msgstr "" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Accuracy of Bots and Crawlers Detection" msgstr "" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." msgstr "" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Inexact detection" msgstr "" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "Exact detection" msgstr "" -#: ../admin.class.php:476 +#: ../admin.class.php:530 msgid "More exact detection" msgstr "" -#: ../admin.class.php:477 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "" -#: ../admin.class.php:477 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." msgstr "" -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "Auto" msgstr "" -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "USD" msgstr "" -#: ../admin.class.php:477 +#: ../admin.class.php:531 msgid "EUR" msgstr "" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "TinyMCE Editor Button Mode" msgstr "" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " "In this case select \"Classic TinyMCE Buttons\"." msgstr "" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "Modern TinyMCE Button" msgstr "" -#: ../admin.class.php:479 +#: ../admin.class.php:533 msgid "Classic TinyMCE Buttons" msgstr "" -#: ../admin.class.php:480 +#: ../admin.class.php:534 msgid "Ads Places per Page" msgstr "" -#: ../admin.class.php:480 +#: ../admin.class.php:534 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." msgstr "" -#: ../admin.class.php:481 +#: ../admin.class.php:535 msgid "Ads per Page" msgstr "" -#: ../admin.class.php:481 +#: ../admin.class.php:535 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." msgstr "" -#: ../admin.class.php:483 +#: ../admin.class.php:537 msgid "Delete plugin options during deactivating plugin" msgstr "" -#: ../admin.class.php:484 +#: ../admin.class.php:538 msgid "Delete database tables of plugin during deactivating plugin" msgstr "" -#: ../admin.class.php:485 +#: ../admin.class.php:539 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" -#: ../admin.class.php:493 +#: ../admin.class.php:547 msgid "Ads" msgstr "" -#: ../admin.class.php:494 +#: ../admin.class.php:548 msgid "Ads List" msgstr "" -#: ../admin.class.php:494 +#: ../admin.class.php:548 msgid "Ads Places" msgstr "" -#: ../admin.class.php:495 +#: ../admin.class.php:549 msgid "Ad Editor" msgstr "" -#: ../admin.class.php:495 +#: ../admin.class.php:549 msgid "New Place" msgstr "" -#: ../admin.class.php:496 +#: ../admin.class.php:550 msgid "Ads Zones List" msgstr "" -#: ../admin.class.php:496 +#: ../admin.class.php:550 msgid "Ads Zones" msgstr "" -#: ../admin.class.php:497 +#: ../admin.class.php:551 msgid "Ads Zone Editor" msgstr "" -#: ../admin.class.php:497 +#: ../admin.class.php:551 msgid "New Zone" msgstr "" -#: ../admin.class.php:498 +#: ../admin.class.php:552 msgid "Ads Blocks List" msgstr "" -#: ../admin.class.php:498 +#: ../admin.class.php:552 msgid "Ads Blocks" msgstr "" -#: ../admin.class.php:499 ../block.editor.admin.class.php:402 +#: ../admin.class.php:553 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "" -#: ../admin.class.php:499 +#: ../admin.class.php:553 msgid "New Block" msgstr "" -#: ../admin.class.php:500 ../admin.class.php:999 +#: ../admin.class.php:554 ../admin.class.php:1087 msgid "Simple Ads Manager Settings" msgstr "" -#: ../admin.class.php:500 +#: ../admin.class.php:554 msgid "Settings" msgstr "" -#: ../admin.class.php:501 +#: ../admin.class.php:555 msgid "Simple Ads Manager Error Log" msgstr "" -#: ../admin.class.php:501 ../errorlog.admin.class.php:57 +#: ../admin.class.php:555 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "" -#: ../admin.class.php:601 ../admin.class.php:658 ../editor.admin.class.php:446 +#: ../admin.class.php:667 ../admin.class.php:739 ../editor.admin.class.php:460 msgid "Name of Ads Place" msgstr "" -#: ../admin.class.php:601 ../admin.class.php:658 +#: ../admin.class.php:667 ../admin.class.php:739 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." msgstr "" -#: ../admin.class.php:602 ../admin.class.php:659 ../editor.admin.class.php:932 +#: ../admin.class.php:668 ../admin.class.php:740 ../editor.admin.class.php:986 msgid "Name of Ad" msgstr "" -#: ../admin.class.php:602 ../admin.class.php:659 ../admin.class.php:705 +#: ../admin.class.php:668 ../admin.class.php:740 ../admin.class.php:788 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." msgstr "" -#: ../admin.class.php:603 ../admin.class.php:660 +#: ../admin.class.php:669 ../admin.class.php:741 msgid "Select Banner Image" msgstr "" -#: ../admin.class.php:603 ../admin.class.php:660 +#: ../admin.class.php:669 ../admin.class.php:741 msgid "Select" msgstr "" -#: ../admin.class.php:605 ../admin.class.php:665 +#: ../admin.class.php:673 ../admin.class.php:747 msgid "Uploading" msgstr "" -#: ../admin.class.php:606 ../admin.class.php:666 +#: ../admin.class.php:674 ../admin.class.php:748 msgid "Uploaded." msgstr "" -#: ../admin.class.php:607 ../admin.class.php:667 +#: ../admin.class.php:675 ../admin.class.php:749 msgid "Only JPG, PNG or GIF files are allowed" msgstr "" -#: ../admin.class.php:608 ../admin.class.php:668 +#: ../admin.class.php:676 ../admin.class.php:750 msgid "File" msgstr "" -#: ../admin.class.php:671 +#: ../admin.class.php:680 ../admin.class.php:684 ../admin.class.php:761 +#: ../editor.admin.class.php:608 ../editor.admin.class.php:937 +#: ../editor.admin.class.php:1547 ../list.admin.class.php:176 +#: ../list.admin.class.php:187 ../list.admin.class.php:235 +#: ../list.admin.class.php:363 ../list.admin.class.php:373 +#: ../list.admin.class.php:425 +msgid "Hits" +msgstr "" + +#: ../admin.class.php:680 ../admin.class.php:685 ../admin.class.php:761 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1548 ../list.admin.class.php:236 +#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:426 +msgid "Clicks" +msgstr "" + +#: ../admin.class.php:683 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:355 +msgid "Name" +msgstr "" + +#: ../admin.class.php:753 msgid "Post" msgstr "" -#: ../admin.class.php:672 ../editor.admin.class.php:1078 +#: ../admin.class.php:754 ../editor.admin.class.php:1134 msgid "Page" msgstr "" -#: ../admin.class.php:673 +#: ../admin.class.php:755 msgid "Subscriber" msgstr "" -#: ../admin.class.php:705 ../zone.editor.admin.class.php:352 +#: ../admin.class.php:788 ../zone.editor.admin.class.php:356 msgid "Name of Ads Zone" msgstr "" -#: ../admin.class.php:706 ../block.editor.admin.class.php:309 +#: ../admin.class.php:789 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "" -#: ../admin.class.php:706 +#: ../admin.class.php:789 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." msgstr "" -#: ../admin.class.php:725 +#: ../admin.class.php:808 msgid "Error ID" msgstr "" -#: ../admin.class.php:726 +#: ../admin.class.php:809 msgid "Error Date" msgstr "" -#: ../admin.class.php:727 ../errorlog.admin.class.php:86 +#: ../admin.class.php:810 ../errorlog.admin.class.php:86 #: ../errorlog.admin.class.php:96 msgid "Table" msgstr "" -#: ../admin.class.php:728 +#: ../admin.class.php:811 msgid "Error Message" msgstr "" -#: ../admin.class.php:729 +#: ../admin.class.php:812 msgid "Error SQL" msgstr "" -#: ../admin.class.php:730 ../errorlog.admin.class.php:87 +#: ../admin.class.php:813 ../errorlog.admin.class.php:87 #: ../errorlog.admin.class.php:97 msgid "Type" msgstr "" -#: ../admin.class.php:731 +#: ../admin.class.php:814 msgid "Close" msgstr "" -#: ../admin.class.php:733 ../admin.class.php:794 +#: ../admin.class.php:816 ../admin.class.php:877 #: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 msgid "Warning" msgstr "" -#: ../admin.class.php:733 ../errorlog.admin.class.php:136 +#: ../admin.class.php:816 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "" -#: ../admin.class.php:794 ../errorlog.admin.class.php:116 +#: ../admin.class.php:877 ../errorlog.admin.class.php:116 msgid "Update Error" msgstr "" -#: ../admin.class.php:794 ../errorlog.admin.class.php:116 +#: ../admin.class.php:877 ../errorlog.admin.class.php:116 msgid "Output Error" msgstr "" -#: ../admin.class.php:880 +#: ../admin.class.php:963 msgid "There are general options." msgstr "" -#: ../admin.class.php:884 +#: ../admin.class.php:967 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" "page content." msgstr "" -#: ../admin.class.php:892 +#: ../admin.class.php:975 msgid "Adjust parameters of your Google DFP account." msgstr "" -#: ../admin.class.php:896 +#: ../admin.class.php:979 msgid "Adjust parameters of plugin statistics." msgstr "" -#: ../admin.class.php:900 +#: ../admin.class.php:983 msgid "This options define layout for Ads Managin Pages." msgstr "" -#: ../admin.class.php:904 +#: ../admin.class.php:987 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "" -#: ../admin.class.php:1013 +#: ../admin.class.php:1101 msgid "Simple Ads Manager Settings Updated." msgstr "" -#: ../admin.class.php:1021 +#: ../admin.class.php:1109 msgid "System Info" msgstr "" -#: ../admin.class.php:1028 +#: ../admin.class.php:1116 msgid "Wordpress Version" msgstr "" -#: ../admin.class.php:1029 +#: ../admin.class.php:1117 msgid "SAM Version" msgstr "" -#: ../admin.class.php:1030 +#: ../admin.class.php:1118 msgid "SAM DB Version" msgstr "" -#: ../admin.class.php:1031 +#: ../admin.class.php:1119 msgid "PHP Version" msgstr "" -#: ../admin.class.php:1032 +#: ../admin.class.php:1120 msgid "MySQL Version" msgstr "" -#: ../admin.class.php:1033 +#: ../admin.class.php:1121 msgid "Memory Limit" msgstr "" -#: ../admin.class.php:1037 +#: ../admin.class.php:1125 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" -#: ../admin.class.php:1042 +#: ../admin.class.php:1130 msgid "Resources" msgstr "" -#: ../admin.class.php:1045 +#: ../admin.class.php:1133 msgid "Wordpress Plugin Page" msgstr "" -#: ../admin.class.php:1046 +#: ../admin.class.php:1134 msgid "Author Plugin Page" msgstr "" -#: ../admin.class.php:1047 ../help.class.php:34 ../help.class.php:51 +#: ../admin.class.php:1135 ../help.class.php:34 ../help.class.php:51 #: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 #: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 #: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 @@ -645,62 +696,62 @@ msgstr "" msgid "Support Forum" msgstr "" -#: ../admin.class.php:1048 +#: ../admin.class.php:1136 msgid "Author's Blog" msgstr "" -#: ../admin.class.php:1053 +#: ../admin.class.php:1141 msgid "Donations" msgstr "" -#: ../admin.class.php:1065 +#: ../admin.class.php:1153 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " "support future development. Your support will be much appreciated. Thank you!" msgstr "" -#: ../admin.class.php:1066 +#: ../admin.class.php:1154 msgid "Donate Now!" msgstr "" -#: ../admin.class.php:1066 +#: ../admin.class.php:1154 msgid "donation" msgstr "" -#: ../admin.class.php:1084 +#: ../admin.class.php:1172 msgid "Another Plugins" msgstr "" -#: ../admin.class.php:1088 +#: ../admin.class.php:1176 #, php-format msgid "Another plugins from %s" msgstr "" -#: ../admin.class.php:1094 +#: ../admin.class.php:1182 msgid "Highlights any portion of text as text in the colored boxes." msgstr "" -#: ../admin.class.php:1095 +#: ../admin.class.php:1183 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." msgstr "" -#: ../admin.class.php:1096 +#: ../admin.class.php:1184 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "" -#: ../admin.class.php:1097 +#: ../admin.class.php:1185 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" -#: ../admin.class.php:1113 +#: ../admin.class.php:1201 msgctxt "Copyright String" msgid "Simple Ads Manager plugin for Wordpress." msgstr "" -#: ../admin.class.php:1113 +#: ../admin.class.php:1201 msgctxt "Copyright String" msgid "All rights reserved." msgstr "" @@ -708,15 +759,16 @@ msgstr "" #: ../block.editor.admin.class.php:73 ../block.editor.admin.class.php:253 #: ../block.editor.admin.class.php:314 ../block.editor.admin.class.php:328 #: ../block.editor.admin.class.php:346 ../block.editor.admin.class.php:372 -#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:382 -#: ../editor.admin.class.php:451 ../editor.admin.class.php:465 -#: ../editor.admin.class.php:486 ../editor.admin.class.php:547 -#: ../editor.admin.class.php:857 ../editor.admin.class.php:937 -#: ../editor.admin.class.php:959 ../editor.admin.class.php:1029 -#: ../editor.admin.class.php:1128 ../editor.admin.class.php:1171 -#: ../editor.admin.class.php:1416 ../editor.admin.class.php:1436 -#: ../editor.admin.class.php:1468 ../zone.editor.admin.class.php:296 -#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:371 +#: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 +#: ../editor.admin.class.php:465 ../editor.admin.class.php:486 +#: ../editor.admin.class.php:507 ../editor.admin.class.php:527 +#: ../editor.admin.class.php:615 ../editor.admin.class.php:911 +#: ../editor.admin.class.php:991 ../editor.admin.class.php:1015 +#: ../editor.admin.class.php:1085 ../editor.admin.class.php:1185 +#: ../editor.admin.class.php:1430 ../editor.admin.class.php:1477 +#: ../editor.admin.class.php:1497 ../editor.admin.class.php:1556 +#: ../zone.editor.admin.class.php:300 ../zone.editor.admin.class.php:361 +#: ../zone.editor.admin.class.php:375 msgid "Click to toggle" msgstr "" @@ -725,7 +777,7 @@ msgid "Item" msgstr "" #: ../block.editor.admin.class.php:77 ../help.class.php:125 -#: ../widget.class.php:16 ../js/dialog.php:48 +#: ../widget.class.php:16 ../js/dialog.php:53 msgid "Ads Place" msgstr "" @@ -739,19 +791,19 @@ msgid "Single Ad" msgstr "" #: ../block.editor.admin.class.php:103 ../widget.class.php:150 -#: ../widget.class.php:155 ../js/dialog-zone.php:48 +#: ../widget.class.php:155 ../js/dialog-zone.php:53 msgid "Ads Zone" msgstr "" #: ../block.editor.admin.class.php:173 ../block.editor.admin.class.php:217 -#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:313 -#: ../editor.admin.class.php:345 ../editor.admin.class.php:362 -#: ../editor.admin.class.php:363 ../editor.admin.class.php:364 -#: ../editor.admin.class.php:372 ../editor.admin.class.php:679 -#: ../editor.admin.class.php:774 ../editor.admin.class.php:838 -#: ../editor.admin.class.php:839 ../editor.admin.class.php:840 -#: ../zone.editor.admin.class.php:158 ../zone.editor.admin.class.php:253 -#: ../zone.editor.admin.class.php:286 +#: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 +#: ../editor.admin.class.php:359 ../editor.admin.class.php:376 +#: ../editor.admin.class.php:377 ../editor.admin.class.php:378 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:725 +#: ../editor.admin.class.php:824 ../editor.admin.class.php:892 +#: ../editor.admin.class.php:893 ../editor.admin.class.php:894 +#: ../zone.editor.admin.class.php:162 ../zone.editor.admin.class.php:257 +#: ../zone.editor.admin.class.php:290 msgid "Undefined" msgstr "" @@ -767,9 +819,9 @@ msgstr "" msgid "Edit Ads Block" msgstr "" -#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:383 -#: ../editor.admin.class.php:858 ../errorlog.admin.class.php:84 -#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:297 +#: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 +#: ../editor.admin.class.php:912 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:301 msgid "Status" msgstr "" @@ -777,59 +829,54 @@ msgstr "" msgid "Back to Blocks List" msgstr "" -#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:66 +#: ../block.editor.admin.class.php:270 ../js/dialog-block.php:71 msgid "Ads Block ID" msgstr "" -#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:413 -#: ../zone.editor.admin.class.php:319 +#: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:323 msgid "Is Active" msgstr "" -#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:414 -#: ../editor.admin.class.php:900 ../zone.editor.admin.class.php:320 +#: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 +#: ../editor.admin.class.php:954 ../zone.editor.admin.class.php:324 msgid "Is In Trash" msgstr "" #: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 -#: ../editor.admin.class.php:421 ../editor.admin.class.php:426 -#: ../editor.admin.class.php:907 ../editor.admin.class.php:912 -#: ../zone.editor.admin.class.php:327 ../zone.editor.admin.class.php:333 -#: ../js/dialog-ad.php:89 ../js/dialog-block.php:79 ../js/dialog-zone.php:89 -#: ../js/dialog.php:89 +#: ../editor.admin.class.php:435 ../editor.admin.class.php:440 +#: ../editor.admin.class.php:961 ../editor.admin.class.php:966 +#: ../zone.editor.admin.class.php:331 ../zone.editor.admin.class.php:337 +#: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 +#: ../js/dialog.php:94 msgid "Cancel" msgstr "" #: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 -#: ../editor.admin.class.php:430 ../editor.admin.class.php:432 -#: ../editor.admin.class.php:916 ../editor.admin.class.php:918 -#: ../zone.editor.admin.class.php:330 ../zone.editor.admin.class.php:337 +#: ../editor.admin.class.php:444 ../editor.admin.class.php:446 +#: ../editor.admin.class.php:970 ../editor.admin.class.php:972 +#: ../zone.editor.admin.class.php:334 ../zone.editor.admin.class.php:341 msgid "Save" msgstr "" -#: ../block.editor.admin.class.php:308 ../editor.admin.class.php:445 -#: ../zone.editor.admin.class.php:351 -msgid "Name" -msgstr "" - -#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:932 -#: ../zone.editor.admin.class.php:352 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:986 +#: ../zone.editor.admin.class.php:356 msgid "Required for SAM widgets." msgstr "" #: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 -#: ../editor.admin.class.php:452 ../editor.admin.class.php:456 -#: ../editor.admin.class.php:941 ../zone.editor.admin.class.php:358 -#: ../zone.editor.admin.class.php:362 +#: ../editor.admin.class.php:466 ../editor.admin.class.php:470 +#: ../editor.admin.class.php:995 ../zone.editor.admin.class.php:362 +#: ../zone.editor.admin.class.php:366 msgid "Description" msgstr "" -#: ../block.editor.admin.class.php:317 ../block.editor.admin.class.php:404 +#: ../block.editor.admin.class.php:317 msgid "Enter description of this Ads Block." msgstr "" -#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:459 -#: ../editor.admin.class.php:945 ../zone.editor.admin.class.php:365 +#: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 +#: ../editor.admin.class.php:999 ../zone.editor.admin.class.php:369 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -916,18 +963,22 @@ msgid "" "Block Items here!" msgstr "" +#: ../block.editor.admin.class.php:404 +msgid "Adjust items settings of this Ads Block." +msgstr "" + #: ../block.editor.admin.class.php:406 msgid "Block Editor." msgstr "" #: ../block.list.admin.class.php:48 ../errorlog.admin.class.php:49 -#: ../list.admin.class.php:129 ../list.admin.class.php:312 +#: ../list.admin.class.php:130 ../list.admin.class.php:313 #: ../zone.list.admin.class.php:48 msgid "«" msgstr "" #: ../block.list.admin.class.php:49 ../errorlog.admin.class.php:50 -#: ../list.admin.class.php:130 ../list.admin.class.php:313 +#: ../list.admin.class.php:131 ../list.admin.class.php:314 #: ../zone.list.admin.class.php:49 msgid "»" msgstr "" @@ -937,25 +988,25 @@ msgid "Managing Ads Blocks" msgstr "" #: ../block.list.admin.class.php:63 ../errorlog.admin.class.php:59 -#: ../list.admin.class.php:144 ../list.admin.class.php:327 +#: ../list.admin.class.php:145 ../list.admin.class.php:328 #: ../zone.list.admin.class.php:63 msgid "All" msgstr "" #: ../block.list.admin.class.php:64 ../errorlog.admin.class.php:60 -#: ../list.admin.class.php:145 ../list.admin.class.php:328 +#: ../list.admin.class.php:146 ../list.admin.class.php:329 #: ../zone.list.admin.class.php:64 msgid "Active" msgstr "" -#: ../block.list.admin.class.php:65 ../list.admin.class.php:146 -#: ../list.admin.class.php:329 ../zone.list.admin.class.php:65 +#: ../block.list.admin.class.php:65 ../list.admin.class.php:147 +#: ../list.admin.class.php:330 ../zone.list.admin.class.php:65 msgid "Trash" msgstr "" #: ../block.list.admin.class.php:70 ../block.list.admin.class.php:144 -#: ../list.admin.class.php:151 ../list.admin.class.php:271 -#: ../list.admin.class.php:335 ../list.admin.class.php:454 +#: ../list.admin.class.php:152 ../list.admin.class.php:272 +#: ../list.admin.class.php:336 ../list.admin.class.php:455 #: ../zone.list.admin.class.php:70 ../zone.list.admin.class.php:144 msgid "Clear Trash" msgstr "" @@ -966,8 +1017,8 @@ msgstr "" #: ../block.list.admin.class.php:76 ../block.list.admin.class.php:150 #: ../errorlog.admin.class.php:71 ../errorlog.admin.class.php:173 -#: ../list.admin.class.php:160 ../list.admin.class.php:280 -#: ../list.admin.class.php:345 ../list.admin.class.php:463 +#: ../list.admin.class.php:161 ../list.admin.class.php:281 +#: ../list.admin.class.php:346 ../list.admin.class.php:464 #: ../zone.list.admin.class.php:76 ../zone.list.admin.class.php:150 #, php-format msgid "Displaying %s–%s of %s" @@ -978,13 +1029,13 @@ msgid "Block Name" msgstr "" #: ../block.list.admin.class.php:113 ../errorlog.admin.class.php:121 -#: ../list.admin.class.php:216 ../list.admin.class.php:403 +#: ../list.admin.class.php:217 ../list.admin.class.php:404 #: ../zone.list.admin.class.php:113 msgid "There are no data ..." msgstr "" -#: ../block.list.admin.class.php:121 ../list.admin.class.php:241 -#: ../list.admin.class.php:431 ../zone.list.admin.class.php:121 +#: ../block.list.admin.class.php:121 ../list.admin.class.php:242 +#: ../list.admin.class.php:432 ../zone.list.admin.class.php:121 msgid "in Trash" msgstr "" @@ -992,8 +1043,8 @@ msgstr "" msgid "Edit Block" msgstr "" -#: ../block.list.admin.class.php:123 ../list.admin.class.php:243 -#: ../list.admin.class.php:433 ../zone.list.admin.class.php:123 +#: ../block.list.admin.class.php:123 ../list.admin.class.php:244 +#: ../list.admin.class.php:434 ../zone.list.admin.class.php:123 msgid "Edit" msgstr "" @@ -1001,8 +1052,8 @@ msgstr "" msgid "Restore this Block from the Trash" msgstr "" -#: ../block.list.admin.class.php:127 ../list.admin.class.php:247 -#: ../list.admin.class.php:437 ../zone.list.admin.class.php:127 +#: ../block.list.admin.class.php:127 ../list.admin.class.php:248 +#: ../list.admin.class.php:438 ../zone.list.admin.class.php:127 msgid "Restore" msgstr "" @@ -1011,7 +1062,7 @@ msgid "Remove this Block permanently" msgstr "" #: ../block.list.admin.class.php:128 ../errorlog.admin.class.php:152 -#: ../list.admin.class.php:248 ../list.admin.class.php:438 +#: ../list.admin.class.php:249 ../list.admin.class.php:439 #: ../zone.list.admin.class.php:128 msgid "Remove permanently" msgstr "" @@ -1020,8 +1071,8 @@ msgstr "" msgid "Move this Block to the Trash" msgstr "" -#: ../block.list.admin.class.php:133 ../list.admin.class.php:253 -#: ../list.admin.class.php:439 ../zone.list.admin.class.php:133 +#: ../block.list.admin.class.php:133 ../list.admin.class.php:254 +#: ../list.admin.class.php:440 ../zone.list.admin.class.php:133 msgid "Delete" msgstr "" @@ -1229,752 +1280,820 @@ msgstr "" msgid "Custom width and height" msgstr "" +#: ../editor.admin.class.php:224 +msgid "January" +msgstr "" + #: ../editor.admin.class.php:225 -msgid "Image Tools" +msgid "February" +msgstr "" + +#: ../editor.admin.class.php:226 +msgid "Mart" +msgstr "" + +#: ../editor.admin.class.php:227 +msgid "April" msgstr "" #: ../editor.admin.class.php:228 -msgid "Media Library" +msgid "May" msgstr "" #: ../editor.admin.class.php:229 -msgid "Server" +msgid "June" msgstr "" #: ../editor.admin.class.php:230 -msgid "Local Computer" +msgid "July" +msgstr "" + +#: ../editor.admin.class.php:231 +msgid "August" +msgstr "" + +#: ../editor.admin.class.php:232 +msgid "September" +msgstr "" + +#: ../editor.admin.class.php:233 +msgid "October" msgstr "" #: ../editor.admin.class.php:234 +msgid "November" +msgstr "" + +#: ../editor.admin.class.php:235 +msgid "December" +msgstr "" + +#: ../editor.admin.class.php:243 +msgid "Image Tools" +msgstr "" + +#: ../editor.admin.class.php:246 +msgid "Media Library" +msgstr "" + +#: ../editor.admin.class.php:247 +msgid "Server" +msgstr "" + +#: ../editor.admin.class.php:248 +msgid "Local Computer" +msgstr "" + +#: ../editor.admin.class.php:252 msgid "Select Image from Media Library" msgstr "" -#: ../editor.admin.class.php:236 +#: ../editor.admin.class.php:254 msgid "Select or Upload" msgstr "" -#: ../editor.admin.class.php:238 +#: ../editor.admin.class.php:256 msgid "" "You can upload your banners to Wordpress Media Library or select banner " "image from it." msgstr "" -#: ../editor.admin.class.php:243 +#: ../editor.admin.class.php:261 msgid "Select File" msgstr "" -#: ../editor.admin.class.php:248 +#: ../editor.admin.class.php:266 msgid "Apply" msgstr "" -#: ../editor.admin.class.php:250 +#: ../editor.admin.class.php:268 msgid "Select file from your blog server." msgstr "" -#: ../editor.admin.class.php:255 +#: ../editor.admin.class.php:273 msgid "Upload File" msgstr "" -#: ../editor.admin.class.php:257 +#: ../editor.admin.class.php:275 msgid "Upload" msgstr "" -#: ../editor.admin.class.php:261 +#: ../editor.admin.class.php:279 msgid "Select and upload file from your local computer." msgstr "" -#: ../editor.admin.class.php:326 +#: ../editor.admin.class.php:340 msgid "Ads Place Data Updated." msgstr "" -#: ../editor.admin.class.php:372 +#: ../editor.admin.class.php:386 msgid "New Ads Place" msgstr "" -#: ../editor.admin.class.php:372 +#: ../editor.admin.class.php:386 msgid "Edit Ads Place" msgstr "" -#: ../editor.admin.class.php:392 +#: ../editor.admin.class.php:406 msgid "Back to Places List" msgstr "" -#: ../editor.admin.class.php:399 ../js/dialog.php:66 +#: ../editor.admin.class.php:413 ../js/dialog.php:71 msgid "Ads Place ID" msgstr "" -#: ../editor.admin.class.php:405 ../editor.admin.class.php:889 -#: ../list.admin.class.php:174 ../list.admin.class.php:185 +#: ../editor.admin.class.php:419 ../editor.admin.class.php:943 +#: ../list.admin.class.php:175 ../list.admin.class.php:186 msgid "Size" msgstr "" -#: ../editor.admin.class.php:407 ../editor.admin.class.php:891 +#: ../editor.admin.class.php:421 ../editor.admin.class.php:945 msgid "Width" msgstr "" -#: ../editor.admin.class.php:409 ../editor.admin.class.php:893 +#: ../editor.admin.class.php:423 ../editor.admin.class.php:947 msgid "Height" msgstr "" -#: ../editor.admin.class.php:446 +#: ../editor.admin.class.php:460 msgid "Required for SAM widgets and settings." msgstr "" -#: ../editor.admin.class.php:454 +#: ../editor.admin.class.php:468 msgid "Enter description of this Ads Place." msgstr "" -#: ../editor.admin.class.php:466 +#: ../editor.admin.class.php:479 ../editor.admin.class.php:1006 +msgid "General" +msgstr "" + +#: ../editor.admin.class.php:480 +msgid "Default Ad" +msgstr "" + +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1010 +msgid "Statistic" +msgstr "" + +#: ../editor.admin.class.php:487 msgid "Ads Place Size" msgstr "" -#: ../editor.admin.class.php:468 +#: ../editor.admin.class.php:489 msgid "Select size of this Ads Place." msgstr "" -#: ../editor.admin.class.php:473 +#: ../editor.admin.class.php:494 msgid "Custom Width" msgstr "" -#: ../editor.admin.class.php:477 +#: ../editor.admin.class.php:498 msgid "Custom Height" msgstr "" -#: ../editor.admin.class.php:480 +#: ../editor.admin.class.php:501 msgid "" "These values are not used and are added solely for the convenience of " "advertising management. Will be used in the future..." msgstr "" -#: ../editor.admin.class.php:487 +#: ../editor.admin.class.php:508 +msgid "Codes" +msgstr "" + +#: ../editor.admin.class.php:510 +msgid "Enter the code to output before and after the codes of Ads Place." +msgstr "" + +#: ../editor.admin.class.php:512 +msgid "Code Before" +msgstr "" + +#: ../editor.admin.class.php:516 +msgid "Code After" +msgstr "" + +#: ../editor.admin.class.php:519 +msgid "" +"You can enter any HTML codes here for the further withdrawal of their before " +"and after the code of Ads Place." +msgstr "" + +#: ../editor.admin.class.php:528 msgid "Ads Place Patch" msgstr "" -#: ../editor.admin.class.php:489 +#: ../editor.admin.class.php:530 msgid "" "Select type of the code of a patch and fill data entry fields with the " "appropriate data." msgstr "" -#: ../editor.admin.class.php:491 ../editor.admin.class.php:495 +#: ../editor.admin.class.php:532 ../editor.admin.class.php:536 msgid "Image" msgstr "" -#: ../editor.admin.class.php:500 +#: ../editor.admin.class.php:541 msgid "" "This image is a patch for advertising space. This may be an image with the " "text \"Place your ad here\"." msgstr "" -#: ../editor.admin.class.php:503 +#: ../editor.admin.class.php:544 msgid "Target" msgstr "" -#: ../editor.admin.class.php:507 +#: ../editor.admin.class.php:548 msgid "This is a link to a page where are your suggestions for advertisers." msgstr "" -#: ../editor.admin.class.php:513 +#: ../editor.admin.class.php:554 msgid "HTML or Javascript Code" msgstr "" -#: ../editor.admin.class.php:517 +#: ../editor.admin.class.php:558 msgid "Patch Code" msgstr "" -#: ../editor.admin.class.php:522 +#: ../editor.admin.class.php:563 msgid "" "This is one-block code of third-party AdServer rotator. Selecting this " "checkbox prevents displaying contained ads." msgstr "" -#: ../editor.admin.class.php:525 +#: ../editor.admin.class.php:566 msgid "" "This is a HTML-code patch of advertising space. For example: use the code to " "display AdSense advertisement. " msgstr "" -#: ../editor.admin.class.php:530 +#: ../editor.admin.class.php:571 msgid "Google DFP" msgstr "" -#: ../editor.admin.class.php:534 +#: ../editor.admin.class.php:575 msgid "DFP Block Name" msgstr "" -#: ../editor.admin.class.php:538 +#: ../editor.admin.class.php:579 msgid "This is name of Google DFP block!" msgstr "" -#: ../editor.admin.class.php:541 +#: ../editor.admin.class.php:582 msgid "" "The patch (default advertisement) will be shown that if the logic of the " "plugin can not show any contained advertisement on the current page of the " "document." msgstr "" -#: ../editor.admin.class.php:548 -msgid "Codes" +#: ../editor.admin.class.php:597 ../editor.admin.class.php:1536 +msgid "Select Period" msgstr "" -#: ../editor.admin.class.php:550 -msgid "Enter the code to output before and after the codes of Ads Place." +#: ../editor.admin.class.php:599 ../editor.admin.class.php:1538 +msgid "This Month" msgstr "" -#: ../editor.admin.class.php:552 -msgid "Code Before" +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1539 +msgid "Previous Month" msgstr "" -#: ../editor.admin.class.php:556 -msgid "Code After" +#: ../editor.admin.class.php:607 ../editor.admin.class.php:1546 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 +msgid "Total" msgstr "" -#: ../editor.admin.class.php:559 -msgid "" -"You can enter any HTML codes here for the further withdrawal of their before " -"and after the code of Ads Place." +#: ../editor.admin.class.php:616 +msgid "Contained Ads" msgstr "" -#: ../editor.admin.class.php:690 +#: ../editor.admin.class.php:736 msgid "Ad Data Updated." msgstr "" -#: ../editor.admin.class.php:847 +#: ../editor.admin.class.php:901 msgid "New advertisement" msgstr "" -#: ../editor.admin.class.php:847 +#: ../editor.admin.class.php:901 msgid "Edit advertisement" msgstr "" -#: ../editor.admin.class.php:867 +#: ../editor.admin.class.php:921 msgid "Back to Ads List" msgstr "" -#: ../editor.admin.class.php:874 +#: ../editor.admin.class.php:928 msgid "Advertisement ID" msgstr "" -#: ../editor.admin.class.php:881 ../list.admin.class.php:361 -#: ../list.admin.class.php:371 +#: ../editor.admin.class.php:935 ../list.admin.class.php:362 +#: ../list.admin.class.php:372 msgid "Activity" msgstr "" -#: ../editor.admin.class.php:882 +#: ../editor.admin.class.php:936 msgid "Ad is Active" msgstr "" -#: ../editor.admin.class.php:882 +#: ../editor.admin.class.php:936 msgid "Ad is Inactive" msgstr "" -#: ../editor.admin.class.php:883 ../list.admin.class.php:175 -#: ../list.admin.class.php:186 ../list.admin.class.php:234 -#: ../list.admin.class.php:362 ../list.admin.class.php:372 -#: ../list.admin.class.php:424 -msgid "Hits" -msgstr "" - -#: ../editor.admin.class.php:885 ../list.admin.class.php:235 -#: ../list.admin.class.php:363 ../list.admin.class.php:373 -#: ../list.admin.class.php:425 -msgid "Clicks" -msgstr "" - -#: ../editor.admin.class.php:898 +#: ../editor.admin.class.php:952 msgid "Is in Rotation" msgstr "" -#: ../editor.admin.class.php:931 +#: ../editor.admin.class.php:985 msgid "Title" msgstr "" -#: ../editor.admin.class.php:938 +#: ../editor.admin.class.php:992 msgid "Advertisement Description" msgstr "" -#: ../editor.admin.class.php:952 -msgid "General" +#: ../editor.admin.class.php:1007 +msgid "Extended Restrictions" msgstr "" -#: ../editor.admin.class.php:953 -msgid "Extended Restrictions" +#: ../editor.admin.class.php:1008 +msgid "Targeting" msgstr "" -#: ../editor.admin.class.php:954 +#: ../editor.admin.class.php:1009 msgid "Earnings settings" msgstr "" -#: ../editor.admin.class.php:960 ../editor.admin.class.php:1019 +#: ../editor.admin.class.php:1016 ../editor.admin.class.php:1075 msgid "Ad Code" msgstr "" -#: ../editor.admin.class.php:964 +#: ../editor.admin.class.php:1020 msgid "Image Mode" msgstr "" -#: ../editor.admin.class.php:968 +#: ../editor.admin.class.php:1024 msgid "Ad Image" msgstr "" -#: ../editor.admin.class.php:973 +#: ../editor.admin.class.php:1029 msgid "Ad Target" msgstr "" -#: ../editor.admin.class.php:977 +#: ../editor.admin.class.php:1033 msgid "Ad Alternative Text" msgstr "" -#: ../editor.admin.class.php:982 +#: ../editor.admin.class.php:1038 msgid "Count clicks for this advertisement" msgstr "" -#: ../editor.admin.class.php:984 +#: ../editor.admin.class.php:1040 msgid "Use carefully!" msgstr "" -#: ../editor.admin.class.php:984 +#: ../editor.admin.class.php:1040 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " "request. It's not good." msgstr "" -#: ../editor.admin.class.php:987 +#: ../editor.admin.class.php:1043 msgid "This is flash (SWF) banner" msgstr "" -#: ../editor.admin.class.php:990 +#: ../editor.admin.class.php:1046 msgid "Flash banner \"flashvars\"" msgstr "" -#: ../editor.admin.class.php:992 +#: ../editor.admin.class.php:1048 msgid "Insert \"flashvars\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:993 +#: ../editor.admin.class.php:1049 msgid "Flash banner \"params\"" msgstr "" -#: ../editor.admin.class.php:995 +#: ../editor.admin.class.php:1051 msgid "Insert \"params\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:996 +#: ../editor.admin.class.php:1052 msgid "Flash banner \"attributes\"" msgstr "" -#: ../editor.admin.class.php:998 +#: ../editor.admin.class.php:1054 msgid "Insert \"attributes\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:1001 +#: ../editor.admin.class.php:1057 msgid "Add to ad" msgstr "" -#: ../editor.admin.class.php:1003 +#: ../editor.admin.class.php:1059 msgid "Non Selected" msgstr "" -#: ../editor.admin.class.php:1004 +#: ../editor.admin.class.php:1060 msgid "nofollow" msgstr "" -#: ../editor.admin.class.php:1005 +#: ../editor.admin.class.php:1061 msgid "noindex" msgstr "" -#: ../editor.admin.class.php:1006 +#: ../editor.admin.class.php:1062 msgid "nofollow and noindex" msgstr "" -#: ../editor.admin.class.php:1015 +#: ../editor.admin.class.php:1071 msgid "Code Mode" msgstr "" -#: ../editor.admin.class.php:1021 +#: ../editor.admin.class.php:1077 msgid "This code of ad contains PHP script" msgstr "" -#: ../editor.admin.class.php:1030 +#: ../editor.admin.class.php:1086 msgid "Restrictions of advertisements showing" msgstr "" -#: ../editor.admin.class.php:1033 +#: ../editor.admin.class.php:1089 msgid "Ad Weight" msgstr "" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1096 msgid "Inactive" msgstr "" -#: ../editor.admin.class.php:1041 +#: ../editor.admin.class.php:1097 msgid "Minimal Activity" msgstr "" -#: ../editor.admin.class.php:1042 +#: ../editor.admin.class.php:1098 msgid "Maximal Activity" msgstr "" -#: ../editor.admin.class.php:1052 +#: ../editor.admin.class.php:1108 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." msgstr "" -#: ../editor.admin.class.php:1054 +#: ../editor.admin.class.php:1110 msgid "0 - ad is inactive" msgstr "" -#: ../editor.admin.class.php:1055 +#: ../editor.admin.class.php:1111 msgid "1 - minimal activity of this advertisement" msgstr "" -#: ../editor.admin.class.php:1057 +#: ../editor.admin.class.php:1113 msgid "10 - maximal activity of this ad." msgstr "" -#: ../editor.admin.class.php:1063 ../help.class.php:20 ../help.class.php:161 +#: ../editor.admin.class.php:1119 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "" -#: ../editor.admin.class.php:1067 +#: ../editor.admin.class.php:1123 msgid "Show ad only on pages of this type" msgstr "" -#: ../editor.admin.class.php:1071 +#: ../editor.admin.class.php:1127 msgid "Home Page (Home or Front Page)" msgstr "" -#: ../editor.admin.class.php:1073 +#: ../editor.admin.class.php:1129 msgid "Singular Pages" msgstr "" -#: ../editor.admin.class.php:1076 +#: ../editor.admin.class.php:1132 msgid "Single Post" msgstr "" -#: ../editor.admin.class.php:1080 +#: ../editor.admin.class.php:1136 msgid "Custom Post Type" msgstr "" -#: ../editor.admin.class.php:1082 +#: ../editor.admin.class.php:1138 msgid "Attachment" msgstr "" -#: ../editor.admin.class.php:1085 +#: ../editor.admin.class.php:1141 msgid "Search Page" msgstr "" -#: ../editor.admin.class.php:1087 +#: ../editor.admin.class.php:1143 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "" -#: ../editor.admin.class.php:1089 +#: ../editor.admin.class.php:1145 msgid "Archive Pages" msgstr "" -#: ../editor.admin.class.php:1092 +#: ../editor.admin.class.php:1148 msgid "Taxonomy Archive Pages" msgstr "" -#: ../editor.admin.class.php:1094 +#: ../editor.admin.class.php:1150 msgid "Category Archive Pages" msgstr "" -#: ../editor.admin.class.php:1096 +#: ../editor.admin.class.php:1152 msgid "Tag Archive Pages" msgstr "" -#: ../editor.admin.class.php:1098 +#: ../editor.admin.class.php:1154 msgid "Author Archive Pages" msgstr "" -#: ../editor.admin.class.php:1100 +#: ../editor.admin.class.php:1156 msgid "Custom Post Type Archive Pages" msgstr "" -#: ../editor.admin.class.php:1102 +#: ../editor.admin.class.php:1158 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" msgstr "" -#: ../editor.admin.class.php:1107 +#: ../editor.admin.class.php:1163 msgid "Show ad only in certain posts/pages" msgstr "" -#: ../editor.admin.class.php:1111 ../editor.admin.class.php:1180 +#: ../editor.admin.class.php:1167 ../editor.admin.class.php:1194 msgid "Posts/Pages" msgstr "" -#: ../editor.admin.class.php:1118 +#: ../editor.admin.class.php:1174 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." msgstr "" -#: ../editor.admin.class.php:1129 -msgid "Users" -msgstr "" - -#: ../editor.admin.class.php:1131 -msgid "Show this ad for" -msgstr "" - -#: ../editor.admin.class.php:1134 -msgid "all users" -msgstr "" - -#: ../editor.admin.class.php:1139 -msgid "these users" -msgstr "" - -#: ../editor.admin.class.php:1144 -msgid "Unregistered Users" -msgstr "" - -#: ../editor.admin.class.php:1148 ../editor.admin.class.php:1156 -msgid "Registered Users" -msgstr "" - -#: ../editor.admin.class.php:1153 -msgid "Exclude these users" -msgstr "" - -#: ../editor.admin.class.php:1164 -msgid "Do not show this ad for advertiser" -msgstr "" - -#: ../editor.admin.class.php:1172 +#: ../editor.admin.class.php:1186 msgid "Extended restrictions of advertisements showing" msgstr "" -#: ../editor.admin.class.php:1176 +#: ../editor.admin.class.php:1190 msgid "Do not show ad on certain posts/pages" msgstr "" -#: ../editor.admin.class.php:1188 +#: ../editor.admin.class.php:1202 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." msgstr "" -#: ../editor.admin.class.php:1193 +#: ../editor.admin.class.php:1207 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" -#: ../editor.admin.class.php:1196 ../editor.admin.class.php:1216 +#: ../editor.admin.class.php:1210 ../editor.admin.class.php:1230 msgid "Categories" msgstr "" -#: ../editor.admin.class.php:1203 +#: ../editor.admin.class.php:1217 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." msgstr "" -#: ../editor.admin.class.php:1207 ../editor.admin.class.php:1241 -#: ../editor.admin.class.php:1275 ../editor.admin.class.php:1310 -#: ../editor.admin.class.php:1345 +#: ../editor.admin.class.php:1221 ../editor.admin.class.php:1255 +#: ../editor.admin.class.php:1289 ../editor.admin.class.php:1324 +#: ../editor.admin.class.php:1359 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " "modes. Otherwise, it will be ignored." msgstr "" -#: ../editor.admin.class.php:1213 +#: ../editor.admin.class.php:1227 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "" -#: ../editor.admin.class.php:1223 +#: ../editor.admin.class.php:1237 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." msgstr "" -#: ../editor.admin.class.php:1228 +#: ../editor.admin.class.php:1242 msgid "" "Show ad only in single posts or archives of certain Custom Taxonomies Terms" msgstr "" -#: ../editor.admin.class.php:1237 +#: ../editor.admin.class.php:1251 msgid "" "Use this setting to display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." msgstr "" -#: ../editor.admin.class.php:1247 +#: ../editor.admin.class.php:1261 msgid "" "Do not show ad in single posts or archives of certain Custom Taxonomies Terms" msgstr "" -#: ../editor.admin.class.php:1256 +#: ../editor.admin.class.php:1270 msgid "" "Use this setting to not display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." msgstr "" -#: ../editor.admin.class.php:1261 +#: ../editor.admin.class.php:1275 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" -#: ../editor.admin.class.php:1264 ../editor.admin.class.php:1284 +#: ../editor.admin.class.php:1278 ../editor.admin.class.php:1298 msgid "Authors" msgstr "" -#: ../editor.admin.class.php:1271 +#: ../editor.admin.class.php:1285 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." msgstr "" -#: ../editor.admin.class.php:1281 +#: ../editor.admin.class.php:1295 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" -#: ../editor.admin.class.php:1291 +#: ../editor.admin.class.php:1305 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." msgstr "" -#: ../editor.admin.class.php:1296 +#: ../editor.admin.class.php:1310 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" -#: ../editor.admin.class.php:1299 ../editor.admin.class.php:1319 +#: ../editor.admin.class.php:1313 ../editor.admin.class.php:1333 msgid "Tags" msgstr "" -#: ../editor.admin.class.php:1306 +#: ../editor.admin.class.php:1320 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." msgstr "" -#: ../editor.admin.class.php:1316 +#: ../editor.admin.class.php:1330 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "" -#: ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1340 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." msgstr "" -#: ../editor.admin.class.php:1331 +#: ../editor.admin.class.php:1345 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" msgstr "" -#: ../editor.admin.class.php:1334 ../editor.admin.class.php:1354 +#: ../editor.admin.class.php:1348 ../editor.admin.class.php:1368 msgid "Custom post types" msgstr "" -#: ../editor.admin.class.php:1341 +#: ../editor.admin.class.php:1355 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." msgstr "" -#: ../editor.admin.class.php:1351 +#: ../editor.admin.class.php:1365 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" msgstr "" -#: ../editor.admin.class.php:1361 +#: ../editor.admin.class.php:1375 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." msgstr "" -#: ../editor.admin.class.php:1366 +#: ../editor.admin.class.php:1380 msgid "Use the schedule for this ad" msgstr "" -#: ../editor.admin.class.php:1370 +#: ../editor.admin.class.php:1384 msgid "Campaign Start Date" msgstr "" -#: ../editor.admin.class.php:1374 +#: ../editor.admin.class.php:1388 msgid "Campaign End Date" msgstr "" -#: ../editor.admin.class.php:1379 +#: ../editor.admin.class.php:1393 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" -#: ../editor.admin.class.php:1384 +#: ../editor.admin.class.php:1398 msgid "Use limitation by hits" msgstr "" -#: ../editor.admin.class.php:1388 +#: ../editor.admin.class.php:1402 msgid "Hits Limit" msgstr "" -#: ../editor.admin.class.php:1393 +#: ../editor.admin.class.php:1407 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" -#: ../editor.admin.class.php:1398 +#: ../editor.admin.class.php:1412 msgid "Use limitation by clicks" msgstr "" -#: ../editor.admin.class.php:1402 +#: ../editor.admin.class.php:1416 msgid "Clicks Limit" msgstr "" -#: ../editor.admin.class.php:1407 +#: ../editor.admin.class.php:1421 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "" -#: ../editor.admin.class.php:1417 +#: ../editor.admin.class.php:1431 +msgid "Users" +msgstr "" + +#: ../editor.admin.class.php:1433 +msgid "Show this ad for" +msgstr "" + +#: ../editor.admin.class.php:1436 +msgid "all users" +msgstr "" + +#: ../editor.admin.class.php:1441 +msgid "these users" +msgstr "" + +#: ../editor.admin.class.php:1446 +msgid "Unregistered Users" +msgstr "" + +#: ../editor.admin.class.php:1450 ../editor.admin.class.php:1458 +msgid "Registered Users" +msgstr "" + +#: ../editor.admin.class.php:1455 +msgid "Exclude these users" +msgstr "" + +#: ../editor.admin.class.php:1466 +msgid "Do not show this ad for advertiser" +msgstr "" + +#: ../editor.admin.class.php:1478 msgid "Advertiser" msgstr "" -#: ../editor.admin.class.php:1420 +#: ../editor.admin.class.php:1481 msgid "Advertiser Nick Name" msgstr "" -#: ../editor.admin.class.php:1437 ../help.class.php:32 ../help.class.php:180 +#: ../editor.admin.class.php:1498 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "" -#: ../editor.admin.class.php:1440 +#: ../editor.admin.class.php:1501 msgid "Price of ad placement per month" msgstr "" -#: ../editor.admin.class.php:1444 +#: ../editor.admin.class.php:1505 msgid "Tthis parameter used only for scheduled ads." msgstr "" -#: ../editor.admin.class.php:1447 +#: ../editor.admin.class.php:1508 msgid "Price per Thousand Hits" msgstr "" -#: ../editor.admin.class.php:1451 +#: ../editor.admin.class.php:1512 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." msgstr "" -#: ../editor.admin.class.php:1454 +#: ../editor.admin.class.php:1515 msgid "Price per Click" msgstr "" -#: ../editor.admin.class.php:1458 +#: ../editor.admin.class.php:1519 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." msgstr "" -#: ../editor.admin.class.php:1469 +#: ../editor.admin.class.php:1557 msgid "Ad Preview" msgstr "" @@ -2274,8 +2393,8 @@ msgid "" "from date to date (the schedule)." msgstr "" -#: ../help.class.php:151 ../list.admin.class.php:360 -#: ../list.admin.class.php:370 +#: ../help.class.php:151 ../list.admin.class.php:361 +#: ../list.admin.class.php:371 msgid "Advertisement" msgstr "" @@ -2287,112 +2406,108 @@ msgstr "" msgid "Additional Parameters" msgstr "" -#: ../list.admin.class.php:137 +#: ../list.admin.class.php:138 msgid "Managing Ads Places" msgstr "" -#: ../list.admin.class.php:153 ../list.admin.class.php:273 +#: ../list.admin.class.php:154 ../list.admin.class.php:274 msgid "Add New Place" msgstr "" -#: ../list.admin.class.php:157 ../list.admin.class.php:277 +#: ../list.admin.class.php:158 ../list.admin.class.php:278 msgid "Reset Statistics" msgstr "" -#: ../list.admin.class.php:173 ../list.admin.class.php:184 +#: ../list.admin.class.php:174 ../list.admin.class.php:185 msgid "Place Name" msgstr "" -#: ../list.admin.class.php:176 ../list.admin.class.php:187 +#: ../list.admin.class.php:177 ../list.admin.class.php:188 msgid "Total Hits" msgstr "" -#: ../list.admin.class.php:177 ../list.admin.class.php:188 +#: ../list.admin.class.php:178 ../list.admin.class.php:189 msgid "Total Ads" msgstr "" -#: ../list.admin.class.php:178 ../list.admin.class.php:189 -#: ../list.admin.class.php:364 ../list.admin.class.php:374 +#: ../list.admin.class.php:179 ../list.admin.class.php:190 +#: ../list.admin.class.php:365 ../list.admin.class.php:375 msgid "Earnings" msgstr "" -#: ../list.admin.class.php:233 ../list.admin.class.php:423 +#: ../list.admin.class.php:234 ../list.admin.class.php:424 msgid "Placement" msgstr "" -#: ../list.admin.class.php:236 ../list.admin.class.php:426 -msgid "Total" -msgstr "" - -#: ../list.admin.class.php:236 ../list.admin.class.php:426 +#: ../list.admin.class.php:237 ../list.admin.class.php:427 msgid "N/A" msgstr "" -#: ../list.admin.class.php:243 +#: ../list.admin.class.php:244 msgid "Edit Place" msgstr "" -#: ../list.admin.class.php:247 +#: ../list.admin.class.php:248 msgid "Restore this Place from the Trash" msgstr "" -#: ../list.admin.class.php:248 +#: ../list.admin.class.php:249 msgid "Remove this Place permanently" msgstr "" -#: ../list.admin.class.php:253 +#: ../list.admin.class.php:254 msgid "Move this Place to the Trash" msgstr "" -#: ../list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View List of Place Ads" msgstr "" -#: ../list.admin.class.php:254 +#: ../list.admin.class.php:255 msgid "View Ads" msgstr "" -#: ../list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "Create New Ad" msgstr "" -#: ../list.admin.class.php:255 +#: ../list.admin.class.php:256 msgid "New Ad" msgstr "" -#: ../list.admin.class.php:320 +#: ../list.admin.class.php:321 msgid "Managing Items of Ads Place" msgstr "" -#: ../list.admin.class.php:337 ../list.admin.class.php:456 +#: ../list.admin.class.php:338 ../list.admin.class.php:457 msgid "Add New Ad" msgstr "" -#: ../list.admin.class.php:341 ../list.admin.class.php:460 +#: ../list.admin.class.php:342 ../list.admin.class.php:461 msgid "Back to Ads Places Management" msgstr "" -#: ../list.admin.class.php:417 +#: ../list.admin.class.php:418 msgid "Yes" msgstr "" -#: ../list.admin.class.php:418 +#: ../list.admin.class.php:419 msgid "No" msgstr "" -#: ../list.admin.class.php:433 +#: ../list.admin.class.php:434 msgid "Edit this Item of Ads Place" msgstr "" -#: ../list.admin.class.php:437 +#: ../list.admin.class.php:438 msgid "Restore this Ad from the Trash" msgstr "" -#: ../list.admin.class.php:438 +#: ../list.admin.class.php:439 msgid "Remove this Ad permanently" msgstr "" -#: ../list.admin.class.php:439 +#: ../list.admin.class.php:440 msgid "Move this item to the Trash" msgstr "" @@ -2431,7 +2546,7 @@ msgstr "" msgid "Ads Zone selector serviced by Simple Ads Manager." msgstr "" -#: ../widget.class.php:286 ../js/dialog-ad.php:48 +#: ../widget.class.php:286 ../js/dialog-ad.php:53 msgid "Ad" msgstr "" @@ -2447,7 +2562,7 @@ msgstr "" msgid "Ads Block collector serviced by Simple Ads Manager." msgstr "" -#: ../widget.class.php:428 ../js/dialog-block.php:48 +#: ../widget.class.php:428 ../js/dialog-block.php:53 msgid "Ads Block" msgstr "" @@ -2459,122 +2574,122 @@ msgstr "" msgid "None" msgstr "" -#: ../zone.editor.admin.class.php:169 +#: ../zone.editor.admin.class.php:173 msgid "Ads Zone Data Updated." msgstr "" -#: ../zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:290 msgid "New Ads Zone" msgstr "" -#: ../zone.editor.admin.class.php:286 +#: ../zone.editor.admin.class.php:290 msgid "Edit Ads Zone" msgstr "" -#: ../zone.editor.admin.class.php:306 +#: ../zone.editor.admin.class.php:310 msgid "Back to Zones List" msgstr "" -#: ../zone.editor.admin.class.php:313 ../js/dialog-zone.php:66 +#: ../zone.editor.admin.class.php:317 ../js/dialog-zone.php:71 msgid "Ads Zone ID" msgstr "" -#: ../zone.editor.admin.class.php:360 +#: ../zone.editor.admin.class.php:364 msgid "Enter description of this Ads Zone." msgstr "" -#: ../zone.editor.admin.class.php:372 +#: ../zone.editor.admin.class.php:376 msgid "Ads Zone Settings" msgstr "" -#: ../zone.editor.admin.class.php:375 +#: ../zone.editor.admin.class.php:379 msgid "Default Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:381 +#: ../zone.editor.admin.class.php:385 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " "\"Default\"." msgstr "" -#: ../zone.editor.admin.class.php:385 +#: ../zone.editor.admin.class.php:389 msgid "Home Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:391 +#: ../zone.editor.admin.class.php:395 msgid "Default Ads Place for Singular Pages" msgstr "" -#: ../zone.editor.admin.class.php:398 +#: ../zone.editor.admin.class.php:402 msgid "Single Post Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:407 +#: ../zone.editor.admin.class.php:411 msgid "Default Ads Place for Single Custom Type Post" msgstr "" -#: ../zone.editor.admin.class.php:418 +#: ../zone.editor.admin.class.php:422 msgid "Ads Place for Single Post of Custom Type" msgstr "" -#: ../zone.editor.admin.class.php:427 +#: ../zone.editor.admin.class.php:431 msgid "Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:433 +#: ../zone.editor.admin.class.php:437 msgid "Attachment Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:440 +#: ../zone.editor.admin.class.php:444 msgid "Search Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:446 +#: ../zone.editor.admin.class.php:450 msgid "404 Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:452 +#: ../zone.editor.admin.class.php:456 msgid "Default Ads Place for Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:459 +#: ../zone.editor.admin.class.php:463 msgid "Default Ads Place for Taxonomies Pages" msgstr "" -#: ../zone.editor.admin.class.php:466 +#: ../zone.editor.admin.class.php:470 msgid "Default Ads Place for Category Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:479 +#: ../zone.editor.admin.class.php:483 msgid "Ads Place for Category" msgstr "" -#: ../zone.editor.admin.class.php:495 +#: ../zone.editor.admin.class.php:499 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" -#: ../zone.editor.admin.class.php:505 +#: ../zone.editor.admin.class.php:509 msgid "Ads Place for Custom Type Posts Archive" msgstr "" -#: ../zone.editor.admin.class.php:514 +#: ../zone.editor.admin.class.php:518 msgid "Tags Archive Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:521 +#: ../zone.editor.admin.class.php:525 msgid "Default Ads Place for Author Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:530 +#: ../zone.editor.admin.class.php:534 msgid "Ads Place for author" msgstr "" -#: ../zone.editor.admin.class.php:539 +#: ../zone.editor.admin.class.php:543 msgid "Date Archive Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:546 +#: ../zone.editor.admin.class.php:550 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." @@ -2612,25 +2727,25 @@ msgstr "" msgid "Insert Single Ad" msgstr "" -#: ../js/dialog-ad.php:41 ../js/dialog-block.php:41 ../js/dialog-zone.php:41 -#: ../js/dialog.php:41 +#: ../js/dialog-ad.php:46 ../js/dialog-block.php:46 ../js/dialog-zone.php:46 +#: ../js/dialog.php:46 msgid "Basic Settings" msgstr "" -#: ../js/dialog-ad.php:66 +#: ../js/dialog-ad.php:71 msgid "Single Ad ID" msgstr "" -#: ../js/dialog-ad.php:69 +#: ../js/dialog-ad.php:74 msgid "Single Ad Name" msgstr "" -#: ../js/dialog-ad.php:79 ../js/dialog-zone.php:79 ../js/dialog.php:79 +#: ../js/dialog-ad.php:84 ../js/dialog-zone.php:84 ../js/dialog.php:84 msgid "Allow Ads Places predefined codes" msgstr "" -#: ../js/dialog-ad.php:92 ../js/dialog-block.php:82 ../js/dialog-zone.php:92 -#: ../js/dialog.php:92 +#: ../js/dialog-ad.php:97 ../js/dialog-block.php:87 ../js/dialog-zone.php:97 +#: ../js/dialog.php:97 msgid "Insert" msgstr "" @@ -2638,7 +2753,7 @@ msgstr "" msgid "Insert Ads Block" msgstr "" -#: ../js/dialog-block.php:69 +#: ../js/dialog-block.php:74 msgid "Ads Block Name" msgstr "" @@ -2646,7 +2761,7 @@ msgstr "" msgid "Insert Ads Zone" msgstr "" -#: ../js/dialog-zone.php:69 +#: ../js/dialog-zone.php:74 msgid "Ads Zone Name" msgstr "" @@ -2654,6 +2769,6 @@ msgstr "" msgid "Insert Ads Place" msgstr "" -#: ../js/dialog.php:69 +#: ../js/dialog.php:74 msgid "Ads Place Name" msgstr "" diff --git a/list.admin.class.php b/list.admin.class.php index 0ba925c..1b0cbab 100644 --- a/list.admin.class.php +++ b/list.admin.class.php @@ -85,6 +85,7 @@ public function page() { global $wpdb; $pTable = $wpdb->prefix . "sam_places"; $aTable = $wpdb->prefix . "sam_ads"; + $sTable = $wpdb->prefix . 'sam_stats'; if(isset($_GET['mode'])) $mode = $_GET['mode']; else $mode = 'active'; @@ -198,16 +199,16 @@ public function page() { sp.place_size, sp.place_custom_width, sp.place_custom_height, - IFNULL(sp.patch_hits, 0) AS patch_hits, - (IFNULL((SELECT sum(sa.ad_hits) FROM $aTable sa WHERE sa.pid = sp.id), 0) + IFNULL(sp.patch_hits, 0)) as total_ad_hits, - (IFNULL((SELECT SUM(IF(cpm > 0, ad_hits*cpm/1000, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpm, - (IFNULL((SELECT SUM(IF(cpc > 0, ad_clicks*cpc, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpc, - (IFNULL((SELECT SUM(IF(ad_schedule AND per_month > 0, DATEDIFF(CURDATE(), ad_start_date)*per_month/30, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_month, + @patch_hits := (IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = 0 AND ss.pid = sp.id AND ss.event_type = 0), 0)) AS patch_hits, + (IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id > 0 AND ss.pid = sp.id AND ss.event_type = 0), 0) + IFNULL(@patch_hits, 0)) as total_ad_hits, + (IFNULL((SELECT SUM(IF(sa.cpm > 0, IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0), 0) * sa.cpm / 1000, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpm, + (IFNULL((SELECT SUM(IF(sa.cpc > 0, IFNULL((SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1), 0) * sa.cpc, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_cpc, + (IFNULL((SELECT SUM(IF(sa.ad_schedule AND sa.per_month > 0, DATEDIFF(CURDATE(), sa.ad_start_date) * sa.per_month / 30, 0)) FROM $aTable sa WHERE sa.pid = sp.id), 0)) AS e_month, sp.trash, (SELECT COUNT(*) FROM $aTable sa WHERE sa.pid = sp.id) AS items FROM $pTable sp". (($mode !== 'all') ? " WHERE sp.trash = ".(($mode === 'trash') ? 'TRUE' : 'FALSE') : ''). - " LIMIT $offset, $places_per_page"; + " LIMIT $offset, $places_per_page;"; $places = $wpdb->get_results($pSql, ARRAY_A); $i = 0; if(!is_array($places) || empty($places)) { @@ -383,12 +384,12 @@ public function page() { sa.pid, sa.name, sa.description, - sa.ad_hits, - sa.ad_clicks, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, sa.ad_weight, (IF(sa.ad_schedule AND sa.per_month > 0, DATEDIFF(CURDATE(), sa.ad_start_date)*sa.per_month/30, 0)) AS e_month, - (sa.cpm * sa.ad_hits / 1000) AS e_cpm, - (sa.cpc * sa.ad_clicks) AS e_cpc, + (sa.cpm * @ad_hits / 1000) AS e_cpm, + (sa.cpc * @ad_clicks) AS e_cpc, sa.trash, IF(DATEDIFF(sa.ad_end_date, NOW()) IS NULL OR DATEDIFF(sa.ad_end_date, NOW()) > 0, FALSE, TRUE) AS expired FROM $aTable sa diff --git a/sam-ajax-admin-stats.php b/sam-ajax-admin-stats.php new file mode 100644 index 0000000..7abd2ab --- /dev/null +++ b/sam-ajax-admin-stats.php @@ -0,0 +1,182 @@ +prefix . 'sam_stats'; +$oTable = $wpdb->prefix . 'options'; +$aTable = $wpdb->prefix . 'sam_ads'; + +$oSql = "SELECT $oTable.option_value FROM $oTable WHERE $oTable.option_name = 'blog_charset'"; +$charset = $wpdb->get_var($oSql); + +function samDaysInMonth($month, $year) { + return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); +} + +@header("Content-Type: application/json; charset=$charset"); +@header( 'X-Robots-Tag: noindex' ); + +send_nosniff_header(); +nocache_headers(); + +$action = !empty($_REQUEST['action']) ? 'sam_ajax_' . stripslashes($_REQUEST['action']) : false; + +//A bit of security +$allowed_actions = array( + 'sam_ajax_load_item_stats', + 'sam_ajax_load_stats', + 'sam_ajax_load_ads' +); +$out = array(); + +if(in_array($action, $allowed_actions)) { + switch($action) { + case 'sam_ajax_load_stats': + if(isset($_POST['id'])) { + $pid = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + $now = getdate(); + $month = $now['mon'] - $sMonth; + $year = $now['year']; + $days = samDaysInMonth($month, $year); + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.pid = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 0, $pid), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 1, $pid), ARRAY_A); + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed'] - 1][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed'] - 1][1] = $click['hits']; + + $sql = "SELECT + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 0 AND ss.pid = %d) AS hits, + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 1 AND ss.pid = %d) AS clicks;"; + $total = $wpdb->get_row($wpdb->prepare($sql, $sMonth, $pid, $sMonth, $pid)); + + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total); + } + else $out = array("status" => "error", "message" => "Error"); + break; + + case 'sam_ajax_load_item_stats': + if(isset($_POST['id'])) { + $id = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + $now = getdate(); + $month = $now['mon'] - $sMonth; + $year = $now['year']; + $days = samDaysInMonth($month, $year); + + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.id = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 0, $id), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 1, $id), ARRAY_A); + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed'] - 1][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed'] - 1][1] = $click['hits']; + + $sql = "SELECT + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 0 AND ss.id = %d) AS hits, + (SELECT + COUNT(*) + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + AND ss.event_type = 1 AND ss.id = %d) AS clicks;"; + $total = $wpdb->get_row($wpdb->prepare($sql, $sMonth, $id, $sMonth, $id)); + + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total); + } + else $out = array("status" => "error", "message" => "Error"); + break; + + case 'sam_ajax_load_ads': + if(isset($_POST['id'])) { + $id = $_POST['id']; + $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + $sql = "SELECT + sa.id, + sa.pid, + sa.name, + sa.description, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + sa.ad_weight, + (sa.cpm / @ad_hits * 1000) AS e_cpm, + sa.cpc AS e_cpc, + (@ad_clicks / @ad_hits * 100) AS e_ctr + FROM $aTable sa + WHERE (sa.pid = %d) AND sa.trash = FALSE AND NOT (sa.ad_schedule AND sa.ad_end_date < NOW());"; + $rows = $wpdb->get_results($wpdb->prepare($sql, $sMonth, $sMonth, $id), ARRAY_A); + + $k = 0; + foreach($rows as &$row) { + $k++; + $row['recid'] = $k; + } + + $out = array( + 'status' => 'success', + 'total' => count($rows), + 'records' => $rows, + 'sql' => $wpdb->prepare($sql, $sMonth, $sMonth, $id) + ); + } + else $out = array('status' => 'error'); + break; + + default: + $out = array("status" => "error", "message" => "Error"); + break; + } + echo json_encode( $out ); wp_die(); +} +else $out = array("status" => "error", "message" => "Error"); + +wp_send_json_error($out); \ No newline at end of file diff --git a/sam-ajax-admin.php b/sam-ajax-admin.php index ef89f2d..1043354 100644 --- a/sam-ajax-admin.php +++ b/sam-ajax-admin.php @@ -24,6 +24,7 @@ global $wpdb; +$sTable = $wpdb->prefix . 'sam_stats'; $tTable = $wpdb->prefix . "terms"; $ttTable = $wpdb->prefix . "term_taxonomy"; $uTable = $wpdb->base_prefix . "users"; @@ -51,7 +52,8 @@ 'sam_ajax_load_authors', 'sam_ajax_load_posts', 'sam_ajax_load_users', - 'sam_ajax_load_combo_data' + 'sam_ajax_load_combo_data', + 'sam_ajax_load_stats' ); $out = array(); @@ -207,16 +209,13 @@ wu.user_email AS email FROM $uTable wu - WHERE wu.user_nicename LIKE '".$searchTerm."%' + WHERE wu.user_nicename LIKE '{$searchTerm}%' ORDER BY wu.id LIMIT $offset, $rows;"; $users = $wpdb->get_results($sql, ARRAY_A); - $sql = "SELECT - COUNT(*) - FROM $uTable wu - WHERE wu.user_nicename LIKE '".$searchTerm."%';"; - $rTotal = $wpdb->get_var($wpdb->prepare($sql)); + $sql = "SELECT COUNT(*) FROM $uTable wu WHERE wu.user_nicename LIKE '{$searchTerm}%';"; + $rTotal = $wpdb->get_var($sql); $total = ceil((int)$rTotal/(int)$rows); $out = array( @@ -229,6 +228,26 @@ break; + case 'sam_ajax_load_stats': + $sql = "SELECT + DATE_FORMAT(ss.event_time, %s) AS ed, + DATE_FORMAT(LAST_DAY(ss.event_time), %s) AS days, + COUNT(*) AS hits + FROM $sTable ss + WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d + GROUP BY ed;"; + $hits = $wpdb->get_results($wpdb->prepare($sql, '%d', '%d', 0, 0), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%d', '%d', 0, 1), ARRAY_A); + $days = $hits[0]['days']; + for($i = 1; $i <= $days; $i++) { + $hitsFull[$i - 1] = array( $i, 0); + $clicksFull[$i - 1] = array($i, 0); + } + foreach($hits as $hit) $hitsFull[$hit['ed']][1] = $hit['hits']; + foreach($clicks as $click) $clicksFull[$click['ed']][1] = $click['hits']; + $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'sql' => $sql); + break; + default: $out = array("status" => "error", "message" => "Error"); break; diff --git a/sam-ajax.php b/sam-ajax.php index 7d6737d..421a2fd 100644 --- a/sam-ajax.php +++ b/sam-ajax.php @@ -28,6 +28,7 @@ $charset = $wpdb->get_var($oSql); $aTable = $wpdb->prefix . "sam_ads"; $pTable = $wpdb->prefix . 'sam_places'; +$sTable = $wpdb->prefix . 'sam_stats'; //Typical headers @header("Content-Type: application/json; charset=$charset"); @@ -55,12 +56,14 @@ } elseif(isset($_POST['id'])) { $id = $_POST['id']; + $pid = $_POST['pid']; } else $id = -100; if($id > 0) { - $aSql = "UPDATE $aTable sa SET sa.ad_clicks = sa.ad_clicks + 1 WHERE sa.id = %d;"; - $result = $wpdb->query($wpdb->prepare($aSql, $id)); + //$aSql = "UPDATE $aTable sa SET sa.ad_clicks = sa.ad_clicks + 1 WHERE sa.id = %d;"; + $aSql = "INSERT HIGH_PRIORITY INTO $sTable (id, pid, event_time, event_type) VALUES (%d, %d, NOW(), 1);"; + $result = $wpdb->query($wpdb->prepare($aSql, $id, $pid)); if($result === 1) { $out = array('success' => true, 'id' => $id, 'result' => $result, 'charset' => $charset); echo json_encode( $out ); @@ -77,10 +80,11 @@ $cid = ($id == 0) ? $pid : $id; $result = 0; //if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1, sa.ad_weight_hits = sa.ad_weight_hits + 1 WHERE sa.id = %d;"; - if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1 WHERE sa.id = %d;"; + /*if($id > 0) $sql = "UPDATE $aTable sa SET sa.ad_hits = sa.ad_hits + 1 WHERE sa.id = %d;"; elseif($id == 0) $sql = "UPDATE $pTable sp SET sp.patch_hits = sp.patch_hits + 1 WHERE sp.id = %d;"; - else $sql = ''; - if(!empty($sql)) $result = $wpdb->query($wpdb->prepare($sql, $cid)); + else $sql = '';*/ + $sql = "INSERT HIGH_PRIORITY INTO $sTable (id, pid, event_time, event_type) VALUES (%d, %d, NOW(), 0);"; + if(!empty($sql)) $result = $wpdb->query($wpdb->prepare($sql, $id, $pid)); if($result === 1) echo json_encode(array('success' => true, 'id' => $id, 'pid' => $pid)); else echo json_encode(array( 'success' => false, diff --git a/sam.class.php b/sam.class.php index 1f5aea4..6226b8a 100644 --- a/sam.class.php +++ b/sam.class.php @@ -47,7 +47,7 @@ class SimpleAdsManager { public function __construct() { define('SAM_VERSION', '1.8.71'); - define('SAM_DB_VERSION', '2.3'); + define('SAM_DB_VERSION', '2.4'); define('SAM_PATH', dirname( __FILE__ )); define('SAM_URL', plugins_url( '/', __FILE__ ) ); define('SAM_IMG_URL', SAM_URL.'images/'); diff --git a/updater.class.php b/updater.class.php index 7e2310f..b3d4166 100644 --- a/updater.class.php +++ b/updater.class.php @@ -213,6 +213,7 @@ public function update() { $zTable = $wpdb->prefix . "sam_zones"; $bTable = $wpdb->prefix . "sam_blocks"; $eTable = $wpdb->prefix . "sam_errors"; + $sTable = $wpdb->prefix . "sam_stats"; $options = $this->options; $el = (integer)$options['errorlog']; @@ -421,7 +422,29 @@ public function update() { } if($el) { - self::errorWrite($eTable, $pTable, $bSql, $dbResult, $wpdb->last_error); + self::errorWrite($eTable, $bTable, $bSql, $dbResult, $wpdb->last_error); + $dbResult = null; + } + + // Statistics Table + if($wpdb->get_var("SHOW TABLES LIKE '$sTable'") != $sTable) { + $sSql = "CREATE TABLE $sTable ( + id int(10) UNSIGNED DEFAULT NULL, + pid int(10) UNSIGNED DEFAULT NULL, + event_time datetime DEFAULT NULL, + event_type tinyint(1) DEFAULT NULL + ) + $charset_collate + COMMENT = 'Simple Ads Manager Statistics';"; + dbDelta($sSql); + } + else { + $sSql = self::getUpdateSql($sTable, $sam_tables_defs['stats']); + if(!empty($sSql)) $dbResult = $wpdb->query($sSql); + } + + if($el) { + self::errorWrite($eTable, $sTable, $sSql, $dbResult, $wpdb->last_error); $dbResult = null; } diff --git a/zone.editor.admin.class.php b/zone.editor.admin.class.php index 719ae75..78963cc 100644 --- a/zone.editor.admin.class.php +++ b/zone.editor.admin.class.php @@ -35,22 +35,25 @@ private function getCustomPostTypes() { private function getTax($type = 'category') { if(empty($type)) return; + + if($type === 'custom_tax_terms') $wc = "NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format')"; + else $wc = "wtt.taxonomy = '$type'"; global $wpdb; $tTable = $wpdb->prefix . "terms"; $ttTable = $wpdb->prefix . "term_taxonomy"; $sql = "SELECT - $tTable.term_id, - $tTable.name, - $tTable.slug, - $ttTable.taxonomy + wt.term_id, + wt.name, + wt.slug, + wtt.taxonomy FROM - $tTable - INNER JOIN $ttTable - ON $tTable.term_id = $ttTable.term_id + $tTable wt + INNER JOIN $ttTable wtt + ON wt.term_id = wtt.term_id WHERE - $ttTable.taxonomy = '$type' AND $tTable.term_id <> 1;"; + $wc AND wt.term_id <> 1;"; $taxonomies = $wpdb->get_results($sql, ARRAY_A); @@ -63,20 +66,21 @@ private function getTax($type = 'category') { private function getAuthors() { global $wpdb; - $uTable = $wpdb->prefix . "users"; - $umTable = $wpdb->prefix . "usermeta"; + $uTable = $wpdb->base_prefix . "users"; + $umTable = $wpdb->base_prefix . "usermeta"; + $userLevel = $wpdb->base_prefix . 'user_level'; $sql = "SELECT - $uTable.id, - $uTable.user_nicename, - $uTable.display_name + wu.id, + wu.user_nicename, + wu.display_name FROM - $uTable - INNER JOIN $umTable - ON $uTable.ID = $umTable.user_id + $uTable wu + INNER JOIN $umTable wum + ON wu.ID = wum.user_id WHERE - $umTable.meta_key = 'wp_user_level' AND - $umTable.meta_value > 1;"; + wum.meta_key = '$userLevel' AND + wum.meta_value > 1;"; $auth = $wpdb->get_results($sql, ARRAY_A); $authors = array(); @@ -132,7 +136,6 @@ public function page() { 'z_home' => $_POST['z_home'], 'z_singular' => $_POST['z_singular'], 'z_single' => $_POST['z_single'], - //FIXED 'z_ct' => $_POST['z_ct'], 'z_ct' => (isset($_POST['z_ct']) ? $_POST['z_ct'] : -1), 'z_single_ct' => serialize($uSingleCT), 'z_page' => $_POST['z_page'], @@ -146,15 +149,16 @@ public function page() { 'z_tag' => $_POST['z_tag'], 'z_author' => $_POST['z_author'], 'z_authors' => serialize($uAuthors), - //FIXED 'z_cts' => $_POST['z_cts'], 'z_cts' => (isset($_POST['z_cts']) ? $_POST['z_cts'] : -1), 'z_archive_ct' => serialize($uArchiveCT), 'z_date' => $_POST['z_date'], - //FIXED 'trash' => ($_POST['trash'] === 'true') 'trash' => ($_POST['trash'] === 'true' ? 1 : 0) ); - //FIXED $formatRow = array( '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d'); - $formatRow = array( '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d'); + $formatRow = array( + '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', + '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', + '%s', '%d', '%d' + ); if($zoneId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($zTable, $updateRow); $updated = true; From c6000c95dc65405f855a9f8fb0ad23597b2f7031 Mon Sep 17 00:00:00 2001 From: minimus Date: Mon, 23 Dec 2013 11:46:18 +0300 Subject: [PATCH 16/18] Fixing month bug of Statistic System --- css/sam-admin-edit.css | 1 + sam-ajax-admin-stats.php | 58 ++++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/css/sam-admin-edit.css b/css/sam-admin-edit.css index fca0688..c9132ab 100644 --- a/css/sam-admin-edit.css +++ b/css/sam-admin-edit.css @@ -219,6 +219,7 @@ input.button-primary, input.button-secondary, padding: 20px 15px 15px 15px; margin: 15px auto 30px auto; border: 1px solid #ddd; + border-radius: 3px; background: #fff; background: linear-gradient(#f6f6f6 0, #fff 50px); background: -o-linear-gradient(#f6f6f6 0, #fff 50px); diff --git a/sam-ajax-admin-stats.php b/sam-ajax-admin-stats.php index 7abd2ab..3b09832 100644 --- a/sam-ajax-admin-stats.php +++ b/sam-ajax-admin-stats.php @@ -57,18 +57,21 @@ function samDaysInMonth($month, $year) { if(isset($_POST['id'])) { $pid = $_POST['id']; $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; - $now = getdate(); - $month = $now['mon'] - $sMonth; - $year = $now['year']; - $days = samDaysInMonth($month, $year); + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + $days = $date->format('t'); + $sql = "SELECT DATE_FORMAT(ss.event_time, %s) AS ed, COUNT(*) AS hits FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.pid = %d + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.pid = %d GROUP BY ed;"; - $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 0, $pid), ARRAY_A); - $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 1, $pid), ARRAY_A); + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 0, $pid), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 1, $pid), ARRAY_A); for($i = 1; $i <= $days; $i++) { $hitsFull[$i - 1] = array( $i, 0); $clicksFull[$i - 1] = array($i, 0); @@ -80,14 +83,14 @@ function samDaysInMonth($month, $year) { (SELECT COUNT(*) FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = 0 AND ss.pid = %d) AS hits, (SELECT COUNT(*) FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = 1 AND ss.pid = %d) AS clicks;"; - $total = $wpdb->get_row($wpdb->prepare($sql, $sMonth, $pid, $sMonth, $pid)); + $total = $wpdb->get_row($wpdb->prepare($sql, $month, $pid, $month, $pid)); $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total); } @@ -98,19 +101,21 @@ function samDaysInMonth($month, $year) { if(isset($_POST['id'])) { $id = $_POST['id']; $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; - $now = getdate(); - $month = $now['mon'] - $sMonth; - $year = $now['year']; - $days = samDaysInMonth($month, $year); + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + $days = $date->format('t'); $sql = "SELECT DATE_FORMAT(ss.event_time, %s) AS ed, COUNT(*) AS hits FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.id = %d + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = %d AND ss.id = %d GROUP BY ed;"; - $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 0, $id), ARRAY_A); - $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $sMonth, 1, $id), ARRAY_A); + $hits = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 0, $id), ARRAY_A); + $clicks = $wpdb->get_results($wpdb->prepare($sql, '%e', $month, 1, $id), ARRAY_A); for($i = 1; $i <= $days; $i++) { $hitsFull[$i - 1] = array( $i, 0); $clicksFull[$i - 1] = array($i, 0); @@ -122,14 +127,14 @@ function samDaysInMonth($month, $year) { (SELECT COUNT(*) FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = 0 AND ss.id = %d) AS hits, (SELECT COUNT(*) FROM $sTable ss - WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) + WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.event_type = 1 AND ss.id = %d) AS clicks;"; - $total = $wpdb->get_row($wpdb->prepare($sql, $sMonth, $id, $sMonth, $id)); + $total = $wpdb->get_row($wpdb->prepare($sql, $month, $id, $month, $id)); $out = array('hits' => $hitsFull, 'clicks' => $clicksFull, 'total' => $total); } @@ -140,20 +145,27 @@ function samDaysInMonth($month, $year) { if(isset($_POST['id'])) { $id = $_POST['id']; $sMonth = (isset($_POST['sm'])) ? $_POST['sm'] : 0; + + $date = new DateTime('now'); + $si = '-'.$sMonth.' month'; + $date->modify($si); + $month = $date->format('Y-m-d'); + //$days = $date->format('t'); + $sql = "SELECT sa.id, sa.pid, sa.name, sa.description, - @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, - @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM NOW()) - %d = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, + @ad_hits := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 0) AS ad_hits, + @ad_clicks := (SELECT COUNT(*) FROM $sTable ss WHERE (EXTRACT(YEAR_MONTH FROM %s) = EXTRACT(YEAR_MONTH FROM ss.event_time)) AND ss.id = sa.id AND ss.pid = sa.pid AND ss.event_type = 1) AS ad_clicks, sa.ad_weight, (sa.cpm / @ad_hits * 1000) AS e_cpm, sa.cpc AS e_cpc, (@ad_clicks / @ad_hits * 100) AS e_ctr FROM $aTable sa WHERE (sa.pid = %d) AND sa.trash = FALSE AND NOT (sa.ad_schedule AND sa.ad_end_date < NOW());"; - $rows = $wpdb->get_results($wpdb->prepare($sql, $sMonth, $sMonth, $id), ARRAY_A); + $rows = $wpdb->get_results($wpdb->prepare($sql, $month, $month, $id), ARRAY_A); $k = 0; foreach($rows as &$row) { From 56ee2469f85281c503734dab42fc80ff0b154c26 Mon Sep 17 00:00:00 2001 From: minimus Date: Wed, 25 Dec 2013 23:15:38 +0300 Subject: [PATCH 17/18] Mailing System --- admin.class.php | 85 ++++++++++++++++-- js/sam-settings.js | 4 +- js/sam-settings.min.js | 2 +- sam-ajax-admin-stats.php | 2 +- sam.class.php | 30 ++++++- sam.tools.php | 185 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 296 insertions(+), 12 deletions(-) create mode 100644 sam.tools.php diff --git a/admin.class.php b/admin.class.php index 53997b0..058ba67 100644 --- a/admin.class.php +++ b/admin.class.php @@ -10,6 +10,7 @@ class SimpleAdsManagerAdmin extends SimpleAdsManager { private $listBlock; private $eLogPage; private $cmsVer; + private $settingsTabs; private $samPointerOptions = array('places' => true, 'ads' => true, 'zones' => true, 'blocks' => true); public function __construct() { @@ -22,6 +23,7 @@ public function __construct() { if(!is_dir(SAM_AD_IMG)) mkdir(SAM_AD_IMG); + $this->settingsTabs = array(); $sam_tables_defs = self::getTablesDefs(); register_activation_hook(SAM_MAIN_FILE, array(&$this, 'onActivate')); @@ -487,16 +489,34 @@ private function getGridsData() { 'cTax' => $cTax ); } + + public function starSettingsTab( $section, $uri, $name ) { + $this->settingsTabs[$section] = array('start_tab' => true, 'uri' => $uri, 'name' => $name); + } + + public function finishSettingsTab( $section ) { + $this->settingsTabs[$section]['finish_tab'] = true; + } public function initSettings() { register_setting('samOptions', SAM_OPTIONS_NAME); + + self::starSettingsTab("sam_general_section", 'tabs-1', __('General', SAM_DOMAIN)); add_settings_section("sam_general_section", __("General Settings", SAM_DOMAIN), array(&$this, "drawGeneralSection"), 'sam-settings'); - add_settings_section("sam_single_section", __("Auto Inserting Settings", SAM_DOMAIN), array(&$this, "drawSingleSection"), 'sam-settings'); add_settings_section("sam_ext_section", __('Extended Options', SAM_DOMAIN), array(&$this, 'drawExtSection'), 'sam-settings'); + add_settings_section("sam_layout_section", __("Admin Layout", SAM_DOMAIN), array(&$this, "drawLayoutSection"), 'sam-settings'); + add_settings_section("sam_deactivate_section", __("Plugin Deactivating", SAM_DOMAIN), array(&$this, "drawDeactivateSection"), 'sam-settings'); + self::finishSettingsTab('sam_deactivate_section'); + self::starSettingsTab('sam_single_section', 'tabs-2', __('Auto Inserting', SAM_DOMAIN)); + add_settings_section("sam_single_section", __("Auto Inserting Settings", SAM_DOMAIN), array(&$this, "drawSingleSection"), 'sam-settings'); + self::finishSettingsTab('sam_single_section'); + self::starSettingsTab('sam_dfp_section', 'tabs-3', __('Google', SAM_DOMAIN)); add_settings_section("sam_dfp_section", __("Google DFP Settings", SAM_DOMAIN), array(&$this, "drawDFPSection"), 'sam-settings'); + self::finishSettingsTab('sam_dfp_section'); + self::starSettingsTab('sam_statistic_section', 'tabs-4', __('Tools', SAM_DOMAIN)); add_settings_section("sam_statistic_section", __("Statistics Settings", SAM_DOMAIN), array(&$this, "drawStatisticsSection"), 'sam-settings'); - add_settings_section("sam_layout_section", __("Admin Layout", SAM_DOMAIN), array(&$this, "drawLayoutSection"), 'sam-settings'); - add_settings_section("sam_deactivate_section", __("Plugin Deactivating", SAM_DOMAIN), array(&$this, "drawDeactivateSection"), 'sam-settings'); + add_settings_section('sam_mailer_section', __('Mailing System', SAM_DOMAIN), array(&$this, 'drawMailerSection'), 'sam-settings'); + self::finishSettingsTab('sam_mailer_section'); add_settings_field('adCycle', __("Views per Cycle", SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_general_section', array('description' => __('Number of hits of one ad for a full cycle of rotation (maximal activity).', SAM_DOMAIN))); add_settings_field('access', __('Minimum Level for access to menu', SAM_DOMAIN), array(&$this, 'drawJSliderOption'), 'sam-settings', 'sam_general_section', array('description' => __('Who can use menu of plugin - Minimum User Level needed for access to menu of plugin. In any case only Super Admin and Administrator can use Settings Menu of SAM Plugin.', SAM_DOMAIN), 'options' => array('manage_network' => __('Super Admin', SAM_DOMAIN), 'manage_options' => __('Administrator', SAM_DOMAIN), 'edit_others_posts' => __('Editor', SAM_DOMAIN), 'publish_posts' => __('Author', SAM_DOMAIN), 'edit_posts' => __('Contributor', SAM_DOMAIN)), 'values' => array('manage_network', 'manage_options', 'edit_others_posts', 'publish_posts', 'edit_posts'))); @@ -524,7 +544,7 @@ public function initSettings() { add_settings_field('errorlogFS', __('Turn on/off the error log for Face Side.', SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_ext_section', array('label_for' => 'errorlogFS', 'checkbox' => true)); add_settings_field('useDFP', __("Allow using Google DoubleClick for Publishers (DFP) rotator codes", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_dfp_section', array('label_for' => 'useDFP', 'checkbox' => true)); - add_settings_field('dfpPub', __("Google DFP Pub Code", SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_dfp_section', array('description' => __('Your Google DFP Pub code. i.e:', SAM_DOMAIN).' ca-pub-0000000000000000.', 'width' => 200)); + add_settings_field('dfpPub', __("Google DFP Pub Code", SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_dfp_section', array('description' => __('Your Google DFP Pub code. i.e:', SAM_DOMAIN).' ca-pub-0000000000000000.', 'width' => '200px')); add_settings_field('detectBots', __("Allow Bots and Crawlers detection", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_statistic_section', array('label_for' => 'detectBots', 'checkbox' => true)); add_settings_field('detectingMode', __("Accuracy of Bots and Crawlers Detection", SAM_DOMAIN), array(&$this, 'drawRadioOption'), 'sam-settings', 'sam_statistic_section', array('description' => __("If bot is detected hits of ads won't be counted. Use with caution! More exact detection requires more server resources.", SAM_DOMAIN), 'options' => array( 'inexact' => __('Inexact detection', SAM_DOMAIN), 'exact' => __('Exact detection', SAM_DOMAIN), 'more' => __('More exact detection', SAM_DOMAIN)))); @@ -537,6 +557,14 @@ public function initSettings() { add_settings_field('deleteOptions', __("Delete plugin options during deactivating plugin", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_deactivate_section', array('label_for' => 'deleteOptions', 'checkbox' => true)); add_settings_field('deleteDB', __("Delete database tables of plugin during deactivating plugin", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_deactivate_section', array('label_for' => 'deleteDB', 'checkbox' => true)); add_settings_field('deleteFolder', __("Delete custom images folder of plugin during deactivating plugin", SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_deactivate_section', array('label_for' => 'deleteFolder', 'checkbox' => true)); + + add_settings_field('mailer', __('Allow SAM Mailing System to send statistical data to advertisers', SAM_DOMAIN), array(&$this, 'drawCheckboxOption'), 'sam-settings', 'sam_mailer_section', array('label_for' => 'mailer', 'checkbox' => true)); + add_settings_field('mail_subject', __('Mail Subject', SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('Mail subject of sending email.', SAM_DOMAIN), 'width' => '70%')); + add_settings_field('mail_greeting', __('Mail Greeting String', SAM_DOMAIN), array(&$this, 'drawTextOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('Greeting string of sending email.', SAM_DOMAIN).' '.__("Shortcode [name] will be replaced with advertiser's name. Shortcode [site] will be replaced with name of your site.", SAM_DOMAIN), 'width' => '70%')); + add_settings_field('mail_text_before', __('Mail Text before statistical data table', SAM_DOMAIN), array(&$this, 'drawTextareaOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('Some text before statistical data table of sending email.', SAM_DOMAIN).' '.__("Shortcode [name] will be replaced with advertiser's name. Shortcode [site] will be replaced with name of your site.", SAM_DOMAIN), 'height' => '75px')); + add_settings_field('mail_text_after', __('Mail Text after statistical data table', SAM_DOMAIN), array(&$this, 'drawTextareaOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('Some text after statistical data table of sending email.', SAM_DOMAIN).' '.__("Shortcode [name] will be replaced with advertiser's name. Shortcode [site] will be replaced with name of your site.", SAM_DOMAIN), 'height' => '75px')); + add_settings_field('mail_warning', __('Mail Warning 1', SAM_DOMAIN), array(&$this, 'drawTextareaOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('This text will be placed at the end of sending email.', SAM_DOMAIN).' '.__("Shortcode [name] will be replaced with advertiser's name. Shortcode [site] will be replaced with name of your site.", SAM_DOMAIN), 'height' => '50px')); + add_settings_field('mail_message', __('Mail Warning 2', SAM_DOMAIN), array(&$this, 'drawTextareaOption'), 'sam-settings', 'sam_mailer_section', array('description' => __('This text will be placed at the very end of sending email.', SAM_DOMAIN).' '.__("Shortcode [name] will be replaced with advertiser's name. Shortcode [site] will be replaced with name of your site.", SAM_DOMAIN), 'height' => '50px')); register_setting('sam-settings', SAM_OPTIONS_NAME, array(&$this, 'sanitizeSettings')); } @@ -601,11 +629,14 @@ public function loadScripts($hook) { wp_enqueue_style('jSlider', SAM_URL.'css/jslider.css', false, '1.1.0'); wp_enqueue_style('jSlider-plastic', SAM_URL.'css/jslider.round.plastic.css', false, '1.1.0'); wp_enqueue_style('colorButtons', SAM_URL.'css/color-buttons.css', false, SAM_VERSION); + wp_enqueue_style('jquery-ui-css', $jqCSS, false, '1.10.3'); wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-effects-core'); wp_enqueue_script('jquery-effects-blind'); + wp_enqueue_script('jquery-ui-widget'); + wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('hash-table', SAM_URL.'js/slider/jshashtable-2.1_src.js', array('jquery'), '2.1'); wp_enqueue_script('number-formatter', SAM_URL.'js/slider/jquery.numberformatter-1.2.3.js', array('jquery'), '1.2.3'); wp_enqueue_script('templates', SAM_URL.'js/slider/tmpl.js', array('jquery')); @@ -895,14 +926,36 @@ public function getErrorDataHandler() { } else wp_send_json_error(); } + + public function settingsTabsHeader( $tabs ) { + $out = "

          "; + + foreach($tabs as $tab) { + if(isset($tab['uri']) && isset($tab['name'])) { + $tabUri = $tab['uri']; + $tabName = $tab['name']; + $out .= "
        • {$tabName}
        • "; + } + } + + $out .= "
        "; + + return $out; + } - public function doSettingsSections($page) { + public function doSettingsSections($page, $tabs) { global $wp_settings_sections, $wp_settings_fields; if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) ) return; + echo "
        \n"; + echo self::settingsTabsHeader($tabs); + foreach ( (array) $wp_settings_sections[$page] as $section ) { + if($this->settingsTabs[ $section['id'] ]['start_tab']) + echo "
        "; + echo "
        \n"; echo "
        \n"; echo "

        {$section['title']}

        \n"; @@ -914,7 +967,9 @@ public function doSettingsSections($page) { echo '
        '; echo '
        '; echo '
        '; + if($this->settingsTabs[ $section['id'] ]['finish_tab']) echo "
        "; } + echo "

        "; } public function doSettingsFields($page, $section) { @@ -986,6 +1041,11 @@ public function drawLayoutSection() { public function drawDeactivateSection() { echo '

        '.__('Are you allow to perform these actions during deactivating plugin?', SAM_DOMAIN).'

        '; } + + public function drawMailerSection() { + $time = get_transient( 'sam_maintenance_date' ); + echo "Next mailing is scheduled on {$time}... ".$this->test[0]; + } public function drawTextOption( $id, $args ) { $settings = parent::getSettings(); @@ -996,7 +1056,18 @@ public function drawTextOption( $id, $args ) { name="" type="text" value="" - style="height: 22px; font-size: 11px; " /> + style="height: 22px; font-size: 11px; " /> + +
        - doSettingsSections('sam-settings'); ?> + doSettingsSections('sam-settings', $this->settingsTabs); ?>

        +

        :
        :

        +

        @@ -1524,6 +1526,7 @@ public function page() {
        +

        :
        :

        +
        diff --git a/langs/simple-ads-manager-ru_RU.mo b/langs/simple-ads-manager-ru_RU.mo index d8a55db80e972eb3407f2dc9167b6e3fe7769044..c3a6c76fd689e24c0e323884bae6d541018b748e 100644 GIT binary patch delta 15840 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 p-}Y>}w>5#xnM%ERlWRh5E_%O+<+-LsKbR5v8J0 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\n" "Language-Team: minimus \n" @@ -31,83 +31,83 @@ msgstr "Флеш объявление" msgid "Empty data..." msgstr "Нет данных ..." -#: ../admin.class.php:148 +#: ../admin.class.php:150 msgid "Active W3 Total Cache plugin detected." msgstr "Обнаружен активный плагин W3 Total Cache." -#: ../admin.class.php:149 +#: ../admin.class.php:151 msgid "Active WP Super Cache plugin detected." msgstr "Обнаружен активный плагин WP Super Cache." -#: ../admin.class.php:154 +#: ../admin.class.php:156 msgid "Active bbPress Forum plugin detected." msgstr "Обнаружен активный плагин bbPress." -#: ../admin.class.php:173 +#: ../admin.class.php:175 msgid "Cache of WP Super Cache plugin is flushed." msgstr "Кэш плагина WP Super Cache обновлён." -#: ../admin.class.php:177 +#: ../admin.class.php:179 msgid "Cache of W3 Total Cache plugin is flushed." msgstr "Кэш плагина W3 Total Cache обновлён." -#: ../admin.class.php:396 ../editor.admin.class.php:1485 +#: ../admin.class.php:399 ../editor.admin.class.php:1487 msgid "Advertiser Name" msgstr "Имя рекламодателя" -#: ../admin.class.php:397 +#: ../admin.class.php:400 msgid "Advertiser Nick" msgstr "Ник рекламодателя" -#: ../admin.class.php:398 ../editor.admin.class.php:1489 +#: ../admin.class.php:401 ../editor.admin.class.php:1491 msgid "Advertiser e-mail" msgstr "e-mail рекламодателя" -#: ../admin.class.php:402 +#: ../admin.class.php:405 msgid "Category Title" msgstr "Наименование рубрики" -#: ../admin.class.php:403 +#: ../admin.class.php:406 msgid "Category Slug" msgstr "Ярлык рубрики" -#: ../admin.class.php:407 ../admin.class.php:426 +#: ../admin.class.php:410 ../admin.class.php:429 msgid "Display Name" msgstr "Показываемое имя" -#: ../admin.class.php:408 ../admin.class.php:427 +#: ../admin.class.php:411 ../admin.class.php:430 msgid "User Name" msgstr "Имя пользователя" -#: ../admin.class.php:412 +#: ../admin.class.php:415 msgid "Tag Title" msgstr "Название метки" -#: ../admin.class.php:413 +#: ../admin.class.php:416 msgid "Tag Slug" msgstr "Ярлык метки" -#: ../admin.class.php:416 +#: ../admin.class.php:419 msgid "Custom Type Title" msgstr "Заголовок пользовательского типа" -#: ../admin.class.php:417 +#: ../admin.class.php:420 msgid "Custom Type Slug" msgstr "Ярлык пользовательского типа" -#: ../admin.class.php:421 +#: ../admin.class.php:424 msgid "Publication Title" msgstr "Заголовок публикации" -#: ../admin.class.php:422 +#: ../admin.class.php:425 msgid "Publication Type" msgstr "Тип публикации" -#: ../admin.class.php:428 +#: ../admin.class.php:431 msgid "Role" msgstr "Роль" -#: ../admin.class.php:431 ../block.list.admin.class.php:88 +#: ../admin.class.php:434 ../block.list.admin.class.php:88 #: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 #: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 #: ../list.admin.class.php:184 ../list.admin.class.php:360 @@ -116,62 +116,94 @@ msgstr "Роль" msgid "ID" msgstr "ID" -#: ../admin.class.php:432 +#: ../admin.class.php:435 msgid "Term Name" msgstr "Имя термина" -#: ../admin.class.php:433 +#: ../admin.class.php:436 msgid "Custom Taxonomy Name" msgstr "Имя пользовательской таксономии" -#: ../admin.class.php:439 +#: ../admin.class.php:442 msgid "Full Size" msgstr "Полный размер" -#: ../admin.class.php:493 +#: ../admin.class.php:503 +msgid "" +"Shortcode [name] will be replaced with advertiser's name. " +"Shortcode [site] will be replaced with name of your site. " +"Shotcode [month] will be replaced with name of month of " +"reporting period." +msgstr "" +"Шаблон [name] будет заменён на имя рекламодателя. Шаблон " +"[site] будет заменён на имя Вашего сайта. Шаблон [month] будет заменён на имя месяца отчётного периода." + +#: ../admin.class.php:507 ../editor.admin.class.php:479 +#: ../editor.admin.class.php:1008 +msgid "General" +msgstr "Основные параметры" + +#: ../admin.class.php:508 msgid "General Settings" msgstr "Основные параметры" -#: ../admin.class.php:494 +#: ../admin.class.php:509 +msgid "Extended Options" +msgstr "Дополнительные параметры" + +#: ../admin.class.php:510 +msgid "Admin Layout" +msgstr "Параметры административных страниц" + +#: ../admin.class.php:511 +msgid "Plugin Deactivating" +msgstr "Деактивация плагина" + +#: ../admin.class.php:513 +msgid "Auto Inserting" +msgstr "Автовставка" + +#: ../admin.class.php:514 msgid "Auto Inserting Settings" msgstr "Параметры автовставки" -#: ../admin.class.php:495 -msgid "Extended Options" -msgstr "Дополнительные параметры" +#: ../admin.class.php:516 +msgid "Google" +msgstr "Google" -#: ../admin.class.php:496 +#: ../admin.class.php:517 msgid "Google DFP Settings" msgstr "Параметры Google DFP" -#: ../admin.class.php:497 ../help.class.php:68 ../help.class.php:195 +#: ../admin.class.php:519 +msgid "Tools" +msgstr "Инструменты" + +#: ../admin.class.php:520 ../help.class.php:68 ../help.class.php:195 msgid "Statistics Settings" msgstr "Параметры статистики" -#: ../admin.class.php:498 -msgid "Admin Layout" -msgstr "Параметры административных страниц" - -#: ../admin.class.php:499 -msgid "Plugin Deactivating" -msgstr "Деактивация плагина" +#: ../admin.class.php:521 +msgid "Mailing System" +msgstr "Система рассылки" -#: ../admin.class.php:501 +#: ../admin.class.php:524 msgid "Views per Cycle" msgstr "Показов в цикле" -#: ../admin.class.php:501 +#: ../admin.class.php:524 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" "Количество показов одного рекламного объявления за полный цикл ротации при " "максимальной активности (см. \"вес объявления\")." -#: ../admin.class.php:502 +#: ../admin.class.php:525 msgid "Minimum Level for access to menu" msgstr "Минимальный уровень для доступа к меню" -#: ../admin.class.php:502 +#: ../admin.class.php:525 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " @@ -181,31 +213,31 @@ msgstr "" "необходимый для доступа к меню плагина. В любом случае, доступ к меню " "настроек плагина имеют только Администратор и Супер Администратор." -#: ../admin.class.php:502 ../admin.class.php:619 ../admin.class.php:760 +#: ../admin.class.php:525 ../admin.class.php:653 ../admin.class.php:794 msgid "Super Admin" msgstr "Супер Админ" -#: ../admin.class.php:502 ../admin.class.php:620 ../admin.class.php:759 +#: ../admin.class.php:525 ../admin.class.php:654 ../admin.class.php:793 msgid "Administrator" msgstr "Администратор" -#: ../admin.class.php:502 ../admin.class.php:621 ../admin.class.php:758 +#: ../admin.class.php:525 ../admin.class.php:655 ../admin.class.php:792 msgid "Editor" msgstr "Редактор" -#: ../admin.class.php:502 ../admin.class.php:622 ../admin.class.php:757 +#: ../admin.class.php:525 ../admin.class.php:656 ../admin.class.php:791 msgid "Author" msgstr "Автор" -#: ../admin.class.php:502 ../admin.class.php:623 ../admin.class.php:756 +#: ../admin.class.php:525 ../admin.class.php:657 ../admin.class.php:790 msgid "Contributor" msgstr "Участник" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Ad Output Mode" msgstr "Режим вывода объявления" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "" "Standard (PHP) mode is more faster but is not compatible with caching " "plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " @@ -221,101 +253,104 @@ msgstr "" "плагинов. Режим Javascript неплохо решает проблему совместной работы с " "плагинами кэширования." -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Standard (PHP)" msgstr "Стандартный (PHP)" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Caching Compatible (Javascript)" msgstr "Совместимость с кэшированием (Javascript)" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Display Ad Source in" msgstr "Открывать ссылку в" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Target wintow (tab) for advetisement source." msgstr "Открытие окна (вкладки) для рекламного объявления." -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "New Window (Tab)" msgstr "Новое окно (вкладка)" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Current Window (Tab)" msgstr "Текущее окно (вкладка)" -#: ../admin.class.php:505 +#: ../admin.class.php:528 msgid "Allow displaying ads on bbPress forum pages" msgstr "Разрешить показ объявленийна страницах форумов bbPress" -#: ../admin.class.php:507 +#: ../admin.class.php:530 msgid "Ads Place before content" msgstr "Рекламное место до контента" -#: ../admin.class.php:508 +#: ../admin.class.php:531 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места перед контентом статьи/" "страницы" -#: ../admin.class.php:509 -msgid "Allow Ads Place auto inserting before post/page excerpt (in the loop)" +#: ../admin.class.php:532 +msgid "" +"Allow Ads Place auto inserting before post/page or post/page excerpt in the " +"loop" msgstr "" -"Разрешить автоматическую вставку рекламного места перед анонсом (в цикле)" +"Разрешить автоматическую вставку рекламного места перед контентом или " +"анонсом в цикле" -#: ../admin.class.php:510 +#: ../admin.class.php:533 msgid "Allow Ads Place auto inserting before bbPress Forum topic content" msgstr "" "Разрешить автоматическую вставку рекламного места перед контентом форумов " "bbPress" -#: ../admin.class.php:511 +#: ../admin.class.php:534 msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" msgstr "" "Разрешить автоматическую вставку рекламного места в на страницах списков " "форумов/топиков bbPress" -#: ../admin.class.php:512 ../admin.class.php:516 ../admin.class.php:520 +#: ../admin.class.php:535 ../admin.class.php:539 ../admin.class.php:543 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" "Использовать заранее заданные коды рекламного места (коды рекламного места " "\"до\" и \"после\")" -#: ../admin.class.php:513 +#: ../admin.class.php:536 msgid "Ads Place in the middle of content" msgstr "Рекламное место в средней части контента" -#: ../admin.class.php:514 +#: ../admin.class.php:537 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места в середину контента статьи/" "страницы" -#: ../admin.class.php:515 +#: ../admin.class.php:538 msgid "" "Allow Ads Place auto inserting into the middle of bbPress Forum topic content" msgstr "" "Разрешить автоматическую вставку рекламного места в середину контента топика " "форумов bbPress" -#: ../admin.class.php:517 +#: ../admin.class.php:540 msgid "Ads Place after content" msgstr "Рекламное место после контента" -#: ../admin.class.php:518 +#: ../admin.class.php:541 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" "Разрешить автоматическую вставку рекламного места после контента статьи/" "страницы" -#: ../admin.class.php:519 +#: ../admin.class.php:542 msgid "Allow Ads Place auto inserting after bbPress Forum topic content" msgstr "" "Разрешить автоматическую вставку рекламного места после контента топика " "форумов bbPress" -#: ../admin.class.php:522 +#: ../admin.class.php:545 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." @@ -323,35 +358,35 @@ msgstr "" "Я использую (планирую использовать) мои собственные флеш (SWF) баннеры. " "Другими словами, разрешить загрузку скрипта \"SWFObject\" на страницах блога." -#: ../admin.class.php:523 +#: ../admin.class.php:546 msgid "Turn on/off the error log." msgstr "Включить/выключить журнал ошибок." -#: ../admin.class.php:524 +#: ../admin.class.php:547 msgid "Turn on/off the error log for Face Side." msgstr "Включить/выключить журнал ошибок для Face Side." -#: ../admin.class.php:526 +#: ../admin.class.php:549 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "Разрешить использование кодов Google DoubleClick for Publishers (DFP)" -#: ../admin.class.php:527 +#: ../admin.class.php:550 msgid "Google DFP Pub Code" msgstr "Pub-код Google DFP" -#: ../admin.class.php:527 +#: ../admin.class.php:550 msgid "Your Google DFP Pub code. i.e:" msgstr "Ваш pub-код Google DFP. Например:" -#: ../admin.class.php:529 +#: ../admin.class.php:552 msgid "Allow Bots and Crawlers detection" msgstr "Разрешить обнаружение ботов и сканеров" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Accuracy of Bots and Crawlers Detection" msgstr "Точность обнаружения ботов и сканеров" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." @@ -359,23 +394,23 @@ msgstr "" "Если обнаружен бот, показы объявлений не будут защитаны. Используйте с " "осторожностью! Чем точнее определение, тем больше ресурсов сервера требуется." -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Inexact detection" msgstr "Неточное определение" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Exact detection" msgstr "Точное определение" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "More exact detection" msgstr "Более точное определение" -#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "Показ валюты" -#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." @@ -384,23 +419,23 @@ msgstr "" "валюты из параметров настройки блога. Доллары США, Евро - принудительное " "отображение валюты в долларах США или евро." -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "Auto" msgstr "Автоопределение" -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "USD" msgstr "Доллары США" -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "EUR" msgstr "Евро" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "TinyMCE Editor Button Mode" msgstr "Режим кнопки плагина в редакторе TinyMCE" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " @@ -411,19 +446,19 @@ msgstr "" "можете использовать классические кнопки TinyMCE. В этом случае выберите " "\"Классические кнопки TinyMCE\"." -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "Modern TinyMCE Button" msgstr "Современная кнопка TinyMCE" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "Classic TinyMCE Buttons" msgstr "Классические кнопки TinyMCE" -#: ../admin.class.php:534 +#: ../admin.class.php:557 msgid "Ads Places per Page" msgstr "Рекламных мест на страницу" -#: ../admin.class.php:534 +#: ../admin.class.php:557 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." @@ -431,11 +466,11 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных мест. Сколько " "рекламных мест будет показано в таблице на одной странице." -#: ../admin.class.php:535 +#: ../admin.class.php:558 msgid "Ads per Page" msgstr "Объявлений на страницу" -#: ../admin.class.php:535 +#: ../admin.class.php:558 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." @@ -443,92 +478,150 @@ msgstr "" "Разбиение на страницы таблицы представления рекламных объявлений. Сколько " "рекламных объявлений будет показано в таблице на одной странице." -#: ../admin.class.php:537 +#: ../admin.class.php:560 msgid "Delete plugin options during deactivating plugin" msgstr "Удалить параметры плагина при деактивации" -#: ../admin.class.php:538 +#: ../admin.class.php:561 msgid "Delete database tables of plugin during deactivating plugin" msgstr "Удалить таблицы базы данных плагина во время деактивации" -#: ../admin.class.php:539 +#: ../admin.class.php:562 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" "Удалить папку пользовательских изображений плагина во время деактивации" -#: ../admin.class.php:547 +#: ../admin.class.php:564 +msgid "Allow SAM Mailing System to send statistical data to advertisers" +msgstr "" +"Разрешить Системе Рассылки плагина отправлять статистические данные " +"рекламодателям." + +#: ../admin.class.php:565 +msgid "Mail Subject" +msgstr "Тема письма" + +#: ../admin.class.php:565 +msgid "Mail subject of sending email." +msgstr "Тема отправляемого письма." + +#: ../admin.class.php:566 +msgid "Mail Greeting String" +msgstr "Строка приветствия" + +#: ../admin.class.php:566 +msgid "Greeting string of sending email." +msgstr "Строка приветствия отправляемого письма." + +#: ../admin.class.php:567 +msgid "Mail Text before statistical data table" +msgstr "Текст перед таблицей статистической отчётности." + +#: ../admin.class.php:567 +msgid "Some text before statistical data table of sending email." +msgstr "" +"Любой, необходимый текст перед таблицей, содержащей статистические данные за " +"отчётный период." + +#: ../admin.class.php:568 +msgid "Mail Text after statistical data table" +msgstr "Текст после таблицы статистической отчётности" + +#: ../admin.class.php:568 +msgid "Some text after statistical data table of sending email." +msgstr "" +"Любой, необходимый текст после таблицы, содержащей статистические данные за " +"отчётный период." + +#: ../admin.class.php:569 +msgid "Mail Warning 1" +msgstr "Предупреждение 1" + +#: ../admin.class.php:569 +msgid "This text will be placed at the end of sending email." +msgstr "Текст будет помещён в конце посылаемого письма." + +#: ../admin.class.php:570 +msgid "Mail Warning 2" +msgstr "Предупреждение 2" + +#: ../admin.class.php:570 +msgid "This text will be placed at the very end of sending email." +msgstr "Текст будет помещён в самом конце посылаемого письма." + +#: ../admin.class.php:578 msgid "Ads" msgstr "Реклама" -#: ../admin.class.php:548 +#: ../admin.class.php:579 msgid "Ads List" msgstr "Список рекламных объявлений" -#: ../admin.class.php:548 +#: ../admin.class.php:579 msgid "Ads Places" msgstr "Рекламные места" -#: ../admin.class.php:549 +#: ../admin.class.php:580 msgid "Ad Editor" msgstr "Редактор рекламного объявления" -#: ../admin.class.php:549 +#: ../admin.class.php:580 msgid "New Place" msgstr "Новое место" -#: ../admin.class.php:550 +#: ../admin.class.php:581 msgid "Ads Zones List" msgstr "Список зон рекламных объявлений" -#: ../admin.class.php:550 +#: ../admin.class.php:581 msgid "Ads Zones" msgstr "Рекламные зоны" -#: ../admin.class.php:551 +#: ../admin.class.php:582 msgid "Ads Zone Editor" msgstr "Редактор рекламной зоны" -#: ../admin.class.php:551 +#: ../admin.class.php:582 msgid "New Zone" msgstr "Новая зона" -#: ../admin.class.php:552 +#: ../admin.class.php:583 msgid "Ads Blocks List" msgstr "Список блоков рекламных объявлений" -#: ../admin.class.php:552 +#: ../admin.class.php:583 msgid "Ads Blocks" msgstr "Рекламные блоки" -#: ../admin.class.php:553 ../block.editor.admin.class.php:402 +#: ../admin.class.php:584 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "Редактор рекламного блока" -#: ../admin.class.php:553 +#: ../admin.class.php:584 msgid "New Block" msgstr "Новый блок" -#: ../admin.class.php:554 ../admin.class.php:1087 +#: ../admin.class.php:585 ../admin.class.php:1167 msgid "Simple Ads Manager Settings" msgstr "Параметры Simple Ads Manager" -#: ../admin.class.php:554 +#: ../admin.class.php:585 msgid "Settings" msgstr "Параметры" -#: ../admin.class.php:555 +#: ../admin.class.php:586 msgid "Simple Ads Manager Error Log" msgstr "Журнал ошибок Simple Ads Manager" -#: ../admin.class.php:555 ../errorlog.admin.class.php:57 +#: ../admin.class.php:586 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "Журнал ошибок" -#: ../admin.class.php:667 ../admin.class.php:739 ../editor.admin.class.php:460 +#: ../admin.class.php:701 ../admin.class.php:773 ../editor.admin.class.php:460 msgid "Name of Ads Place" msgstr "Имя рекламного места" -#: ../admin.class.php:667 ../admin.class.php:739 +#: ../admin.class.php:701 ../admin.class.php:773 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." @@ -537,11 +630,11 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений, виджеты плагина " "или автовставку объявлений." -#: ../admin.class.php:668 ../admin.class.php:740 ../editor.admin.class.php:986 +#: ../admin.class.php:702 ../admin.class.php:774 ../editor.admin.class.php:988 msgid "Name of Ad" msgstr "Имя рекламного объявления" -#: ../admin.class.php:668 ../admin.class.php:740 ../admin.class.php:788 +#: ../admin.class.php:702 ../admin.class.php:774 ../admin.class.php:822 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." @@ -550,73 +643,73 @@ msgstr "" "если вы планируете использовать блоки рекламных объявлений или виджеты " "плагина." -#: ../admin.class.php:669 ../admin.class.php:741 +#: ../admin.class.php:703 ../admin.class.php:775 msgid "Select Banner Image" msgstr "Выбор изображения баннера" -#: ../admin.class.php:669 ../admin.class.php:741 +#: ../admin.class.php:703 ../admin.class.php:775 msgid "Select" msgstr "Выбрать" -#: ../admin.class.php:673 ../admin.class.php:747 +#: ../admin.class.php:707 ../admin.class.php:781 msgid "Uploading" msgstr "Загружается" -#: ../admin.class.php:674 ../admin.class.php:748 +#: ../admin.class.php:708 ../admin.class.php:782 msgid "Uploaded." msgstr "загружен." -#: ../admin.class.php:675 ../admin.class.php:749 +#: ../admin.class.php:709 ../admin.class.php:783 msgid "Only JPG, PNG or GIF files are allowed" msgstr "Разрешается загрузка файлов формата JPG, PNG или GIF" -#: ../admin.class.php:676 ../admin.class.php:750 +#: ../admin.class.php:710 ../admin.class.php:784 msgid "File" msgstr "Файл" -#: ../admin.class.php:680 ../admin.class.php:684 ../admin.class.php:761 -#: ../editor.admin.class.php:608 ../editor.admin.class.php:937 -#: ../editor.admin.class.php:1547 ../list.admin.class.php:176 +#: ../admin.class.php:714 ../admin.class.php:718 ../admin.class.php:795 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1550 ../list.admin.class.php:176 #: ../list.admin.class.php:187 ../list.admin.class.php:235 #: ../list.admin.class.php:363 ../list.admin.class.php:373 #: ../list.admin.class.php:425 msgid "Hits" msgstr "Показы" -#: ../admin.class.php:680 ../admin.class.php:685 ../admin.class.php:761 -#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 -#: ../editor.admin.class.php:1548 ../list.admin.class.php:236 +#: ../admin.class.php:714 ../admin.class.php:719 ../admin.class.php:795 +#: ../editor.admin.class.php:610 ../editor.admin.class.php:941 +#: ../editor.admin.class.php:1551 ../list.admin.class.php:236 #: ../list.admin.class.php:364 ../list.admin.class.php:374 #: ../list.admin.class.php:426 msgid "Clicks" msgstr "Клики" -#: ../admin.class.php:683 ../block.editor.admin.class.php:308 -#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:355 +#: ../admin.class.php:717 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:381 msgid "Name" msgstr "Наименование" -#: ../admin.class.php:753 +#: ../admin.class.php:787 msgid "Post" msgstr "Статья" -#: ../admin.class.php:754 ../editor.admin.class.php:1134 +#: ../admin.class.php:788 ../editor.admin.class.php:1136 msgid "Page" msgstr "Страница" -#: ../admin.class.php:755 +#: ../admin.class.php:789 msgid "Subscriber" msgstr "Подписчик" -#: ../admin.class.php:788 ../zone.editor.admin.class.php:356 +#: ../admin.class.php:822 ../zone.editor.admin.class.php:382 msgid "Name of Ads Zone" msgstr "Имя рекламной зоны" -#: ../admin.class.php:789 ../block.editor.admin.class.php:309 +#: ../admin.class.php:823 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "Имя рекламного блока" -#: ../admin.class.php:789 +#: ../admin.class.php:823 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." @@ -624,58 +717,58 @@ msgstr "" "Необязательный параметр. Однако, настоятельно рекомендуется определить его, " "если вы планируете использовать виджеты плагина." -#: ../admin.class.php:808 +#: ../admin.class.php:842 msgid "Error ID" msgstr "ID ошибки" -#: ../admin.class.php:809 +#: ../admin.class.php:843 msgid "Error Date" msgstr "Дата ошибки" -#: ../admin.class.php:810 ../errorlog.admin.class.php:86 +#: ../admin.class.php:844 ../errorlog.admin.class.php:86 #: ../errorlog.admin.class.php:96 msgid "Table" msgstr "Таблица" -#: ../admin.class.php:811 +#: ../admin.class.php:845 msgid "Error Message" msgstr "Сообщение об ошибке" -#: ../admin.class.php:812 +#: ../admin.class.php:846 msgid "Error SQL" msgstr "SQL вызвавший ошибку" -#: ../admin.class.php:813 ../errorlog.admin.class.php:87 +#: ../admin.class.php:847 ../errorlog.admin.class.php:87 #: ../errorlog.admin.class.php:97 msgid "Type" msgstr "Тип ошибки" -#: ../admin.class.php:814 +#: ../admin.class.php:848 msgid "Close" msgstr "Закрыть" -#: ../admin.class.php:816 ../admin.class.php:877 +#: ../admin.class.php:850 ../admin.class.php:911 #: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 msgid "Warning" msgstr "Внимание" -#: ../admin.class.php:816 ../errorlog.admin.class.php:136 +#: ../admin.class.php:850 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "Ok" -#: ../admin.class.php:877 ../errorlog.admin.class.php:116 +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 msgid "Update Error" msgstr "Ошибка обновления" -#: ../admin.class.php:877 ../errorlog.admin.class.php:116 +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 msgid "Output Error" msgstr "Ошибка вывода" -#: ../admin.class.php:963 +#: ../admin.class.php:1022 msgid "There are general options." msgstr "Основные параметры плагина." -#: ../admin.class.php:967 +#: ../admin.class.php:1026 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" @@ -685,75 +778,83 @@ msgstr "" "Используйте эти параметры для разрешения/определения рекламных мест, которые " "будут автоматически вставлены до/после контента статьи/страницы." -#: ../admin.class.php:975 +#: ../admin.class.php:1034 msgid "Adjust parameters of your Google DFP account." msgstr "Настройте параметры вашей учётной записи Google DFP." -#: ../admin.class.php:979 +#: ../admin.class.php:1038 msgid "Adjust parameters of plugin statistics." msgstr "Настройте параметры статистики плагина." -#: ../admin.class.php:983 +#: ../admin.class.php:1042 msgid "This options define layout for Ads Managin Pages." msgstr "" "Эти параметры определяют внешний вид страниц управления рекламными " "объявлениями и рекламными местами." -#: ../admin.class.php:987 +#: ../admin.class.php:1046 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "Вы разрешаете выполнение этих деиствий в ходе деактивации плагина?" -#: ../admin.class.php:1101 +#: ../admin.class.php:1054 +msgid "Next mailing is scheduled on" +msgstr "Следующая рассылка запланирована на" + +#: ../admin.class.php:1056 +msgid "Adjust parameters of Mailing System." +msgstr "Настройте параметры Системы рассылки." + +#: ../admin.class.php:1181 msgid "Simple Ads Manager Settings Updated." msgstr "Параметры Simple Ads Manager сохранены." -#: ../admin.class.php:1109 +#: ../admin.class.php:1189 msgid "System Info" msgstr "Системная информация" -#: ../admin.class.php:1116 +#: ../admin.class.php:1196 msgid "Wordpress Version" msgstr "Версия Wordpress" -#: ../admin.class.php:1117 +#: ../admin.class.php:1197 msgid "SAM Version" msgstr "Версия плагина" -#: ../admin.class.php:1118 +#: ../admin.class.php:1198 msgid "SAM DB Version" msgstr "Версия таблиц БД плагина" -#: ../admin.class.php:1119 +#: ../admin.class.php:1199 msgid "PHP Version" msgstr "Версия PHP" -#: ../admin.class.php:1120 +#: ../admin.class.php:1200 msgid "MySQL Version" msgstr "Версия MySQL" -#: ../admin.class.php:1121 +#: ../admin.class.php:1201 msgid "Memory Limit" msgstr "Лимит памяти" -#: ../admin.class.php:1125 +#: ../admin.class.php:1205 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" "Обратите внимание! Если вы обнаружили ошибку, не забудьте включить эти " "данные в отчет об ошибке." -#: ../admin.class.php:1130 +#: ../admin.class.php:1210 msgid "Resources" msgstr "Ресурсы" -#: ../admin.class.php:1133 +#: ../admin.class.php:1213 msgid "Wordpress Plugin Page" msgstr "Страница плагина на Wordpress" -#: ../admin.class.php:1134 +#: ../admin.class.php:1214 msgid "Author Plugin Page" msgstr "Страница плагина" -#: ../admin.class.php:1135 ../help.class.php:34 ../help.class.php:51 +#: ../admin.class.php:1215 ../help.class.php:34 ../help.class.php:51 #: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 #: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 #: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 @@ -761,15 +862,15 @@ msgstr "Страница плагина" msgid "Support Forum" msgstr "Форум поддержки" -#: ../admin.class.php:1136 +#: ../admin.class.php:1216 msgid "Author's Blog" msgstr "Блог автора" -#: ../admin.class.php:1141 +#: ../admin.class.php:1221 msgid "Donations" msgstr "Пожертвования" -#: ../admin.class.php:1153 +#: ../admin.class.php:1233 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " @@ -779,28 +880,28 @@ msgstr "" "%s, чтобы поддержать дальнейшие работы по разработке плагина. Ваша поддержка " "будет оценена по достоинству. Спасибо!" -#: ../admin.class.php:1154 +#: ../admin.class.php:1234 msgid "Donate Now!" msgstr "Пожертвовать!" -#: ../admin.class.php:1154 +#: ../admin.class.php:1234 msgid "donation" msgstr "пожертвование" -#: ../admin.class.php:1172 +#: ../admin.class.php:1252 msgid "Another Plugins" msgstr "Другие плагины" -#: ../admin.class.php:1176 +#: ../admin.class.php:1256 #, php-format msgid "Another plugins from %s" msgstr "Другие плагины от %s'а" -#: ../admin.class.php:1182 +#: ../admin.class.php:1262 msgid "Highlights any portion of text as text in the colored boxes." msgstr "Подсветка любой части текста в виде текста в цветной рамке." -#: ../admin.class.php:1183 +#: ../admin.class.php:1263 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." @@ -808,21 +909,21 @@ msgstr "" "Добавляет бейджик счётчиков (подписчики Feedburner и последователи Twitter) " "на все страницы блога." -#: ../admin.class.php:1184 +#: ../admin.class.php:1264 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "Wordpress оболочка для плагина FloatBox от Байрона МакГрегора." -#: ../admin.class.php:1185 +#: ../admin.class.php:1265 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" "Добавляет строку уведомления об авторском праве в конец каждой статьи блога." -#: ../admin.class.php:1201 +#: ../admin.class.php:1281 msgctxt "Copyright String" msgid "Simple Ads Manager plugin for Wordpress." msgstr "Wordpress плагин Simple Ads Manager" -#: ../admin.class.php:1201 +#: ../admin.class.php:1281 msgctxt "Copyright String" msgid "All rights reserved." msgstr "Все права защищены." @@ -833,13 +934,13 @@ msgstr "Все права защищены." #: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 #: ../editor.admin.class.php:465 ../editor.admin.class.php:486 #: ../editor.admin.class.php:507 ../editor.admin.class.php:527 -#: ../editor.admin.class.php:615 ../editor.admin.class.php:911 -#: ../editor.admin.class.php:991 ../editor.admin.class.php:1015 -#: ../editor.admin.class.php:1085 ../editor.admin.class.php:1185 -#: ../editor.admin.class.php:1430 ../editor.admin.class.php:1477 -#: ../editor.admin.class.php:1497 ../editor.admin.class.php:1556 -#: ../zone.editor.admin.class.php:300 ../zone.editor.admin.class.php:361 -#: ../zone.editor.admin.class.php:375 +#: ../editor.admin.class.php:617 ../editor.admin.class.php:913 +#: ../editor.admin.class.php:993 ../editor.admin.class.php:1017 +#: ../editor.admin.class.php:1087 ../editor.admin.class.php:1187 +#: ../editor.admin.class.php:1432 ../editor.admin.class.php:1479 +#: ../editor.admin.class.php:1499 ../editor.admin.class.php:1560 +#: ../zone.editor.admin.class.php:326 ../zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:401 msgid "Click to toggle" msgstr "Кликнуть для переключения" @@ -870,11 +971,11 @@ msgstr "Рекламная зона" #: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 #: ../editor.admin.class.php:359 ../editor.admin.class.php:376 #: ../editor.admin.class.php:377 ../editor.admin.class.php:378 -#: ../editor.admin.class.php:386 ../editor.admin.class.php:725 -#: ../editor.admin.class.php:824 ../editor.admin.class.php:892 -#: ../editor.admin.class.php:893 ../editor.admin.class.php:894 -#: ../zone.editor.admin.class.php:162 ../zone.editor.admin.class.php:257 -#: ../zone.editor.admin.class.php:290 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:727 +#: ../editor.admin.class.php:826 ../editor.admin.class.php:894 +#: ../editor.admin.class.php:895 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:172 ../zone.editor.admin.class.php:282 +#: ../zone.editor.admin.class.php:316 msgid "Undefined" msgstr "Не определено" @@ -891,8 +992,8 @@ msgid "Edit Ads Block" msgstr "Изменить рекламный блок" #: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 -#: ../editor.admin.class.php:912 ../errorlog.admin.class.php:84 -#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:301 +#: ../editor.admin.class.php:914 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:327 msgid "Status" msgstr "Статус" @@ -905,19 +1006,19 @@ msgid "Ads Block ID" msgstr "ID рекламного блока" #: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 -#: ../zone.editor.admin.class.php:323 +#: ../zone.editor.admin.class.php:349 msgid "Is Active" msgstr "Активно" #: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 -#: ../editor.admin.class.php:954 ../zone.editor.admin.class.php:324 +#: ../editor.admin.class.php:956 ../zone.editor.admin.class.php:350 msgid "Is In Trash" msgstr "В корзине" #: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 #: ../editor.admin.class.php:435 ../editor.admin.class.php:440 -#: ../editor.admin.class.php:961 ../editor.admin.class.php:966 -#: ../zone.editor.admin.class.php:331 ../zone.editor.admin.class.php:337 +#: ../editor.admin.class.php:963 ../editor.admin.class.php:968 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:363 #: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 #: ../js/dialog.php:94 msgid "Cancel" @@ -925,20 +1026,20 @@ msgstr "Отмена" #: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 #: ../editor.admin.class.php:444 ../editor.admin.class.php:446 -#: ../editor.admin.class.php:970 ../editor.admin.class.php:972 -#: ../zone.editor.admin.class.php:334 ../zone.editor.admin.class.php:341 +#: ../editor.admin.class.php:972 ../editor.admin.class.php:974 +#: ../zone.editor.admin.class.php:360 ../zone.editor.admin.class.php:367 msgid "Save" msgstr "Сохранить" -#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:986 -#: ../zone.editor.admin.class.php:356 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:988 +#: ../zone.editor.admin.class.php:382 msgid "Required for SAM widgets." msgstr "Требуется для виджетов плагина." #: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 #: ../editor.admin.class.php:466 ../editor.admin.class.php:470 -#: ../editor.admin.class.php:995 ../zone.editor.admin.class.php:362 -#: ../zone.editor.admin.class.php:366 +#: ../editor.admin.class.php:997 ../zone.editor.admin.class.php:388 +#: ../zone.editor.admin.class.php:392 msgid "Description" msgstr "Описание" @@ -947,7 +1048,7 @@ msgid "Enter description of this Ads Block." msgstr "Введите описание для этого рекламного блока." #: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 -#: ../editor.admin.class.php:999 ../zone.editor.admin.class.php:369 +#: ../editor.admin.class.php:1001 ../zone.editor.admin.class.php:395 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -1486,16 +1587,16 @@ msgstr "Назад, к списку мест" msgid "Ads Place ID" msgstr "ID рекламного места" -#: ../editor.admin.class.php:419 ../editor.admin.class.php:943 +#: ../editor.admin.class.php:419 ../editor.admin.class.php:945 #: ../list.admin.class.php:175 ../list.admin.class.php:186 msgid "Size" msgstr "Размеры" -#: ../editor.admin.class.php:421 ../editor.admin.class.php:945 +#: ../editor.admin.class.php:421 ../editor.admin.class.php:947 msgid "Width" msgstr "Ширина" -#: ../editor.admin.class.php:423 ../editor.admin.class.php:947 +#: ../editor.admin.class.php:423 ../editor.admin.class.php:949 msgid "Height" msgstr "Высота" @@ -1507,15 +1608,11 @@ msgstr "Требуется для виджетов и параметров пл msgid "Enter description of this Ads Place." msgstr "Введите описание для этого рекламного места." -#: ../editor.admin.class.php:479 ../editor.admin.class.php:1006 -msgid "General" -msgstr "Основные параметры" - #: ../editor.admin.class.php:480 msgid "Default Ad" msgstr "Объявление по умолчанию" -#: ../editor.admin.class.php:481 ../editor.admin.class.php:1010 +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1012 msgid "Statistic" msgstr "Статистика" @@ -1646,113 +1743,113 @@ msgstr "" "когда логика плагина не позволяет показать какое-либо рекламное объявление " "на текущей странице документа." -#: ../editor.admin.class.php:597 ../editor.admin.class.php:1536 +#: ../editor.admin.class.php:598 ../editor.admin.class.php:1539 msgid "Select Period" msgstr "Выбрать период" -#: ../editor.admin.class.php:599 ../editor.admin.class.php:1538 +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1541 msgid "This Month" msgstr "Этот месяц" -#: ../editor.admin.class.php:600 ../editor.admin.class.php:1539 +#: ../editor.admin.class.php:601 ../editor.admin.class.php:1542 msgid "Previous Month" msgstr "Предыдущий месяц" -#: ../editor.admin.class.php:607 ../editor.admin.class.php:1546 +#: ../editor.admin.class.php:608 ../editor.admin.class.php:1549 #: ../list.admin.class.php:237 ../list.admin.class.php:427 msgid "Total" msgstr "Всего" -#: ../editor.admin.class.php:616 +#: ../editor.admin.class.php:618 msgid "Contained Ads" msgstr "Объявления рекламного места" -#: ../editor.admin.class.php:736 +#: ../editor.admin.class.php:738 msgid "Ad Data Updated." msgstr "Данные рекламного объявления сохранены." -#: ../editor.admin.class.php:901 +#: ../editor.admin.class.php:903 msgid "New advertisement" msgstr "Новое рекламное объявление" -#: ../editor.admin.class.php:901 +#: ../editor.admin.class.php:903 msgid "Edit advertisement" msgstr "Изменить рекламное объявление" -#: ../editor.admin.class.php:921 +#: ../editor.admin.class.php:923 msgid "Back to Ads List" msgstr "Назад, к списку объявлений" -#: ../editor.admin.class.php:928 +#: ../editor.admin.class.php:930 msgid "Advertisement ID" msgstr "ID объявления" -#: ../editor.admin.class.php:935 ../list.admin.class.php:362 +#: ../editor.admin.class.php:937 ../list.admin.class.php:362 #: ../list.admin.class.php:372 msgid "Activity" msgstr "Активность" -#: ../editor.admin.class.php:936 +#: ../editor.admin.class.php:938 msgid "Ad is Active" msgstr "Активно" -#: ../editor.admin.class.php:936 +#: ../editor.admin.class.php:938 msgid "Ad is Inactive" msgstr "Неактивно" -#: ../editor.admin.class.php:952 +#: ../editor.admin.class.php:954 msgid "Is in Rotation" msgstr "В ротации" -#: ../editor.admin.class.php:985 +#: ../editor.admin.class.php:987 msgid "Title" msgstr "Имя" -#: ../editor.admin.class.php:992 +#: ../editor.admin.class.php:994 msgid "Advertisement Description" msgstr "Описание рекламного объявления" -#: ../editor.admin.class.php:1007 +#: ../editor.admin.class.php:1009 msgid "Extended Restrictions" msgstr "Дополнительные ограничения" -#: ../editor.admin.class.php:1008 +#: ../editor.admin.class.php:1010 msgid "Targeting" msgstr "Таргетинг" -#: ../editor.admin.class.php:1009 +#: ../editor.admin.class.php:1011 msgid "Earnings settings" msgstr "Параметры доходов" -#: ../editor.admin.class.php:1016 ../editor.admin.class.php:1075 +#: ../editor.admin.class.php:1018 ../editor.admin.class.php:1077 msgid "Ad Code" msgstr "Код рекламного объявления" -#: ../editor.admin.class.php:1020 +#: ../editor.admin.class.php:1022 msgid "Image Mode" msgstr "Режим изображения" -#: ../editor.admin.class.php:1024 +#: ../editor.admin.class.php:1026 msgid "Ad Image" msgstr "Изображение объявления" -#: ../editor.admin.class.php:1029 +#: ../editor.admin.class.php:1031 msgid "Ad Target" msgstr "Ссылка объявления" -#: ../editor.admin.class.php:1033 +#: ../editor.admin.class.php:1035 msgid "Ad Alternative Text" msgstr "Альтернативный текст" -#: ../editor.admin.class.php:1038 +#: ../editor.admin.class.php:1040 msgid "Count clicks for this advertisement" msgstr "Считать клики для этого рекламного объявления" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1042 msgid "Use carefully!" msgstr "Используйте крайне осторожно!" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1042 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " @@ -1762,83 +1859,83 @@ msgstr "" "этом случае, во время Ajax запроса посетителю будет предложено ввести имя " "пользователя и пароль." -#: ../editor.admin.class.php:1043 +#: ../editor.admin.class.php:1045 msgid "This is flash (SWF) banner" msgstr "Это флеш (SWF) баннер" -#: ../editor.admin.class.php:1046 +#: ../editor.admin.class.php:1048 msgid "Flash banner \"flashvars\"" msgstr "Параметр \"flashvars\"" -#: ../editor.admin.class.php:1048 +#: ../editor.admin.class.php:1050 msgid "Insert \"flashvars\" parameters between braces..." msgstr "Вставьте параметры \"flashvars\" между фигурными скобками" -#: ../editor.admin.class.php:1049 +#: ../editor.admin.class.php:1051 msgid "Flash banner \"params\"" msgstr "Параметр \"params\"" -#: ../editor.admin.class.php:1051 +#: ../editor.admin.class.php:1053 msgid "Insert \"params\" parameters between braces..." msgstr "Вставьте параметры \"params\" между фигурными скобками" -#: ../editor.admin.class.php:1052 +#: ../editor.admin.class.php:1054 msgid "Flash banner \"attributes\"" msgstr "Параметр \"attributes\"" -#: ../editor.admin.class.php:1054 +#: ../editor.admin.class.php:1056 msgid "Insert \"attributes\" parameters between braces..." msgstr "Вставьте параметры \"attributes\" между фигурными скобками" -#: ../editor.admin.class.php:1057 +#: ../editor.admin.class.php:1059 msgid "Add to ad" msgstr "Добавить теги" -#: ../editor.admin.class.php:1059 +#: ../editor.admin.class.php:1061 msgid "Non Selected" msgstr "Не выбрано" -#: ../editor.admin.class.php:1060 +#: ../editor.admin.class.php:1062 msgid "nofollow" msgstr "nofollow" -#: ../editor.admin.class.php:1061 +#: ../editor.admin.class.php:1063 msgid "noindex" msgstr "noindex" -#: ../editor.admin.class.php:1062 +#: ../editor.admin.class.php:1064 msgid "nofollow and noindex" msgstr "nofollow и noindex" -#: ../editor.admin.class.php:1071 +#: ../editor.admin.class.php:1073 msgid "Code Mode" msgstr "Режим кода" -#: ../editor.admin.class.php:1077 +#: ../editor.admin.class.php:1079 msgid "This code of ad contains PHP script" msgstr "Этот код объявления содержит PHP скрипт" -#: ../editor.admin.class.php:1086 +#: ../editor.admin.class.php:1088 msgid "Restrictions of advertisements showing" msgstr "Ограничения показа объявления" -#: ../editor.admin.class.php:1089 +#: ../editor.admin.class.php:1091 msgid "Ad Weight" msgstr "Вес объявления" -#: ../editor.admin.class.php:1096 +#: ../editor.admin.class.php:1098 msgid "Inactive" msgstr "Неактивно" -#: ../editor.admin.class.php:1097 +#: ../editor.admin.class.php:1099 msgid "Minimal Activity" msgstr "Минимальная активность" -#: ../editor.admin.class.php:1098 +#: ../editor.admin.class.php:1100 msgid "Maximal Activity" msgstr "Максимальная активность" -#: ../editor.admin.class.php:1108 +#: ../editor.admin.class.php:1110 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." @@ -1846,79 +1943,79 @@ msgstr "" "Вес рекламного объявления является коэффициентом частоты показа рекламного " "объявления за однин цикл ротации." -#: ../editor.admin.class.php:1110 +#: ../editor.admin.class.php:1112 msgid "0 - ad is inactive" msgstr "0 - объявление не активно" -#: ../editor.admin.class.php:1111 +#: ../editor.admin.class.php:1113 msgid "1 - minimal activity of this advertisement" msgstr "1 - минимальная активность этого объявления" -#: ../editor.admin.class.php:1113 +#: ../editor.admin.class.php:1115 msgid "10 - maximal activity of this ad." msgstr "10 - максимальная активность данного объявления" -#: ../editor.admin.class.php:1119 ../help.class.php:20 ../help.class.php:161 +#: ../editor.admin.class.php:1121 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "Показывать объявление на всех страницах блога" -#: ../editor.admin.class.php:1123 +#: ../editor.admin.class.php:1125 msgid "Show ad only on pages of this type" msgstr "Показывать объявление только на страницах данного типа" -#: ../editor.admin.class.php:1127 +#: ../editor.admin.class.php:1129 msgid "Home Page (Home or Front Page)" msgstr "Главная страница (главная или фронтальная страница)" -#: ../editor.admin.class.php:1129 +#: ../editor.admin.class.php:1131 msgid "Singular Pages" msgstr "Сингулярные страницы" -#: ../editor.admin.class.php:1132 +#: ../editor.admin.class.php:1134 msgid "Single Post" msgstr "Страница статьи" -#: ../editor.admin.class.php:1136 +#: ../editor.admin.class.php:1138 msgid "Custom Post Type" msgstr "Пользовательский тип статьи" -#: ../editor.admin.class.php:1138 +#: ../editor.admin.class.php:1140 msgid "Attachment" msgstr "Приложение" -#: ../editor.admin.class.php:1141 +#: ../editor.admin.class.php:1143 msgid "Search Page" msgstr "Страница вывода результата поиска" -#: ../editor.admin.class.php:1143 +#: ../editor.admin.class.php:1145 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "Страница \"Не найдено\" (ошибка HTTP 404)" -#: ../editor.admin.class.php:1145 +#: ../editor.admin.class.php:1147 msgid "Archive Pages" msgstr "Страницы архивов" -#: ../editor.admin.class.php:1148 +#: ../editor.admin.class.php:1150 msgid "Taxonomy Archive Pages" msgstr "Страницы архивов таксономий" -#: ../editor.admin.class.php:1150 +#: ../editor.admin.class.php:1152 msgid "Category Archive Pages" msgstr "Страницы архивов рубрик" -#: ../editor.admin.class.php:1152 +#: ../editor.admin.class.php:1154 msgid "Tag Archive Pages" msgstr "Страницы архивов меток" -#: ../editor.admin.class.php:1154 +#: ../editor.admin.class.php:1156 msgid "Author Archive Pages" msgstr "Страницы архивов авторов" -#: ../editor.admin.class.php:1156 +#: ../editor.admin.class.php:1158 msgid "Custom Post Type Archive Pages" msgstr "Страницы архивов пользовательскии типов" -#: ../editor.admin.class.php:1158 +#: ../editor.admin.class.php:1160 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" @@ -1926,15 +2023,15 @@ msgstr "" "Страницы архивов по датам (любые основанные на датах страницы архивов, " "другими словами, архивы по месяцам, по годам, по дням и по времени)" -#: ../editor.admin.class.php:1163 +#: ../editor.admin.class.php:1165 msgid "Show ad only in certain posts/pages" msgstr "Показывать объявление только в определённых статьях/страницах" -#: ../editor.admin.class.php:1167 ../editor.admin.class.php:1194 +#: ../editor.admin.class.php:1169 ../editor.admin.class.php:1196 msgid "Posts/Pages" msgstr "Статьи/Страницы" -#: ../editor.admin.class.php:1174 +#: ../editor.admin.class.php:1176 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." @@ -1942,15 +2039,15 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: ../editor.admin.class.php:1186 +#: ../editor.admin.class.php:1188 msgid "Extended restrictions of advertisements showing" msgstr "Дополнительные ограничения показа объявления" -#: ../editor.admin.class.php:1190 +#: ../editor.admin.class.php:1192 msgid "Do not show ad on certain posts/pages" msgstr "Не показывать объявление в определённых статьях/страницах" -#: ../editor.admin.class.php:1202 +#: ../editor.admin.class.php:1204 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." @@ -1958,17 +2055,17 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "выбранных статьях/страницах. Выберите статьи/страницы." -#: ../editor.admin.class.php:1207 +#: ../editor.admin.class.php:1209 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных рубрик" -#: ../editor.admin.class.php:1210 ../editor.admin.class.php:1230 +#: ../editor.admin.class.php:1212 ../editor.admin.class.php:1232 msgid "Categories" msgstr "Рубрики" -#: ../editor.admin.class.php:1217 +#: ../editor.admin.class.php:1219 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." @@ -1976,9 +2073,9 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных рубрик." -#: ../editor.admin.class.php:1221 ../editor.admin.class.php:1255 -#: ../editor.admin.class.php:1289 ../editor.admin.class.php:1324 -#: ../editor.admin.class.php:1359 +#: ../editor.admin.class.php:1223 ../editor.admin.class.php:1257 +#: ../editor.admin.class.php:1291 ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1361 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " @@ -1989,12 +2086,12 @@ msgstr "" "объявление только на страницах данного типа\". В противном случае, параметр " "будет проигнорирован." -#: ../editor.admin.class.php:1227 +#: ../editor.admin.class.php:1229 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "Не показывать объявление в одиночных статьях и архивах заданных рубрик" -#: ../editor.admin.class.php:1237 +#: ../editor.admin.class.php:1239 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." @@ -2002,14 +2099,14 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных рубрик." -#: ../editor.admin.class.php:1242 +#: ../editor.admin.class.php:1244 msgid "" "Show ad only in single posts or archives of certain Custom Taxonomies Terms" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных терминов " "пользовательских таксономий" -#: ../editor.admin.class.php:1251 +#: ../editor.admin.class.php:1253 msgid "" "Use this setting to display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." @@ -2017,14 +2114,14 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных терминов пользовательских таксономий." -#: ../editor.admin.class.php:1261 +#: ../editor.admin.class.php:1263 msgid "" "Do not show ad in single posts or archives of certain Custom Taxonomies Terms" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных терминов " "пользовательских таксономий" -#: ../editor.admin.class.php:1270 +#: ../editor.admin.class.php:1272 msgid "" "Use this setting to not display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." @@ -2032,16 +2129,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных терминов пользовательских таксономий." -#: ../editor.admin.class.php:1275 +#: ../editor.admin.class.php:1277 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных авторов" -#: ../editor.admin.class.php:1278 ../editor.admin.class.php:1298 +#: ../editor.admin.class.php:1280 ../editor.admin.class.php:1300 msgid "Authors" msgstr "Авторы" -#: ../editor.admin.class.php:1285 +#: ../editor.admin.class.php:1287 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." @@ -2049,12 +2146,12 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных авторов." -#: ../editor.admin.class.php:1295 +#: ../editor.admin.class.php:1297 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных авторов" -#: ../editor.admin.class.php:1305 +#: ../editor.admin.class.php:1307 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." @@ -2062,16 +2159,16 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных авторов." -#: ../editor.admin.class.php:1310 +#: ../editor.admin.class.php:1312 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных меток" -#: ../editor.admin.class.php:1313 ../editor.admin.class.php:1333 +#: ../editor.admin.class.php:1315 ../editor.admin.class.php:1335 msgid "Tags" msgstr "Метки" -#: ../editor.admin.class.php:1320 +#: ../editor.admin.class.php:1322 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." @@ -2079,11 +2176,11 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных меток." -#: ../editor.admin.class.php:1330 +#: ../editor.admin.class.php:1332 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "Не показывать объявление в одиночных статьях и архивах заданных меток" -#: ../editor.admin.class.php:1340 +#: ../editor.admin.class.php:1342 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." @@ -2091,7 +2188,7 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных меток." -#: ../editor.admin.class.php:1345 +#: ../editor.admin.class.php:1347 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" @@ -2099,11 +2196,11 @@ msgstr "" "Показывать объявление только в одиночных статьях и архивах заданных " "пользовательских типов" -#: ../editor.admin.class.php:1348 ../editor.admin.class.php:1368 +#: ../editor.admin.class.php:1350 ../editor.admin.class.php:1370 msgid "Custom post types" msgstr "Пользовательские типы" -#: ../editor.admin.class.php:1355 +#: ../editor.admin.class.php:1357 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." @@ -2111,7 +2208,7 @@ msgstr "" "Используйте этот параметр для показа рекламного объявления только в " "одиночных статьях и архивах выбранных пользовательских типов." -#: ../editor.admin.class.php:1365 +#: ../editor.admin.class.php:1367 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" @@ -2119,7 +2216,7 @@ msgstr "" "Не показывать объявление в одиночных статьях и архивах заданных " "пользовательских типов" -#: ../editor.admin.class.php:1375 +#: ../editor.admin.class.php:1377 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." @@ -2127,108 +2224,108 @@ msgstr "" "Используйте этот параметр для блокировки показа рекламного объявления в " "одиночных статьях и архивах выбранных пользовательских типов." -#: ../editor.admin.class.php:1380 +#: ../editor.admin.class.php:1382 msgid "Use the schedule for this ad" msgstr "Использовать расписание для этого объявления" -#: ../editor.admin.class.php:1384 +#: ../editor.admin.class.php:1386 msgid "Campaign Start Date" msgstr "Дата начала кампании" -#: ../editor.admin.class.php:1388 +#: ../editor.admin.class.php:1390 msgid "Campaign End Date" msgstr "Дата окончания кампании" -#: ../editor.admin.class.php:1393 +#: ../editor.admin.class.php:1395 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" "Используйте эти параметры для показа объявления в течение определенного " "периода времени." -#: ../editor.admin.class.php:1398 +#: ../editor.admin.class.php:1400 msgid "Use limitation by hits" msgstr "Использовать ограничение по показам" -#: ../editor.admin.class.php:1402 +#: ../editor.admin.class.php:1404 msgid "Hits Limit" msgstr "Лимит показов" -#: ../editor.admin.class.php:1407 +#: ../editor.admin.class.php:1409 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" "Используйте этот параметр для ограничения показа объявлений по просмотрам." -#: ../editor.admin.class.php:1412 +#: ../editor.admin.class.php:1414 msgid "Use limitation by clicks" msgstr "Использовать ограничение по кликам" -#: ../editor.admin.class.php:1416 +#: ../editor.admin.class.php:1418 msgid "Clicks Limit" msgstr "Лимит кликов" -#: ../editor.admin.class.php:1421 +#: ../editor.admin.class.php:1423 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "Используйте этот параметр для ограничения показа объявлений по кликам." -#: ../editor.admin.class.php:1431 +#: ../editor.admin.class.php:1433 msgid "Users" msgstr "Пользователи" -#: ../editor.admin.class.php:1433 +#: ../editor.admin.class.php:1435 msgid "Show this ad for" msgstr "Показывать это рекламное объявление для" -#: ../editor.admin.class.php:1436 +#: ../editor.admin.class.php:1438 msgid "all users" msgstr "всех пользователей" -#: ../editor.admin.class.php:1441 +#: ../editor.admin.class.php:1443 msgid "these users" msgstr "этих пользователей" -#: ../editor.admin.class.php:1446 +#: ../editor.admin.class.php:1448 msgid "Unregistered Users" msgstr "Незарегистрированные пользователи" -#: ../editor.admin.class.php:1450 ../editor.admin.class.php:1458 +#: ../editor.admin.class.php:1452 ../editor.admin.class.php:1460 msgid "Registered Users" msgstr "Зарегистрированные пользователи" -#: ../editor.admin.class.php:1455 +#: ../editor.admin.class.php:1457 msgid "Exclude these users" msgstr "Исключая этих пользователей" -#: ../editor.admin.class.php:1466 +#: ../editor.admin.class.php:1468 msgid "Do not show this ad for advertiser" msgstr "Не показывать объявление рекламодателю" -#: ../editor.admin.class.php:1478 +#: ../editor.admin.class.php:1480 msgid "Advertiser" msgstr "Рекламодатель" -#: ../editor.admin.class.php:1481 +#: ../editor.admin.class.php:1483 msgid "Advertiser Nick Name" msgstr "Ник рекламодателя" -#: ../editor.admin.class.php:1498 ../help.class.php:32 ../help.class.php:180 +#: ../editor.admin.class.php:1500 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "Расценки" -#: ../editor.admin.class.php:1501 +#: ../editor.admin.class.php:1503 msgid "Price of ad placement per month" msgstr "Цена размещения в месяц" -#: ../editor.admin.class.php:1505 +#: ../editor.admin.class.php:1507 msgid "Tthis parameter used only for scheduled ads." msgstr "" "Этот параметр используется только для объявлений, показываемых по расписанию." -#: ../editor.admin.class.php:1508 +#: ../editor.admin.class.php:1510 msgid "Price per Thousand Hits" msgstr "Цена за тысячу показов" -#: ../editor.admin.class.php:1512 +#: ../editor.admin.class.php:1514 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." @@ -2236,11 +2333,11 @@ msgstr "" "Не только люди посещают Ваш блог ... Включите обнаружение ботов и сканеров " "для того, чтобы правильно считать показы и не обманывать рекламодателя." -#: ../editor.admin.class.php:1515 +#: ../editor.admin.class.php:1517 msgid "Price per Click" msgstr "Цена за клик" -#: ../editor.admin.class.php:1519 +#: ../editor.admin.class.php:1521 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." @@ -2248,7 +2345,7 @@ msgstr "" "Для подсчёта заработка по кликам, необходимо включить подсчёт кликов для " "этого объявления." -#: ../editor.admin.class.php:1557 +#: ../editor.admin.class.php:1561 msgid "Ad Preview" msgstr "Предварительный просмотр объявления" @@ -2836,39 +2933,39 @@ msgstr "По умолчанию" msgid "None" msgstr "Нет" -#: ../zone.editor.admin.class.php:173 +#: ../zone.editor.admin.class.php:183 msgid "Ads Zone Data Updated." msgstr "Данные рекламной зоны сохранены." -#: ../zone.editor.admin.class.php:290 +#: ../zone.editor.admin.class.php:316 msgid "New Ads Zone" msgstr "Новая рекламная зона" -#: ../zone.editor.admin.class.php:290 +#: ../zone.editor.admin.class.php:316 msgid "Edit Ads Zone" msgstr "Изменить рекламную зону" -#: ../zone.editor.admin.class.php:310 +#: ../zone.editor.admin.class.php:336 msgid "Back to Zones List" msgstr "Назад, к списку зон" -#: ../zone.editor.admin.class.php:317 ../js/dialog-zone.php:71 +#: ../zone.editor.admin.class.php:343 ../js/dialog-zone.php:71 msgid "Ads Zone ID" msgstr "ID рекламноой зоны" -#: ../zone.editor.admin.class.php:364 +#: ../zone.editor.admin.class.php:390 msgid "Enter description of this Ads Zone." msgstr "Введите описание для этой рекламной зоны." -#: ../zone.editor.admin.class.php:376 +#: ../zone.editor.admin.class.php:402 msgid "Ads Zone Settings" msgstr "Параметры зоны рекламных объявлений" -#: ../zone.editor.admin.class.php:379 +#: ../zone.editor.admin.class.php:405 msgid "Default Ads Place" msgstr "Рекламное место по умолчанию" -#: ../zone.editor.admin.class.php:385 +#: ../zone.editor.admin.class.php:411 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " @@ -2878,85 +2975,89 @@ msgstr "" "экран для тех страниц, для которых параметр рекламного места установлен в " "значение \"По умолчанию\"." -#: ../zone.editor.admin.class.php:389 +#: ../zone.editor.admin.class.php:415 msgid "Home Page Ads Place" msgstr "Рекламное место главной страницы" -#: ../zone.editor.admin.class.php:395 +#: ../zone.editor.admin.class.php:421 msgid "Default Ads Place for Singular Pages" msgstr "Рекламное место по умолчанию для сингулярных страниц" -#: ../zone.editor.admin.class.php:402 +#: ../zone.editor.admin.class.php:428 msgid "Single Post Ads Place" msgstr "Рекламное место статьи" -#: ../zone.editor.admin.class.php:411 +#: ../zone.editor.admin.class.php:437 msgid "Default Ads Place for Single Custom Type Post" msgstr "" "Рекламное место по умолчанию для одиночных статей пользовательских типов" -#: ../zone.editor.admin.class.php:422 +#: ../zone.editor.admin.class.php:448 msgid "Ads Place for Single Post of Custom Type" msgstr "Рекламное место для одиночной статьи пользовательского типа" -#: ../zone.editor.admin.class.php:431 +#: ../zone.editor.admin.class.php:457 msgid "Page Ads Place" msgstr "Рекламное место страницы" -#: ../zone.editor.admin.class.php:437 +#: ../zone.editor.admin.class.php:463 msgid "Attachment Ads Place" msgstr "Рекламное место страницы вложения" -#: ../zone.editor.admin.class.php:444 +#: ../zone.editor.admin.class.php:470 msgid "Search Pages Ads Place" msgstr "Рекламное место страницы вывода результата поиска" -#: ../zone.editor.admin.class.php:450 +#: ../zone.editor.admin.class.php:476 msgid "404 Page Ads Place" msgstr "Рекламное место страницы ошибки 404" -#: ../zone.editor.admin.class.php:456 +#: ../zone.editor.admin.class.php:482 msgid "Default Ads Place for Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов" -#: ../zone.editor.admin.class.php:463 +#: ../zone.editor.admin.class.php:489 msgid "Default Ads Place for Taxonomies Pages" msgstr "Рекламное место по умолчанию для странц таксономий" -#: ../zone.editor.admin.class.php:470 +#: ../zone.editor.admin.class.php:502 +msgid "Ads Place for Custom Taxonomy Term" +msgstr "Рекламное место для термина пользовательской таксономии" + +#: ../zone.editor.admin.class.php:515 msgid "Default Ads Place for Category Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов рубрик" -#: ../zone.editor.admin.class.php:483 +#: ../zone.editor.admin.class.php:528 msgid "Ads Place for Category" msgstr "Рекламное место для рубрики" -#: ../zone.editor.admin.class.php:499 +#: ../zone.editor.admin.class.php:544 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" "Рекламное место по умолчанию для страниц архивов пользовательских типов" -#: ../zone.editor.admin.class.php:509 +#: ../zone.editor.admin.class.php:554 msgid "Ads Place for Custom Type Posts Archive" msgstr "Рекламное место по умолчанию для страниц архива пользовательского типа" -#: ../zone.editor.admin.class.php:518 +#: ../zone.editor.admin.class.php:563 msgid "Tags Archive Pages Ads Place" msgstr "Рекламное место страницы архивов меток" -#: ../zone.editor.admin.class.php:525 +#: ../zone.editor.admin.class.php:569 msgid "Default Ads Place for Author Archive Pages" msgstr "Рекламное место по умолчанию для страниц архивов авторов" -#: ../zone.editor.admin.class.php:534 +#: ../zone.editor.admin.class.php:578 msgid "Ads Place for author" msgstr "Рекламное место для автора" -#: ../zone.editor.admin.class.php:543 +#: ../zone.editor.admin.class.php:587 msgid "Date Archive Pages Ads Place" msgstr "Рекламное место страницы архивов дат" -#: ../zone.editor.admin.class.php:550 +#: ../zone.editor.admin.class.php:594 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." diff --git a/langs/simple-ads-manager.pot b/langs/simple-ads-manager.pot index ddec876..f3c6bdb 100644 --- a/langs/simple-ads-manager.pot +++ b/langs/simple-ads-manager.pot @@ -4,8 +4,8 @@ msgid "" msgstr "" "Project-Id-Version: Simple Ads Manager 1.8.70\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-ads-manager\n" -"POT-Creation-Date: 2013-12-22 22:01+0300\n" -"PO-Revision-Date: 2013-12-22 22:01+0300\n" +"POT-Creation-Date: 2013-12-29 20:08+0300\n" +"PO-Revision-Date: 2013-12-29 20:08+0300\n" "Last-Translator: minimus \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -26,83 +26,83 @@ msgstr "" msgid "Empty data..." msgstr "" -#: ../admin.class.php:148 +#: ../admin.class.php:150 msgid "Active W3 Total Cache plugin detected." msgstr "" -#: ../admin.class.php:149 +#: ../admin.class.php:151 msgid "Active WP Super Cache plugin detected." msgstr "" -#: ../admin.class.php:154 +#: ../admin.class.php:156 msgid "Active bbPress Forum plugin detected." msgstr "" -#: ../admin.class.php:173 +#: ../admin.class.php:175 msgid "Cache of WP Super Cache plugin is flushed." msgstr "" -#: ../admin.class.php:177 +#: ../admin.class.php:179 msgid "Cache of W3 Total Cache plugin is flushed." msgstr "" -#: ../admin.class.php:396 ../editor.admin.class.php:1485 +#: ../admin.class.php:399 ../editor.admin.class.php:1487 msgid "Advertiser Name" msgstr "" -#: ../admin.class.php:397 +#: ../admin.class.php:400 msgid "Advertiser Nick" msgstr "" -#: ../admin.class.php:398 ../editor.admin.class.php:1489 +#: ../admin.class.php:401 ../editor.admin.class.php:1491 msgid "Advertiser e-mail" msgstr "" -#: ../admin.class.php:402 +#: ../admin.class.php:405 msgid "Category Title" msgstr "" -#: ../admin.class.php:403 +#: ../admin.class.php:406 msgid "Category Slug" msgstr "" -#: ../admin.class.php:407 ../admin.class.php:426 +#: ../admin.class.php:410 ../admin.class.php:429 msgid "Display Name" msgstr "" -#: ../admin.class.php:408 ../admin.class.php:427 +#: ../admin.class.php:411 ../admin.class.php:430 msgid "User Name" msgstr "" -#: ../admin.class.php:412 +#: ../admin.class.php:415 msgid "Tag Title" msgstr "" -#: ../admin.class.php:413 +#: ../admin.class.php:416 msgid "Tag Slug" msgstr "" -#: ../admin.class.php:416 +#: ../admin.class.php:419 msgid "Custom Type Title" msgstr "" -#: ../admin.class.php:417 +#: ../admin.class.php:420 msgid "Custom Type Slug" msgstr "" -#: ../admin.class.php:421 +#: ../admin.class.php:424 msgid "Publication Title" msgstr "" -#: ../admin.class.php:422 +#: ../admin.class.php:425 msgid "Publication Type" msgstr "" -#: ../admin.class.php:428 +#: ../admin.class.php:431 msgid "Role" msgstr "" -#: ../admin.class.php:431 ../block.list.admin.class.php:88 +#: ../admin.class.php:434 ../block.list.admin.class.php:88 #: ../block.list.admin.class.php:94 ../errorlog.admin.class.php:83 #: ../errorlog.admin.class.php:93 ../list.admin.class.php:173 #: ../list.admin.class.php:184 ../list.admin.class.php:360 @@ -111,91 +111,120 @@ msgstr "" msgid "ID" msgstr "" -#: ../admin.class.php:432 +#: ../admin.class.php:435 msgid "Term Name" msgstr "" -#: ../admin.class.php:433 +#: ../admin.class.php:436 msgid "Custom Taxonomy Name" msgstr "" -#: ../admin.class.php:439 +#: ../admin.class.php:442 msgid "Full Size" msgstr "" -#: ../admin.class.php:493 +#: ../admin.class.php:503 +msgid "" +"Shortcode [name] will be replaced with advertiser's name. " +"Shortcode [site] will be replaced with name of your site. " +"Shotcode [month] will be replaced with name of month of " +"reporting period." +msgstr "" + +#: ../admin.class.php:507 ../editor.admin.class.php:479 +#: ../editor.admin.class.php:1008 +msgid "General" +msgstr "" + +#: ../admin.class.php:508 msgid "General Settings" msgstr "" -#: ../admin.class.php:494 +#: ../admin.class.php:509 +msgid "Extended Options" +msgstr "" + +#: ../admin.class.php:510 +msgid "Admin Layout" +msgstr "" + +#: ../admin.class.php:511 +msgid "Plugin Deactivating" +msgstr "" + +#: ../admin.class.php:513 +msgid "Auto Inserting" +msgstr "" + +#: ../admin.class.php:514 msgid "Auto Inserting Settings" msgstr "" -#: ../admin.class.php:495 -msgid "Extended Options" +#: ../admin.class.php:516 +msgid "Google" msgstr "" -#: ../admin.class.php:496 +#: ../admin.class.php:517 msgid "Google DFP Settings" msgstr "" -#: ../admin.class.php:497 ../help.class.php:68 ../help.class.php:195 -msgid "Statistics Settings" +#: ../admin.class.php:519 +msgid "Tools" msgstr "" -#: ../admin.class.php:498 -msgid "Admin Layout" +#: ../admin.class.php:520 ../help.class.php:68 ../help.class.php:195 +msgid "Statistics Settings" msgstr "" -#: ../admin.class.php:499 -msgid "Plugin Deactivating" +#: ../admin.class.php:521 +msgid "Mailing System" msgstr "" -#: ../admin.class.php:501 +#: ../admin.class.php:524 msgid "Views per Cycle" msgstr "" -#: ../admin.class.php:501 +#: ../admin.class.php:524 msgid "" "Number of hits of one ad for a full cycle of rotation (maximal activity)." msgstr "" -#: ../admin.class.php:502 +#: ../admin.class.php:525 msgid "Minimum Level for access to menu" msgstr "" -#: ../admin.class.php:502 +#: ../admin.class.php:525 msgid "" "Who can use menu of plugin - Minimum User Level needed for access to menu of " "plugin. In any case only Super Admin and Administrator can use Settings Menu " "of SAM Plugin." msgstr "" -#: ../admin.class.php:502 ../admin.class.php:619 ../admin.class.php:760 +#: ../admin.class.php:525 ../admin.class.php:653 ../admin.class.php:794 msgid "Super Admin" msgstr "" -#: ../admin.class.php:502 ../admin.class.php:620 ../admin.class.php:759 +#: ../admin.class.php:525 ../admin.class.php:654 ../admin.class.php:793 msgid "Administrator" msgstr "" -#: ../admin.class.php:502 ../admin.class.php:621 ../admin.class.php:758 +#: ../admin.class.php:525 ../admin.class.php:655 ../admin.class.php:792 msgid "Editor" msgstr "" -#: ../admin.class.php:502 ../admin.class.php:622 ../admin.class.php:757 +#: ../admin.class.php:525 ../admin.class.php:656 ../admin.class.php:791 msgid "Author" msgstr "" -#: ../admin.class.php:502 ../admin.class.php:623 ../admin.class.php:756 +#: ../admin.class.php:525 ../admin.class.php:657 ../admin.class.php:790 msgid "Contributor" msgstr "" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Ad Output Mode" msgstr "" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "" "Standard (PHP) mode is more faster but is not compatible with caching " "plugins. If your blog use caching plugin (i.e WP Super Cache or W3 Total " @@ -204,491 +233,553 @@ msgid "" "of special support of these plugins." msgstr "" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Standard (PHP)" msgstr "" -#: ../admin.class.php:503 +#: ../admin.class.php:526 msgid "Caching Compatible (Javascript)" msgstr "" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Display Ad Source in" msgstr "" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Target wintow (tab) for advetisement source." msgstr "" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "New Window (Tab)" msgstr "" -#: ../admin.class.php:504 +#: ../admin.class.php:527 msgid "Current Window (Tab)" msgstr "" -#: ../admin.class.php:505 +#: ../admin.class.php:528 msgid "Allow displaying ads on bbPress forum pages" msgstr "" -#: ../admin.class.php:507 +#: ../admin.class.php:530 msgid "Ads Place before content" msgstr "" -#: ../admin.class.php:508 +#: ../admin.class.php:531 msgid "Allow Ads Place auto inserting before post/page content" msgstr "" -#: ../admin.class.php:509 -msgid "Allow Ads Place auto inserting before post/page excerpt (in the loop)" +#: ../admin.class.php:532 +msgid "" +"Allow Ads Place auto inserting before post/page or post/page excerpt in the " +"loop" msgstr "" -#: ../admin.class.php:510 +#: ../admin.class.php:533 msgid "Allow Ads Place auto inserting before bbPress Forum topic content" msgstr "" -#: ../admin.class.php:511 +#: ../admin.class.php:534 msgid "Allow Ads Place auto inserting into bbPress Forum forums/topics lists" msgstr "" -#: ../admin.class.php:512 ../admin.class.php:516 ../admin.class.php:520 +#: ../admin.class.php:535 ../admin.class.php:539 ../admin.class.php:543 msgid "Allow using predefined Ads Place HTML codes (before and after codes)" msgstr "" -#: ../admin.class.php:513 +#: ../admin.class.php:536 msgid "Ads Place in the middle of content" msgstr "" -#: ../admin.class.php:514 +#: ../admin.class.php:537 msgid "Allow Ads Place auto inserting into the middle of post/page content" msgstr "" -#: ../admin.class.php:515 +#: ../admin.class.php:538 msgid "" "Allow Ads Place auto inserting into the middle of bbPress Forum topic content" msgstr "" -#: ../admin.class.php:517 +#: ../admin.class.php:540 msgid "Ads Place after content" msgstr "" -#: ../admin.class.php:518 +#: ../admin.class.php:541 msgid "Allow Ads Place auto inserting after post/page content" msgstr "" -#: ../admin.class.php:519 +#: ../admin.class.php:542 msgid "Allow Ads Place auto inserting after bbPress Forum topic content" msgstr "" -#: ../admin.class.php:522 +#: ../admin.class.php:545 msgid "" "I use (plan to use) my own flash (SWF) banners. In other words, allow " "loading the script \"SWFObject\" on the pages of the blog." msgstr "" -#: ../admin.class.php:523 +#: ../admin.class.php:546 msgid "Turn on/off the error log." msgstr "" -#: ../admin.class.php:524 +#: ../admin.class.php:547 msgid "Turn on/off the error log for Face Side." msgstr "" -#: ../admin.class.php:526 +#: ../admin.class.php:549 msgid "Allow using Google DoubleClick for Publishers (DFP) rotator codes" msgstr "" -#: ../admin.class.php:527 +#: ../admin.class.php:550 msgid "Google DFP Pub Code" msgstr "" -#: ../admin.class.php:527 +#: ../admin.class.php:550 msgid "Your Google DFP Pub code. i.e:" msgstr "" -#: ../admin.class.php:529 +#: ../admin.class.php:552 msgid "Allow Bots and Crawlers detection" msgstr "" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Accuracy of Bots and Crawlers Detection" msgstr "" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "" "If bot is detected hits of ads won't be counted. Use with caution! More " "exact detection requires more server resources." msgstr "" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Inexact detection" msgstr "" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "Exact detection" msgstr "" -#: ../admin.class.php:530 +#: ../admin.class.php:553 msgid "More exact detection" msgstr "" -#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "Display of Currency" msgstr "" -#: ../admin.class.php:531 ../help.class.php:70 ../help.class.php:197 +#: ../admin.class.php:554 ../help.class.php:70 ../help.class.php:197 msgid "" "Define display of currency. Auto - auto detection of currency from blog " "settings. USD, EUR - Forcing the display of currency to U.S. dollars or Euro." msgstr "" -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "Auto" msgstr "" -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "USD" msgstr "" -#: ../admin.class.php:531 +#: ../admin.class.php:554 msgid "EUR" msgstr "" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "TinyMCE Editor Button Mode" msgstr "" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "" "If you do not want to use the modern dropdown button in your TinyMCE editor, " "or use of this button causes a problem, you can use classic TinyMCE buttons. " "In this case select \"Classic TinyMCE Buttons\"." msgstr "" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "Modern TinyMCE Button" msgstr "" -#: ../admin.class.php:533 +#: ../admin.class.php:556 msgid "Classic TinyMCE Buttons" msgstr "" -#: ../admin.class.php:534 +#: ../admin.class.php:557 msgid "Ads Places per Page" msgstr "" -#: ../admin.class.php:534 +#: ../admin.class.php:557 msgid "" "Ads Places Management grid pagination. How many Ads Places will be shown on " "one page of grid." msgstr "" -#: ../admin.class.php:535 +#: ../admin.class.php:558 msgid "Ads per Page" msgstr "" -#: ../admin.class.php:535 +#: ../admin.class.php:558 msgid "" "Ads of Ads Place Management grid pagination. How many Ads will be shown on " "one page of grid." msgstr "" -#: ../admin.class.php:537 +#: ../admin.class.php:560 msgid "Delete plugin options during deactivating plugin" msgstr "" -#: ../admin.class.php:538 +#: ../admin.class.php:561 msgid "Delete database tables of plugin during deactivating plugin" msgstr "" -#: ../admin.class.php:539 +#: ../admin.class.php:562 msgid "Delete custom images folder of plugin during deactivating plugin" msgstr "" -#: ../admin.class.php:547 +#: ../admin.class.php:564 +msgid "Allow SAM Mailing System to send statistical data to advertisers" +msgstr "" + +#: ../admin.class.php:565 +msgid "Mail Subject" +msgstr "" + +#: ../admin.class.php:565 +msgid "Mail subject of sending email." +msgstr "" + +#: ../admin.class.php:566 +msgid "Mail Greeting String" +msgstr "" + +#: ../admin.class.php:566 +msgid "Greeting string of sending email." +msgstr "" + +#: ../admin.class.php:567 +msgid "Mail Text before statistical data table" +msgstr "" + +#: ../admin.class.php:567 +msgid "Some text before statistical data table of sending email." +msgstr "" + +#: ../admin.class.php:568 +msgid "Mail Text after statistical data table" +msgstr "" + +#: ../admin.class.php:568 +msgid "Some text after statistical data table of sending email." +msgstr "" + +#: ../admin.class.php:569 +msgid "Mail Warning 1" +msgstr "" + +#: ../admin.class.php:569 +msgid "This text will be placed at the end of sending email." +msgstr "" + +#: ../admin.class.php:570 +msgid "Mail Warning 2" +msgstr "" + +#: ../admin.class.php:570 +msgid "This text will be placed at the very end of sending email." +msgstr "" + +#: ../admin.class.php:578 msgid "Ads" msgstr "" -#: ../admin.class.php:548 +#: ../admin.class.php:579 msgid "Ads List" msgstr "" -#: ../admin.class.php:548 +#: ../admin.class.php:579 msgid "Ads Places" msgstr "" -#: ../admin.class.php:549 +#: ../admin.class.php:580 msgid "Ad Editor" msgstr "" -#: ../admin.class.php:549 +#: ../admin.class.php:580 msgid "New Place" msgstr "" -#: ../admin.class.php:550 +#: ../admin.class.php:581 msgid "Ads Zones List" msgstr "" -#: ../admin.class.php:550 +#: ../admin.class.php:581 msgid "Ads Zones" msgstr "" -#: ../admin.class.php:551 +#: ../admin.class.php:582 msgid "Ads Zone Editor" msgstr "" -#: ../admin.class.php:551 +#: ../admin.class.php:582 msgid "New Zone" msgstr "" -#: ../admin.class.php:552 +#: ../admin.class.php:583 msgid "Ads Blocks List" msgstr "" -#: ../admin.class.php:552 +#: ../admin.class.php:583 msgid "Ads Blocks" msgstr "" -#: ../admin.class.php:553 ../block.editor.admin.class.php:402 +#: ../admin.class.php:584 ../block.editor.admin.class.php:402 msgid "Ads Block Editor" msgstr "" -#: ../admin.class.php:553 +#: ../admin.class.php:584 msgid "New Block" msgstr "" -#: ../admin.class.php:554 ../admin.class.php:1087 +#: ../admin.class.php:585 ../admin.class.php:1167 msgid "Simple Ads Manager Settings" msgstr "" -#: ../admin.class.php:554 +#: ../admin.class.php:585 msgid "Settings" msgstr "" -#: ../admin.class.php:555 +#: ../admin.class.php:586 msgid "Simple Ads Manager Error Log" msgstr "" -#: ../admin.class.php:555 ../errorlog.admin.class.php:57 +#: ../admin.class.php:586 ../errorlog.admin.class.php:57 msgid "Error Log" msgstr "" -#: ../admin.class.php:667 ../admin.class.php:739 ../editor.admin.class.php:460 +#: ../admin.class.php:701 ../admin.class.php:773 ../editor.admin.class.php:460 msgid "Name of Ads Place" msgstr "" -#: ../admin.class.php:667 ../admin.class.php:739 +#: ../admin.class.php:701 ../admin.class.php:773 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks, plugin's widgets or autoinserting of ads." msgstr "" -#: ../admin.class.php:668 ../admin.class.php:740 ../editor.admin.class.php:986 +#: ../admin.class.php:702 ../admin.class.php:774 ../editor.admin.class.php:988 msgid "Name of Ad" msgstr "" -#: ../admin.class.php:668 ../admin.class.php:740 ../admin.class.php:788 +#: ../admin.class.php:702 ../admin.class.php:774 ../admin.class.php:822 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use Ads Blocks or plugin's widgets." msgstr "" -#: ../admin.class.php:669 ../admin.class.php:741 +#: ../admin.class.php:703 ../admin.class.php:775 msgid "Select Banner Image" msgstr "" -#: ../admin.class.php:669 ../admin.class.php:741 +#: ../admin.class.php:703 ../admin.class.php:775 msgid "Select" msgstr "" -#: ../admin.class.php:673 ../admin.class.php:747 +#: ../admin.class.php:707 ../admin.class.php:781 msgid "Uploading" msgstr "" -#: ../admin.class.php:674 ../admin.class.php:748 +#: ../admin.class.php:708 ../admin.class.php:782 msgid "Uploaded." msgstr "" -#: ../admin.class.php:675 ../admin.class.php:749 +#: ../admin.class.php:709 ../admin.class.php:783 msgid "Only JPG, PNG or GIF files are allowed" msgstr "" -#: ../admin.class.php:676 ../admin.class.php:750 +#: ../admin.class.php:710 ../admin.class.php:784 msgid "File" msgstr "" -#: ../admin.class.php:680 ../admin.class.php:684 ../admin.class.php:761 -#: ../editor.admin.class.php:608 ../editor.admin.class.php:937 -#: ../editor.admin.class.php:1547 ../list.admin.class.php:176 +#: ../admin.class.php:714 ../admin.class.php:718 ../admin.class.php:795 +#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 +#: ../editor.admin.class.php:1550 ../list.admin.class.php:176 #: ../list.admin.class.php:187 ../list.admin.class.php:235 #: ../list.admin.class.php:363 ../list.admin.class.php:373 #: ../list.admin.class.php:425 msgid "Hits" msgstr "" -#: ../admin.class.php:680 ../admin.class.php:685 ../admin.class.php:761 -#: ../editor.admin.class.php:609 ../editor.admin.class.php:939 -#: ../editor.admin.class.php:1548 ../list.admin.class.php:236 +#: ../admin.class.php:714 ../admin.class.php:719 ../admin.class.php:795 +#: ../editor.admin.class.php:610 ../editor.admin.class.php:941 +#: ../editor.admin.class.php:1551 ../list.admin.class.php:236 #: ../list.admin.class.php:364 ../list.admin.class.php:374 #: ../list.admin.class.php:426 msgid "Clicks" msgstr "" -#: ../admin.class.php:683 ../block.editor.admin.class.php:308 -#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:355 +#: ../admin.class.php:717 ../block.editor.admin.class.php:308 +#: ../editor.admin.class.php:459 ../zone.editor.admin.class.php:381 msgid "Name" msgstr "" -#: ../admin.class.php:753 +#: ../admin.class.php:787 msgid "Post" msgstr "" -#: ../admin.class.php:754 ../editor.admin.class.php:1134 +#: ../admin.class.php:788 ../editor.admin.class.php:1136 msgid "Page" msgstr "" -#: ../admin.class.php:755 +#: ../admin.class.php:789 msgid "Subscriber" msgstr "" -#: ../admin.class.php:788 ../zone.editor.admin.class.php:356 +#: ../admin.class.php:822 ../zone.editor.admin.class.php:382 msgid "Name of Ads Zone" msgstr "" -#: ../admin.class.php:789 ../block.editor.admin.class.php:309 +#: ../admin.class.php:823 ../block.editor.admin.class.php:309 msgid "Name of Ads Block" msgstr "" -#: ../admin.class.php:789 +#: ../admin.class.php:823 msgid "" "This is not required parameter. But it is strongly recommended to define it " "if you plan to use plugin's widgets." msgstr "" -#: ../admin.class.php:808 +#: ../admin.class.php:842 msgid "Error ID" msgstr "" -#: ../admin.class.php:809 +#: ../admin.class.php:843 msgid "Error Date" msgstr "" -#: ../admin.class.php:810 ../errorlog.admin.class.php:86 +#: ../admin.class.php:844 ../errorlog.admin.class.php:86 #: ../errorlog.admin.class.php:96 msgid "Table" msgstr "" -#: ../admin.class.php:811 +#: ../admin.class.php:845 msgid "Error Message" msgstr "" -#: ../admin.class.php:812 +#: ../admin.class.php:846 msgid "Error SQL" msgstr "" -#: ../admin.class.php:813 ../errorlog.admin.class.php:87 +#: ../admin.class.php:847 ../errorlog.admin.class.php:87 #: ../errorlog.admin.class.php:97 msgid "Type" msgstr "" -#: ../admin.class.php:814 +#: ../admin.class.php:848 msgid "Close" msgstr "" -#: ../admin.class.php:816 ../admin.class.php:877 +#: ../admin.class.php:850 ../admin.class.php:911 #: ../errorlog.admin.class.php:116 ../errorlog.admin.class.php:132 msgid "Warning" msgstr "" -#: ../admin.class.php:816 ../errorlog.admin.class.php:136 +#: ../admin.class.php:850 ../errorlog.admin.class.php:136 msgid "Ok" msgstr "" -#: ../admin.class.php:877 ../errorlog.admin.class.php:116 +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 msgid "Update Error" msgstr "" -#: ../admin.class.php:877 ../errorlog.admin.class.php:116 +#: ../admin.class.php:911 ../errorlog.admin.class.php:116 msgid "Output Error" msgstr "" -#: ../admin.class.php:963 +#: ../admin.class.php:1022 msgid "There are general options." msgstr "" -#: ../admin.class.php:967 +#: ../admin.class.php:1026 msgid "" "Single post/page auto inserting options. Use these parameters for allowing/" "defining Ads Places which will be automatically inserted before/after post/" "page content." msgstr "" -#: ../admin.class.php:975 +#: ../admin.class.php:1034 msgid "Adjust parameters of your Google DFP account." msgstr "" -#: ../admin.class.php:979 +#: ../admin.class.php:1038 msgid "Adjust parameters of plugin statistics." msgstr "" -#: ../admin.class.php:983 +#: ../admin.class.php:1042 msgid "This options define layout for Ads Managin Pages." msgstr "" -#: ../admin.class.php:987 +#: ../admin.class.php:1046 msgid "Are you allow to perform these actions during deactivating plugin?" msgstr "" -#: ../admin.class.php:1101 +#: ../admin.class.php:1054 +msgid "Next mailing is scheduled on" +msgstr "" + +#: ../admin.class.php:1056 +msgid "Adjust parameters of Mailing System." +msgstr "" + +#: ../admin.class.php:1181 msgid "Simple Ads Manager Settings Updated." msgstr "" -#: ../admin.class.php:1109 +#: ../admin.class.php:1189 msgid "System Info" msgstr "" -#: ../admin.class.php:1116 +#: ../admin.class.php:1196 msgid "Wordpress Version" msgstr "" -#: ../admin.class.php:1117 +#: ../admin.class.php:1197 msgid "SAM Version" msgstr "" -#: ../admin.class.php:1118 +#: ../admin.class.php:1198 msgid "SAM DB Version" msgstr "" -#: ../admin.class.php:1119 +#: ../admin.class.php:1199 msgid "PHP Version" msgstr "" -#: ../admin.class.php:1120 +#: ../admin.class.php:1200 msgid "MySQL Version" msgstr "" -#: ../admin.class.php:1121 +#: ../admin.class.php:1201 msgid "Memory Limit" msgstr "" -#: ../admin.class.php:1125 +#: ../admin.class.php:1205 msgid "Note! If you have detected a bug, include this data to bug report." msgstr "" -#: ../admin.class.php:1130 +#: ../admin.class.php:1210 msgid "Resources" msgstr "" -#: ../admin.class.php:1133 +#: ../admin.class.php:1213 msgid "Wordpress Plugin Page" msgstr "" -#: ../admin.class.php:1134 +#: ../admin.class.php:1214 msgid "Author Plugin Page" msgstr "" -#: ../admin.class.php:1135 ../help.class.php:34 ../help.class.php:51 +#: ../admin.class.php:1215 ../help.class.php:34 ../help.class.php:51 #: ../help.class.php:58 ../help.class.php:72 ../help.class.php:105 #: ../help.class.php:113 ../help.class.php:124 ../help.class.php:141 #: ../help.class.php:150 ../help.class.php:166 ../help.class.php:182 @@ -696,62 +787,62 @@ msgstr "" msgid "Support Forum" msgstr "" -#: ../admin.class.php:1136 +#: ../admin.class.php:1216 msgid "Author's Blog" msgstr "" -#: ../admin.class.php:1141 +#: ../admin.class.php:1221 msgid "Donations" msgstr "" -#: ../admin.class.php:1153 +#: ../admin.class.php:1233 #, php-format msgid "" "If you have found this plugin useful, please consider making a %s to help " "support future development. Your support will be much appreciated. Thank you!" msgstr "" -#: ../admin.class.php:1154 +#: ../admin.class.php:1234 msgid "Donate Now!" msgstr "" -#: ../admin.class.php:1154 +#: ../admin.class.php:1234 msgid "donation" msgstr "" -#: ../admin.class.php:1172 +#: ../admin.class.php:1252 msgid "Another Plugins" msgstr "" -#: ../admin.class.php:1176 +#: ../admin.class.php:1256 #, php-format msgid "Another plugins from %s" msgstr "" -#: ../admin.class.php:1182 +#: ../admin.class.php:1262 msgid "Highlights any portion of text as text in the colored boxes." msgstr "" -#: ../admin.class.php:1183 +#: ../admin.class.php:1263 msgid "" "Adds simple counters badge (FeedBurner subscribers and Twitter followers) to " "your blog." msgstr "" -#: ../admin.class.php:1184 +#: ../admin.class.php:1264 msgid "This plugin is WordPress shell for FloatBox library by Byron McGregor." msgstr "" -#: ../admin.class.php:1185 +#: ../admin.class.php:1265 msgid "Adds copyright notice in the end of each post of your blog. " msgstr "" -#: ../admin.class.php:1201 +#: ../admin.class.php:1281 msgctxt "Copyright String" msgid "Simple Ads Manager plugin for Wordpress." msgstr "" -#: ../admin.class.php:1201 +#: ../admin.class.php:1281 msgctxt "Copyright String" msgid "All rights reserved." msgstr "" @@ -762,13 +853,13 @@ msgstr "" #: ../block.editor.admin.class.php:401 ../editor.admin.class.php:396 #: ../editor.admin.class.php:465 ../editor.admin.class.php:486 #: ../editor.admin.class.php:507 ../editor.admin.class.php:527 -#: ../editor.admin.class.php:615 ../editor.admin.class.php:911 -#: ../editor.admin.class.php:991 ../editor.admin.class.php:1015 -#: ../editor.admin.class.php:1085 ../editor.admin.class.php:1185 -#: ../editor.admin.class.php:1430 ../editor.admin.class.php:1477 -#: ../editor.admin.class.php:1497 ../editor.admin.class.php:1556 -#: ../zone.editor.admin.class.php:300 ../zone.editor.admin.class.php:361 -#: ../zone.editor.admin.class.php:375 +#: ../editor.admin.class.php:617 ../editor.admin.class.php:913 +#: ../editor.admin.class.php:993 ../editor.admin.class.php:1017 +#: ../editor.admin.class.php:1087 ../editor.admin.class.php:1187 +#: ../editor.admin.class.php:1432 ../editor.admin.class.php:1479 +#: ../editor.admin.class.php:1499 ../editor.admin.class.php:1560 +#: ../zone.editor.admin.class.php:326 ../zone.editor.admin.class.php:387 +#: ../zone.editor.admin.class.php:401 msgid "Click to toggle" msgstr "" @@ -799,11 +890,11 @@ msgstr "" #: ../block.editor.admin.class.php:243 ../editor.admin.class.php:327 #: ../editor.admin.class.php:359 ../editor.admin.class.php:376 #: ../editor.admin.class.php:377 ../editor.admin.class.php:378 -#: ../editor.admin.class.php:386 ../editor.admin.class.php:725 -#: ../editor.admin.class.php:824 ../editor.admin.class.php:892 -#: ../editor.admin.class.php:893 ../editor.admin.class.php:894 -#: ../zone.editor.admin.class.php:162 ../zone.editor.admin.class.php:257 -#: ../zone.editor.admin.class.php:290 +#: ../editor.admin.class.php:386 ../editor.admin.class.php:727 +#: ../editor.admin.class.php:826 ../editor.admin.class.php:894 +#: ../editor.admin.class.php:895 ../editor.admin.class.php:896 +#: ../zone.editor.admin.class.php:172 ../zone.editor.admin.class.php:282 +#: ../zone.editor.admin.class.php:316 msgid "Undefined" msgstr "" @@ -820,8 +911,8 @@ msgid "Edit Ads Block" msgstr "" #: ../block.editor.admin.class.php:254 ../editor.admin.class.php:397 -#: ../editor.admin.class.php:912 ../errorlog.admin.class.php:84 -#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:301 +#: ../editor.admin.class.php:914 ../errorlog.admin.class.php:84 +#: ../errorlog.admin.class.php:94 ../zone.editor.admin.class.php:327 msgid "Status" msgstr "" @@ -834,19 +925,19 @@ msgid "Ads Block ID" msgstr "" #: ../block.editor.admin.class.php:276 ../editor.admin.class.php:427 -#: ../zone.editor.admin.class.php:323 +#: ../zone.editor.admin.class.php:349 msgid "Is Active" msgstr "" #: ../block.editor.admin.class.php:277 ../editor.admin.class.php:428 -#: ../editor.admin.class.php:954 ../zone.editor.admin.class.php:324 +#: ../editor.admin.class.php:956 ../zone.editor.admin.class.php:350 msgid "Is In Trash" msgstr "" #: ../block.editor.admin.class.php:284 ../block.editor.admin.class.php:289 #: ../editor.admin.class.php:435 ../editor.admin.class.php:440 -#: ../editor.admin.class.php:961 ../editor.admin.class.php:966 -#: ../zone.editor.admin.class.php:331 ../zone.editor.admin.class.php:337 +#: ../editor.admin.class.php:963 ../editor.admin.class.php:968 +#: ../zone.editor.admin.class.php:357 ../zone.editor.admin.class.php:363 #: ../js/dialog-ad.php:94 ../js/dialog-block.php:84 ../js/dialog-zone.php:94 #: ../js/dialog.php:94 msgid "Cancel" @@ -854,20 +945,20 @@ msgstr "" #: ../block.editor.admin.class.php:293 ../block.editor.admin.class.php:295 #: ../editor.admin.class.php:444 ../editor.admin.class.php:446 -#: ../editor.admin.class.php:970 ../editor.admin.class.php:972 -#: ../zone.editor.admin.class.php:334 ../zone.editor.admin.class.php:341 +#: ../editor.admin.class.php:972 ../editor.admin.class.php:974 +#: ../zone.editor.admin.class.php:360 ../zone.editor.admin.class.php:367 msgid "Save" msgstr "" -#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:986 -#: ../zone.editor.admin.class.php:356 +#: ../block.editor.admin.class.php:309 ../editor.admin.class.php:988 +#: ../zone.editor.admin.class.php:382 msgid "Required for SAM widgets." msgstr "" #: ../block.editor.admin.class.php:315 ../block.editor.admin.class.php:319 #: ../editor.admin.class.php:466 ../editor.admin.class.php:470 -#: ../editor.admin.class.php:995 ../zone.editor.admin.class.php:362 -#: ../zone.editor.admin.class.php:366 +#: ../editor.admin.class.php:997 ../zone.editor.admin.class.php:388 +#: ../zone.editor.admin.class.php:392 msgid "Description" msgstr "" @@ -876,7 +967,7 @@ msgid "Enter description of this Ads Block." msgstr "" #: ../block.editor.admin.class.php:322 ../editor.admin.class.php:473 -#: ../editor.admin.class.php:999 ../zone.editor.admin.class.php:369 +#: ../editor.admin.class.php:1001 ../zone.editor.admin.class.php:395 msgid "" "This description is not used anywhere and is added solely for the " "convenience of managing advertisements." @@ -1402,16 +1493,16 @@ msgstr "" msgid "Ads Place ID" msgstr "" -#: ../editor.admin.class.php:419 ../editor.admin.class.php:943 +#: ../editor.admin.class.php:419 ../editor.admin.class.php:945 #: ../list.admin.class.php:175 ../list.admin.class.php:186 msgid "Size" msgstr "" -#: ../editor.admin.class.php:421 ../editor.admin.class.php:945 +#: ../editor.admin.class.php:421 ../editor.admin.class.php:947 msgid "Width" msgstr "" -#: ../editor.admin.class.php:423 ../editor.admin.class.php:947 +#: ../editor.admin.class.php:423 ../editor.admin.class.php:949 msgid "Height" msgstr "" @@ -1423,15 +1514,11 @@ msgstr "" msgid "Enter description of this Ads Place." msgstr "" -#: ../editor.admin.class.php:479 ../editor.admin.class.php:1006 -msgid "General" -msgstr "" - #: ../editor.admin.class.php:480 msgid "Default Ad" msgstr "" -#: ../editor.admin.class.php:481 ../editor.admin.class.php:1010 +#: ../editor.admin.class.php:481 ../editor.admin.class.php:1012 msgid "Statistic" msgstr "" @@ -1546,554 +1633,554 @@ msgid "" "document." msgstr "" -#: ../editor.admin.class.php:597 ../editor.admin.class.php:1536 +#: ../editor.admin.class.php:598 ../editor.admin.class.php:1539 msgid "Select Period" msgstr "" -#: ../editor.admin.class.php:599 ../editor.admin.class.php:1538 +#: ../editor.admin.class.php:600 ../editor.admin.class.php:1541 msgid "This Month" msgstr "" -#: ../editor.admin.class.php:600 ../editor.admin.class.php:1539 +#: ../editor.admin.class.php:601 ../editor.admin.class.php:1542 msgid "Previous Month" msgstr "" -#: ../editor.admin.class.php:607 ../editor.admin.class.php:1546 +#: ../editor.admin.class.php:608 ../editor.admin.class.php:1549 #: ../list.admin.class.php:237 ../list.admin.class.php:427 msgid "Total" msgstr "" -#: ../editor.admin.class.php:616 +#: ../editor.admin.class.php:618 msgid "Contained Ads" msgstr "" -#: ../editor.admin.class.php:736 +#: ../editor.admin.class.php:738 msgid "Ad Data Updated." msgstr "" -#: ../editor.admin.class.php:901 +#: ../editor.admin.class.php:903 msgid "New advertisement" msgstr "" -#: ../editor.admin.class.php:901 +#: ../editor.admin.class.php:903 msgid "Edit advertisement" msgstr "" -#: ../editor.admin.class.php:921 +#: ../editor.admin.class.php:923 msgid "Back to Ads List" msgstr "" -#: ../editor.admin.class.php:928 +#: ../editor.admin.class.php:930 msgid "Advertisement ID" msgstr "" -#: ../editor.admin.class.php:935 ../list.admin.class.php:362 +#: ../editor.admin.class.php:937 ../list.admin.class.php:362 #: ../list.admin.class.php:372 msgid "Activity" msgstr "" -#: ../editor.admin.class.php:936 +#: ../editor.admin.class.php:938 msgid "Ad is Active" msgstr "" -#: ../editor.admin.class.php:936 +#: ../editor.admin.class.php:938 msgid "Ad is Inactive" msgstr "" -#: ../editor.admin.class.php:952 +#: ../editor.admin.class.php:954 msgid "Is in Rotation" msgstr "" -#: ../editor.admin.class.php:985 +#: ../editor.admin.class.php:987 msgid "Title" msgstr "" -#: ../editor.admin.class.php:992 +#: ../editor.admin.class.php:994 msgid "Advertisement Description" msgstr "" -#: ../editor.admin.class.php:1007 +#: ../editor.admin.class.php:1009 msgid "Extended Restrictions" msgstr "" -#: ../editor.admin.class.php:1008 +#: ../editor.admin.class.php:1010 msgid "Targeting" msgstr "" -#: ../editor.admin.class.php:1009 +#: ../editor.admin.class.php:1011 msgid "Earnings settings" msgstr "" -#: ../editor.admin.class.php:1016 ../editor.admin.class.php:1075 +#: ../editor.admin.class.php:1018 ../editor.admin.class.php:1077 msgid "Ad Code" msgstr "" -#: ../editor.admin.class.php:1020 +#: ../editor.admin.class.php:1022 msgid "Image Mode" msgstr "" -#: ../editor.admin.class.php:1024 +#: ../editor.admin.class.php:1026 msgid "Ad Image" msgstr "" -#: ../editor.admin.class.php:1029 +#: ../editor.admin.class.php:1031 msgid "Ad Target" msgstr "" -#: ../editor.admin.class.php:1033 +#: ../editor.admin.class.php:1035 msgid "Ad Alternative Text" msgstr "" -#: ../editor.admin.class.php:1038 +#: ../editor.admin.class.php:1040 msgid "Count clicks for this advertisement" msgstr "" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1042 msgid "Use carefully!" msgstr "" -#: ../editor.admin.class.php:1040 +#: ../editor.admin.class.php:1042 msgid "" "Do not use if the wp-admin folder is password protected. In this case the " "viewer will be prompted to enter a username and password during ajax " "request. It's not good." msgstr "" -#: ../editor.admin.class.php:1043 +#: ../editor.admin.class.php:1045 msgid "This is flash (SWF) banner" msgstr "" -#: ../editor.admin.class.php:1046 +#: ../editor.admin.class.php:1048 msgid "Flash banner \"flashvars\"" msgstr "" -#: ../editor.admin.class.php:1048 +#: ../editor.admin.class.php:1050 msgid "Insert \"flashvars\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:1049 +#: ../editor.admin.class.php:1051 msgid "Flash banner \"params\"" msgstr "" -#: ../editor.admin.class.php:1051 +#: ../editor.admin.class.php:1053 msgid "Insert \"params\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:1052 +#: ../editor.admin.class.php:1054 msgid "Flash banner \"attributes\"" msgstr "" -#: ../editor.admin.class.php:1054 +#: ../editor.admin.class.php:1056 msgid "Insert \"attributes\" parameters between braces..." msgstr "" -#: ../editor.admin.class.php:1057 +#: ../editor.admin.class.php:1059 msgid "Add to ad" msgstr "" -#: ../editor.admin.class.php:1059 +#: ../editor.admin.class.php:1061 msgid "Non Selected" msgstr "" -#: ../editor.admin.class.php:1060 +#: ../editor.admin.class.php:1062 msgid "nofollow" msgstr "" -#: ../editor.admin.class.php:1061 +#: ../editor.admin.class.php:1063 msgid "noindex" msgstr "" -#: ../editor.admin.class.php:1062 +#: ../editor.admin.class.php:1064 msgid "nofollow and noindex" msgstr "" -#: ../editor.admin.class.php:1071 +#: ../editor.admin.class.php:1073 msgid "Code Mode" msgstr "" -#: ../editor.admin.class.php:1077 +#: ../editor.admin.class.php:1079 msgid "This code of ad contains PHP script" msgstr "" -#: ../editor.admin.class.php:1086 +#: ../editor.admin.class.php:1088 msgid "Restrictions of advertisements showing" msgstr "" -#: ../editor.admin.class.php:1089 +#: ../editor.admin.class.php:1091 msgid "Ad Weight" msgstr "" -#: ../editor.admin.class.php:1096 +#: ../editor.admin.class.php:1098 msgid "Inactive" msgstr "" -#: ../editor.admin.class.php:1097 +#: ../editor.admin.class.php:1099 msgid "Minimal Activity" msgstr "" -#: ../editor.admin.class.php:1098 +#: ../editor.admin.class.php:1100 msgid "Maximal Activity" msgstr "" -#: ../editor.admin.class.php:1108 +#: ../editor.admin.class.php:1110 msgid "" "Ad weight - coefficient of frequency of show of the advertisement for one " "cycle of advertisements rotation." msgstr "" -#: ../editor.admin.class.php:1110 +#: ../editor.admin.class.php:1112 msgid "0 - ad is inactive" msgstr "" -#: ../editor.admin.class.php:1111 +#: ../editor.admin.class.php:1113 msgid "1 - minimal activity of this advertisement" msgstr "" -#: ../editor.admin.class.php:1113 +#: ../editor.admin.class.php:1115 msgid "10 - maximal activity of this ad." msgstr "" -#: ../editor.admin.class.php:1119 ../help.class.php:20 ../help.class.php:161 +#: ../editor.admin.class.php:1121 ../help.class.php:20 ../help.class.php:161 msgid "Show ad on all pages of blog" msgstr "" -#: ../editor.admin.class.php:1123 +#: ../editor.admin.class.php:1125 msgid "Show ad only on pages of this type" msgstr "" -#: ../editor.admin.class.php:1127 +#: ../editor.admin.class.php:1129 msgid "Home Page (Home or Front Page)" msgstr "" -#: ../editor.admin.class.php:1129 +#: ../editor.admin.class.php:1131 msgid "Singular Pages" msgstr "" -#: ../editor.admin.class.php:1132 +#: ../editor.admin.class.php:1134 msgid "Single Post" msgstr "" -#: ../editor.admin.class.php:1136 +#: ../editor.admin.class.php:1138 msgid "Custom Post Type" msgstr "" -#: ../editor.admin.class.php:1138 +#: ../editor.admin.class.php:1140 msgid "Attachment" msgstr "" -#: ../editor.admin.class.php:1141 +#: ../editor.admin.class.php:1143 msgid "Search Page" msgstr "" -#: ../editor.admin.class.php:1143 +#: ../editor.admin.class.php:1145 msgid "\"Not found\" Page (HTTP 404: Not Found)" msgstr "" -#: ../editor.admin.class.php:1145 +#: ../editor.admin.class.php:1147 msgid "Archive Pages" msgstr "" -#: ../editor.admin.class.php:1148 +#: ../editor.admin.class.php:1150 msgid "Taxonomy Archive Pages" msgstr "" -#: ../editor.admin.class.php:1150 +#: ../editor.admin.class.php:1152 msgid "Category Archive Pages" msgstr "" -#: ../editor.admin.class.php:1152 +#: ../editor.admin.class.php:1154 msgid "Tag Archive Pages" msgstr "" -#: ../editor.admin.class.php:1154 +#: ../editor.admin.class.php:1156 msgid "Author Archive Pages" msgstr "" -#: ../editor.admin.class.php:1156 +#: ../editor.admin.class.php:1158 msgid "Custom Post Type Archive Pages" msgstr "" -#: ../editor.admin.class.php:1158 +#: ../editor.admin.class.php:1160 msgid "" "Date Archive Pages (any date-based archive pages, i.e. a monthly, yearly, " "daily or time-based archive)" msgstr "" -#: ../editor.admin.class.php:1163 +#: ../editor.admin.class.php:1165 msgid "Show ad only in certain posts/pages" msgstr "" -#: ../editor.admin.class.php:1167 ../editor.admin.class.php:1194 +#: ../editor.admin.class.php:1169 ../editor.admin.class.php:1196 msgid "Posts/Pages" msgstr "" -#: ../editor.admin.class.php:1174 +#: ../editor.admin.class.php:1176 msgid "" "Use this setting to display an ad only in certain posts/pages. Select posts/" "pages." msgstr "" -#: ../editor.admin.class.php:1186 +#: ../editor.admin.class.php:1188 msgid "Extended restrictions of advertisements showing" msgstr "" -#: ../editor.admin.class.php:1190 +#: ../editor.admin.class.php:1192 msgid "Do not show ad on certain posts/pages" msgstr "" -#: ../editor.admin.class.php:1202 +#: ../editor.admin.class.php:1204 msgid "" "Use this setting to not display an ad on certain posts/pages. Select posts/" "pages." msgstr "" -#: ../editor.admin.class.php:1207 +#: ../editor.admin.class.php:1209 msgid "" "Show ad only in single posts or categories archives of certain categories" msgstr "" -#: ../editor.admin.class.php:1210 ../editor.admin.class.php:1230 +#: ../editor.admin.class.php:1212 ../editor.admin.class.php:1232 msgid "Categories" msgstr "" -#: ../editor.admin.class.php:1217 +#: ../editor.admin.class.php:1219 msgid "" "Use this setting to display an ad only in single posts or categories " "archives of certain categories." msgstr "" -#: ../editor.admin.class.php:1221 ../editor.admin.class.php:1255 -#: ../editor.admin.class.php:1289 ../editor.admin.class.php:1324 -#: ../editor.admin.class.php:1359 +#: ../editor.admin.class.php:1223 ../editor.admin.class.php:1257 +#: ../editor.admin.class.php:1291 ../editor.admin.class.php:1326 +#: ../editor.admin.class.php:1361 msgid "" "This display logic parameter will be applied only when you use the \"Show ad " "on all pages of blog\" and \"Show your ad only on the pages of this type\" " "modes. Otherwise, it will be ignored." msgstr "" -#: ../editor.admin.class.php:1227 +#: ../editor.admin.class.php:1229 msgid "" "Do not show ad in single posts or categories archives of certain categories" msgstr "" -#: ../editor.admin.class.php:1237 +#: ../editor.admin.class.php:1239 msgid "" "Use this setting to not display an ad in single posts or categories archives " "of certain categories." msgstr "" -#: ../editor.admin.class.php:1242 +#: ../editor.admin.class.php:1244 msgid "" "Show ad only in single posts or archives of certain Custom Taxonomies Terms" msgstr "" -#: ../editor.admin.class.php:1251 +#: ../editor.admin.class.php:1253 msgid "" "Use this setting to display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." msgstr "" -#: ../editor.admin.class.php:1261 +#: ../editor.admin.class.php:1263 msgid "" "Do not show ad in single posts or archives of certain Custom Taxonomies Terms" msgstr "" -#: ../editor.admin.class.php:1270 +#: ../editor.admin.class.php:1272 msgid "" "Use this setting to not display an ad only in single posts or archives of " "certain Custom Taxonomies Terms." msgstr "" -#: ../editor.admin.class.php:1275 +#: ../editor.admin.class.php:1277 msgid "Show ad only in single posts or authors archives of certain authors" msgstr "" -#: ../editor.admin.class.php:1278 ../editor.admin.class.php:1298 +#: ../editor.admin.class.php:1280 ../editor.admin.class.php:1300 msgid "Authors" msgstr "" -#: ../editor.admin.class.php:1285 +#: ../editor.admin.class.php:1287 msgid "" "Use this setting to display an ad only in single posts or authors archives " "of certain authors." msgstr "" -#: ../editor.admin.class.php:1295 +#: ../editor.admin.class.php:1297 msgid "Do not show ad in single posts or authors archives of certain authors" msgstr "" -#: ../editor.admin.class.php:1305 +#: ../editor.admin.class.php:1307 msgid "" "Use this setting to not display an ad in single posts or authors archives of " "certain authors." msgstr "" -#: ../editor.admin.class.php:1310 +#: ../editor.admin.class.php:1312 msgid "Show ad only in single posts or tags archives of certain tags" msgstr "" -#: ../editor.admin.class.php:1313 ../editor.admin.class.php:1333 +#: ../editor.admin.class.php:1315 ../editor.admin.class.php:1335 msgid "Tags" msgstr "" -#: ../editor.admin.class.php:1320 +#: ../editor.admin.class.php:1322 msgid "" "Use this setting to display an ad only in single posts or tags archives of " "certain tags." msgstr "" -#: ../editor.admin.class.php:1330 +#: ../editor.admin.class.php:1332 msgid "Do not show ad in single posts or tags archives of certain tags" msgstr "" -#: ../editor.admin.class.php:1340 +#: ../editor.admin.class.php:1342 msgid "" "Use this setting to not display an ad in single posts or tags archives of " "certain tags." msgstr "" -#: ../editor.admin.class.php:1345 +#: ../editor.admin.class.php:1347 msgid "" "Show ad only in custom type single posts or custom post type archives of " "certain custom post types" msgstr "" -#: ../editor.admin.class.php:1348 ../editor.admin.class.php:1368 +#: ../editor.admin.class.php:1350 ../editor.admin.class.php:1370 msgid "Custom post types" msgstr "" -#: ../editor.admin.class.php:1355 +#: ../editor.admin.class.php:1357 msgid "" "Use this setting to display an ad only in custom type single posts or custom " "post type archives of certain custom post types." msgstr "" -#: ../editor.admin.class.php:1365 +#: ../editor.admin.class.php:1367 msgid "" "Do not show ad in custom type single posts or custom post type archives of " "certain custom post types" msgstr "" -#: ../editor.admin.class.php:1375 +#: ../editor.admin.class.php:1377 msgid "" "Use this setting to not display an ad in custom type single posts or custom " "post type archives of certain custom post types." msgstr "" -#: ../editor.admin.class.php:1380 +#: ../editor.admin.class.php:1382 msgid "Use the schedule for this ad" msgstr "" -#: ../editor.admin.class.php:1384 +#: ../editor.admin.class.php:1386 msgid "Campaign Start Date" msgstr "" -#: ../editor.admin.class.php:1388 +#: ../editor.admin.class.php:1390 msgid "Campaign End Date" msgstr "" -#: ../editor.admin.class.php:1393 +#: ../editor.admin.class.php:1395 msgid "" "Use these parameters for displaying ad during the certain period of time." msgstr "" -#: ../editor.admin.class.php:1398 +#: ../editor.admin.class.php:1400 msgid "Use limitation by hits" msgstr "" -#: ../editor.admin.class.php:1402 +#: ../editor.admin.class.php:1404 msgid "Hits Limit" msgstr "" -#: ../editor.admin.class.php:1407 +#: ../editor.admin.class.php:1409 msgid "Use this parameter for limiting displaying of ad by hits." msgstr "" -#: ../editor.admin.class.php:1412 +#: ../editor.admin.class.php:1414 msgid "Use limitation by clicks" msgstr "" -#: ../editor.admin.class.php:1416 +#: ../editor.admin.class.php:1418 msgid "Clicks Limit" msgstr "" -#: ../editor.admin.class.php:1421 +#: ../editor.admin.class.php:1423 msgid "Use this parameter for limiting displaying of ad by clicks." msgstr "" -#: ../editor.admin.class.php:1431 +#: ../editor.admin.class.php:1433 msgid "Users" msgstr "" -#: ../editor.admin.class.php:1433 +#: ../editor.admin.class.php:1435 msgid "Show this ad for" msgstr "" -#: ../editor.admin.class.php:1436 +#: ../editor.admin.class.php:1438 msgid "all users" msgstr "" -#: ../editor.admin.class.php:1441 +#: ../editor.admin.class.php:1443 msgid "these users" msgstr "" -#: ../editor.admin.class.php:1446 +#: ../editor.admin.class.php:1448 msgid "Unregistered Users" msgstr "" -#: ../editor.admin.class.php:1450 ../editor.admin.class.php:1458 +#: ../editor.admin.class.php:1452 ../editor.admin.class.php:1460 msgid "Registered Users" msgstr "" -#: ../editor.admin.class.php:1455 +#: ../editor.admin.class.php:1457 msgid "Exclude these users" msgstr "" -#: ../editor.admin.class.php:1466 +#: ../editor.admin.class.php:1468 msgid "Do not show this ad for advertiser" msgstr "" -#: ../editor.admin.class.php:1478 +#: ../editor.admin.class.php:1480 msgid "Advertiser" msgstr "" -#: ../editor.admin.class.php:1481 +#: ../editor.admin.class.php:1483 msgid "Advertiser Nick Name" msgstr "" -#: ../editor.admin.class.php:1498 ../help.class.php:32 ../help.class.php:180 +#: ../editor.admin.class.php:1500 ../help.class.php:32 ../help.class.php:180 msgid "Prices" msgstr "" -#: ../editor.admin.class.php:1501 +#: ../editor.admin.class.php:1503 msgid "Price of ad placement per month" msgstr "" -#: ../editor.admin.class.php:1505 +#: ../editor.admin.class.php:1507 msgid "Tthis parameter used only for scheduled ads." msgstr "" -#: ../editor.admin.class.php:1508 +#: ../editor.admin.class.php:1510 msgid "Price per Thousand Hits" msgstr "" -#: ../editor.admin.class.php:1512 +#: ../editor.admin.class.php:1514 msgid "" "Not only humans visit your blog, bots and crawlers too. In order not to " "deceive an advertiser, you must enable the detection of bots and crawlers." msgstr "" -#: ../editor.admin.class.php:1515 +#: ../editor.admin.class.php:1517 msgid "Price per Click" msgstr "" -#: ../editor.admin.class.php:1519 +#: ../editor.admin.class.php:1521 msgid "" "To calculate the earnings on clicks, you must enable counting of clicks for " "that ad." msgstr "" -#: ../editor.admin.class.php:1557 +#: ../editor.admin.class.php:1561 msgid "Ad Preview" msgstr "" @@ -2574,122 +2661,126 @@ msgstr "" msgid "None" msgstr "" -#: ../zone.editor.admin.class.php:173 +#: ../zone.editor.admin.class.php:183 msgid "Ads Zone Data Updated." msgstr "" -#: ../zone.editor.admin.class.php:290 +#: ../zone.editor.admin.class.php:316 msgid "New Ads Zone" msgstr "" -#: ../zone.editor.admin.class.php:290 +#: ../zone.editor.admin.class.php:316 msgid "Edit Ads Zone" msgstr "" -#: ../zone.editor.admin.class.php:310 +#: ../zone.editor.admin.class.php:336 msgid "Back to Zones List" msgstr "" -#: ../zone.editor.admin.class.php:317 ../js/dialog-zone.php:71 +#: ../zone.editor.admin.class.php:343 ../js/dialog-zone.php:71 msgid "Ads Zone ID" msgstr "" -#: ../zone.editor.admin.class.php:364 +#: ../zone.editor.admin.class.php:390 msgid "Enter description of this Ads Zone." msgstr "" -#: ../zone.editor.admin.class.php:376 +#: ../zone.editor.admin.class.php:402 msgid "Ads Zone Settings" msgstr "" -#: ../zone.editor.admin.class.php:379 +#: ../zone.editor.admin.class.php:405 msgid "Default Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:385 +#: ../zone.editor.admin.class.php:411 msgid "" "Select the Ads Place by default. This Ads Place will be displayed in the " "event that for the page of a given type the Ads Place value is set to " "\"Default\"." msgstr "" -#: ../zone.editor.admin.class.php:389 +#: ../zone.editor.admin.class.php:415 msgid "Home Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:395 +#: ../zone.editor.admin.class.php:421 msgid "Default Ads Place for Singular Pages" msgstr "" -#: ../zone.editor.admin.class.php:402 +#: ../zone.editor.admin.class.php:428 msgid "Single Post Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:411 +#: ../zone.editor.admin.class.php:437 msgid "Default Ads Place for Single Custom Type Post" msgstr "" -#: ../zone.editor.admin.class.php:422 +#: ../zone.editor.admin.class.php:448 msgid "Ads Place for Single Post of Custom Type" msgstr "" -#: ../zone.editor.admin.class.php:431 +#: ../zone.editor.admin.class.php:457 msgid "Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:437 +#: ../zone.editor.admin.class.php:463 msgid "Attachment Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:444 +#: ../zone.editor.admin.class.php:470 msgid "Search Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:450 +#: ../zone.editor.admin.class.php:476 msgid "404 Page Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:456 +#: ../zone.editor.admin.class.php:482 msgid "Default Ads Place for Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:463 +#: ../zone.editor.admin.class.php:489 msgid "Default Ads Place for Taxonomies Pages" msgstr "" -#: ../zone.editor.admin.class.php:470 +#: ../zone.editor.admin.class.php:502 +msgid "Ads Place for Custom Taxonomy Term" +msgstr "" + +#: ../zone.editor.admin.class.php:515 msgid "Default Ads Place for Category Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:483 +#: ../zone.editor.admin.class.php:528 msgid "Ads Place for Category" msgstr "" -#: ../zone.editor.admin.class.php:499 +#: ../zone.editor.admin.class.php:544 msgid "Default Ads Place for Archives of Custom Type Posts" msgstr "" -#: ../zone.editor.admin.class.php:509 +#: ../zone.editor.admin.class.php:554 msgid "Ads Place for Custom Type Posts Archive" msgstr "" -#: ../zone.editor.admin.class.php:518 +#: ../zone.editor.admin.class.php:563 msgid "Tags Archive Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:525 +#: ../zone.editor.admin.class.php:569 msgid "Default Ads Place for Author Archive Pages" msgstr "" -#: ../zone.editor.admin.class.php:534 +#: ../zone.editor.admin.class.php:578 msgid "Ads Place for author" msgstr "" -#: ../zone.editor.admin.class.php:543 +#: ../zone.editor.admin.class.php:587 msgid "Date Archive Pages Ads Place" msgstr "" -#: ../zone.editor.admin.class.php:550 +#: ../zone.editor.admin.class.php:594 msgid "" "Ads Places for Singular pages, for Pages of Taxonomies and for Archive pages " "are Ads Places by default for the low level pages of relevant pages." diff --git a/sam.class.php b/sam.class.php index 2b2a85d..993d666 100644 --- a/sam.class.php +++ b/sam.class.php @@ -55,7 +55,7 @@ class SimpleAdsManager { public function __construct() { define('SAM_VERSION', '1.8.71'); - define('SAM_DB_VERSION', '2.4'); + define('SAM_DB_VERSION', '2.5'); define('SAM_PATH', dirname( __FILE__ )); define('SAM_URL', plugins_url( '/', __FILE__ ) ); define('SAM_IMG_URL', SAM_URL.'images/'); @@ -95,7 +95,6 @@ public function __construct() { add_shortcode('sam_zone', array(&$this, 'doZoneShortcode')); add_shortcode('sam_block', array(&$this, 'doBlockShortcode')); add_filter('the_content', array(&$this, 'addContentAds'), 8); - // SE begin add_filter('get_the_excerpt', array(&$this, 'addExcerptAds'), 10); if( $this->samOptions['bbpActive'] && $this->samOptions['bbpEnabled'] ) { add_filter('bbp_get_reply_content', array(&$this, 'addBbpContentAds'), 39, 2); @@ -103,7 +102,6 @@ public function __construct() { add_action('bbp_theme_after_forum_sub_forums', array(&$this, 'addBbpForumAds')); add_action('bbp_theme_before_topic_started_by', array(&$this, 'addBbpForumAds')); } - //SE end // For backward compatibility add_shortcode('sam-ad', array(&$this, 'doAdShortcode')); @@ -170,15 +168,18 @@ private function customTaxonomiesTerms($id) { } public function samMaintenance() { + $options = self::getSettings(); if(false === ($mDate = get_transient( 'sam_maintenance_date' ))) { $date = new DateTime('now'); $date->modify('+1 month'); $nextDate = new DateTime($date->format('Y-m-01 02:00')); $diff = $nextDate->format('U') - $_SERVER['REQUEST_TIME']; - include_once('sam.tools.php'); - $mailer = new SamMailer($this->getSettings()); - $mailer->sendMails(); + if($options['mailer']) { + include_once('sam.tools.php'); + $mailer = new SamMailer($options); + $mailer->sendMails(); + } $format = get_option('date_format').' '.get_option('time_format'); set_transient( 'sam_maintenance_date', $nextDate->format($format), $diff ); @@ -555,8 +556,7 @@ public function addContentAds( $content ) { if(!empty($options['afterPost']) && !empty($options['apAdsId'])) $apAd = $this->buildAd(array('id' => $options['apAdsId']), $options['apUseCodes']); } - //SE - else { + elseif($options['bpExcerpt']) { if(!empty($options['beforePost']) && !empty($options['bpAdsId'])) $bpAd = $this->buildAd(array('id' => $options['bpAdsId']), $options['bpUseCodes']); } @@ -588,7 +588,6 @@ public function addExcerptAds( $excerpt ) { else return $excerpt; } - // SE begin public function addBbpContentAds( $content, $reply_id ) { $options = self::getSettings(); $bpAd = ''; @@ -635,7 +634,6 @@ public function addBbpForumAds() { echo $bpAd; } - // SE end } // end of class definition } // end of if not class SimpleAdsManager exists ?> \ No newline at end of file diff --git a/zone.editor.admin.class.php b/zone.editor.admin.class.php index 78963cc..7cbcba2 100644 --- a/zone.editor.admin.class.php +++ b/zone.editor.admin.class.php @@ -33,7 +33,7 @@ private function getCustomPostTypes() { return $post_types; } - private function getTax($type = 'category') { + private function getTaxes($type = 'category') { if(empty($type)) return; if($type === 'custom_tax_terms') $wc = "NOT FIND_IN_SET(wtt.taxonomy, 'category,post_tag,nav_menu,link_category,post_format')"; @@ -59,7 +59,7 @@ private function getTax($type = 'category') { $output = array(); foreach($taxonomies as $tax) { - array_push($output, array('name' => $tax['name'], 'slug' => $tax['slug'])); + array_push($output, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['taxonomy'])); } return $output; } @@ -95,9 +95,12 @@ public function page() { $pTable = $wpdb->prefix . "sam_places"; $options = $this->settings; - $cats = $this->getTax(); - $authors = $this->getAuthors(); - $customs = $this->getCustomPostTypes(); + $taxes = self::getTaxes('custom_tax_terms'); + $cats = self::getTaxes(); + $authors = self::getAuthors(); + $customs = self::getCustomPostTypes(); + + $uTaxes = array(); $uCats = array(); $uAuthors = array(); $uSingleCT = array(); @@ -116,6 +119,12 @@ public function page() { if(isset($_POST['update_zone'])) { $zoneId = $_POST['zone_id']; + foreach($taxes as $tax) { + if(isset($_POST['z_taxes_'.$tax['slug']])) { + $value = (integer) $_POST['z_taxes_'.$tax['slug']]; + $uTaxes[$tax['slug']] = array('id' => $value, 'tax' => $tax['tax']); + } + } foreach($cats as $cat) { if(isset($_POST['z_cats_'.$cat['slug']])) { $value = (integer) $_POST['z_cats_'.$cat['slug']]; @@ -144,6 +153,7 @@ public function page() { 'z_404' => $_POST['z_404'], 'z_archive' => $_POST['z_archive'], 'z_tax' => $_POST['z_tax'], + 'z_taxes' => serialize($uTaxes), 'z_category' => $_POST['z_category'], 'z_cats' => serialize($uCats), 'z_tag' => $_POST['z_tag'], @@ -156,8 +166,8 @@ public function page() { ); $formatRow = array( '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', - '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%s', '%d', - '%s', '%d', '%d' + '%d', '%d', '%d', '%d', '%s', '%d', '%s', '%d', '%d', '%s', + '%d', '%s', '%d', '%d' ); if($zoneId === __('Undefined', SAM_DOMAIN)) { $wpdb->insert($zTable, $updateRow); @@ -189,7 +199,8 @@ public function page() { z_search, z_404, z_archive, - z_tax, + z_tax, + z_taxes, z_category, z_cats, z_tag, @@ -204,17 +215,25 @@ public function page() { $pSql = "SELECT id, name FROM $pTable WHERE $pTable.trash IS FALSE;"; $places = $wpdb->get_results($pSql, ARRAY_A); + $sCats = array(); $sAuthors = array(); $sSingleCT = array(); $sArchiveCT = array(); + $sTaxes = array(); if($action !== 'new') { $row = $wpdb->get_row($zSql, ARRAY_A); + $zTaxes = unserialize($row['z_taxes']); $zCats = unserialize($row['z_cats']); $zAuthors = unserialize($row['z_authors']); $zSingleCT = unserialize($row['z_single_ct']); $zArchiveCT = unserialize($row['z_archive_ct']); + + foreach($taxes as $tax) { + $val = (!is_null($zTaxes[$tax['slug']])) ? $zTaxes[$tax['slug']]['id'] : -1; + array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => $val)); + } foreach($cats as $cat) { $val = (!is_null($zCats[$cat['slug']])) ? $zCats[$cat['slug']] : -1; array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => $val)); @@ -233,10 +252,16 @@ public function page() { else { if($updated) { $row = $wpdb->get_row($zSql, ARRAY_A); + $zTaxes = unserialize($row['z_taxes']); $zCats = unserialize($row['z_cats']); $zAuthors = unserialize($row['z_authors']); $zSingleCT = unserialize($row['z_single_ct']); $zArchiveCT = unserialize($row['z_archive_ct']); + + foreach($taxes as $tax) { + $val = (!is_null($zTaxes[$tax['slug']])) ? $zTaxes[$tax['slug']]['id'] : -1; + array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => $val)); + } foreach($cats as $cat) { $val = (!is_null($zCats[$cat['slug']])) ? $zCats[$cat['slug']] : -1; array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => $val)); @@ -275,6 +300,7 @@ public function page() { 'z_date' => -1, 'trash' => false ); + foreach($taxes as $tax) array_push($sTaxes, array('name' => $tax['name'], 'slug' => $tax['slug'], 'tax' => $tax['tax'], 'val' => -1)); foreach($cats as $cat) array_push($sCats, array('name' => $cat['name'], 'slug' => $cat['slug'], 'val' => -1)); foreach($authors as $key => $author) array_push($sAuthors, array('id' => $author, 'name' => $key, 'val' => -1)); foreach($customs as $custom) { @@ -465,62 +491,80 @@ public function page() { drawPlacesSelector($places, $row['z_tax'], false); ?>

        -
        -

        - - -

        - 1) { + 1) { + ?> +
        + -
        -

        - - ' name=''> + drawPlacesSelector($places, $tax['val'], false); ?> -

        - +

        +
        - +

        + + +

        + 1) { ?> +
        -

        - - -

        -
        - -

        - - -

        - -
        - + foreach($sCats as $cat) { + ?>

        - - ' name=''> + drawPlacesSelector($places, $cat['val'], false); ?>

        +
        + + +

        + + +

        +
        + +

        + + +

        + +
        + +

        + + +