本文整理汇总了PHP中JControllerForm::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerForm::edit方法的具体用法?PHP JControllerForm::edit怎么用?PHP JControllerForm::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerForm
的用法示例。
在下文中一共展示了JControllerForm::edit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Edit document.
*/
public function edit($key = null, $urlVar = null)
{
if (JFactory::getApplication()->isSite()) {
JRequest::setVar('id', $this->getModel()->searchIdByPath(JoomDOCRequest::getPath()), 'post');
}
parent::edit();
}
示例2: q1edit
/**
* Method to edit an existing record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return Boolean True if access level check and checkout passes, false otherwise.
*/
public function q1edit($key = null, $urlVar = 'sub_id')
{
$result = false;
$Itemid = JRequest::getInt('Itemid');
$result = parent::edit($key, $urlVar);
$this->getModel()->checkIn(JRequest::getInt($urlVar));
return $result;
}
示例3: edit
public function edit($key = null, $urlVar = 'sub_id')
{
$result = parent::edit($key, $urlVar);
if (!$result) {
// $this->setRedirect($this->getReturnPage());
}
return $result;
}
示例4: edit
function edit($key = NULL, $urlVar = NULL)
{
$cid = JRequest::getVar('cid', array(), 'get', 'array');
if (count($cid)) {
JRequest::setVar('cid', $cid, 'post', 'array');
}
parent::edit();
}
示例5: edit
public function edit($key = null, $urlVar = null)
{
$canDo = JvrelativesHelper::getActions();
if (!$canDo->get('core.admin')) {
$this->setMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_jvrelatives&view=jvrelatives', false));
return false;
}
return parent::edit($key, $urlVar);
}
示例6: edit
public function edit($key = null, $urlVar = null)
{
$app = JFactory::getApplication();
$result = parent::edit();
if ($result) {
$app->setUserState('com_heartcare.edit.waves.type', null);
$app->setUserState('com_heartcare.edit.waves.link', null);
}
return $result;
}
示例7: edit
/**
* Extend parent edit to check if the new image has a item defined
*/
public function edit($key = null, $urlVar = null)
{
// check item
$id = JRequest::getInt('id', 0);
$filters = JFactory::getApplication()->getUserState('com_jkit.images.filter');
$item = $filters['item'];
if (!$id && !$item) {
$this->setRedirect(JRoute::_('index.php?option=com_jkit&view=images', false), JText::_('COM_JKIT_IMAGE_SELECT_ITEM'), 'notice');
return;
}
parent::edit($key = null, $urlVar = null);
}
示例8: edit
/**
* Method to edit an existing menu item.
*
* @return void
* @since 1.6
*/
public function edit($key = null, $urlVar = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$result = parent::edit();
if ($result) {
// Push the new ancillary data into the session.
$app->setUserState('com_menus.edit.adminitem.type', null);
$app->setUserState('com_menus.edit.adminitem.link', null);
}
return true;
}
示例9: edit
/**
* Extend parent edit to check if the new room has a hotel defined
*/
public function edit($key = null, $urlVar = null)
{
// check hotel
$id = JRequest::getInt('id', 0);
$filters = JFactory::getApplication()->getUserState('com_chpanel.rooms.filter');
$hotel = $filters['hotel'];
if (!$id && !$hotel) {
$this->setRedirect(JRoute::_('index.php?option=com_chpanel&view=rooms', false), JText::_('COM_CHPANEL_ANY_ERROR_SELECT_HOTEL'), 'notice');
return;
}
parent::edit($key = null, $urlVar = null);
}
示例10: editRatePrices
public function editRatePrices($key = null, $urlVar = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$result = parent::edit();
$recordId = JRequest::getInt('room_id');
$rateId = JRequest::getInt('rate_id');
// Save the data in the session.
$app->setUserState('com_jhotelreservation.edit.room.roomid', $recordId);
// Redirect back to the edit screen.
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=roomrateprices&layout=edit&rate_id=' . $rateId, false));
return true;
}
示例11: edit
public function edit($key = null, $url_var = null)
{
if (!JSession::checkToken('get') and !JSession::checkToken('post')) {
jexit(JText::_('JINVALID_TOKEN'));
}
$rights = AimySitemapRightsHelper::getRights();
if (!$rights->get('core.edit')) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_aimysitemap&view=urls', false));
return false;
}
return parent::edit($key, $url_var);
}
示例12: edit
public function edit($key = null, $urlVar = null)
{
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), 'array');
$recordId = count($cid) ? $cid[0] : 0;
$parts = explode(',', $recordId);
if (count($parts) == 2) {
$cid = $parts[1];
$user_id = $parts[0];
$app->input->set('user_id', $user_id);
$app->input->set('cid', array($cid));
$app->input->post->set('cid', array($cid));
$app->input->set('cid', array($cid));
@JRequest::setVar('cid', array($cid), 'post');
@JRequest::setVar('user_id', $user_id, 'post');
if (!$cid) {
return $this->add();
}
}
return parent::edit($key, $urlVar);
}
示例13: edit
/**
* Method to edit an existing record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key
* (sometimes required to avoid router collisions).
*
* @since 3.1
*
* @return boolean True if access level check and checkout passes, false otherwise.
*/
public function edit($key = null, $urlVar = null)
{
$this->option = 'com_fabrik';
return parent::edit($key, $urlVar);
}
示例14: edit
public function edit($key = null, $urlVar = null)
{
$model = $this->getModel();
$table = $model->getTable();
$cid = $this->input->post->get('cid', array(), 'array');
$context = "{$this->option}.edit.{$this->context}";
// Determine the name of the primary key for the data.
if (empty($key)) {
$key = $table->getKeyName();
}
// To avoid data collisions the urlVar may be different from the primary key.
if (empty($urlVar)) {
$urlVar = $key;
}
// Get the previous record id (if any) and the current record id.
$recordId = (int) (count($cid) ? $cid[0] : $this->input->getInt($urlVar));
$app = JFactory::getApplication('administration');
$app->setUserState('message.id', (int) $recordId);
parent::edit($key, $urlVar);
}
示例15: edit
public function edit($key = 'id', $urlVar = 'id')
{
if (!$this->allowEdit(null, 'id')) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
$return = 'index.php?option=com_smfaq&task=edit.edit&id=' . JRequest::getInt('id') . '&catid=' . JRequest::getInt('catid');
$this->setRedirect(JRoute::_('index.php?option=com_users&task=login&return=' . base64_encode($return)));
return false;
}
parent::edit($key, $urlVar);
}