コード例 #1
0
ファイル: class.field.date.php プロジェクト: volhali/mebel
 function __construct($name, $caption, $time, $begin_year = 1970, $end_year = 2020, $parameters = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "date", $caption, $is_required, $value, $parameters, $help, $help_url);
     if (empty($time)) {
         $this->time = time();
     } else {
         if (is_array($time)) {
             $this->time = mktime($time['hour'], $time['minute'], 0, $time['month'], $time['day'], $time['year']);
         } else {
             $this->time = $time;
         }
     }
     if (!empty($begin_year)) {
         $this->begin_year = $begin_year;
     } else {
         $this->begin_year = 1970;
     }
     if (!empty($end_year)) {
         $this->end_year = $end_year;
     } else {
         $this->end_year = 2020;
     }
 }
コード例 #2
0
ファイル: class.rating.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = false;
     $this->multiLang = false;
     $this->max = 5;
 }
コード例 #3
0
ファイル: class.password.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = false;
     $this->widthField = 4;
     $this->multiLang = false;
 }
コード例 #4
0
ファイル: class.field.file.php プロジェクト: volhali/mebel
 function __construct($name, $caption, $is_required = false, $value, $dir, $prefix = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "file", $caption, $is_required, $value, "", $help, $help_url);
     $this->dir = $dir;
     $this->prefix = $prefix;
     if (!empty($this->value)) {
         // Проверяем, не является ли файл скриптом PHP
         // или Perl, html, если это так преобразуем его в формат .txt
         $extentions = array("#\\.php#is", "#\\.phtml#is", "#\\.php3#is", "#\\.html#is", "#\\.htm#is", "#\\.hta#is", "#\\.pl#is", "#\\.xml#is", "#\\.inc#is", "#\\.shtml#is", "#\\.xht#is", "#\\.xhtml#is");
         // Заменяем русские символы на транслит
         $this->value[$this->name]['name'] = $this->encodestring($this->value[$this->name]['name']);
         // Извлекаем из имени файла расширение
         $path_parts = pathinfo($this->value[$this->name]['name']);
         $ext = "." . $path_parts['extension'];
         $path = basename(date("y_m_d_h_i_") . $this->value[$this->name]['name'], $ext);
         $add = $ext;
         foreach ($extentions as $exten) {
             if (preg_match($exten, $ext)) {
                 $add = ".txt";
             }
         }
         $path .= $add;
         $path = str_replace("//", "/", $dir . "/" . $prefix . $path);
         // Перемещаем файл из временной директории сервера в
         // директорию /files Web-приложения
         if (copy($this->value[$this->name]['tmp_name'], $path)) {
             // Уничтожаем файл во временной директории
             @unlink($this->value[$this->name]['tmp_name']);
             // Изменяем права доступа к файлу
             @chmod($path, 0644);
         }
     }
 }
コード例 #5
0
ファイル: class.file.php プロジェクト: wedesign-pf/code-g
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = true;
     $this->upload = true;
     $this->browse = true;
     $this->showImage = false;
 }
コード例 #6
0
ファイル: class.selectMCols.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = false;
     $this->multiLang = false;
     $this->tags = false;
     $this->selectAll = true;
     $this->filter = false;
 }
コード例 #7
0
ファイル: class.field.text.php プロジェクト: volhali/mebel
 function __construct($name, $caption, $is_required = false, $value = "", $maxlength = 255, $size = 41, $parameters = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "text", $caption, $is_required, $value, $parameters, $help, $help_url);
     // Инициализируем члены класса
     $this->size = $size;
     $this->maxlength = $maxlength;
 }
コード例 #8
0
ファイル: class.field.radio.php プロジェクト: volhali/mebel
 function __construct($name, $caption, $radio = array(), $value, $parameters = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "radio", $caption, false, $value, $parameters, $help, $help_url);
     // Инициализируем члены класса
     if ($this->radio != "radio_rate") {
         $this->radio = $radio;
     }
 }
コード例 #9
0
ファイル: class.editorck.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = true;
     $this->widthField = 8;
     $this->height = 200;
     $this->toolbar = 'Default';
     $this->upload = true;
     $this->type = "CK";
 }
コード例 #10
0
ファイル: class.field.select.php プロジェクト: volhali/mebel
 function __construct($name, $caption, $options = array(), $value, $multi = false, $select_size = 4, $parameters = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "select", $caption, false, $value, $parameters);
     // Инициализируем члены класса
     $this->options = $options;
     $this->multi = $multi;
     $this->select_size = $select_size;
 }
コード例 #11
0
ファイル: class.editortm.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = true;
     $this->widthField = 8;
     $this->toolbar = 'Default';
     $this->upload = true;
     $this->type = "TM";
     $this->disabled = false;
 }
コード例 #12
0
ファイル: class.field.title.php プロジェクト: volhali/mebel
 function __construct($value = "", $h_type = 3, $parameters = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct("", "title", "", false, $value, $parameters, "", "");
     if ($h_type > 0 && $h_type < 7) {
         $this->h_type = $h_type;
     } else {
         $this->h_type = 3;
     }
 }
コード例 #13
0
ファイル: class.mediaFile.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     global $datas_lang;
     $this->type = "file";
     $this->insideForm = false;
     $this->multiLangType = true;
     $this->label = $datas_lang["addmajMedia"];
     $this->fileRequired = true;
     $this->legendeEnabled = true;
 }
