/**
  * render current pagenavi skin
  * @param $html
  */
 public static function render_pagination_skin($html = '')
 {
     //get hoangweb scb options
     $options = HWPageNavi_Core::getOptions()->get();
     //$options = PageNavi_Core::$options->get();    //other way
     if (isset($options['hw_skin']['hwskin_config']) && isset($options['hw_skin']['hash_skin'])) {
         #$skin = HW_SKIN::resume_skin($options['hw_skin']['hwskin_config']);
         $skin = HW_SKIN::resume_hwskin_instance($options['hw_skin']);
         if (!empty($skin)) {
             $file = $skin->instance->get_skin_file($options['hw_skin']['hash_skin']);
             if (file_exists($file)) {
                 $theme_setting = $skin->instance->get_file_skin_setting();
                 //extract theme setting from skin
                 //load theme setting
                 if (file_exists($theme_setting)) {
                     include $theme_setting;
                 }
                 //custom wp_pagenavi output by skin
                 $html = hw_paginav_output($file, $html);
                 //valid theme setting
                 /*if(!isset($theme['styles']) || !is_array($theme['styles'])) $theme['styles'] = array();
                                     if(!isset($theme['scripts']) || !is_array($theme['scripts'])) $theme['scripts'] = array();
                 
                                     if(count($theme['styles']) || count($theme['scripts'])) {
                                         //put css within head tag
                                         $skin->instance->enqueue_files_from_skin($theme['styles'], $theme['scripts']);
                                     }*/
                 $skin_assets = array('skin_file' => $file);
                 if (isset($theme)) {
                     $skin_assets['theme_settings'] = $theme;
                 }
                 HW_SKIN::enqueue_skin_assets(array_merge($skin_assets, (array) $skin));
                 return isset($theme) && is_array($theme) ? $theme : array();
             }
         }
     }
 }
Example #2
0
 /**
  * render scb hw_skin field type
  * @param $value
  * @param $field
  */
 public function pagination_skin_scb_field($value, $field)
 {
     if (!$this->skin) {
         return;
     }
     //get hoangweb scb options
     $options = HWPageNavi_Core::getOptions()->get();
     //get hw_skin config
     if (empty($options['hw_skin_config'])) {
         $hwskin_config = $this->skin->get_config(true);
     } else {
         $hwskin_config = $options['hw_skin_config'];
     }
     //skin condition
     $skin_condition = isset($options['hw_skin_condition']) ? $options['hw_skin_condition'] : '';
     #$out = $this->skin->get_skins_select_tag('hw_skin',$value,array('name' => "hw_skin[hash_skin]",'class'=>'hw-skin-selector'),false);
     //get skin config
     #$out .= '<input type="hidden" name="hw_skin_config" id="hw_skin_config" value="'.$hwskin_config.'"/>';
     $out = $this->skin->create_total_skin_selector('hw_skin', $value, array(), array('show_main_skin' => 1, 'show_config_field' => 1, 'show_condition_field' => 1, 'show_skin_options' => 1));
     $out .= '<em>' . $field->desc . '</em>';
     return $out;
 }