本文整理汇总了PHP中JModelAdmin::canEditState方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelAdmin::canEditState方法的具体用法?PHP JModelAdmin::canEditState怎么用?PHP JModelAdmin::canEditState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelAdmin
的用法示例。
在下文中一共展示了JModelAdmin::canEditState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canEditState
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
if (!empty($record->catid)) {
return JFactory::getUser()->authorise('core.edit.state', 'com_htraininglogs.category.' . (int) $record->catid);
}
return parent::canEditState($record);
}
示例2: canEditState
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the component.
*
* @since 1.0.0
*/
protected function canEditState($record)
{
if (!empty($record->catid)) {
return JFactory::getUser()->authorise('core.edit.state', 'com_digicom.discount.' . (int) $record->catid);
}
return parent::canEditState($record);
}
示例3: canEditState
/**
* Method to test whether a record can have its state edited.
*
* @param object A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
* @since 1.6
*/
protected function canEditState($record)
{
if (!empty($record->id)) {
return User::authorise('core.edit.state', 'com_menus.item.' . (int) $record->id);
} else {
return parent::canEditState($record);
}
}
示例4: canEditState
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$permissions = SibdietHelper::getUserPermissions();
if (in_array('contags', $permissions)) {
return parent::canEditState($record);
}
return false;
}
示例5: canEditState
protected function canEditState($record)
{
$user = JFactory::getUser();
if ($record->imgid) {
return $user->authorise('core.edit.state', 'com_phocagallery.phocagallerycoimg.' . (int) $record->imgid);
} else {
return parent::canEditState($record);
}
}
示例6: canEditState
protected function canEditState($record)
{
$user = JFactory::getUser();
if (!empty($record->id)) {
return $user->authorise('core.edit.state', 'com_bt_socialconnect.widget.' . (int) $record->id);
} else {
return parent::canEditState('com_bt_socialconnect');
}
}
示例7: canEditState
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
if (!empty($record->id)) {
return $user->authorise('core.edit.state', 'com_azurapagebuilder.page.' . (int) $record->id);
} else {
return parent::canEditState($record);
}
}
示例8: canEditState
protected function canEditState($record)
{
$user = JFactory::getUser();
/*if (!empty($record->catid)) {
return $user->authorise('core.edit.state', 'com_phocagallery.phocagalleryuser');
} else {*/
return parent::canEditState($record);
//}
}
示例9: canEditState
/**
* Method to test whether a record can have its state changed.
*
* @param object A record object.
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
if (!empty($record->catid)) {
return $user->authorise('core.edit.state', 'com_faqs.category.' . (int) $record->catid);
} else {
return parent::canEditState($record);
}
}
示例10: canEditState
/**
* Method to test whether a record can have its state changed.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
// Check against the category.
if (!empty($record->catid)) {
return $user->authorise('core.edit.state', 'com_jnt_hanhphuc.category.' . (int) $record->catid);
} else {
return parent::canEditState($record);
}
}
示例11: canEditState
protected function canEditState($record)
{
$user = JFactory::getUser();
if (!empty($record->id)) {
return $user->authorise('core.edit.state', 'com_judirectory.field.' . $record->id);
} elseif (!empty($record->group_id)) {
return $user->authorise('core.edit.state', 'com_judirectory.fieldgroup.' . (int) $record->group_id);
} else {
return parent::canEditState($record);
}
}
示例12: canEditState
/**
* Method to test whether a record can be deleted.
*
* @param JForm $record a record object.
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*/
protected function canEditState($record)
{
if (!empty($record)) {
if ($record instanceof JForm) {
return JoomDOCAccessDocument::editState($record->getValue('id'), $record->getValue('checked_out'), $record->getValue('path'));
} else {
return JoomDOCAccessDocument::editState($record->id, $record->checked_out, $record->path);
}
}
return parent::canEditState($record);
}
示例13: canEditState
/**
* Method to test whether a record state can be changed.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the component.
*
* @since 11.1
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
$fid = JFactory::getApplication()->input->getInt('fid', -1);
// Check form settings.
if ($fid != -1) {
return $user->authorise('core.edit.state', 'com_visforms.visform.' . (int) $fid);
} else {
return parent::canEditState($record);
}
}
示例14: canEditState
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
// Check for existing article.
if (!empty($record->id)) {
return $user->authorise('core.edit.state', 'com_content.article.' . (int) $record->id);
} else {
if (!empty($record->catid)) {
return $user->authorise('core.edit.state', 'com_content.category.' . (int) $record->catid);
} else {
return parent::canEditState($record);
}
}
}
示例15: canEditState
/**
* Method to test whether a record can have its state changed.
*
* @param
* object A record object.
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
if (!empty($record->catid)) {
$canEditState = $user->authorise('core.edit.state', 'com_edashboard.category.' . (int) $record->catid);
} else {
$canEditState = parent::canEditState($record);
}
// ABP: Additional check on pub dates: deny if published, only superadmin can change
if ($canEditState && !$user->authorise('core.admin') && $record->id) {
$item = $this->getItem($record->id);
$canEditState = !$this->isPublished($item);
}
return $canEditState;
}