Exemplo n.º 1
0
 function __construct()
 {
     $this->name = "Range Slider";
     $this->hasData = true;
     $this->needsDataType = false;
     //should always take integer
     $this->overrideDataType = 'integer';
     $this->adminCanMakeRequired = true;
     $this->alwaysValideInputs = false;
     //no validation required
     parent::formulizeformulize();
 }
 function __construct()
 {
     $this->name = "Custom Table of existing elements (place BEFORE the elements it contains)";
     $this->hasData = false;
     // set to false if this is a non-data element, like the subform or the grid
     $this->needsDataType = false;
     // set to false if you're going force a specific datatype for this element using the overrideDataType
     $this->overrideDataType = "";
     // use this to set a datatype for the database if you need the element to always have one (like 'date').  set needsDataType to false if you use this.
     $this->adminCanMakeRequired = false;
     // set to true if the webmaster should be able to toggle this element as required/not required
     $this->alwaysValidateInputs = false;
     // set to true if you want your custom validation function to always be run.  This will override any required setting that the webmaster might have set, so the recommendation is to set adminCanMakeRequired to false when this is set to true.
     parent::formulizeformulize();
 }
Exemplo n.º 3
0
 function &getObjects($criteria = null, $id_form, $id_as_key = false)
 {
     $ret = array();
     $limit = $start = 0;
     //		awareness of $criteria added, Sept 1 2005, jwe
     //		removal of ele_display=1 from next line and addition of the renderWhere line in the conditional below
     $sql = 'SELECT * FROM ' . formulize_TABLE . ' WHERE id_form=' . $id_form;
     if (isset($criteria)) {
         $sql .= $criteria->render() ? ' AND (' . $criteria->render() . ')' : '';
         if ($criteria->getSort() != '') {
             $criteriaByClause = ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
         }
         $limit = $criteria->getLimit();
         $start = $criteria->getStart();
     }
     if (!isset($criteriaByClause)) {
         $sql .= " ORDER BY ele_order ASC";
     } else {
         $sql .= $criteriaByClause;
     }
     $result = $this->db->query($sql, $limit, $start);
     if (!$result) {
         return false;
     }
     while ($myrow = $this->db->fetchArray($result)) {
         // instantiate the right kind of element, depending on the type
         $ele_type = $myrow['ele_type'];
         if (file_exists(XOOPS_ROOT_PATH . "/modules/formulize/class/" . $ele_type . "Element.php")) {
             $customTypeHandler = xoops_getmodulehandler($ele_type . "Element", 'formulize');
             $elements = $customTypeHandler->create();
         } else {
             $elements = new formulizeformulize();
         }
         $elements->assignVars($myrow);
         $elements->isLinked = false;
         $ele_type = $elements->getVar('ele_type');
         if ($ele_type == "select") {
             $ele_value = $elements->getVar('ele_value');
             if (!is_array($ele_value[2])) {
                 $elements->isLinked = strstr($ele_value[2], "#*=:*") ? true : false;
             }
         }
         if ($ele_type == "text" or $ele_type == "textarea" or $ele_type == "select" or $ele_type == "radio" or $ele_type == "checkbox" or $ele_type == "date" or $ele_type == "colorpick" or $ele_type == "yn" or $ele_type == "derived") {
             $elements->hasData = true;
         }
         if ($id_as_key === true or $id_as_key == "element_id") {
             $ret[$myrow['ele_id']] =& $elements;
         } elseif ($id_as_key == "handle") {
             $ret[$myrow['ele_handle']] =& $elements;
         } else {
             $ret[] =& $elements;
         }
         unset($elements);
     }
     return $ret;
 }