Commit 573a3cc7 authored by kiki's avatar kiki

rimosso AVH Extended Categories Widgets

parent b265127a
<?php
/**
* Singleton Class
*/
class AVH_EC_Singleton {
/**
* @param $class
* @param $arg1
*/
function &getInstance($class, $arg1 = null) {
static $instances = array(); // array of instance names
if (array_key_exists($class, $instances)) {
$instance = &$instances[ $class ];
} else {
if ( ! class_exists($class)) {
switch ($class) {
case 'AVH_EC_Core':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.core.php');
break;
case 'AVH_EC_Category_Group':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.category-group.php');
break;
case 'AVH_EC_Widget_Helper_Class':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.widget-helper.php');
break;
}
}
$instances[ $class ] = new $class($arg1);
$instance = &$instances[ $class ];
}
return $instance;
} // getInstance
} // singleton
/**
* Include the necessary files
*/
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/helpers/avh-forms.php');
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.widgets.php');
/**
* Initialize the plugin
*/
function avhextendedcategories_init() {
// Admin
if (is_admin()) {
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.admin.php');
$avhec_admin = new AVH_EC_Admin();
}
AVH_EC_Singleton::getInstance('AVH_EC_Core');
add_action('widgets_init', 'avhextendedcategories_widgets_init');
} // End avhamazon_init()
/**
* Register the widget
*
* @WordPress Action widgets_init
* @since 3.0
*/
function avhextendedcategories_widgets_init() {
register_widget('WP_Widget_AVH_ExtendedCategories_Normal');
register_widget('WP_Widget_AVH_ExtendedCategories_Top');
register_widget('WP_Widget_AVH_ExtendedCategories_Category_Group');
}
add_action('plugins_loaded', 'avhextendedcategories_init');
?>
\ No newline at end of file
.footer_avhec {
font-size : 0.8em;
text-align : center;
}
div.clearer {
clear : both;
line-height : 1px;
font-size : 1px;
height : 1px;
}
/* Metabox in General */
table.avhec-options {
}
.avhec-metabox-wrap {
}
.avhec-metabox-wrap .p {
line-height : 140%;
margin : 1em 0;
}
#avhecBoxOptions option {
padding : .5em;
}
.avhec-metabox-wrap span.description {
}
.avhec-metabox-wrap .b {
font-weight : bold;
}
.avhec-metabox-wrap ul {
margin-bottom : 1em;
}
.avhec-metabox-wrap ul li {
line-height : 120%;
list-style : disc inside none;
margin-bottom : 0;
}
#avhec-options input {
}
#avhec-generaloptions input {
}
/* Metabox FAQ */
#avhecBoxFAQ .inside ul {
margin-bottom : 6px;
}
#avhecBoxFAQ .inside ul li {
line-height : 120%;
list-style : disc inside none;
margin-bottom : 0;
}
/* Metabox Donations*/
#avhecBoxDonations .inside {
}
#avhecBoxDonations .versions {
padding : 6px 10px 12px;
}
/* Metabox Donations*/
#avhecBoxTranslation .inside {
}
/* Metabox in post and page */
#post_avhec_category_group {
width : 100%;
}
#avhec-catlist {
-moz-border-radius : 4px 4px 4px 4px;
background-color : #FFFFFF;
border : 1px solid #DFDFDF;
height : 20em;
margin-bottom : -1.8em;
overflow : auto;
width : 95%;
}
#avhec-catlist ul {
padding : 3px;
}
#avhec-catlist li ul {
padding : 0px;
}
#avhec-catlist li {
margin-bottom : 0px;
}
#avhecManualOrder {
width : 25%;
/* border: 1px solid #B2B2B2;*/
/* margin: 10px 10px 10px 0px;*/
/* padding: 5px 10px 5px 10px;*/
/* list-style: none;*/
/* background-color: #fff;*/
/* border-radius: 3px;*/
/* -webkit-border-radius: 3px;*/
}
#avhecManualOrder li.lineitem {
border : 1px solid #DFDFDF;
background-image : none;
border-radius : 3px;
-webkit-border-radius : 3px;
background-color : #FFFFFF;
color : #555555;
cursor : move;
margin-top : 5px;
margin-bottom : 5px;
padding : 2px 5px 2px 5px;
list-style : none outside none;
}
#avhecManualOrder .sortable-placeholder {
border : 1px dashed #B2B2B2;
margin-top : 5px;
margin-bottom : 5px;
padding : 2px 5px 2px 5px;
height : 1.5em;
line-height : 1.5em;
list-style : none outside none;
background-color : transparent;
background-image : -ms-linear-gradient(top, #f9f9f9, #f5f5f5); /* IE10 */
background-image : -moz-linear-gradient(top, #f9f9f9, #f5f5f5); /* Firefox */
background-image : -o-linear-gradient(top, #f9f9f9, #f5f5f5); /* Opera */
background-image : -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#f5f5f5)); /* old Webkit */
background-image : -webkit-linear-gradient(top, #f9f9f9, #f5f5f5); /* new Webkit */
background-image : linear-gradient(top, #f9f9f9, #f5f5f5); /* proposed W3C Markup */
}
\ No newline at end of file
/* AVH Extended Categories Widget CSS */
.avhec-widget-line {
display : inline-block;
}
.avhec-widget-count {
display : inline;
}
.avhec-widget-rss {
display : inline;
}
\ No newline at end of file
<?php
if ( ! function_exists('avh_doWidgetFormText')) {
function avh_doWidgetFormText($field_id, $field_name, $description, $value) {
echo '<label for="' . $field_id . '">';
echo $description;
echo '<input class="widefat" id="' .
$field_id .
'" name="' .
$field_name .
'" type="text" value="' .
esc_attr($value) .
'" /> ';
echo '</label>';
echo '<br />';
}
}
if ( ! function_exists('avh_doWidgetFormCheckbox')) {
function avh_doWidgetFormCheckbox($field_id, $field_name, $description, $is_checked = false) {
echo '<label for="' . $field_id . '">';
echo '<input class="checkbox" type="checkbox" id="' .
$field_id .
'" name="' .
$field_name .
'"' .
($is_checked ? ' CHECKED' : '') .
' /> ';
echo $description;
echo '</label>';
echo '<br />';
}
}
if ( ! function_exists('avh_doWidgetFormSelect')) {
function avh_doWidgetFormSelect($field_id, $field_name, $description, $options, $selected_value) {
echo '<label for="' . $field_id . '">';
echo $description . ' ';
echo '</label>';
$data = '';
foreach ($options as $value => $text) {
$data .= '<option value="' .
$value .
'" ' .
($value == $selected_value ? "SELECTED" : '') .
'>' .
$text .
'</option>' .
"/n";
}
echo '<select id="' . $field_id . '" name="' . $field_name . '"> ';
echo $data;
echo '</select>';
echo '<br />';
}
}
function avhecManualOrder(){jQuery("#avhecManualOrder").sortable({placeholder:"sortable-placeholder",revert:false,items:".lineitem",opacity:0.65,cursor:"move",forcePlaceholderSize:true,tolerance:"pointer"})}addLoadEvent(avhecManualOrder);function orderCats(){jQuery("#updateText").html("Updating Category Order...");jQuery("#hdnManualOrder").val(jQuery("#avhecManualOrder").sortable("toArray"))};
\ No newline at end of file
function avhecManualOrder() {
jQuery("#avhecManualOrder").sortable({
placeholder: "sortable-placeholder",
revert: false,
items: '.lineitem',
opacity: 0.65,
cursor: 'move',
forcePlaceholderSize: true,
tolerance: "pointer"
});
};
addLoadEvent(avhecManualOrder);
function orderCats() {
jQuery("#updateText").html("Updating Category Order...");
jQuery("#hdnManualOrder").val(
jQuery("#avhecManualOrder").sortable("toArray"));
}
\ No newline at end of file
function avhecManualOrder(){jQuery("#avhecManualOrder").sortable({placeholder:"sortable-placeholder",revert:false,items:".lineitem",opacity:.65,cursor:"move",forcePlaceholderSize:true,tolerance:"pointer"})}addLoadEvent(avhecManualOrder);function orderCats(){jQuery("#updateText").html("Updating Category Order...");jQuery("#hdnManualOrder").val(jQuery("#avhecManualOrder").sortable("toArray"))}
\ No newline at end of file
jQuery(document).ready(function(a){a("#the-list").wpList({delBefore:function(b){if("undefined"!=showNotice)return showNotice.warn()?b:false;return b}});a('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
jQuery(document).ready(function($) {
var options = false, delBefore, delAfter;
delAfter = function( r, settings ) {
var id = $('cat', r).attr('id'), o;
for ( o = 0; o < options.length; o++ )
if ( id == options[o].value )
options[o] = null;
};
delBefore = function(s) {
if ( 'undefined' != showNotice )
return showNotice.warn() ? s : false;
return s;
};
$('#the-list').wpList({ delBefore: delBefore });
$('.delete a[class^="delete"]').live('click', function(){return false;});
});
\ No newline at end of file
jQuery(document).ready(function ($) {
var options = false, delBefore, delAfter;
delAfter = function (r, settings) {
var id = $('cat', r).attr('id'), o;
for (o = 0; o < options.length; o++)
if (id == options[o].value)
options[o] = null;
};
delBefore = function (s) {
if ('undefined' != showNotice)
return showNotice.warn() ? s : false;
return s;
};
$('#the-list').wpList({delBefore: delBefore});
$('.delete a[class^="delete"]').live('click', function () {
return false;
});
});
\ No newline at end of file
jQuery(document).ready(function(a){a("#the-list").wpList({delBefore:function(b){if("undefined"!=showNotice)return showNotice.warn()?b:false;return b}});a('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
jQuery(document).ready(function($){var options=false,delBefore,delAfter;delAfter=function(r,settings){var id=$("cat",r).attr("id"),o;for(o=0;o<options.length;o++)if(id==options[o].value)options[o]=null};delBefore=function(s){if("undefined"!=showNotice)return showNotice.warn()?s:false;return s};$("#the-list").wpList({delBefore:delBefore});$('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
<?php
/**
* Singleton Class
*/
class AVH_EC_Singleton {
/**
* @param $class
* @param $arg1
*/
function &getInstance($class, $arg1 = null) {
static $instances = array(); // array of instance names
if (array_key_exists($class, $instances)) {
$instance = &$instances[ $class ];
} else {
if ( ! class_exists($class)) {
switch ($class) {
case 'AVH_EC_Core':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.core.php');
break;
case 'AVH_EC_Category_Group':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.category-group.php');
break;
case 'AVH_EC_Widget_Helper_Class':
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.widget-helper.php');
break;
}
}
$instances[ $class ] = new $class($arg1);
$instance = &$instances[ $class ];
}
return $instance;
} // getInstance
} // singleton
/**
* Include the necessary files
*/
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/helpers/avh-forms.php');
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.widgets.php');
/**
* Initialize the plugin
*/
function avhextendedcategories_init() {
// Admin
if (is_admin()) {
require_once(AVHEC_ABSOLUTE_WORKING_DIR . '/class/avh-ec.admin.php');
$avhec_admin = new AVH_EC_Admin();
}
AVH_EC_Singleton::getInstance('AVH_EC_Core');
add_action('widgets_init', 'avhextendedcategories_widgets_init');
} // End avhamazon_init()
/**
* Register the widget
*
* @WordPress Action widgets_init
* @since 3.0
*/
function avhextendedcategories_widgets_init() {
register_widget('WP_Widget_AVH_ExtendedCategories_Normal');
register_widget('WP_Widget_AVH_ExtendedCategories_Top');
register_widget('WP_Widget_AVH_ExtendedCategories_Category_Group');
}
add_action('plugins_loaded', 'avhextendedcategories_init');
?>
\ No newline at end of file
/* AVH Extended Categories Widget CSS */
.avhec-widget-line {
display : inline-block;
}
.avhec-widget-count {
display : inline;
}
.avhec-widget-rss {
display : inline;
}
\ No newline at end of file
<?php
if ( ! function_exists('avh_doWidgetFormText')) {
function avh_doWidgetFormText($field_id, $field_name, $description, $value) {
echo '<label for="' . $field_id . '">';
echo $description;
echo '<input class="widefat" id="' .
$field_id .
'" name="' .
$field_name .
'" type="text" value="' .
esc_attr($value) .
'" /> ';
echo '</label>';
echo '<br />';
}
}
if ( ! function_exists('avh_doWidgetFormCheckbox')) {
function avh_doWidgetFormCheckbox($field_id, $field_name, $description, $is_checked = false) {
echo '<label for="' . $field_id . '">';
echo '<input class="checkbox" type="checkbox" id="' .
$field_id .
'" name="' .
$field_name .
'"' .
($is_checked ? ' CHECKED' : '') .
' /> ';
echo $description;
echo '</label>';
echo '<br />';
}
}
if ( ! function_exists('avh_doWidgetFormSelect')) {
function avh_doWidgetFormSelect($field_id, $field_name, $description, $options, $selected_value) {
echo '<label for="' . $field_id . '">';
echo $description . ' ';
echo '</label>';
$data = '';
foreach ($options as $value => $text) {
$data .= '<option value="' .
$value .
'" ' .
($value == $selected_value ? "SELECTED" : '') .
'>' .
$text .
'</option>' .
"/n";
}
echo '<select id="' . $field_id . '" name="' . $field_name . '"> ';
echo $data;
echo '</select>';
echo '<br />';
}
}
function avhecManualOrder(){jQuery("#avhecManualOrder").sortable({placeholder:"sortable-placeholder",revert:false,items:".lineitem",opacity:0.65,cursor:"move",forcePlaceholderSize:true,tolerance:"pointer"})}addLoadEvent(avhecManualOrder);function orderCats(){jQuery("#updateText").html("Updating Category Order...");jQuery("#hdnManualOrder").val(jQuery("#avhecManualOrder").sortable("toArray"))};
\ No newline at end of file
function avhecManualOrder() {
jQuery("#avhecManualOrder").sortable({
placeholder: "sortable-placeholder",
revert: false,
items: '.lineitem',
opacity: 0.65,
cursor: 'move',
forcePlaceholderSize: true,
tolerance: "pointer"
});
};
addLoadEvent(avhecManualOrder);
function orderCats() {
jQuery("#updateText").html("Updating Category Order...");
jQuery("#hdnManualOrder").val(
jQuery("#avhecManualOrder").sortable("toArray"));
}
\ No newline at end of file
function avhecManualOrder(){jQuery("#avhecManualOrder").sortable({placeholder:"sortable-placeholder",revert:false,items:".lineitem",opacity:.65,cursor:"move",forcePlaceholderSize:true,tolerance:"pointer"})}addLoadEvent(avhecManualOrder);function orderCats(){jQuery("#updateText").html("Updating Category Order...");jQuery("#hdnManualOrder").val(jQuery("#avhecManualOrder").sortable("toArray"))}
\ No newline at end of file
jQuery(document).ready(function(a){a("#the-list").wpList({delBefore:function(b){if("undefined"!=showNotice)return showNotice.warn()?b:false;return b}});a('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
jQuery(document).ready(function($){var options=false,delBefore,delAfter;delAfter=function(r,settings){var id=$("cat",r).attr("id"),o;for(o=0;o<options.length;o++)if(id==options[o].value)options[o]=null};delBefore=function(s){if("undefined"!=showNotice)return showNotice.warn()?s:false;return s};$("#the-list").wpList({delBefore:delBefore});$('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file