public static function prtCat($categories, $category_act, $category_childs_act, $single = FALSE)
 {
     $DW =& $GLOBALS['DW'];
     foreach ($categories as $pid => $childs) {
         $run = TRUE;
         if ($DW->wpml) {
             include_once DW_MODULES . 'wpml_module.php';
             $wpml_id = DW_WPML::getID($pid, 'tax_category');
             if ($wpml_id > 0 && $wpml_id != $pid) {
                 $run = FALSE;
             }
         }
         if ($run) {
             $cat = get_category($pid);
             echo '<div style="position:relative;left:15px;">';
             echo '<input type="checkbox" id="' . ($single ? 'single_' : '') . 'category_act_' . $cat->cat_ID . '" name="' . ($single ? 'single_' : '') . 'category_act[]" value="' . $cat->cat_ID . '" ' . (isset($category_act) && count($category_act) > 0 && in_array($cat->cat_ID, $category_act) ? 'checked="checked"' : '') . '  onchange="chkChild(\'' . ($single ? 'single_' : '') . 'category\', ' . $pid . ');' . ($single ? 'ci(\'single_category_act_' . $cat->cat_ID . '\')' : '') . '" /> <label for="' . ($single ? 'single_' : '') . 'category_act_' . $cat->cat_ID . '">' . $cat->name . '</label><br />';
             echo '<div style="position:relative;left:15px;">';
             echo '<input type="checkbox" id="' . ($single ? 'single_' : '') . 'category_childs_act_' . $cat->cat_ID . '" name="' . ($single ? 'single_' : '') . 'category_childs_act[]" value="' . $cat->cat_ID . '" ' . (isset($category_childs_act) && count($category_childs_act) > 0 && in_array($cat->cat_ID, $category_childs_act) ? 'checked="checked"' : '') . ' onchange="chkParent(\'' . ($single ? 'single_' : '') . 'category\', ' . $cat->cat_ID . ');' . ($single ? 'ci(\'single_category_act_' . $cat->cat_ID . '\')' : '') . '" /> <label for="' . ($single ? 'single_' : '') . 'category_childs_act_' . $cat->cat_ID . '"><em>' . __('All childs', DW_L10N_DOMAIN) . '</em></label><br />';
             echo '</div>';
             if (count($childs) > 0) {
                 self::prtCat($childs, $category_act, $category_childs_act, $single);
             }
             echo '</div>';
         }
     }
 }
Example #2
0
 public static function detect($update = TRUE)
 {
     $DW =& $GLOBALS['DW'];
     $DW->wpml = FALSE;
     if (defined('ICL_PLUGIN_PATH') && file_exists(ICL_PLUGIN_PATH . DW_WPML_API)) {
         self::checkOverrule('DW_WPML');
         if ($update) {
             $DW->wpml = TRUE;
         }
         self::$icon = '<img src="' . $DW->plugin_url . DW_WPML_ICON . '" alt="WMPL" title="Dynamic Widgets syncs with other languages of these pages via WPML" style="position:relative;top:2px;" />';
         return TRUE;
     }
     return FALSE;
 }