コード例 #14
0
ファイル: class.date.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = false;
     $this->multiLang = false;
     $this->rangeDate = false;
     $this->showButtonPanel = true;
     $this->changeYear = false;
     $this->numberOfMonths = 1;
     $this->dateFormat = "dd/mm/yy";
     //http://api.jqueryui.com/datepicker/
 }
コード例 #15
0
 function __construct($name, $caption, $id_required = false, $value = "", $cols = 30, $rows = 10, $disabled = false, $readonly = false, $wrap = false, $parameters = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "textarea", $caption, $id_required, $value, $parameters, $help, $help_url);
     // Инициируем члены класса field_text
     $this->cols = $cols;
     $this->rows = $rows;
     $this->disabled = $disabled;
     $this->readonly = $readonly;
     $this->wrap = $wrap;
 }
コード例 #16
0
ファイル: class.selectM.php プロジェクト: wedesign-pf/Tit
 public function __construct()
 {
     parent::__construct();
     $this->variablesAuthorized = false;
     $this->multiLang = false;
     $this->tags = false;
     $this->selectAll = true;
     $this->multiple = false;
     $this->single = false;
     $this->filter = false;
     $this->isOpen = false;
     $this->keepOpen = false;
     $this->minimumCountSelected = 10;
     $this->countSelected = "# sélectionnés sur % ";
 }
コード例 #17
0
 function __construct($name, $caption, $value = false, $parameters = "", $help = "", $help_url = "")
 {
     // Вызываем конструктор базового класса field для
     // инициализации его данных
     parent::__construct($name, "checkbox", $caption, false, $value, $parameters, $help, $help_url);
     // Инициализируем члены класса
     if ($value == "on") {
         $this->value = true;
     } else {
         if ($value === true) {
             $this->value = true;
         } else {
             $this->value = false;
         }
     }
 }
コード例 #18
0
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     /**
      * The only required item in this array is "type" whose value should be the same as the name of this class.
      * The other items (which differs for each field type) only exists here to make it easier for a developer
      * to check out the class and be remembered of which options a field type has.
      * The easiest way to get these items and values is by using the GUI for ACF
      * to create a field group with an instance of the field type without setting any values on it and then, under
      * Custom Fields - >Tools, generate export code for the field group. From the output of that, you can copy the
      * array and paste it here.
      * Make sure that you remove "key", "label" and "name" form that array.
      * The example array below is taken from [plugins]/fewbricks/lib/acf/fields/google-maps.php, but we have changed
      * the value of "type" to match that of this class.
      */
     $base_settings = ['type' => 'fewbricks_example_field', 'prefix' => '', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'center_lat' => '', 'center_lng' => '', 'zoom' => '', 'height' => ''];
     // This call must be present
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #19
0
ファイル: select.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => ['width' => '', 'class' => '', 'id' => ''], 'choices' => [], 'default_value' => '', 'allow_null' => 1, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #20
0
ファイル: color-picker.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'color_picker', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => ''];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #21
0
ファイル: password.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'password', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'placeholder' => '', 'prepend' => '', 'append' => '', 'readonly' => 0, 'disabled' => 0];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #22
0
ファイル: relationship.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => array(), 'taxonomy' => array(), 'min' => 0, 'max' => 0, 'filters' => array(0 => 'search', 1 => 'post_type', 2 => 'taxonomy'), 'elements' => array(), 'return_format' => 'object'];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #23
0
ファイル: textarea.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'textarea', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => ['width' => '', 'class' => '', 'id' => ''], 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '', 'new_lines' => 'wpautop', 'readonly' => 0, 'disabled' => 0];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #24
0
ファイル: google-map.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'google_map', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'center_lat' => '', 'center_lng' => '', 'zoom' => '', 'height' => ''];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #25
0
ファイル: tab.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'tab', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'placement' => 'top'];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #26
0
ファイル: true-false.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => ['width' => '', 'class' => '', 'id' => ''], 'message' => '', 'default_value' => 0];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #27
0
ファイル: gallery.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'gallery', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'min' => '', 'max' => '', 'preview_size' => 'thumbnail', 'library' => 'all', 'min_width' => '', 'min_height' => '', 'min_size' => '', 'max_width' => '', 'max_height' => '', 'max_size' => '', 'mime_types' => ''];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #28
0
ファイル: file.php プロジェクト: mmjaeger/fewbricks
 /**
  * @param string $label
  * @param string $name
  * @param string $key
  * @param array $custom_settings
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'file', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'return_format' => 'id', 'library' => 'all'];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #29
0
ファイル: radio.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'radio', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'choices' => [], 'other_choice' => 0, 'save_other_choice' => 0, 'default_value' => '', 'layout' => 'vertical'];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }
コード例 #30
0
ファイル: page-link.php プロジェクト: folbert/fewbricks
 /**
  * @param string $label The label that the field will get.
  * @param string $name The name that the field will get.
  * @param string $key The key that the field wil get. It is very important that this value is unique among
  * all the keys across the entire site.
  * @param array $custom_settings Any custom settings that you want to set. A setting must be implemented in the ACF
  * field class for it to have an effect. This array wil be merged with $base_settings in this class and then with
  * the default settings in the ACF field class.
  */
 public function __construct($label, $name, $key, $custom_settings = [])
 {
     $base_settings = ['prefix' => '', 'type' => 'page_link', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => ['width' => '', 'class' => '', 'id' => ''], 'post_type' => '', 'taxonomy' => '', 'allow_null' => 1, 'multiple' => 0];
     parent::__construct($label, $name, $key, $base_settings, $custom_settings);
 }