本文整理汇总了PHP中JTEXT::script方法的典型用法代码示例。如果您正苦于以下问题:PHP JTEXT::script方法的具体用法?PHP JTEXT::script怎么用?PHP JTEXT::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTEXT
的用法示例。
在下文中一共展示了JTEXT::script方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJs
/**
* Create the js that manages the edit list view page
*
* @return string js
*/
public function getJs()
{
$connModel = $this->getCnn();
$item = $this->getItem();
JText::script('COM_FABRIK_OPTIONS');
JText::script('COM_FABRIK_JOIN');
JText::script('COM_FABRIK_FIELD');
JText::script('COM_FABRIK_CONDITION');
JText::script('COM_FABRIK_VALUE');
JText::script('COM_FABRIK_EVAL');
JText::script('COM_FABRIK_APPLY_FILTER_TO');
JText::script('COM_FABRIK_DELETE');
JText::script('JYES');
JText::script('JNO');
JText::script('COM_FABRIK_QUERY');
JTEXT::script('COM_FABRIK_NO_QUOTES');
JText::script('COM_FABRIK_TEXT');
JText::script('COM_FABRIK_TYPE');
JText::script('COM_FABRIK_PLEASE_SELECT');
JText::script('COM_FABRIK_GROUPED');
JText::script('COM_FABRIK_TO');
JText::script('COM_FABRIK_FROM');
JText::script('COM_FABRIK_JOIN_TYPE');
JText::script('COM_FABRIK_FROM_COLUMN');
JText::script('COM_FABRIK_TO_COLUMN');
JText::script('COM_FABRIK_REPEAT_GROUP_BUTTON_LABEL');
JText::script('COM_FABRIK_PUBLISHED');
$joinTypeOpts = array();
$joinTypeOpts[] = array('inner', FText::_('INNER JOIN'));
$joinTypeOpts[] = array('left', FText::_('LEFT JOIN'));
$joinTypeOpts[] = array('right', FText::_('RIGHT JOIN'));
$activeTableOpts[] = '';
$activeTableOpts[] = $item->get('db_table_name');
$joins = $this->getJoins();
for ($i = 0; $i < count($joins); $i++) {
$j = $joins[$i];
$activeTableOpts[] = $j->table_join;
$activeTableOpts[] = $j->join_from_table;
}
$activeTableOpts = array_unique($activeTableOpts);
$activeTableOpts = array_values($activeTableOpts);
$opts = new stdClass();
$opts->joinOpts = $joinTypeOpts;
$opts->tableOpts = $connModel->getThisTables(true);
$opts->activetableOpts = $activeTableOpts;
$opts->j3 = FabrikWorker::j3();
$opts = json_encode($opts);
$filterOpts = new stdClass();
$filterOpts->filterJoinDd = $this->getFilterJoinDd(false, 'jform[params][filter-join][]');
$filterOpts->filterCondDd = $this->getFilterConditionDd(false, 'jform[params][filter-conditions][]', 2);
$filterOpts->filterAccess = JHtml::_('access.level', 'jform[params][filter-access][]', $item->access, 'class="input-small"');
$filterOpts->filterAccess = str_replace(array("\n", "\r"), '', $filterOpts->filterAccess);
$filterOpts->j3 = FabrikWorker::j3();
$filterOpts = json_encode($filterOpts);
$formModel = $this->getFormModel();
$attribs = 'class="inputbox input-small" size="1"';
$filterfields = $formModel->getElementList('jform[params][filter-fields][]', '', false, false, true, 'name', $attribs);
$filterfields = addslashes(str_replace(array("\n", "\r"), '', $filterfields));
$plugins = json_encode($this->getPlugins());
$js = array();
$js[] = "window.addEvent('domready', function () {";
$js[] = "Fabrik.controller = new PluginManager({$plugins}, " . (int) $this->getItem()->id . ", 'list');";
$js[] = "oAdminTable = new ListForm({$opts});";
$js[] = "oAdminTable.watchJoins();";
for ($i = 0; $i < count($joins); $i++) {
$joinGroupParams = json_decode($joins[$i]->params);
$j = $joins[$i];
$joinFormFields = json_encode($j->joinFormFields);
$joinToFields = json_encode($j->joinToFields);
$repeat = $joinGroupParams->repeat_group_button == 1 ? 1 : 0;
$js[] = "\toAdminTable.addJoin('{$j->group_id}','{$j->id}','{$j->join_type}','{$j->table_join}'," . "'{$j->table_key}','{$j->table_join_key}','{$j->join_from_table}', {$joinFormFields}, {$joinToFields}, {$repeat});";
}
$js[] = "oAdminFilters = new adminFilters('filterContainer', '{$filterfields}', {$filterOpts});";
$form = $this->getForm();
$afilterJoins = $form->getValue('params.filter-join');
// Force to arrays as single prefilters imported from 2.x will be stored as string values
$filterFields = (array) $form->getValue('params.filter-fields');
$afilterConditions = (array) $form->getValue('params.filter-conditions');
$afilterEval = (array) $form->getValue('params.filter-eval');
$afilterValues = (array) $form->getValue('params.filter-value');
$afilterAccess = (array) $form->getValue('params.filter-access');
$aGrouped = (array) $form->getValue('params.filter-grouped');
for ($i = 0; $i < count($filterFields); $i++) {
$selJoin = FArrayHelper::getValue($afilterJoins, $i, 'and');
// 2.0 upgraded sites had quoted filter names
$selFilter = str_replace('`', '', $filterFields[$i]);
$grouped = FArrayHelper::getValue($aGrouped, $i, 0);
$selCondition = $afilterConditions[$i];
$filerEval = (int) FArrayHelper::getValue($afilterEval, $i, '1');
if ($selCondition == '>') {
$selCondition = '>';
}
if ($selCondition == '<') {
$selCondition = '<';
}
//.........这里部分代码省略.........
示例2: getJs
/**
* create the js that manages the edit list view page
*/
public function getJs()
{
$abstractPlugins = $this->getAbstractPlugins();
$connModel = $this->getCnn();
$plugins = $this->getPlugins();
$item = $this->getItem();
//JModel::addIncludePath(JPATH_SITE.DS.'components'.DS.'com_fabrik'.DS.'models');
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
JText::script('COM_FABRIK_ACTION');
JText::script('COM_FABRIK_DO');
JText::script('COM_FABRIK_IN');
JText::script('COM_FABRIK_ON');
JText::script('COM_FABRIK_OPTIONS');
JText::script('COM_FABRIK_JOIN');
JText::script('COM_FABRIK_FIELD');
JText::script('COM_FABRIK_CONDITION');
JText::script('COM_FABRIK_VALUE');
JText::script('COM_FABRIK_EVAL');
JText::script('COM_FABRIK_APPLY_FILTER_TO');
JText::script('COM_FABRIK_DELETE');
JText::script('JYES');
JText::script('JNO');
JText::script('COM_FABRIK_QUERY');
JTEXT::script('COM_FABRIK_NO_QUOTES');
JText::script('COM_FABRIK_TEXT');
JText::script('COM_FABRIK_TYPE');
JText::script('COM_FABRIK_PLEASE_SELECT');
JText::script('COM_FABRIK_GROUPED');
JText::script('COM_FABRIK_TO');
JText::script('COM_FABRIK_FROM');
JText::script('COM_FABRIK_JOIN_TYPE');
JText::script('COM_FABRIK_FROM_COLUMN');
JText::script('COM_FABRIK_TO_COLUMN');
JText::script('COM_FABRIK_REPEAT_GROUP_BUTTON_LABEL');
$joinTypeOpts = array();
$joinTypeOpts[] = array('inner', JText::_('INNER JOIN'));
$joinTypeOpts[] = array('left', JText::_('LEFT JOIN'));
$joinTypeOpts[] = array('right', JText::_('RIGHT JOIN'));
$activetableOpts[] = "";
$activetableOpts[] = $item->db_table_name;
$joins = $this->getJoins();
for ($i = 0; $i < count($joins); $i++) {
$j = $joins[$i];
$activetableOpts[] = $j->table_join;
$activetableOpts[] = $j->join_from_table;
}
$activetableOpts = array_unique($activetableOpts);
$activetableOpts = array_values($activetableOpts);
$opts = new stdClass();
$opts->joinOpts = $joinTypeOpts;
$opts->tableOpts = $connModel->getThisTables(true);
$opts->activetableOpts = $activetableOpts;
$opts = json_encode($opts);
$filterOpts = new stdClass();
$filterOpts->filterJoinDd = $this->getFilterJoinDd(false, 'jform[params][filter-join][]');
$filterOpts->filterCondDd = $this->getFilterConditionDd(false, 'jform[params][filter-conditions][]', 2);
$filterOpts->filterAccess = JHtml::_('access.level', 'jform[params][filter-access][]', $item->access);
$filterOpts->filterAccess = str_replace(array("\n", "\r"), '', $filterOpts->filterAccess);
$filterOpts = json_encode($filterOpts);
$formModel =& $this->getFormModel();
$filterfields = $formModel->getElementList('jform[params][filter-fields][]', '', false, false, true);
$filterfields = addslashes(str_replace(array("\n", "\r"), '', $filterfields));
$js = "\n head.ready(function() {\n\n\t\toAdminTable = new ListForm({$opts});\n\toAdminTable.watchJoins();\n";
for ($i = 0; $i < count($joins); $i++) {
$joinGroupParams = json_decode($joins[$i]->params);
$j = $joins[$i];
$joinFormFields = json_encode($j->joinFormFields);
$joinToFields = json_encode($j->joinToFields);
$repeat = $joinGroupParams->repeat_group_button == 1 ? 1 : 0;
$js .= "\toAdminTable.addJoin('{$j->group_id}','{$j->id}','{$j->join_type}','{$j->table_join}',";
$js .= "'{$j->table_key}','{$j->table_join_key}','{$j->join_from_table}', {$joinFormFields}, {$joinToFields}, {$repeat});\n";
}
$js .= "var aPlugins = [];\n";
foreach ($abstractPlugins as $abstractPlugin) {
$js .= "aPlugins.push(" . $abstractPlugin['js'] . ");\n";
}
$js .= "controller = new ListPluginManager(aPlugins);\n";
foreach ($plugins as $plugin) {
$js .= "controller.addAction('" . $plugin['html'] . "', '" . $plugin['plugin'] . "', '" . @$plugin['location'] . "', '" . @$plugin['event'] . "', false);\n";
}
$js .= "oAdminFilters = new adminFilters('filterContainer', '{$filterfields}', {$filterOpts});\n";
$form = $this->getForm();
$afilterJoins = $form->getValue('params.filter-join');
$afilterFields = $form->getValue('params.filter-fields');
$afilterConditions = $form->getValue('params.filter-conditions');
$afilterEval = $form->getValue('params.filter-eval');
$afilterValues = $form->getValue('params.filter-value');
$afilterAccess = $form->getValue('params.filter-access');
$aGrouped = $form->getValue('params.filter-grouped');
for ($i = 0; $i < count($afilterFields); $i++) {
$selJoin = JArrayHelper::getValue($afilterJoins, $i, 'and');
$selFilter = $afilterFields[$i];
$grouped = $aGrouped[$i];
$selCondition = $afilterConditions[$i];
$filerEval = JArrayHelper::getValue($afilterEval, $i, '1');
if ($selCondition == '>') {
$selCondition = '>';
//.........这里部分代码省略.........