Example #3
0
     }
     break;
 case 'author':
     if (count($act) > 0 && is_author($act)) {
         $display = $other;
         $DW->message('Exception triggered for ' . $widget_id . ' sets display to ' . $e . ' (rule EA1)');
     }
     break;
 case 'category':
     if (count($act) > 0) {
         $act_cat = array();
         $act_childs = array();
         $id = get_query_var('cat');
         $DW->message('CatID: ' . $id);
         if (DW_WPML::detect(FALSE)) {
             $id = DW_WPML::getID($id, 'tax_category');
             $DW->message('WPML ObjectID: ' . $id);
         }
         foreach ($opt as $condition) {
             if ($condition->name != 'default') {
                 switch ($condition->maintype) {
                     case 'category':
                         $act_cat[] = $condition->name;
                         break;
                     case 'category-childs':
                         $act_childs[] = $condition->name;
                         break;
                 }
             }
         }
         if (in_array($id, $act_cat)) {
 public static function prtTax($widget_id, $tax, $terms, $terms_act, $terms_childs_act, $prefix)
 {
     $DW =& $GLOBALS['DW'];
     // foreach ( $terms as $pid => $childs ) {
     foreach ($terms as $term) {
         $run = TRUE;
         /*				if ( $DW->wpml ) {
         					include_once(DW_MODULES . 'wpml_module.php');
         					$wpml_id = DW_WPML::getID($pid, 'tax_' . $tax);
         					if ( $wpml_id > 0 && $wpml_id <> $pid ) {
         						$run = FALSE;
         					}
         				} */
         if ($DW->wpml) {
             include_once DW_MODULES . 'wpml_module.php';
             $wpml_id = DW_WPML::getID($term->term_id, 'tax_' . $tax);
             if ($wpml_id > 0 && $wpml_id != $term->term_id) {
                 $run = FALSE;
             }
         }
         if ($run) {
             // $term = get_term_by('id', $pid, $tax);
             echo '<div style="position:relative;left:15px;">';
             echo '<input type="checkbox" id="' . $prefix . '_act_' . $term->term_id . '" name="' . $prefix . '_chkbx[]" value="' . $term->term_id . '" ' . (isset($terms_act) && count($terms_act) > 0 && in_array($term->term_id, $terms_act) ? 'checked="checked"' : '') . ' onchange="chkChild(\'' . $prefix . '\', ' . $term->term_id . ')" /> <label for="' . $prefix . '_act_' . $term->term_id . '">' . $term->name . '</label>';
             echo $terms_childs_act !== FALSE ? ' <span title=" Click to expand " onclick="term_tree(\'' . $widget_id . '\', \'' . $tax . '\', ' . $term->term_id . ', \'' . $prefix . '\');return false;"><img src="' . $DW->plugin_url . '/img/arrow-down.png" /></span>' : '';
             echo '<br />';
             if ($terms_childs_act !== FALSE) {
                 echo '<div id="child_' . $prefix . $term->term_id . '" style="position:relative;left:15px;display:none;">';
                 echo '<input type="checkbox" id="' . $prefix . '_childs_act_' . $term->term_id . '" name="' . $prefix . '_childs_chkbx[]" value="' . $term->term_id . '" ' . (isset($terms_childs_act) && count($terms_childs_act) > 0 && in_array($term->term_id, $terms_childs_act) ? 'checked="checked"' : '') . ' onchange="chkParent(\'' . $prefix . '\', ' . $term->term_id . ')" /> <label for="' . $prefix . '_childs_act_' . $term->term_id . '"><em>' . __('All childs', DW_L10N_DOMAIN) . '</em></label><br />';
                 echo '<div id="tree_' . $prefix . $term->term_id . '"></div>';
                 echo '</div>';
                 /* if ( count($childs) > 0 ) {
                 				self::prtTax($tax, $childs, $terms_act, $terms_childs_act, $prefix);
                 			} */
             }
             echo '</div>';
         }
     }
 }
 /**
  * dynWid::registerOverrulers() Overrule module regsitering
  *
  */
 public function registerOverrulers()
 {
     include_once DW_MODULES . 'browser_module.php';
     include_once DW_MODULES . 'date_module.php';
     include_once DW_MODULES . 'day_module.php';
     include_once DW_MODULES . 'week_module.php';
     include_once DW_MODULES . 'role_module.php';
     include_once DW_MODULES . 'shortcode_module.php';
     include_once DW_MODULES . 'tpl_module.php';
     include_once DW_MODULES . 'url_module.php';
     include_once DW_MODULES . 'device_module.php';
     include_once DW_MODULES . 'ip_module.php';
     include_once DW_MODULES . 'fimage_module.php';
     DW_Browser::checkOverrule('DW_Browser');
     DW_Date::checkOverrule('DW_Date');
     DW_Day::checkOverrule('DW_Day');
     DW_Week::checkOverrule('DW_Week');
     DW_Role::checkOverrule('DW_Role');
     DW_Shortcode::checkOverrule('DW_Shortcode');
     DW_Tpl::checkOverrule('DW_Tpl');
     DW_URL::checkOverrule('DW_URL');
     DW_Device::checkOverrule('DW_Device');
     DW_IP::checkOverrule('DW_IP');
     DW_Fimage::checkOverrule('DW_Fimage');
     // WPML Plugin Support
     include_once DW_MODULES . 'wpml_module.php';
     DW_WPML::detectLanguage();
     // QT Plugin Support
     // include_once(DW_MODULES . 'qt_module.php');
     // DW_QT::detectLanguage();
 }
<input type="hidden" name="widget_id" value="<?php 
echo $widget_id;
?>
" />
<input type="hidden" id="returnurl" name="returnurl" value="<?php 
echo !empty($return_url) ? trailingslashit(admin_url()) . $return_url : '';
?>
" />

<div id="dynwid">
<?php 
$DW_Role = new DW_Role();
$DW_Role->admin();
$DW_Date = new DW_Date();
$DW_Date->admin();
$DW_WPML = new DW_WPML();
$DW_WPML->admin();
$DW_QT = new DW_QT();
$DW_QT->admin();
$DW_Browser = new DW_Browser();
$DW_Browser->admin();
$DW_Tpl = new DW_Tpl();
$DW_Tpl->admin();
$DW_Front_page = new DW_Front_page();
$DW_Front_page->admin();
$DW_Single = new DW_Single();
$DW_Single->admin();
$DW_Attachment = new DW_Attachment();
$DW_Attachment->admin();
$DW_Page = new DW_Page();
$DW_Page->admin();
 /**
  * dynWid::registerOverrulers() Overrule module regsitering
  *
  */
 public function registerOverrulers()
 {
     include_once DW_MODULES . 'browser_module.php';
     include_once DW_MODULES . 'date_module.php';
     include_once DW_MODULES . 'role_module.php';
     include_once DW_MODULES . 'tpl_module.php';
     DW_Browser::checkOverrule('DW_Browser');
     DW_Date::checkOverrule('DW_Date');
     DW_Role::checkOverrule('DW_Role');
     DW_Tpl::checkOverrule('DW_Tpl');
     // WPML Plugin Support
     include_once DW_MODULES . 'wpml_module.php';
     DW_WPML::detectLanguage();
     // QT Plugin Support
     include_once DW_MODULES . 'qt_module.php';
     DW_QT::detectLanguage();
 }
 public static function prtTax($tax, $terms, $terms_act, $terms_childs_act, $prefix)
 {
     $DW =& $GLOBALS['DW'];
     foreach ($terms as $pid => $childs) {
         $run = TRUE;
         if ($DW->wpml) {
             include_once DW_MODULES . 'wpml_module.php';
             $wpml_id = DW_WPML::getID($pid, 'tax_' . $tax);
             if ($wpml_id > 0 && $wpml_id != $pid) {
                 $run = FALSE;
             }
         }
         if ($run) {
             $term = get_term_by('id', $pid, $tax);
             echo '<div style="position:relative;left:15px;">';
             echo '<input type="checkbox" id="' . $prefix . '_act_' . $pid . '" name="' . $prefix . '_act[]" value="' . $pid . '" ' . (isset($terms_act) && count($terms_act) > 0 && in_array($pid, $terms_act) ? 'checked="checked"' : '') . ' onchange="chkChild(\'' . $prefix . '\', ' . $pid . ')" /> <label for="' . $prefix . '_act_' . $pid . '">' . $term->name . '</label><br />';
             if ($terms_childs_act !== FALSE) {
                 echo '<div style="position:relative;left:15px;">';
                 echo '<input type="checkbox" id="' . $prefix . '_childs_act_' . $pid . '" name="' . $prefix . '_childs_act[]" value="' . $pid . '" ' . (isset($terms_childs_act) && count($terms_childs_act) > 0 && in_array($pid, $terms_childs_act) ? 'checked="checked"' : '') . ' onchange="chkParent(\'' . $prefix . '\', ' . $pid . ')" /> <label for="' . $prefix . '_childs_act_' . $pid . '"><em>' . __('All childs', DW_L10N_DOMAIN) . '</em></label><br />';
                 echo '</div>';
                 if (count($childs) > 0) {
                     self::prtTax($tax, $childs, $terms_act, $terms_childs_act, $prefix);
                 }
             }
             echo '</div>';
         }
     }
 }