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


PHP JControllerForm::allowAdd方法代码示例

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


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

示例1: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	An array of input data.
  *
  * @return	boolean
  */
 protected function allowAdd($data = array())
 {
     $jinput = JFactory::getApplication()->input;
     // Initialise variables.
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', $jinput->getInt('catid'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the data or URL check it.
         $allow = $user->authorise('core.create', 'com_jem.category.' . $categoryId);
     }
     $jemsettings = JEMHelper::config();
     $maintainer = JEMUser::ismaintainer('add');
     $genaccess = JEMUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes);
     $valguest = JEMUser::validate_guest();
     if ($maintainer || $genaccess || $valguest) {
         return true;
     }
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
开发者ID:JKoelman,项目名称:JEM-3,代码行数:32,代码来源:editevent.php

示例2: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $permissions = SibdietHelper::getUserPermissions();
     if (in_array('requests', $permissions) && $this->input->get('return') != 'requestschecks') {
         return parent::allowAdd();
     } else {
         return false;
     }
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:18,代码来源:request.php

示例3: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $permissions = SibdietHelper::getUserPermissions();
     if (in_array('sweeteners', $permissions)) {
         return parent::allowAdd();
     } else {
         return false;
     }
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:18,代码来源:sweetener.php

示例4: allowAdd

 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $allow = null;
     if ($allow === null) {
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:10,代码来源:socialconnect.php

示例5: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param	array $data An array of input data.
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:17,代码来源:currency.php

示例6: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     // Access check.
     $access = JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder');
     if (!$access) {
         return false;
     }
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }
开发者ID:vdm-io,项目名称:Joomla-Component-Builder,代码行数:19,代码来源:site_view.php

示例7: allowAdd

 /**
  * Method to check if you can add a new record.
  * Extended classes can override this if necessary.
  *
  * @param     array      $data    An array of input data.
  *
  * @return    boolean
  */
 protected function allowAdd($data = array())
 {
     if (empty($data)) {
         $context = JRequest::getCmd('filter_context');
         $item_id = JRequest::getUint('filter_item_id');
         if (empty($context) || $item_id == 0) {
             return false;
         }
     }
     return parent::allowAdd($data);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:19,代码来源:comment.php

示例8: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since    1.7.0
  */
 protected function allowAdd($data = [])
 {
     // Initialise variables.
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:20,代码来源:kml.php

示例9: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.0.0
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     // If the category has been passed in the URL check it.
     $allow = $user->authorise('core.create', $this->option . '.discount');
     if ($allow !== null) {
         return $allow;
     }
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }
开发者ID:Shtier,项目名称:digicom,代码行数:20,代码来源:discount.php

示例10: allowAdd

 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $allow = null;
     $allow = $user->authorise('core.create', 'com_phocagallery');
     if ($allow === null) {
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
开发者ID:scarsroga,项目名称:blog-soa,代码行数:11,代码来源:phocagallerym.php

示例11: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	An array of input data.
  *
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = $user->authorise('core.create', 'com_mapfrance');
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
开发者ID:steevo,项目名称:mapfrance,代码行数:20,代码来源:area.php

示例12: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param	array $data An array of input data.
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:19,代码来源:roomtype.php

示例13: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	$data	An array of input data.
  *
  * @return	boolean
  * 
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     // Check create access on the object.
     $result = $user->authorise('core.create', 'com_knvbapi');
     if ($result === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $result;
     }
 }
开发者ID:esorone,项目名称:efcpw,代码行数:20,代码来源:team.php

示例14: allowAdd

 /**
  * Method override to check if you can add a new record.
  *
  * @param    array    $data    An array of input data.
  * @return    boolean
  * @since    1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = null;
     $allow = $user->authorise('core.create', 'com_jdownloads');
     if ($allow === null) {
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:19,代码来源:template.php

示例15: allowAdd

 /**
  * Переопределение метода для проверки,
  * может ли пользователь добавлять запись.
  *
  * @param   array  $data  Массив данных.
  *
  * @return  boolean  True, если разрешено редактировать запись.
  */
 protected function allowAdd($data = array())
 {
     // Получаем значение категории из массива.
     $categoryId = JArrayHelper::getValue($data, 'catid', JFactory::getApplication()->input->getInt('filter_category_id', 0), 'int');
     if ($categoryId) {
         // Проверка добавления на уровне категории.
         return JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
     } else {
         // Проверка добавления на уровне компонента.
         return parent::allowAdd($data);
     }
 }
开发者ID:thebeuving,项目名称:joomla-25-component-example,代码行数:20,代码来源:helloworld.php


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