本文整理匯總了PHP中FabrikHelperHTML::useLoadEvent方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::useLoadEvent方法的具體用法?PHP FabrikHelperHTML::useLoadEvent怎麽用?PHP FabrikHelperHTML::useLoadEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::useLoadEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _addJavascript
/**
* append the form javascript into the document head
* @param int table id
*/
function _addJavascript($tableId)
{
// $$$ rob ALWAYS load the calendar (so its avaible in ajax forms)
FabrikHelperHTML::loadcalendar();
$app =& JFactory::getApplication();
$document =& JFactory::getDocument();
$model =& $this->getModel();
$aLoadedElementPlugins = array();
$jsActions = array();
$jsControllerKey = $model->_editable ? 'form_' . $model->getId() : 'details_' . $model->getId();
$allJsActions = $model->getJsActions();
FabrikHelperHTML::packageJS();
if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
FabrikHelperHTML::slimbox();
FabrikHelperHTML::script('form.js', 'media/com_fabrik/js/', true);
FabrikHelperHTML::script('element.js', 'media/com_fabrik/js/', true);
}
$aWYSIWYGNames = array();
// $$$ hugh - yeat another one where if we =&, the $groups array pointer get buggered up and it
// skips a group
$groups = $model->getGroupsHiarachy();
foreach ($groups as $groupModel) {
$elementModels =& $groupModel->getPublishedElements();
foreach ($elementModels as $elementModel) {
$res = $elementModel->useEditor();
if ($res !== false) {
$aWYSIWYGNames[] = $res;
}
$eparams =& $elementModel->getParams();
//load in once the element js class files
// $$$ hugh - only needed getParent when we weren't saving changes to parent params to child
// which we should now be doing ... and getParent() causes an extra table lookup for every child
// element on the form.
//$element =& $elementModel->getParent();
$element =& $elementModel->getElement();
if (!in_array($element->plugin, $aLoadedElementPlugins)) {
$aLoadedElementPlugins[] = $element->plugin;
$elementModel->formJavascriptClass();
}
$eventMax = $groupModel->_repeatTotal == 0 ? 1 : $groupModel->_repeatTotal;
for ($c = 0; $c < $eventMax; $c++) {
$jsActions[] = $elementModel->getFormattedJSActions($allJsActions, $jsControllerKey, $c);
}
}
}
//new
$actions = trim(implode("\n", $jsActions));
//end new
$params =& $model->getParams();
$tableModel =& $model->getTableModel();
$table =& $tableModel->getTable();
$form =& $model->getForm();
FabrikHelperHTML::mocha();
$bkey = $model->_editable ? 'form_' . $model->getId() : 'details_' . $model->getId();
FabrikHelperHTML::tips('.hasTip', array(), "\$('{$bkey}')");
$key = FabrikString::safeColNameToArrayKey($table->db_primary_key);
$this->get('FormCss');
$this->get('CustomJsAction');
//$startJs = "window.addEvent('domready', function() {\n";
$startJs = "window.addEvent('" . FabrikHelperHTML::useLoadEvent() . "', function() {\n";
$endJs = "});\n";
$start_page = isset($model->sessionModel->last_page) ? (int) $model->sessionModel->last_page : 0;
if ($start_page !== 0) {
$app->enqueueMessage(JText::_('RESTARTINGMUTLIPAGEFORM'));
} else {
// form submitted but fails validation - needs to go to the last page
$start_page = JRequest::getInt('currentPage', 0);
}
$opts = new stdClass();
$opts->admin = $app->isAdmin();
$opts->postMethod = $this->get('PostMethod');
$opts->ajaxValidation = $params->get('ajax_validations');
$opts->primaryKey = $key;
$opts->liveSite = COM_FABRIK_LIVESITE;
$opts->error = @$form->origerror;
$opts->pages = $model->getPages();
$opts->plugins = array();
$opts->multipage_save = (bool) $model->saveMultiPage();
$opts->editable = $model->_editable;
$opts->start_page = $start_page;
$opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
//$$$rob dont int this as keys may be string
$opts->rowid = $model->_rowId;
//$$$rob if you are loading a table in a window from a form db join select record option
// then we want to know the id of the window so we can set its showSpinner() method
$opts->winid = JRequest::getVar('winid', '');
//for editing groups with joined data and an empty joined record (ie no joined records)
$hidden = array();
$maxRepeat = array();
$showMaxRepeats = array();
$postedRepeatGroupCounts = (array) JRequest::getVar('fabrik_repeat_group');
foreach ($this->groups as $g) {
$hidden[$g->id] = $g->startHidden;
if (JArrayHelper::getValue($postedRepeatGroupCounts, $g->id, 1) == 0) {
$hidden[$g->id] = true;
//.........這裏部分代碼省略.........