本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例4: allowAdd
protected function allowAdd($data = array())
{
$user = JFactory::getUser();
$allow = null;
if ($allow === null) {
return parent::allowAdd();
} else {
return $allow;
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}