本文整理汇总了PHP中flexicontent_html::get_system_messages_html方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html::get_system_messages_html方法的具体用法?PHP flexicontent_html::get_system_messages_html怎么用?PHP flexicontent_html::get_system_messages_html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flexicontent_html
的用法示例。
在下文中一共展示了flexicontent_html::get_system_messages_html方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save($key = NULL, $urlVar = NULL)
{
parent::save();
if (JRequest::getVar('fc_doajax_submit')) {
JFactory::getApplication()->enqueueMessage(JText::_('FLEXI_ITEM_SAVED'), 'message');
echo flexicontent_html::get_system_messages_html();
exit;
// Ajax submit, do not rerender the view
}
}
示例2: save
//.........这里部分代码省略.........
} else {
if ($model->get('catid')) {
$data['catid'] = $model->get('catid');
}
}
}
// **************************
// Basic Form data validation
// **************************
// Get the JForm object, but do not pass any data we only want the form object,
// in order to validate the data and not create a filled-in form
$form = $model->getForm();
// Validate Form data for core fields and for parameters
$post = $model->validate($form, $data);
// Check for validation error
if (!$post) {
// Get the validation messages and push up to three validation messages out to the user
$errors = $form->getErrors();
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
$app->enqueueMessage($errors[$i] instanceof Exception ? $errors[$i]->getMessage() : $errors[$i], 'error');
}
// Set POST form date into the session, so that they get reloaded
$app->setUserState($form->option . '.edit.' . $form->context . '.data', $data);
// Save the jform data in the session
$app->setUserState($form->option . '.edit.' . $form->context . '.custom', $custom);
// Save the custom fields data in the session
$app->setUserState($form->option . '.edit.' . $form->context . '.jfdata', $jfdata);
// Save the falang translations into the session
$app->setUserState($form->option . '.edit.' . $form->context . '.unique_tmp_itemid', $unique_tmp_itemid);
// Save temporary unique item id into the session
// Redirect back to the item form
$this->setRedirect($_SERVER['HTTP_REFERER']);
if (JRequest::getVar('fc_doajax_submit')) {
echo flexicontent_html::get_system_messages_html();
exit;
// Ajax submit, do not rerender the view
}
return false;
//die('error');
}
// Some values need to be assigned after validation
$post['attribs'] = @$data['attribs'];
// Workaround for item's template parameters being clear by validation since they are not present in item.xml
$post['custom'] =& $custom;
// Assign array of custom field values, they are in the 'custom' form array instead of jform
$post['jfdata'] =& $jfdata;
// Assign array of Joomfish field values, they are in the 'jfdata' form array instead of jform
// Assign template parameters of the select ilayout as an sub-array (the DB model will handle the merging of parameters)
$ilayout = $data['attribs']['ilayout'];
if (!empty($data['layouts'][$ilayout])) {
//echo "<pre>"; print_r($post['attribs']);
//$post['attribs'] = array_merge($post['attribs'], $data['layouts'][$ilayout]);
$post['attribs']['layouts'] = $data['layouts'];
//echo "<pre>"; print_r($post['attribs']); exit;
}
// USEFULL FOR DEBUGING for J2.5 (do not remove commented code)
//$diff_arr = array_diff_assoc ( $data, $post);
//echo "<pre>"; print_r($diff_arr); jexit();
// Make sure Content ID in the REQUEST is set, this is needed in BACKEND, needed in some cases
// NOTE this is not the same as jform['cid'] which is the category IDs of the Content Item
JRequest::setVar('cid', array($model->getId()), 'post', 'array');
// ********************************************************************************
// PERFORM ACCESS CHECKS, NOTE: we need to check access again, despite having
// checked them on edit form load, because user may have tampered with the form ...
// ********************************************************************************
$itemAccess = $model->getItemAccess();
示例3: savelayoutfile
function savelayoutfile()
{
jimport('joomla.filesystem.file');
$app = JFactory::getApplication();
$user = JFactory::getUser();
$var['sysmssg'] = '';
$var['content'] = '';
// Check for request forgeries
if (!JRequest::checkToken()) {
$app->enqueueMessage('Invalid Token', 'error');
$var['sysmssg'] = flexicontent_html::get_system_messages_html();
echo json_encode($var);
exit;
}
//get vars
$file_contents = $_POST['file_contents'];
$layout_name = JRequest::getVar('layout_name', 'default');
$file_subpath = JRequest::getVar('file_subpath', '');
$layout_name = preg_replace("/\\.\\.\\//", "", $layout_name);
$file_subpath = preg_replace("/\\.\\.\\//", "", $file_subpath);
if (!$layout_name) {
$app->enqueueMessage('Layout name is empty / invalid', 'warning');
}
if (!$file_subpath) {
$app->enqueueMessage('File path is empty / invalid', 'warning');
}
if (!$layout_name || !$file_subpath) {
$var['sysmssg'] = flexicontent_html::get_system_messages_html();
echo json_encode($var);
exit;
}
$path = JPath::clean(JPATH_ROOT . DS . 'components' . DS . 'com_flexicontent' . DS . 'templates' . DS . $layout_name);
if (!is_dir($path)) {
$app->enqueueMessage('Layout: ' . $layout_name . ' was not found', 'warning');
$var['sysmssg'] = flexicontent_html::get_system_messages_html();
echo json_encode($var);
exit;
}
$file_path = JPath::clean($path . DS . $file_subpath);
if (!file_exists($file_path)) {
$app->enqueueMessage('Layout: ' . $layout_name . ' was not found', 'warning');
$var['sysmssg'] = flexicontent_html::get_system_messages_html();
echo json_encode($var);
exit;
}
if (file_put_contents($file_path, $file_contents)) {
$app->enqueueMessage('File: ' . $file_path . ' was saved ', 'message');
if (preg_match('#\\.xml#', $file_path)) {
$tmplcache = JFactory::getCache('com_flexicontent_tmpl');
$tmplcache->clean();
}
} else {
$app->enqueueMessage('Failed to save file: ' . $layout_name, 'warning');
}
$var['sysmssg'] = flexicontent_html::get_system_messages_html();
$var['content'] = file_get_contents($file_path);
echo json_encode($var);
}