本文整理汇总了PHP中JemHelper::dissolve_recurrence方法的典型用法代码示例。如果您正苦于以下问题:PHP JemHelper::dissolve_recurrence方法的具体用法?PHP JemHelper::dissolve_recurrence怎么用?PHP JemHelper::dissolve_recurrence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JemHelper
的用法示例。
在下文中一共展示了JemHelper::dissolve_recurrence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onContentAfterDelete
/**
* Dissolve recurrence sets where deleted event is referred to as first.
*
* @param string The context for the content passed to the plugin.
* @param object The data relating to the content that was deleted.
* @since 1.9.6
*/
public function onContentAfterDelete($context, $data)
{
// Skip plugin if we are deleting something other than events
if (($context != 'com_jem.event') || empty($data->id)) {
return;
}
// event maybe first of recurrence set -> dissolve complete set
JemHelper::dissolve_recurrence($data->id);
return;
}
示例2: save
/**
* Method to save the form data.
*
* @param $data array
*/
public function save($data)
{
// Variables
$date = JFactory::getDate();
$app = JFactory::getApplication();
$jinput = $app->input;
$jemsettings = JEMHelper::config();
$fileFilter = new JInput($_FILES);
$table = $this->getTable();
// Check if we're in the front or back
$backend = (bool)$app->isAdmin();
$new = (bool)empty($data['id']);
// Variables
$cats = $jinput->get('cid', array(), 'array');
$recurrencenumber = $jinput->get('recurrence_number', '', 'int');
$recurrencebyday = $jinput->get('recurrence_byday', '', 'string');
$metakeywords = $jinput->get('meta_keywords', '', '');
$metadescription = $jinput->get('meta_description', '', '');
$task = $jinput->get('task', '', 'cmd');
// event maybe first of recurrence set -> dissolve complete set
if (JemHelper::dissolve_recurrence($data['id'])) {
$this->cleanCache();
}
if ($data['dates'] == null || $data['recurrence_type'] == '0')
{
$data['recurrence_number'] = '';
$data['recurrence_byday'] = '';
$data['recurrence_counter'] = '';
$data['recurrence_type'] = '';
$data['recurrence_limit'] = '';
$data['recurrence_limit_date'] = '';
$data['recurrence_first_id'] = '';
} else {
if (!$new) {
// edited event maybe part of a recurrence set
// -> drop event from set
$data['recurrence_first_id'] = '';
$data['recurrence_counter'] = '';
}
$data['recurrence_number'] = $recurrencenumber;
$data['recurrence_byday'] = $recurrencebyday;
}
$data['meta_keywords'] = $metakeywords;
$data['meta_description'] = $metadescription;
// Store IP of author only.
if ($new) {
$author_ip = $jinput->get('author_ip', '', 'string');
$data['author_ip'] = $author_ip;
}
// Store as copy - reset creation date, modification fields, hit counter, version
if ($task == 'save2copy') {
unset($data['created']);
unset($data['modified']);
unset($data['modified_by']);
unset($data['version']);
unset($data['hits']);
}
// Save the event
$saved = parent::save($data);
if ($saved) {
// At this point we do have an id.
$pk = $this->getState($this->getName() . '.id');
if (isset($data['featured'])) {
$this->featured($pk, $data['featured']);
}
// attachments, new ones first
$attachments = array();
$attachments = $fileFilter->get('attach', array(), 'array');
$attachments['customname'] = $jinput->post->get('attach-name', array(), 'array');
$attachments['description'] = $jinput->post->get('attach-desc', array(), 'array');
$attachments['access'] = $jinput->post->get('attach-access', array(), 'array');
JEMAttachment::postUpload($attachments, 'event' . $pk);
// and update old ones
$old = array();
$old['id'] = $jinput->post->get('attached-id', array(), 'array');
$old['name'] = $jinput->post->get('attached-name', array(), 'array');
$old['description'] = $jinput->post->get('attached-desc', array(), 'array');
$old['access'] = $jinput->post->get('attached-access', array(), 'array');
foreach ($old['id'] as $k => $id) {
$attach = array();
$attach['id'] = $id;
//.........这里部分代码省略.........