Exemple #1
0
 /**
  * contruct a list settings in backend
  * @param array $args : 
   - name : required  option name
   - id
   - title
   - form param array contain form args
  * @param $template 
  	- template the item template path  (php render)
  	- js_template js item template path (for js app)
  	- form The form use to submit an item (php render)
  	- form_js The js form template use to edit an item  (for js app)
  * @param $data  pack list data
  * @package AE
  * @version 1.0
 */
 function __construct($args = array(), $template = array(), $data)
 {
     $this->data = $data;
     $this->params = $args;
     if (!empty($template)) {
         $this->template = locate_template($template['template']);
         $this->js_template = locate_template($template['js_template']);
         $this->form_template = locate_template($template['form']);
         $this->form_js_template = locate_template($template['form_js']);
     } else {
         $this->template = ae_get_path() . '/template/post-item.php';
         $this->js_template = ae_get_path() . '/template-js/post-item.php';
         $this->form_template = ae_get_path() . '/template/add-pack-form.php';
         $this->form_js_template = ae_get_path() . '/template-js/add-pack-form.php';
     }
 }
Exemple #2
0
 /**
  * contruct a list settings in backend
  * @param array $args : 
   - name : required  option name
   - id
   - title
   - form param array contain form args
  * @param $template 
  	- template the item template path  (php render)
  	- js_template js item template path (for js app)
  	- form The form use to submit an item (php render)
  	- form_js The js form template use to edit an item  (for js app)
  * @param $data  pack list data
  * @package AE
  * @version 1.0
 */
 function __construct($args = array(), $template = array(), $data)
 {
     $this->data = $data->{$args}['name'];
     $this->params = $args;
     if (!empty($template)) {
         $this->template = $template['template'];
         $this->js_template = $template['js_template'];
         $this->form_template = $template['form'];
         $this->form_js_template = $template['form_js'];
     } else {
         $this->template = ae_get_path() . '/template/category.php';
         $this->js_template = ae_get_path() . '/template-js/cat-item.php';
         $this->form_js_template = ae_get_path() . '/template-js/cat-item-form.php';
     }
     // call AJAX class
     //new AE_CategoryAjax( new AE_Category( array('taxonomy' => $this->params['taxonomy']) ) );
 }
 /**
 * contruct a list settings in backend
 * @param array $args :
 - name : required  option name
 - id
 - title
 - form param array contain form args
 * @param $template
 - template the item template path  (php render)
 - js_template js item template path (for js app)
 - form The form use to submit an item (php render)
 - form_js The js form template use to edit an item  (for js app)
 * @param $data  pack list data
 * @package AE
 * @version 1.0
 */
 function __construct($args = array(), $template = array(), $data)
 {
     $this->data = $data;
     $this->params = $args;
     if (!isset($this->params['custom_field']) || !$this->params['custom_field']) {
         $this->params['custom_field'] = 'meta';
     }
     if (!empty($template)) {
         $this->template = $template['template'];
         $this->js_template = $template['js_template'];
         $this->form_template = $template['form'];
         $this->form_js_template = $template['form_js'];
     } else {
         $this->template = ae_get_path() . '/template/post-item.php';
         $this->js_template = ae_get_path() . '/template-js/post-item.php';
         $this->form_template = ae_get_path() . '/template/add-pack-form.php';
         $this->form_js_template = ae_get_path() . '/template-js/add-pack-form.php';
     }
 }
 function ae_get_template_part($slug, $name)
 {
     $template = '';
     // Look in yourtheme/slug-name.php and yourtheme/woocommerce/slug-name.php
     if ($name) {
         $template = locate_template(array("/includes/aecore/template/{$slug}-{$name}.php", "{$slug}-{$name}.php"));
     }
     // Get default slug-name.php
     if (!$template && $name && file_exists(ae_get_path() . "/template/{$slug}-{$name}.php")) {
         $template = ae_get_path() . "/template/{$slug}-{$name}.php";
     }
     // If template file doesn't exist, look in yourtheme/slug.php and yourtheme/woocommerce/slug.php
     if (!$template) {
         $template = locate_template(array("{$slug}.php", ae_get_path() . "{$slug}.php"));
     }
     // Allow 3rd party plugin filter template file from their plugin
     $template = apply_filters('ae_get_template_part', $template, $slug, $name);
     if ($template) {
         load_template($template, false);
     }
 }