當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。