当前位置: 首页>>代码示例>>PHP>>正文


PHP plgFabrik_Element::dataConsideredEmpty方法代码示例

本文整理汇总了PHP中plgFabrik_Element::dataConsideredEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP plgFabrik_Element::dataConsideredEmpty方法的具体用法?PHP plgFabrik_Element::dataConsideredEmpty怎么用?PHP plgFabrik_Element::dataConsideredEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plgFabrik_Element的用法示例。


在下文中一共展示了plgFabrik_Element::dataConsideredEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dataConsideredEmpty

 /**
  * used in notempty validation rule
  */
 function dataConsideredEmpty($data, $repeatCounter)
 {
     if ((int) JRequest::getVar('rowid', 0) !== 0) {
         if (JRequest::getVar('task') == '') {
             return parent::dataConsideredEmpty($data, $repeatCounter);
         }
         $olddaata = JArrayHelper::getValue($this->getFormModel()->_origData, $repeatCounter);
         if (!is_null($olddaata)) {
             $name = $this->getFullName(false, true, false);
             $r = JArrayHelper::getValue(JArrayHelper::fromObject($olddaata), $name, '') === '' ? true : false;
             if (!$r) {
                 //if an original value is found then data not empty - if not found continue to check the $_FILES array to see if one
                 // has been uploaded
                 return false;
             }
         }
     }
     $groupModel = $this->getGroup();
     if ($groupModel->isJoin()) {
         $name = $this->getFullName(false, true, false);
         $joinid = $groupModel->getGroup()->join_id;
         $joindata = JRequest::getVar('join', '', 'files', 'array', array());
         if (!array_key_exists('name', $joindata)) {
             return true;
         }
         $file = (array) $joindata['name'][$joinid][$name];
         return JArrayHelper::getValue($file, $repeatCounter, '') == '' ? true : false;
     } else {
         if ($this->isJoin()) {
             $join = $this->getJoinModel()->getJoin();
             $joinid = $join->id;
             $joindata = JRequest::getVar('join', '', 'post', 'array', array());
             $joindata = JArrayHelper::getValue($joindata, $joinid, array());
             $name = $this->getFullName(false, true, false);
             $joindata = JArrayHelper::getValue($joindata, $name, array());
             $joinids = JArrayHelper::getValue($joindata, 'id', array());
             return empty($joinids) ? true : false;
         } else {
             $name = $this->getFullName(true, true, false);
             $file = JRequest::getVar($name, '', 'files', 'array', array());
             if ($groupModel->canRepeat()) {
                 return JArrayHelper::getValue($file['name'], $repeatCounter, '') == '' ? true : false;
             }
         }
     }
     if (!array_key_exists('name', $file)) {
         $file = JRequest::getVar($name);
         return $file == '' ? true : false;
         //ajax test - nothing in files
     }
     // no files selected?
     return $file['name'] == '' ? true : false;
 }
开发者ID:romuland,项目名称:khparts,代码行数:56,代码来源:fileupload.php

示例2: dataConsideredEmpty

 /**
  * used in notempty validation rule
  */
 function dataConsideredEmpty($data, $repeatCounter)
 {
     if ((int) JRequest::getVar('rowid', 0) != 0) {
         if (JRequest::getVar('task') == '') {
             return parent::dataConsideredEmpty($data, $repeatCounter);
         }
         // editing an existing record so consider that the file was tested and added for
         // when the original record was added. (cant test $_FILES on edit)
         return false;
     }
     $groupModel = $this->getGroup();
     if ($groupModel->isJoin()) {
         $name = $this->getFullName(false, true, false);
         $joinid = $groupModel->getGroup()->join_id;
         $joindata = JRequest::getVar('join', '', 'files', 'array', array());
         if (!array_key_exists('name', $joindata)) {
             return true;
         }
         $file = (array) $joindata['name'][$joinid][$name];
         return JArrayHelper::getValue($file, $repeatCounter, '') == '' ? true : false;
     } else {
         $name = $this->getFullName(true, true, false);
         $file = JRequest::getVar($name, '', 'files', 'array', array());
         if ($groupModel->canRepeat()) {
             return JArrayHelper::getValue($file['name'], $repeatCounter, '') == '' ? true : false;
         }
     }
     if (!array_key_exists('name', $file)) {
         $file = JRequest::getVar($name);
         return $file == '' ? true : false;
         //ajax test - nothing in files
     }
     // no files selected?
     return $file['name'] == '' ? true : false;
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:38,代码来源:fileupload.php


注:本文中的plgFabrik_Element::dataConsideredEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。