本文整理匯總了PHP中FabrikHelperHTML::mocha方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::mocha方法的具體用法?PHP FabrikHelperHTML::mocha怎麽用?PHP FabrikHelperHTML::mocha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::mocha方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
function display($tmpl = 'default')
{
JHTML::_('behavior.calendar');
FabrikHelperHTML::script('media/com_fabrik/js/list.js', true);
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model =& $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
$this->row =& $model->getVisualization();
$model->setListIds();
if ($this->row->published == 0) {
JError::raiseWarning(500, JText::_('ALERTNOTAUTH'));
return '';
}
$calendar =& $model->_row;
$this->media = $model->getMedia();
$viewName = $this->getName();
$pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikFEModel');
$plugin =& $pluginManager->getPlugIn('calendar', 'visualization');
$this->assign('containerId', $this->get('ContainerId'));
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assignRef('filters', $this->get('Filters'));
$pluginParams =& $model->getPluginParams();
$tmpl = $pluginParams->get('media_layout', $tmpl);
$tmplpath = JPATH_ROOT . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'media' . DS . 'views' . DS . 'media' . DS . 'tmpl' . DS . $tmpl;
$this->_setPath('template', $tmplpath);
$ab_css_file = $tmplpath . DS . "template.css";
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('plugins/fabrik_visualization/media/views/media/tmpl/' . $tmpl . '/template.css');
}
echo parent::display();
}
示例2: display
function display($tmpl = 'default')
{
JHTML::_('behavior.calendar');
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model =& $this->getModel();
$usersConfig =& JComponentHelper::getParams('com_fabrik');
$model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
echo $model->getEvents();
}
示例3: display
function display($tmpl = 'default')
{
JHTML::_('behavior.calendar');
FabrikHelperHTML::packageJS();
FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/');
FabrikHelperHTML::script('advanced-search.js', 'media/com_fabrik/js/');
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model =& $this->getModel();
$usersConfig =& JComponentHelper::getParams('com_fabrik');
$model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
$this->row =& $model->getVisualization();
$model->setTableIds();
if ($this->row->state == 0) {
JError::raiseWarning(500, JText::_('ALERTNOTAUTH'));
return '';
}
$calendar =& $model->_row;
$this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
if ($this->requiredFiltersFound) {
$this->assign('chart', $this->get('Chart'));
} else {
$this->assign('chart', '');
}
$viewName = $this->getName();
$pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
$plugin =& $pluginManager->getPlugIn('calendar', 'visualization');
$this->assign('containerId', $this->get('ContainerId'));
$this->assignRef('filters', $this->get('Filters'));
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assign('filterFormURL', $this->get('FilterFormURL'));
$pluginParams =& $model->getPluginParams();
$this->assignRef('params', $pluginParams);
JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
$tmpl = $pluginParams->get('chart_layout', $tmpl);
$tmplpath = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . 'visualization' . DS . 'chart' . DS . 'views' . DS . 'chart' . DS . 'tmpl' . DS . $tmpl;
$this->_setPath('template', $tmplpath);
$ab_css_file = $tmplpath . DS . "template.css";
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('template.css', 'components/com_fabrik/plugins/visualization/chart/views/chart/tmpl/' . $tmpl . '/', true);
}
//check and add a general fabrik custom css file overrides template css and generic table css
FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css");
//check and add a specific biz template css file overrides template css generic table css and generic custom css
FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "plugins" . DS . "visualization" . DS . "chart" . DS . "views" . DS . "chart" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
//assign something to oPackage to ensure we can clear filters
$str = "window.addEvent('domready', function(){\n\t\t\tfabrikChart{$this->row->id} = {};";
$str .= "\n" . "oPackage.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});\n\t\t});";
FabrikHelperHTML::addScriptDeclaration($str);
//ensure we don't have an incorrect version of mootools loaded
FabrikHelperHTML::cleanMootools();
echo parent::display();
}
示例4: display
function display($tmpl = 'default')
{
JHTML::_('behavior.calendar');
FabrikHelperHTML::script('media/com_fabrik/js/list.js');
FabrikHelperHTML::script('media/com_fabrik/js/advanced-search.js');
require_once(COM_FABRIK_FRONTEND.DS.'helpers'.DS.'html.php');
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model = &$this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
$this->row = $model->getVisualization();
$model->setListIds();
if ($this->row->published == 0) {
JError::raiseWarning(500, JText::_('ALERTNOTAUTH'));
return '';
}
$calendar = $model->_row;
$this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
if ($this->requiredFiltersFound) {
$this->assign('chart', $this->get('Chart'));
} else {
$this->assign('chart', '');
}
$viewName = $this->getName();
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
$plugin = $pluginManager->getPlugIn('calendar', 'visualization');
$this->assign('containerId', $this->get('ContainerId'));
$this->assignRef('filters', $this->get('Filters'));
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assign('filterFormURL', $this->get('FilterFormURL'));
$pluginParams = $model->getPluginParams();
$this->assignRef('params', $pluginParams);
$tmpl = $pluginParams->get('chart_layout', $tmpl);
$tmplpath = JPATH_ROOT.DS.'plugins'.DS.'fabrik_visualization'.DS.'chart'.DS.'views'.DS.'chart'.DS.'tmpl'.DS.$tmpl;
$this->_setPath('template', $tmplpath);
$ab_css_file = $tmplpath.DS."template.css";
if (JFile::exists($ab_css_file))
{
JHTML::stylesheet('plugins/fabrik_visualization/chart/views/chart/tmpl/'.$tmpl.'/template.css', true);
}
//assign something to Fabrik.blocks to ensure we can clear filters
$str = "head.ready(function() {
fabrikChart{$this->row->id} = {};";
$str .= "\n" . "Fabrik.addBlock('vizualization_{$this->row->id}', fabrikChart{$this->row->id});
});";
FabrikHelperHTML::addScriptDeclaration($str);
echo parent::display();
}
示例5: loadJavascriptClass
/**
* load the javascript class that manages interaction with the form element
* should only be called once
* @return string javascript class file
*/
function loadJavascriptClass()
{
FabrikHelperHTML::mocha();
FabrikHelperHTML::script('javascript.js', 'components/com_fabrik/plugins/table/emailtable/', false);
}
示例6: getManagementJS
protected function getManagementJS($data = array())
{
global $Itemid;
// $$$ rob ALWAYS load the calendar (so its avaible in ajax forms)
FabrikHelperHTML::loadcalendar();
$app =& JFactory::getApplication();
$model =& $this->getModel();
$table =& $model->getTable();
$formModel =& $model->getForm();
$elementsNotInTable =& $formModel->getElementsNotInTable();
$keys = array('id' => '', 'name' => '', 'label' => '');
foreach ($elementsNotInTable as &$i) {
if (is_a($i, 'TableElement')) {
$i = array_intersect_key($i->getPublicProperties(), $keys);
}
}
FabrikHelperHTML::packageJS();
$document =& JFactory::getDocument();
if ($model->requiresSlimbox()) {
FabrikHelperHTML::slimbox();
}
if ($model->requiresMocha()) {
FabrikHelperHTML::mocha();
}
FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
$tmpl = $this->getTmpl();
FabrikHelperHTML::stylesheet('table.css', 'media/com_fabrik/css/');
// check for a custom css file and include it if it exists
FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "template.css");
//check and add a general fabrik custom css file overrides template css and generic table css
FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css");
//check and add a specific table template css file overrides template css generic table css and generic custom css
FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
// check for a custom js file and include it if it exists
$aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
if (JFile::exists($aJsPath)) {
FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/', true);
}
$origRows = $this->rows;
$this->rows = array(array());
$tmpItemid = !isset($Itemid) ? 0 : $Itemid;
$this->_c = 0;
$this->_row = new stdClass();
$script = '';
// $$$ rob done in HTMLHelper
//$script = "/* <![CDATA[ */ \n";
static $tableini;
if (!$tableini) {
$tableini = true;
$script .= "var oTables = \$H();\n";
}
$opts = new stdClass();
$opts->admin = $app->isAdmin();
$opts->postMethod = $model->getPostMethod();
$opts->filterMethod = $this->filter_action;
$opts->form = 'tableform_' . $model->_id;
$opts->headings = $model->_jsonHeadings();
$labels = $this->headings;
foreach ($labels as &$l) {
$l = strip_tags($l);
}
$opts->labels = $labels;
$opts->primaryKey = $table->db_primary_key;
$opts->Itemid = $tmpItemid;
$opts->formid = $model->_oForm->getId();
$opts->canEdit = $model->canEdit() ? "1" : "0";
$opts->canView = $model->canView() ? "1" : "0";
$opts->page = JRoute::_('index.php');
$opts->isGrouped = $this->isGrouped;
$opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
if (FabrikWorker::nativeMootools12()) {
$opts->mooversion = 1.24;
}
$opts->formels = $elementsNotInTable;
//if table data starts as empty then we need the html from the row
// template otherwise we can't add a row to the table
if ($model->_postMethod == 'ajax') {
ob_start();
$this->_row = new stdClass();
$this->_row->id = '';
$this->_row->class = 'fabrik_row';
require COM_FABRIK_FRONTEND . DS . 'views' . DS . 'table' . DS . 'tmpl' . DS . 'default' . DS . 'default_row.php';
$opts->rowtemplate = ob_get_contents();
ob_end_clean();
}
//$$$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', '');
$opts->ajaxEditViewLink = $model->ajaxEditViewLink() ? 1 : 0;
$opts = json_encode($opts);
$lang = new stdClass();
$lang->select_rows = JText::_('SELECT SOME ROWS FOR DELETION');
$lang->yes = JText::_('Yes');
$lang->no = JText::_('No');
$lang->select_colums_to_export = JText::_('SELECT_COLUMNS_TO_EXPORT');
$lang->include_filters = JText::_('INCLUDE_FILTERS');
$lang->include_data = JText::_('INCLUDE_DATA');
$lang->inlcude_raw_data = JText::_('INCLUDE_RAW_DATA');
$lang->include_calculations = JText::_('INLCUDE_CALCULATIONS');
$lang->export = JText::_('EXPORT');
//.........這裏部分代碼省略.........
示例7: getAdvancedSearchLink
/**
* build the advanced search link
* @return string <a href...> link
*/
function getAdvancedSearchLink()
{
FabrikHelperHTML::mocha('a.popupwin');
$table =& $this->getTable();
$url = COM_FABRIK_LIVESITE . "index.php?option=com_fabrik&view=list&layout=_advancedsearch&tmpl=component&listid=" . $table->id . "&nextview=" . JRequest::getVar('view');
return "<a rel=\"{id:'advanced-search-win',width:690,loadMethod:'xhr',title:'" . JText::_('COM_FABRIK_ADVANCED_SEARCH') . "',maximizable:1}\" href=\"{$url}\" class=\"popupwin\">" . JText::_('COM_FABRIK_ADVANCED_SEARCH') . "</a>";
}
示例8: defined
/*
* @package Joomla.Administrator
* @subpackage Fabrik
* @since 1.6
* @copyright Copyright (C) 2005 Rob Clayburn. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . DS . 'helpers' . DS . 'html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$fbConfig = JComponentHelper::getParams('com_fabrik');
FabrikHelperHTML::mocha();
FabrikHelperHTML::script('media/com_fabrik/js/lib/art.js');
FabrikHelperHTML::script('media/com_fabrik/js/icons.js');
FabrikHelperHTML::script('media/com_fabrik/js/icongen.js');
FabrikHelperHTML::script('media/com_fabrik/js/canvas.js');
FabrikHelperHTML::script('media/com_fabrik/js/history.js');
FabrikHelperHTML::script('media/com_fabrik/js/keynav.js');
FabrikHelperHTML::script('media/com_fabrik/js/tabs.js');
FabrikHelperHTML::script('media/com_fabrik/js/pages.js');
FabrikHelperHTML::script('administrator/components/com_fabrik/views/package/adminpackage.js');
JHTML::stylesheet('media/com_fabrik/css/package.css');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
示例9: display
function display($tpl = null)
{
$config =& JFactory::getConfig();
$user =& JFactory::getUser();
$model =& $this->getModel();
$formModel =& $this->_formView->getModel();
//Get the active menu item
$usersConfig =& JComponentHelper::getParams('com_fabrik');
$model->setId($usersConfig->get('packageid', JRequest::getInt('packageid', 0)));
$package =& $model->getPackage();
$model->_lastTask = JRequest::getVar('task', '');
$model->_senderBlock = JRequest::getVar('fabrik_senderBlock', '');
//@TODO: not sure if this is used?
$model->_lastTaskStatus = JRequest::getVar('taskstatus', '');
/** @var string any data created by the lasttask - e.g. data to create a new table row with */
$model->_lastTaskData = JRequest::getVar('taskData', '');
// TODO: query table/forms to find out which blocks are releated to the block that has updated itself
$model->_updateBlocks = JRequest::getVar('fbUpdateBlocks', array());
$model->loadTables();
$package =& $model->getPackage();
$usedForms = array();
if ($package->tables != '') {
$tableids = explode(",", $package->tables);
foreach ($tableids as $i) {
if ($i === '') {
continue;
}
//in PHP5 objects are assigned by reference as default -
//cloning object doesnt deep clone other oject references either??
//this copy method might be intensive
$tableView = clone $this->_tableView;
$tableView->setId($i);
$tableView->_isMambot = true;
$tableModel =& $tableView->getModel();
$tableModel->setId($i);
$tableModel->_packageId = $this->_id;
$tableModel->_postMethod = 'ajax';
$table =& $tableModel->getTable();
$this->blocks[$table->label] = $tableView->display();
$table = $tableModel->getTable();
$formModel =& $tableModel->getForm();
$formModel->_editable = 1;
$formView = clone $this->_formView;
//used to buffer output
$formView->_isMambot = true;
$formView->setId($table->form_id);
$formModel->_postMethod = 'ajax';
$formModel->_packageId = $this->_id;
$usedForms[] = $formModel->_id;
$formView->setModel($formModel, true);
$this->blocks['form_' . $formModel->_id] = $formView->display();
//creating a read only view
$formModel->_editable = 0;
$formView->setModel($formModel, true);
$orgiView = JRequest::getVar('view', 'form');
$view = JRequest::setVar('view', 'details');
$this->blocks[$table->label . ' details'] = $formView->display();
JRequest::setVar('view', $orgiView);
}
}
// see if we have any forms that dont record to the database that need to be added to blocks[]
// can occur when redering a form in a module with use ajax turned on
if ($package->forms != '') {
$formids = explode(",", $package->forms);
foreach ($formids as $fid) {
if (!array_key_exists('form_' . $fid, $this->blocks)) {
$formModel->_editable = 1;
$formView = clone $this->_formView;
//used to buffer output
$formView->_isMambot = true;
$formView->setId($fid);
$formModel->_postMethod = 'ajax';
$formModel->_packageId = $this->_id;
$usedForms[] = $formModel->_id;
$formView->setModel($formModel, true);
$this->blocks['form_' . $formModel->_id] = $formView->display();
}
}
}
$model->render();
$this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
$tmpl = JRequest::getVar('layout', 'default');
//$this->blocks = $model->_blocks;
$this->_setPath('template', $this->_basePath . DS . 'package' . DS . 'tmpl' . DS . $tmpl);
if (!isset($package->template)) {
$package->template = 'default';
$tmpl = JRequest::getVar('layout', $package->template);
} else {
//set by table module in ajax mode
$tmpl = $package->template;
}
$this->_includeCSS($tmpl);
$this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
$this->_setPath('template', $this->_basePath . DS . 'package' . DS . 'tmpl' . DS . $tmpl);
$liveTmplPath = JURI::root() . '/components/com_fabrik/views/package/tmpl/' . $tmpl . '/';
FabrikHelperHTML::mootools();
FabrikHelperHTML::mocha();
// check for a custom js file and include it if it exists
$aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "package" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
if (file_exists($aJsPath)) {
//.........這裏部分代碼省略.........
示例10: viewDataLink
/**
* build the link (<a href..>) for viewing table data
*
* @param bol $popUp is the link to generated a popup to show
* @param obj element 27/06/2011
* @param object $row
* @param string $key 28/06/2011 - do longer passed in with _raw appended (done in this method)
* @param string $val
* @param int number of related records
* @param int ref to related data admin info 27/16/2011
* @return string
*/
function viewDataLink($popUp = false, $element, $row = null, $key = '', $val = '', $count = 0, $f)
{
$elKey = $element->list_id . '-' . $element->form_id . '-' . $element->element_id;
$listid = $element->list_id;
$app = JFactory::getApplication();
$params = $this->getParams();
$factedLinks = $params->get('factedlinks');
// $$$ hugh - we are getting element keys that aren't in the linkedlisttext.
// not sure why, so added this defensive code. Should probably find out
// why though! I just needed to make this error go away NAO!
$linkedListText = isset($factedLinks->linkedlisttext->{$elKey}) ? $factedLinks->linkedlisttext->{$elKey} : '';
$label = $this->parseMessageForRowHolder($linkedListText, JArrayHelper::fromObject($row));
$Itemid = $app->isAdmin() ? 0 : @$app->getMenu('site')->getActive()->id;
$action = $app->isAdmin() ? "task" : "view";
$url = "index.php?option=com_fabrik&";
if (is_null($listid)) {
$list = $this->getTable();
$listid = $list->id;
}
$facetTable = $this->_facetedTable($listid);
if (!$facetTable->canView()) {
return '<div style="text-align:center"><a title="' . JText::_('Insufficient access rights. Please login') . '"><img src="media/com_fabrik/images/login.png" alt="' . JText::_('iInsufficient access rights. Please login') . '" /></a></div>';
}
$tlabel = $label === '' ? JText::_('COM_FABRIK_NO_RECORDS') : '(0) ' . $label;
if ($count === 0) {
$aExisitngLinkedForms = $params->get('linkedform', '', '_default', 'array');
$linkedForm = JArrayHelper::getValue($aExisitngLinkedForms, $f, false);
$addLink = $linkedForm == '0' ? $this->viewFormLink($popUp, $element, $row, $key, $val, false, $f) : '';
return '<div style="text-align:center" class="related_data_norecords">' . $tlabel . '</div>' . $addLink;
}
$key .= '_raw';
if ($label === '') {
$label = JText::_('COM_FABRIK_VIEW');
}
$label = '(' . $count . ') ' . $label;
if ($app->isAdmin()) {
$bits[] = "task=list.view";
$bits[] = "cid={$listid}";
} else {
$bits[] = "view=list";
$bits[] = "listid={$listid}";
$tableLinks = $this->getTableLinks();
// $$$ rob 01/03/2011 find at matching itemid in another menu item for the related data link
foreach ($tableLinks as $tlink) {
if (strstr($tlink->link, 'index.php?option=com_fabrik&view=list&listid=' . $listid)) {
$bits[] = "Itemid=" . $tlink->id;
$Itemid = $tlink->id;
break;
}
}
$bits[] = "Itemid={$Itemid}";
}
if ($key != '') {
$bits[] = "{$key}={$val}";
}
$bits[] = 'limitstart' . $listid . '=0';
if ($popUp) {
$bits[] = "tmpl=component";
$bits[] = "ajax=1";
}
$bits[] = "&resetfilters=1";
//$bits[] = "clearfilters=1"; //nope stops url filter form workin on related data :(
$bits[] = '&fabrik_incsessionfilters=0';
//test for releated data, filter once, go backt o main list re-filter -
$url .= implode("&", $bits);
$url = JRoute::_($url);
if ($popUp) {
FabrikHelperHTML::mocha('a.popupwin');
$opts = new stdClass();
$opts->maximizable = 1;
$opts->title = JText::_('COM_FABRIK_VIEW');
$opts->evalScripts = 1;
$opts = str_replace('"', "'", json_encode($opts));
$url = '<a rel="' . $opts . '" href="' . $url . '" class="popupwin">' . $label . '</a>';
} else {
$url = '<a class="related_data" href="' . $url . '">' . $label . "</a>";
}
return $url;
}
示例11: display
function display($tmpl = 'default')
{
FabrikHelperHTML::framework();
$app = JFactory::getApplication();
$Itemid = (int) @$app->getMenu('site')->getActive()->id;
JHTML::_('behavior.calendar');
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model =& $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
$model->setId($id);
$this->row =& $model->getVisualization();
$model->setListIds();
$this->assign('containerId', $this->get('ContainerId'));
$this->assignRef('filters', $this->get('Filters'));
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assign('filterFormURL', $this->get('FilterFormURL'));
$calendar =& $model->_row;
$this->calName = $model->getCalName();
$canAdd = $this->get('CanAdd');
$this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
if ($canAdd && $this->requiredFiltersFound) {
$app->enqueueMessage(JText::_('PLG_VISUALIZATION_CALENDAR_DOUBLE_CLICK_TO_ADD'));
}
$this->assign('canAdd', $canAdd);
$fbConfig =& JComponentHelper::getParams('com_fabrik');
JHTML::stylesheet('media/com_fabrik/css/list.css');
FabrikHelperHTML::script('media/com_fabrik/js/element.js', true);
FabrikHelperHTML::script('media/com_fabrik/js/form.js', true);
FabrikHelperHTML::script('media/com_fabrik/js/list.js', true);
FabrikHelperHTML::script('plugins/fabrik_visualization/calendar/calendar.js', true);
$params =& $model->getParams();
//Get the active menu item
$urlfilters = JRequest::get('get');
unset($urlfilters['option']);
unset($urlfilters['view']);
unset($urlfilters['controller']);
unset($urlfilters['Itemid']);
unset($urlfilters['visualizationid']);
unset($urlfilters['format']);
if (empty($urlfilters)) {
$urlfilters = new stdClass();
}
$urls = new stdClass();
//dont JRoute as its wont load with sef?
$urls->del = 'index.php?option=com_fabrik&controller=visualization.calendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $id;
$urls->add = 'index.php?option=com_fabrik&view=visualization&controller=visualization.calendar&format=raw&Itemid=' . $Itemid . '&id=' . $id;
$user =& JFactory::getUser();
$legend = $params->get('show_calendar_legend', 0) ? $model->getLegend() : '';
$tmpl = $params->get('calendar_layout', 'default');
$pluginManager->loadJS();
$options = new stdClass();
$options->url = $urls;
$options->eventLists = $this->get('eventLists');
$options->calendarId = $calendar->id;
$options->popwiny = $params->get('yoffset', 0);
$options->urlfilters = $urlfilters;
$options->canAdd = $canAdd;
$options->tmpl = $tmpl;
//$formView =& $this->_formView;
$o = $model->getAddStandardEventFormInfo();
if ($o != null) {
$options->listid = $o->id;
//$formView->setId($o->form_id);
//$options->formid = $o->form_id;
}
//$formModel =& $formView->getModel();
//$form =& $formModel->getForm();
//$$$rob @TODO not sure this is need - it isnt in the timeline viz
$model->setRequestFilters();
$options->filters =& $model->filters;
// end not sure
$options->Itemid = $Itemid;
$options->show_day = $params->get('show_day', true);
$options->show_week = $params->get('show_week', true);
$options->days = array(JText::_('SUNDAY'), JText::_('MONDAY'), JText::_('TUESDAY'), JText::_('WEDNESDAY'), JText::_('THURSDAY'), JText::_('FRIDAY'), JText::_('SATURDAY'));
$options->shortDays = array(JText::_('SUN'), JText::_('MON'), JText::_('TUE'), JText::_('WED'), JText::_('THU'), JText::_('FRI'), JText::_('SAT'));
$options->months = array(JText::_('JANUARY'), JText::_('FEBRUARY'), JText::_('MARCH'), JText::_('APRIL'), JText::_('MAY'), JText::_('JUNE'), JText::_('JULY'), JText::_('AUGUST'), JText::_('SEPTEMBER'), JText::_('OCTOBER'), JText::_('NOVEMBER'), JText::_('DECEMBER'));
$options->shortMonths = array(JText::_('JANUARY_SHORT'), JText::_('FEBRUARY_SHORT'), JText::_('MARCH_SHORT'), JText::_('APRIL_SHORT'), JText::_('MAY_SHORT'), JText::_('JUNE_SHORT'), JText::_('JULY_SHORT'), JText::_('AUGUST_SHORT'), JText::_('SEPTEMBER_SHORT'), JText::_('OCTOBER_SHORT'), JText::_('NOVEMBER_SHORT'), JText::_('DECEMBER_SHORT'));
$options->first_week_day = (int) $params->get('first_week_day', 0);
$options->monthday = new stdClass();
$options->monthday->width = (int) $params->get('calendar-monthday-width', 90);
$options->monthday->height = (int) $params->get('calendar-monthday-height', 90);
$options->greyscaledweekend = $params->get('greyscaled-week-end', 0);
$options->viewType = $params->get('calendar_default_view', 'month');
$json = json_encode($options);
JText::script('PLG_VISUALIZATION_CALENDAR_NEXT');
JText::script('PLG_VISUALIZATION_CALENDAR_PREVIOUS');
JText::script('PLG_VISUALIZATION_CALENDAR_DAY');
JText::script('PLG_VISUALIZATION_CALENDAR_WEEK');
JText::script('PLG_VISUALIZATION_CALENDAR_MONTH');
JText::script('PLG_VISUALIZATION_CALENDAR_KEY');
JText::script('PLG_VISUALIZATION_CALENDAR_TODAY');
JText::script('PLG_VISUALIZATION_CALENDAR_CONF_DELETE');
JText::script('PLG_VISUALIZATION_CALENDAR_DELETE');
JText::script('PLG_VISUALIZATION_CALENDAR_VIEW');
JText::script('PLG_VISUALIZATION_CALENDAR_EDIT');
JText::script('PLG_VISUALIZATION_CALENDAR_ADD_EDIT_EVENT');
//.........這裏部分代碼省略.........
示例12: pluploadLRuntimes
/**
* load the required plupload runtime engines
* @param string $runtimes
*/
protected function pluploadLRuntimes($runtimes)
{
FabrikHelperHTML::mocha();
$config =& JFactory::getConfig();
$debug = $config->getValue('config.debug');
// $$$ hugh - plupload have changed their build script so it no longer
// adds the .min. on the minified script names
//$ex = !$debug ? '.min' : '';
$ex = '';
$path = $debug ? 'components/com_fabrik/plugins/element/fabrikfileupload/plupload/src/javascript/' : 'components/com_fabrik/plugins/element/fabrikfileupload/plupload/js/';
FabrikHelperHTML::script('plupload' . $ex . '.js', $path, true);
if (strstr($runtimes, 'html5')) {
FabrikHelperHTML::script('plupload.html5' . $ex . '.js', $path, true);
}
if (strstr($runtimes, 'html4')) {
FabrikHelperHTML::script('plupload.html4' . $ex . '.js', $path, true);
}
if (strstr($runtimes, 'gears')) {
FabrikHelperHTML::script('gears_init.js', $path, true);
FabrikHelperHTML::script('plupload.gears' . $ex . '.js', $path, true);
}
if (strstr($runtimes, 'flash')) {
FabrikHelperHTML::script('plupload.flash' . $ex . '.js', $path, true);
}
if (strstr($runtimes, 'silverlight')) {
FabrikHelperHTML::script('plupload.silverlight' . $ex . '.js', $path, true);
}
if (strstr($runtimes, 'browserplus')) {
FabrikHelperHTML::script('plupload.browserplus' . $ex . '.js', $path, true);
}
}
示例13: _addJavascript
/**
* append the form javascript into the document head
* @param int table id
*/
protected function _addJavascript($tableId)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$model = $this->getModel();
$aLoadedElementPlugins = array();
$jsActions = array();
$jsControllerKey = $model->_editable ? 'form_' . $model->getId() : 'details_' . $model->getId();
if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
FabrikHelperHTML::slimbox();
$srcs = array('media/com_fabrik/js/form.js', 'media/com_fabrik/js/element.js');
}
$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($srcs);
}
$eventMax = $groupModel->_repeatTotal == 0 ? 1 : $groupModel->_repeatTotal;
for ($c = 0; $c < $eventMax; $c++) {
$jsActions[] = $elementModel->getFormattedJSActions($jsControllerKey, $c);
}
}
}
FabrikHelperHTML::script($srcs, true);
//new
$actions = trim(implode("\n", $jsActions));
//end new
$params = $model->getParams();
$listModel = $model->getlistModel();
$table = $listModel->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 = "head.ready(function() {\n";
$endJs = "});\n";
$start_page = isset($model->sessionModel->last_page) ? (int) $model->sessionModel->last_page : 0;
if ($start_page !== 0) {
$app->enqueueMessage(JText::_('COM_FABRIK_RESTARTING_MUTLIPAGE_FORM'));
} 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->ajax = $model->isAjax();
$opts->ajaxValidation = $params->get('ajax_validations');
$opts->primaryKey = $key;
$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->inlineMessage = (bool) $this->isMambot;
//$$$rob dont int this as keys may be string
$opts->rowid = $model->_rowId;
//3.0 needed for ajax requests
$opts->listid = (int) $this->get('ListModel')->getId();
$imgs = new stdClass();
$imgs->alert = FabrikHelperHTML::image('alert.png', 'form', $this->tmpl, '', true);
$imgs->action_check = FabrikHelperHTML::image('action_check.png', 'form', $this->tmpl, '', true);
$imgs->ajax_loader = FabrikHelperHTML::image('ajax-loader.gif', 'form', $this->tmpl, '', true);
$opts->images = $imgs;
//$$$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->fabrik_window_id = JRequest::getVar('fabrik_window_id', '');
//3.0 changed to fabrik_window_id (automatically appended by Fabrik.Window xhr request to load window data
//for editing groups with joined data and an empty joined record (ie no joined records)
$hidden = array();
$maxRepeat = array();
foreach ($this->groups as $g) {
$hidden[$g->id] = $g->startHidden;
$maxRepeat[$g->id] = $g->maxRepeat;
}
//.........這裏部分代碼省略.........
示例14: display
function display($tmpl = 'default')
{
global $Itemid;
$app =& JFactory::getApplication();
JHTML::_('behavior.calendar');
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
$pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
$plugin =& $pluginManager->getPlugIn('calendar', 'visualization');
if (FabrikWorker::nativeMootools12()) {
FabrikHelperHTML::script('Mootools.Lang.js', 'components/com_fabrik/libs/mootools1.2/', true);
FabrikHelperHTML::script('date.js', 'components/com_fabrik/plugins/element/fabrikdate/', false);
FabrikHelperHTML::addScriptDeclaration("Date.defineParsers('%d([-./]%m([-./]%Y((T| )%X)?)?)?');");
}
FabrikHelperHTML::mocha();
FabrikHelperHTML::loadCalendar();
$model =& $this->getModel();
$usersConfig =& JComponentHelper::getParams('com_fabrik');
$id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
$model->setId($id);
$this->row =& $model->getVisualization();
$model->setTableIds();
$this->assign('containerId', $this->get('ContainerId'));
$this->assignRef('filters', $this->get('Filters'));
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assign('filterFormURL', $this->get('FilterFormURL'));
$calendar =& $model->_row;
$this->calName = $model->getCalName();
$config =& JFactory::getConfig();
$document =& JFactory::getDocument();
$canAdd = $this->get('CanAdd');
$this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
if ($canAdd && $this->requiredFiltersFound) {
$app->enqueueMessage(JText::_('COM_FABRIK_DOUBLE_CLICK_TO_ADD_EVENT'));
}
$this->assign('canAdd', $canAdd);
//FabrikHelperHTML::mocha();
FabrikHelperHTML::packageJS();
$fbConfig =& JComponentHelper::getParams('com_fabrik');
JHTML::stylesheet('table.css', 'media/com_fabrik/css/');
FabrikHelperHTML::script('element.js', 'media/com_fabrik/js/', true);
FabrikHelperHTML::script('form.js', 'media/com_fabrik/js/', true);
FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
FabrikHelperHTML::script('calendar.js', 'components/com_fabrik/plugins/visualization/calendar/', true);
$params =& $model->getParams();
//Get the active menu item
$usersConfig =& JComponentHelper::getParams('com_fabrik');
$urlfilters = JRequest::get('get');
unset($urlfilters['option']);
unset($urlfilters['view']);
unset($urlfilters['controller']);
unset($urlfilters['Itemid']);
unset($urlfilters['visualizationid']);
unset($urlfilters['format']);
if (empty($urlfilters)) {
$urlfilters = new stdClass();
}
$urls = new stdClass();
//dont JRoute as its wont load with sef?
$urls->del = 'index.php?option=com_fabrik&controller=visualization.calendar&view=visualization&task=deleteEvent&format=raw&Itemid=' . $Itemid . '&id=' . $id;
$urls->add = 'index.php?option=com_fabrik&view=visualization&controller=visualization.calendar&format=raw&Itemid=' . $Itemid . '&id=' . $id;
$user =& JFactory::getUser();
$legend = $params->get('show_calendar_legend', 0) ? $model->getLegend() : '';
$tmpl = $params->get('calendar_layout', 'default');
$pluginManager->loadJS();
$options = new stdClass();
$options->url = $urls;
$options->eventTables =& $model->getEventTables();
$options->calendarId = $calendar->id;
$options->popwiny = $params->get('yoffset', 0);
$options->urlfilters = $urlfilters;
$options->canAdd = $canAdd;
$options->tmpl = $tmpl;
$formView =& $this->_formView;
$formView->_isMambot = true;
$o = $model->getAddStandardEventFormInfo();
if ($o != null) {
$options->tableid = $o->id;
$formView->setId($o->form_id);
$options->formid = $o->form_id;
}
$formModel =& $formView->getModel();
$form =& $formModel->getForm();
$options->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
$model->setRequestFilters();
$options->filters =& $model->filters;
// end not sure
$options->Itemid = $Itemid;
$options->standard_event_form = $params->get('use_standard_event_table', 0) == 1 ? true : false;
$options->show_day = $params->get('show_day', true);
$options->show_week = $params->get('show_week', true);
$options->days = array(JText::_('Sunday'), JText::_('Monday'), JText::_('Tuesday'), JText::_('Wednesday'), JText::_('Thursday'), JText::_('Friday'), JText::_('Saturday'));
$options->shortDays = array(JText::_('Sun'), JText::_('Mon'), JText::_('Tue'), JText::_('Wed'), JText::_('Thu'), JText::_('Fri'), JText::_('Sat'));
$options->months = array(JText::_('January'), JText::_('February'), JText::_('March'), JText::_('April'), JText::_('May'), JText::_('June'), JText::_('July'), JText::_('August'), JText::_('September'), JText::_('October'), JText::_('November'), JText::_('December'));
$options->shortMonths = array(JText::_('Jan'), JText::_('Feb'), JText::_('Mar'), JText::_('Apr'), JText::_('May'), JText::_('Jun'), JText::_('Jul'), JText::_('Aug'), JText::_('Sept'), JText::_('Oct'), JText::_('Nov'), JText::_('Dec'));
$options->first_week_day = (int) $params->get('first_week_day', 0);
$options->monthday = new stdClass();
$options->monthday->width = (int) $params->get('calendar-monthday-width', 90);
$options->monthday->height = (int) $params->get('calendar-monthday-height', 90);
$options->greyscaledweekend = $params->get('greyscaled-week-end', 0);
$options->viewType = $params->get('calendar_default_view', 'month');
//.........這裏部分代碼省略.........
示例15: viewFormLink
/**
* Creates the html <a> link allowing you to edit other forms from the table
* E.g. Faceted browsing: those specified in the table's "Form's whose primary keys link to this table"
*
* @param bool $popUp is popup link
* @param object $element 27/06/2011 - changed to passing in element
* @param object $row current list row
* @param string $key key
* @param string $val value
* @param bool $usekey use the key
* @param int $f repeat value 27/11/2011
*
* @return string <a> html part
*/
public function viewFormLink($popUp = false, $element = null, $row = null, $key = '', $val = '', $usekey = false, $f = 0)
{
$elKey = $element->list_id . '-' . $element->form_id . '-' . $element->element_id;
$params = $this->getParams();
$listid = $element->list_id;
$formid = $element->form_id;
$linkedFormText = $params->get('linkedformtext');
$factedlinks = $params->get('factedlinks');
$linkedFormText = JArrayHelper::fromObject($factedlinks->linkedformtext);
$label = $this->parseMessageForRowHolder(JArrayHelper::getValue($linkedFormText, $elKey), JArrayHelper::fromObject($row));
$app = JFactory::getApplication();
if (!$app->isAdmin()) {
$Itemid = (int) @$app->getMenu('site')->getActive()->id;
}
if (is_null($listid)) {
$list = $this->getTable();
$listid = $list->id;
}
if (is_null($formid)) {
$form = $this->getFormModel()->getForm();
$formid = $form->id;
}
$facetTable = $this->_facetedTable($listid);
if (!$facetTable->canAdd()) {
return '<div style="text-align:center"><a title="' . JText::_('JERROR_ALERTNOAUTHOR') . '"><img src="media/com_fabrik/images/login.png" alt="' . JText::_('JERROR_ALERTNOAUTHOR') . '" /></a></div>';
}
if ($app->isAdmin()) {
$bits[] = 'task=form.view';
$bits[] = 'cid=' . $formid;
} else {
$bits[] = 'view=form';
$bits[] = 'Itemid=' . $Itemid;
}
$bits[] = 'formid=' . $formid;
$bits[] = 'referring_table=' . $this->getTable()->id;
// $$$ hugh - change in fabrikdatabasejoin getValue() means we have to append _raw to key name
if ($key != '') {
$bits[] = $key . '_raw=' . $val;
}
if ($popUp) {
$bits[] = "tmpl=component";
$bits[] = "ajax=1";
}
if ($usekey and $key != '' and !is_null($row)) {
$bits[] = 'usekey=' . FabrikString::shortColName($key);
$bits[] = 'rowid=' . $row->slug;
} else {
$bits[] = 'rowid=0';
}
$url = 'index.php?option=com_fabrik&' . implode('&', $bits);
$url = JRoute::_($url);
if (is_null($label) || $label == '') {
$label = JText::_('COM_FABRIK_LINKED_FORM_ADD');
}
if ($popUp) {
FabrikHelperHTML::mocha('a.popupwin');
$opts = new stdClass();
$opts->maximizable = 1;
$opts->title = JText::_('COM_FABRIK_ADD');
$opts->evalScripts = 1;
$opts = json_encode($opts);
$link = "<a rel='{$opts}' href=\"{$url}\" class=\"popupwin\" title=\"{$label}\">" . $label . "</a>";
} else {
$link = '<a href="' . $url . '" title="' . $label . '">' . $label . '</a>';
}
$url = '<span class="addbutton">' . $link . '</span></a>';
return $url;
}