當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FabrikHelperHTML::tips方法代碼示例

本文整理匯總了PHP中FabrikHelperHTML::tips方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::tips方法的具體用法?PHP FabrikHelperHTML::tips怎麽用?PHP FabrikHelperHTML::tips使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FabrikHelperHTML的用法示例。


在下文中一共展示了FabrikHelperHTML::tips方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display

 /**
  * display the admin home page
  */
 function display()
 {
     $db =& JFactory::getDBO();
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'home.php';
     $db->setQuery("SELECT * FROM #__fabrik_log WHERE\tmessage_type != '' ORDER BY timedate_created DESC limit 0, 10");
     $logs = $db->loadObjectList();
     $feed = $this->getRSSFeed();
     FabrikHelperHTML::tips();
     FabrikViewHome::show($feed, $logs);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:13,代碼來源:home.php

示例2: _addJavascript

 /**
  * Append the form javascript into the document head
  *
  * @param   int $listId table id
  *
  * @return  void|boolean
  */
 protected function _addJavascript($listId)
 {
     $pluginManager = FabrikWorker::getPluginManager();
     /** @var FabrikFEModelForm $model */
     $model = $this->getModel();
     $aLoadedElementPlugins = array();
     $jsActions = array();
     $bKey = $model->jsKey();
     $srcs = FabrikHelperHTML::framework();
     $shim = array();
     if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
         define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
         FabrikHelperHTML::slimbox();
         $dep = new stdClass();
         $dep->deps = array('fab/element', 'lib/form_placeholder/Form.Placeholder', 'fab/encoder');
         $shim['fabrik/form'] = $dep;
         $deps = new stdClass();
         $deps->deps = array('fab/fabrik', 'fab/element', 'fab/form-submit');
         $framework['fab/elementlist'] = $deps;
         $srcs[] = 'media/com_fabrik/js/lib/form_placeholder/Form.Placeholder.js';
         FabrikHelperHTML::addToFrameWork($srcs, 'media/com_fabrik/js/form');
         FabrikHelperHTML::addToFrameWork($srcs, 'media/com_fabrik/js/form-submit');
         FabrikHelperHTML::addToFrameWork($srcs, 'media/com_fabrik/js/element');
     }
     $aWYSIWYGNames = array();
     // $$$ hugh - yet 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 && $elementModel->canUse() && $model->isEditable()) {
                 $aWYSIWYGNames[] = $res;
             }
             // Load in once the element js class files
             $element = $elementModel->getElement();
             if (!in_array($element->plugin, $aLoadedElementPlugins)) {
                 /* $$$ hugh - certain elements, like file-upload, need to load different JS files
                  * on a per-element basis, so as a test fix, I modified the file-upload's formJavaScriptClass to return false,
                  * and test for that here, so as to not add it to aLoadedElementPlugins[].  The existing 'static' tests in
                  * formJavascriptClass() should still prevent scripts being added twice.
                  */
                 if ($elementModel->formJavascriptClass($srcs, '', $shim) !== false) {
                     $aLoadedElementPlugins[] = $element->plugin;
                 }
             }
             $eventMax = $groupModel->repeatTotal == 0 ? 1 : $groupModel->repeatTotal;
             for ($c = 0; $c < $eventMax; $c++) {
                 $jsAct = $elementModel->getFormattedJSActions($bKey, $c);
                 if (!empty($jsAct)) {
                     $jsActions[] = $jsAct;
                 }
             }
         }
     }
     FabrikHelperHTML::iniRequireJS($shim);
     $actions = trim(implode("\n", $jsActions));
     FabrikHelperHTML::windows('a.fabrikWin');
     FabrikHelperHTML::tips('.hasTip', array(), "\$('{$bKey}')");
     $model->getFormCss();
     $opts = $this->jsOpts();
     $model->jsOpts = $opts;
     $pluginManager->runPlugins('onJSOpts', $model);
     $opts = json_encode($model->jsOpts);
     if (!FabrikHelperHTML::inAjaxLoadedPage()) {
         JText::script('COM_FABRIK_VALIDATING');
         JText::script('COM_FABRIK_SUCCESS');
         JText::script('COM_FABRIK_NO_REPEAT_GROUP_DATA');
         JText::script('COM_FABRIK_VALIDATION_ERROR');
         JText::script('COM_FABRIK_CONFIRM_DELETE_1');
     }
     JText::script('COM_FABRIK_FORM_SAVED');
     // $$$ rob don't declare as var $bKey, but rather assign to window, as if loaded via ajax window the function is wrapped
     // inside an anonymous function, and therefore $bKey wont be available as a global var in window
     $script = array();
     $script[] = "\t\tvar {$bKey} = Fabrik.form('{$bKey}', " . $model->getId() . ", {$opts});";
     // Instantiate js objects for each element
     $vstr = "\n";
     $groups = $model->getGroupsHiarachy();
     $script[] = "\tFabrik.blocks['{$bKey}'].addElements(";
     $groupedJs = new stdClass();
     foreach ($groups as $groupModel) {
         $groupId = $groupModel->getGroup()->id;
         $groupedJs->{$groupId} = array();
         if (!$groupModel->canView('form')) {
             continue;
         }
         $elementJs = array();
         $elementModels = $groupModel->getPublishedElements();
         // $$$ rob if repeatTotal is 0 we still want to add the js objects as the els are only hidden
         $max = $groupModel->repeatTotal > 0 ? $groupModel->repeatTotal : 1;
         foreach ($elementModels as $elementModel) {
//.........這裏部分代碼省略.........
開發者ID:LGBGit,項目名稱:tierno,代碼行數:101,代碼來源:view.base.php

示例3: edit

    /**
     * Display the form to add or edit a cronjob
     * @param object cronjob
     * @param object parameters from attributes
     * @param array lists
     * @param object pluginmanager
     */
    function edit($row, $params, $lists, &$pluginManager)
    {
        JRequest::setVar('hidemainmenu', 1);
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('admincron.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::tips();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::addScriptDeclaration("\n\t\t\twindow.addEvent('domready', function(e) {\n\t\t\t\tnew adminCron({'sel':'" . $row->plugin . "'});\n\t\t\t});\n\n\t\t\tfunction submitbutton(pressbutton) {\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/* do field validation */\n\t\t\t\tif (form.label.value == '') {\n\t\t\t\t\talert( '" . JText::_('PLEASE ENTER A LABEL', true) . "');\n\t\t\t\t} else {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}\n\t\t\t}\n\t\t\t");
        FabrikViewCron::setCronToolbar();
        FabrikHelperHTML::loadCalendar();
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm">
		<div class="col100">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
			<table class="admintable">

				<tr>
					<td class="key"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
					<td><input class="inputbox" type="text" id="label" name="label" size="75" value="<?php 
        echo $row->label;
        ?>
" /></td>
				</tr>

				<tr>
					<td class="key"><label for="frequency"><?php 
        echo JText::_('EVERY');
        ?>
</label></td>
					<td><input class="inputbox" type="text" id="frequency" name="frequency" size="4" value="<?php 
        echo $row->frequency;
        ?>
" /></td>
				</tr>

				<tr>
					<td class="key"><label for="unit"><?php 
        echo JText::_('UNIT');
        ?>
</label></td>
					<td><?php 
        echo $lists['unit'];
        ?>
</td>
				</tr>

				<tr>
					<td class="key"><label for="lastrun"><?php 
        echo JText::_('STARTING FROM');
        ?>
</label></td>
					<td><?php 
        echo JHTML::calendar($row->lastrun, 'lastrun', 'lastrun', '%Y-%m-%d %H:%M:%S', array('size' => 23));
        ?>
</td>
				</tr>

				<tr>
					<td class="key"><label for="state"><?php 
        echo JText::_('PUBLISHED');
        ?>
</label></td>
					<td>
					<input type="checkbox" id="state" name="state" value="1" <?php 
        echo $row->state ? 'checked="checked"' : '';
        ?>
 />
					</td>
				</tr>
				<tr>
					<td colspan="2">
					<?php 
        echo stripslashes($params->render());
        ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for=""><?php 
        echo JText::_('PLUGIN');
        ?>
</label>
					</td>
					<td>
						<?php 
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:cron.php

示例4: display


//.........這裏部分代碼省略.........
     }
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     //if there is a menu item available AND the form is not rendered in a content plugin or module
     if (is_object($menu) && !$this->_isMambot) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title') || $menu_params->get('show_page_title') == 0) {
             $params->set('page_title', '');
             $params->set('show_page_title', 0);
         } else {
             $params->set('page_title', $menu_params->get('page_title'));
             $params->set('show_page_title', $menu_params->get('show_page_title', 0));
         }
     } else {
         $params->set('show_page_title', JRequest::getInt('show_page_title', 0));
         $params->set('page_title', JRequest::getVar('title', ''));
         $params->set('show-title', JRequest::getInt('show-title', 1));
     }
     if (!$this->_isMambot) {
         $document->setTitle($w->parseMessageForPlaceHolder($params->get('page_title'), $_REQUEST));
     }
     $this->table = new stdClass();
     $this->table->label = $w->parseMessageForPlaceHolder($table->label, $_REQUEST);
     $this->table->intro = $w->parseMessageForPlaceHolder($table->introduction);
     $this->table->id = $table->id;
     $this->table->db_table_name = $table->db_table_name;
     $this->group_by = $table->group_by;
     $this->form = new stdClass();
     $this->form->id = $table->form_id;
     $this->formid = 'tableform_' . $table->id;
     $form =& $model->getForm();
     FabrikHelperHTML::tips('.hasTip', array(), "\$('" . $this->formid . "')");
     $this->table->action = $this->get('TableAction');
     $this->showCSV = $model->canCSVExport();
     $this->showCSVImport = $model->canCSVImport();
     $this->assignRef('navigation', $nav);
     $this->nav = JRequest::getInt('fabrik_show_nav', $params->get('show-table-nav', 1)) ? $nav->getListFooter($model->_id, $this->getTmpl()) : '';
     $this->nav = '<div class="fabrikNav">' . $this->nav . '</div>';
     $this->fabrik_userid = $user->get('id');
     $this->canDelete = $model->deletePossible() ? true : false;
     $jsdelete = "oPackage.submitfabrikTable({$table->id}, 'delete')";
     $this->deleteButton = $model->deletePossible() ? "<input class=\"button\" type=\"button\" onclick=\"{$jsdelete}\" value=\"" . JText::_('DELETE') . "\" name=\"delete\"/>" : '';
     $this->showPDF = $params->get('pdf', 0);
     if ($this->showPDF) {
         $this->pdfLink = FabrikHelperHTML::pdfIcon($model, $params);
     }
     $this->emptyButton = $model->canEmpty() ? "<input class=\"button\" type=\"button\" value=\"" . JText::_('EMPTY') . "\" name=\"doempty\"/>" : "";
     $this->csvImportLink = $this->showCSVImport ? JRoute::_("index.php?option=com_fabrik&c=import&view=import&filetype=csv&tableid=" . $table->id) : '';
     $this->showAdd = $model->canAdd();
     if ($this->showAdd) {
         if ($params->get('show-table-add', 1)) {
             $this->assign('addRecordLink', $this->get('AddRecordLink'));
             $this->assign('addRecordLabel', $this->get('AddRecordLabel'));
         } else {
             $this->showAdd = false;
         }
     }
     $this->assign('addRecordId', "table_" . $model->_id . "_addRecord");
     $this->showRSS = $params->get('rss', 0) == 0 ? 0 : 1;
     if ($this->showRSS) {
         $this->rssLink = $model->getRSSFeedLink();
         if ($this->rssLink != '') {
             $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
             $document->addHeadLink($this->rssLink, 'alternate', 'rel', $attribs);
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:67,代碼來源:view.html.php

示例5: edit

    /**
     * Display the form to add or edit a table
     * @param object table
     * @param array the drop down lists used on the form
     * @param array connection tables
     * @param object menus
     * @param string compoent action
     * @param int form id that the table links to?
     * @param object parameters
     * @param object plugin mangager
     * @param object table model
     */
    function edit($row, $lists, $connectionTables, $menus, $fabrikid, $params, $pluginManager, $model, $form)
    {
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        FabrikViewTable::setTableToolbar();
        JRequest::setVar('hidemainmenu', 1);
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('pluginmanager.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('admintable.js', 'administrator/components/com_fabrik/views/', true);
        JFilterOutput::objectHTMLSafe($row);
        jimport('joomla.html.editor');
        //just until joomla uses mootools 1.2
        FabrikHelperHTML::mootools();
        require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'editor.php';
        jimport('joomla.html.pane');
        FabrikHelperHTML::tips();
        $editor =& FabrikHelperHTML::getEditor();
        $pane =& JPane::getInstance();
        $fbConfig =& JComponentHelper::getParams('com_fabrik');
        $opts = new stdClass();
        $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
        $opts = FastJSON::encode($opts);
        $lang = new stdClass();
        $lang->action = JText::_('ACTION');
        $lang->do = JText::_('DO');
        $lang->del = JText::_('DELETE');
        $lang->in = JText::_('IN');
        $lang->on = JText::_('ON');
        $lang->options = JText::_('OPTIONS');
        $lang->please_select = JText::_('COM_FABRIK_PLEASE_SELECT');
        $lang = FastJSON::encode($lang);
        $js = "window.addEvent('domready', function() {\n  \t\tvar aPlugins = [];\n";
        $js .= $pluginManager->getAdminPluginJs('table', $row, $lists);
        $js .= "controller = new TablePluginManager(aPlugins, {$lang}, {$opts});\n";
        $usedPlugins = $params->get('plugin', '', '_default', 'array');
        $js .= $pluginManager->getAdminSelectedPluginJS('table', $row, $lists, $params);
        $js .= "});\n";
        $js .= "var connectiontables = new Array;\n";
        $i = 0;
        if (is_array($connectionTables)) {
            foreach ($connectionTables as $k => $items) {
                foreach ($items as $v) {
                    $js .= "connectiontables[" . $i++ . "] = new Array('{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "');\n\t\t";
                }
            }
        }
        $js .= "\n\t\t\tfunction submitbutton(pressbutton) {\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar err = '';";
        $js .= $editor->save('introduction');
        $js .= "if(\$('label').value == '') {\n\t\t\t\t\terr = err +'" . JText::_('PLEASE ENTER A TABLE LABEL', true) . '\\n' . "';\n\t\t\t\t}\n\n\t\t\t\tif(\$('database_name')) {\n\t\t\t\t\tif(\$('database_name').value == '') {\n\t\t\t\t\t\tif(\$('connection_id')) {\n\t\t\t\t\t\t\tif(\$('connection_id').value == '-1') {\n\t\t\t\t\t\t\t\terr = err +'" . JText::_('PLEASE SELECT A CONNECTION', true) . '\\n' . "';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(\$('tablename')) {\n\t\t\t\t\t\t\tif(\$('tablename').value == '' || \$('tablename').value == '-1') {\n\t\t\t\t\t\t\t\terr = err + '" . JText::_('PLEASE SELECT A DATABASE TABLE', true) . '\\n' . "';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (err == '') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}else{\n\t\t\t\t\talert (err);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar joinCounter = 0;";
        $document->addScriptDeclaration($js);
        FabrikHelperHTML::cleanMootools();
        ?>
<form action="index.php" method="post" name="adminForm">
<table style="width: 100%">
	<tr>
		<td style="width: 50%" valign="top">
		<fieldset class="adminform"><legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
		<table class="admintable">
			<tr>
				<td class="key"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
				<td><input class="inputbox" type="text" id="label" name="label"
					size="50" value="<?php 
        echo $row->label;
        ?>
" /></td>
			</tr>
			<tr>
				<td class="key"><?php 
        echo JText::_('INTRODUCTION');
        ?>
</td>
				<td><?php 
        echo $editor->display('introduction', $row->introduction, '100%', '200', '45', '25', false);
        ?>
				</td>
			</tr>
		</table>
		</fieldset>

		<fieldset><legend><?php 
        echo JText::_('FILTERS');
        ?>
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:table.php

示例6: edit

    /**
     * Display the form to add or edit a Visualization
     * @param object Visualization
     * @param object parameters from attributes
     * @param array lists
     * @param object menus
     * @param object pluginmanager
     * @param object form - used to render xml form cdoe
     */
    function edit(&$row, &$params, &$lists, &$menus, &$pluginManager, &$form)
    {
        JRequest::setVar('hidemainmenu', 1);
        FabrikViewVisualization::setVisualizationToolbar();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('administrator/components/com_fabrik/views/namespace.js');
        FabrikHelperHTML::script('administrator/components/com_fabrik/views/adminvisualization.js');
        FabrikHelperHTML::tips();
        JFilterOutput::objectHTMLSafe($row);
        jimport('joomla.html.pane');
        $pane = JPane::getInstance();
        $editor = JFactory::getEditor();
        $js = "head.ready(function() {\n\t\tnew adminVisualization({'sel':'" . $row->plugin . "'});\n\t});";
        $js .= "\n\t\tfunction submitbutton(pressbutton) {\n\t\t\tvar form = document.adminForm;\n\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\tsubmitform( pressbutton);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// do field validation\n\t\t\tif (\$('plugin').getValue() == '') {\n\t\t\t\talert('" . JText::_('YOU MUST SELECT A PLUGIN.', true) . "');\n\t\t\t} else if (\$('label').getValue()  == '') {\n\t\t\t\talert('" . JText::_('PLEASE ENTER A LABEL', true) . "');\n\t\t\t} else {\n\t\t\t\tsubmitform( pressbutton);\n\t\t\t}\n\t\t}";
        $document->addScriptDeclaration($js);
        ?>
		<form action="index.php" method="post" name="adminForm">
			<table style="width:100%;">
		 		<tr>
	 			<td  valign="top" style="width:50%;">
	 			<fieldset class="adminform">
					<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
	 				<table class="admintable">
	 					<tr>
							<td class="key" width="30%"><label for="label"><?php 
        echo JText::_('LABEL');
        ?>
</label></td>
							<td width="70%">
								<input class="inputbox" type="text" name="label" id="label"" size="50" value="<?php 
        echo $row->label;
        ?>
" />
							</td>
						</tr>
					<tr>
						<td class="key">
							<label for="intro_text">
								<?php 
        echo JText::_('INTRO TEXT');
        ?>
							</label>
						</td>
						<td>
							<?php 
        echo $editor->display('intro_text', $row->intro_text, '100%', '200', '50', '5', false);
        ?>
						</td>
					</tr>
						<tr>
							<td class="key">
								<label for=""><?php 
        echo JText::_('PLUGIN');
        ?>
</label>
							</td>
							<td>
								<?php 
        echo $lists['plugins'];
        ?>
							</td>
						</tr>
							<?php 
        foreach ($pluginManager->_plugIns['visualization'] as $oPlugin) {
            $oPlugin->setId($row->id);
            ?>
								<tr>
								<td colspan="2">
									<?php 
            $oPlugin->renderAdminSettings();
            ?>
									</td>
								</tr>
								<?php 
        }
        ?>
							</td>
						</tr>
	 				</table>
	 				</fieldset>
	 			</td>
	 			<td valign="top">
	 				<?php 
        echo $pane->startPane("content-pane");
        echo $pane->startPanel(JText::_('PUBLISHING'), "publish-page");
        echo $form->render('details');
        echo $pane->endPanel();
        echo $pane->endPane();
//.........這裏部分代碼省略.........
開發者ID:romuland,項目名稱:khparts,代碼行數:101,代碼來源:visualization.php

示例7: edit

    /**
     * Display the form to add or edit an form
     * @param object form table
     * @param object plugin manager
     * @param array lists
     * @param object parameters from attributes
     * @param object form - used to render xml form cdoe
     */
    function edit($row, $pluginManager, $lists, $params, &$form)
    {
        FabrikHelperHTML::mootools();
        JHTML::stylesheet('fabrikadmin.css', 'administrator/components/com_fabrik/views/');
        jimport('joomla.html.pane');
        JRequest::setVar('hidemainmenu', 1);
        $pane =& JPane::getInstance();
        FabrikHelperHTML::tips();
        FabrikViewForm::setFormToolbar();
        $editor =& JFactory::getEditor();
        $document =& JFactory::getDocument();
        FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('pluginmanager.js', 'administrator/components/com_fabrik/views/', true);
        FabrikHelperHTML::script('adminform.js', 'administrator/components/com_fabrik/views/', true);
        JFilterOutput::objectHTMLSafe($row);
        $lang = new stdClass();
        $lang->action = JText::_('ACTION');
        $lang->do = JText::_('DO');
        $lang->del = JText::_('DELETE');
        $lang->in = JText::_('IN');
        $lang->on = JText::_('ON');
        $lang->options = JText::_('OPTIONS');
        $lang->please_select = JText::_('COM_FABRIK_PLEASE_SELECT');
        $lang->front_end = JText::_('FRONT END');
        $lang->back_end = JText::_('BACK END');
        $lang->both = JText::_('BOTH');
        $lang->new = JText::_('NEW');
        $lang->edit = JText::_('EDIT');
        $lang = FastJSON::encode($lang);
        $js = "\n  window.addEvent('load', function() {\n  \tvar lang = {$lang};\n";
        $js .= $pluginManager->getAdminPluginJs('form', $row, $lists);
        $js .= "controller = new fabrikAdminForm(aPlugins, lang);\n";
        $js .= $pluginManager->getAdminSelectedPluginJS('form', $row, $lists, $params);
        jimport('joomla.html.editor');
        $js .= "\n});\n\nfunction submitbutton(pressbutton) {\n\n\tvar form = document.adminForm;" . $editor->save('intro') . "\n\tif (pressbutton == 'cancel') {\n\t\tsubmitform( pressbutton);\n\t\treturn;\n\t}\n\n\t/* do field validation */\n\tvar err = '';\n\n\tif (form.label.value == '') {\n\t\terr = err + '" . JText::_('PLEASE ENTER A FORM LABEL', true) . '\\n' . "';\n\t}\n\n\tif(form.record_in_database.checked == true && form._database_name.value == '') {\n\t\terr = err + '" . JText::_('PLEASE ENTER A DATABASE TABLE NAME', true) . "';\n\t}\n\tif (err == '') {\n\t\t/* assemble the form groups back into one field */\n\t\tmergeFormGroups()\n\t\tsubmitform( pressbutton);\n\t}else{\n\t\talert (err);\n\t}\n}\n\nfunction mergeFormGroups() {\n\t/* assemble the form groups back into one field */\n\tvar tmp = [];\n\tif(\$('current_groups')) {\n\t\tvar opts = \$('current_groups').options;\n\t\tfor (var i=0, n=opts.length; i < n; i++) {\n\t\t\ttmp.push(opts[i].value);\n\t\t}\n\t\t\$('current_groups_str').value = tmp.join(',');\n\t}\n}\n";
        $document->addScriptDeclaration($js);
        FabrikHelperHTML::cleanMootools();
        ?>
		<form action="index.php" method="post" name="adminForm" id="adminForm">
		 	<table style="width:100%;">
		 		<tr>
	 			<td style="width:50%;" valign="top">
	 			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
					<table class="admintable">
						<tr>
							<td class="key" width="30%">
							<?php 
        echo JHTML::_('tooltip', JText::_('FROM LABEL DESC'), JText::_('LABEL'), 'tooltip.png', JText::_('LABEL'));
        ?>
							</td>
							<td width="70%">
								<input class="inputbox" type="text" name="label" id="label" size="50" value="<?php 
        echo $row->label;
        ?>
" />
							</td>
						</tr>
						<tr>
							<td class="key"><?php 
        echo JText::_('INTRODUCTION');
        ?>
</td>
							<td><?php 
        echo $editor->display('intro', $row->intro, '100%', '200', '50', '5', false);
        ?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="error">
								<?php 
        echo JHTML::_('tooltip', JText::_('FROM ERROR MESSAGE DESC'), JText::_('ERROR MESSAGE'), 'tooltip.png', JText::_('ERROR MESSAGE', true));
        ?>
								</label>
							</td>
							<td>
								<input class="inputbox" type="text" name="error" id="error" size="50" value="<?php 
        echo $row->error;
        ?>
" />
							</td>
						</tr>
					</table>
				</fieldset>
				<fieldset class="adminform">
				<legend><?php 
        echo JText::_('BUTTONS');
        ?>
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:form.php

示例8: truncate

 /**
  * Truncate text possibly setting a tip to show all of the text
  *
  * @param   string  $text  text to truncate
  * @param   array   $opts  optional options array
  *
  * @return  string
  */
 public static function truncate($text, $opts = array())
 {
     $text = htmlspecialchars(strip_tags($text), ENT_QUOTES);
     $orig = $text;
     $wordCount = FArrayHelper::getValue($opts, 'wordcount', 10);
     $showTip = FArrayHelper::getValue($opts, 'tip', true);
     $title = FArrayHelper::getValue($opts, 'title', "");
     $text = explode(' ', $text);
     $summary = array_slice($text, 0, $wordCount);
     if (count($text) > $wordCount) {
         $summary[] = " ...";
     }
     $summary = implode(' ', $summary);
     if ($showTip && count($text) > $wordCount) {
         FabrikHelperHTML::tips();
         if ($title !== '') {
             $title .= "::";
         }
         $tip = htmlspecialchars('<div class="truncate_text">' . $title . $orig . '</div>');
         $jOpts = new stdClass();
         $jOpts->notice = true;
         $jOpts->position = FArrayHelper::getValue($opts, 'position', 'top');
         $jOpts = json_encode($jOpts);
         $summary = '<span class="fabrikTip" opts=\'' . $jOpts . '\' title="' . $tip . '">' . $summary . '</span>';
     }
     return $summary;
 }
開發者ID:ankaau,項目名稱:GathBandhan,代碼行數:35,代碼來源:string.php

示例9: _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;
     }
//.........這裏部分代碼省略.........
開發者ID:juliano-hallac,項目名稱:fabrik,代碼行數:101,代碼來源:view.html.php

示例10: editJs

 function editJs($row, $pluginManager, $lists, $params)
 {
     FabrikHelperHTML::mootools();
     FabrikHelperHTML::tips();
     $fbConfig =& JComponentHelper::getParams('com_fabrik');
     FabrikHelperHTML::script('namespace.js', 'administrator/components/com_fabrik/views/', true);
     //FabrikHelperHTML::script('element.js', 'components/com_fabrik/views/form/', true);
     FabrikHelperHTML::script('adminelement.js', 'administrator/components/com_fabrik/views/', true);
     $document =& JFactory::getDocument();
     $js = "/* <![CDATA[ */\n\n\tfunction submitbutton(pressbutton) {\n\t\tvar adminform = document.adminForm;\n\t\t/*  do field validation */\n\t\tif (pressbutton == 'cancel') {\n\t\t\tsubmitform( pressbutton);\n\t\t\treturn;\n   \t}\n   \tif(\$('javascriptActions').getElements('select[name^=js_action]').get('value').contains('')) {\n   \t\talert('" . JText::_('ENSURE_JS_EVENT_SELECTED', true) . "');\n   \t\treturn;\n   \t}\n\n   \tvar empty = \$('javascriptActions').getElements('select[name^=js_e_condition]').some(function(s) {\n   \t\tvar c = s.findClassUp('adminform');\n   \t\treturn (c.getElement('textarea').get('value') == '' && s.get('value') == '');\n   \t});\n   \tif(empty) {\n   \t\talert('" . JText::_('ENSURE_JS_CONDITION_SELECTED', true) . "');\n   \t\treturn;\n   \t}\n\n   \tvar myRegxp = /^([a-zA-Z0-9_]+)\$/;\n\n\t\tif(myRegxp.test(adminform.name.value)==false || adminform.name.value.indexOf('___') != -1) {\n\t\t\talert( '" . JText::_('PLEASE_ENTER_A_VALID_ELEMENTNAME', true) . "');\n\t\t} else {\n\t\t\tsubmitbutton2( pressbutton);\n\t\t}\n\t}\n\n\tfunction submitbutton2(pressbutton) {";
     if ($fbConfig->get('fbConf_wysiwyg_label', false)) {
         $editor =& FabrikHelperHTML::getEditor();
         $js .= $editor->save('label');
     }
     $js .= "//iternate through the plugin controllers to match selected plugin\n\t\tvar adminform = document.adminForm;\n\t\tvar er = false;\n\n\t\t\$A(pluginControllers).each(function(plugin) {\n\t\t\tif(\$('detailsplugin').value == plugin.element) {\n\t\t\t\tvar r = plugin.controller.onSave();\n\t\t\t\tif(r == false) {\n\t\t\t\t\ter = true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif(er === false) {\n\t\t\tsubmitform( pressbutton);\n\t\t}\n\t\treturn false;\n\t}\n\twindow.addEvent('domready', function() {\n";
     $opts = new stdClass();
     $opts->plugin = $row->plugin;
     $opts->parentid = $row->parent_id;
     $opts->jsevents = $lists['jsActions'];
     $opts->elements = $lists['elements'];
     $js .= "\tvar options = " . FastJSON::encode($opts) . ";\n";
     $js .= "\tvar lang = {'jsaction':'" . JText::_('ACTION') . "','code':'" . JText::_('CODE') . "'};\n" . "var aPlugins = [];\n";
     $c = 0;
     //	set up the template code for creating validation plugin interfaces
     foreach ($pluginManager->_plugIns['validationrule'] as $usedPlugin => $oPlugin) {
         $pluginParams = new fabrikParams('', $oPlugin->_xmlPath, 'fabrikplugin');
         $oPlugin->_pluginParams =& $pluginParams;
         $pluginParams->_duplicate = true;
         $oPlugin->_adminVisible = false;
         $o = new stdClass();
         $o->{$usedPlugin} = $oPlugin->_pluginLabel;
         $o->value = $usedPlugin;
         $o->label = $oPlugin->_pluginLabel;
         $o->html = $oPlugin->renderAdminSettings($usedPlugin, $row, $pluginParams, 0);
         $o = FastJSON::encode($o);
         $js .= "aPlugins.push({$o});\n";
         $c++;
     }
     $js .= "\tvar controller = new fabrikAdminElement(aPlugins, options, lang);\n";
     //add in active validations
     $usedPlugins = $params->get('validation-plugin', '', '_default', 'array');
     $c = 0;
     foreach ($usedPlugins as $usedPlugin) {
         $plugin =& $pluginManager->_plugIns['validationrule'][$usedPlugin];
         $plugin->renderOrder = $c;
         unset($plugin->pluginParams);
         $pluginParams = $plugin->setParams($params);
         $pluginParams->_duplicate = true;
         $names = $pluginParams->_getParamNames();
         $plugin->_adminVisible = true;
         $plugin->_counter = $c;
         //@TODO isnt this the same as renderOrder?
         $data = $oPlugin->renderAdminSettings($usedPlugin, $row, $pluginParams, $lists, 0);
         $data = addslashes(str_replace("\n", "", $data));
         $js .= "controller.addValidation('" . $data . "', '" . $usedPlugins[$c] . "');\n";
         $c++;
     }
     foreach ($pluginManager->_plugIns['element'] as $key => $tmp) {
         $oPlugin =& $pluginManager->_plugIns['element'][$key];
         //do this to reduce the number of queries
         $oPlugin->_element =& $row;
         if (is_a($oPlugin, 'FabrikModelElement')) {
             $oPlugin->setId($row->id);
         } else {
             JError::raiseError(500, "could not load {$key}");
             jexit();
         }
         $js .= $oPlugin->getAdminJS();
     }
     $js .= "});\n\t\t/* ]]> */";
     $document->addScriptDeclaration($js);
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:72,代碼來源:element.php

示例11: _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;
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:view.html.php

示例12: truncate

 function truncate($text, $opts = array())
 {
     $text = htmlspecialchars(strip_tags($text), ENT_QUOTES);
     $orig = $text;
     $wordCount = JArrayHelper::getValue($opts, 'wordcount', 10);
     $showTip = JArrayHelper::getValue($opts, 'tip', true);
     $title = JArrayHelper::getValue($opts, 'title', "");
     $text = explode(" ", $text);
     $summary = array_slice($text, 0, $wordCount);
     if (count($text) > $wordCount) {
         $summary[] = " ...";
     }
     $summary = implode(" ", $summary);
     if ($showTip) {
         FabrikHelperHTML::tips();
         if ($title !== '') {
             $title .= "::";
         }
         $summary = "<span class=\"hasTip\" title=\"{$title}" . "{$orig}\">{$summary}</span>";
     }
     return $summary;
 }
開發者ID:nickbunyan,項目名稱:fabrik,代碼行數:22,代碼來源:string.php

示例13: _addJavascript

 /**
  * Append the form javascript into the document head
  *
  * @param   int  $tableId  table id
  *
  * @return  void
  */
 protected function _addJavascript($tableId)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $aLoadedElementPlugins = array();
     $jsActions = array();
     $jsControllerKey = $model->isEditable() ? 'form_' . $model->getId() : 'details_' . $model->getId();
     $srcs = FabrikHelperHTML::framework();
     if (!defined('_JOS_FABRIK_FORMJS_INCLUDED')) {
         define('_JOS_FABRIK_FORMJS_INCLUDED', 1);
         FabrikHelperHTML::slimbox();
         $srcs[] = 'media/com_fabrik/js/form.js';
         $srcs[] = 'media/com_fabrik/js/element.js';
         $srcs[] = 'media/com_fabrik/js/lib/form_placeholder/Form.Placeholder.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)) {
                 /* $$$ hugh - certain elements, like fileupload, need to load different JS files
                  * on a per-element basis, so as a test fix, I modified the fileupload's formJavaScriptClass to return false,
                  * and test for that here, so as to not add it to aLoadedElementPlugins[].  The existing 'static' tests in
                  * formJavascriptClass() should still prevent scripts being added twice.
                  */
                 if ($elementModel->formJavascriptClass($srcs) !== false) {
                     $aLoadedElementPlugins[] = $element->plugin;
                 }
             }
             $eventMax = $groupModel->repeatTotal == 0 ? 1 : $groupModel->repeatTotal;
             for ($c = 0; $c < $eventMax; $c++) {
                 $jsActions[] = $elementModel->getFormattedJSActions($jsControllerKey, $c);
             }
         }
     }
     $actions = trim(implode("\n", $jsActions));
     $params = $model->getParams();
     $listModel = $model->getlistModel();
     $table = $listModel->getTable();
     $form = $model->getForm();
     FabrikHelperHTML::mocha();
     $bkey = $model->isEditable() ? 'form_' . $model->getId() : 'details_' . $model->getId();
     FabrikHelperHTML::tips('.hasTip', array(), "\$('{$bkey}')");
     $key = FabrikString::safeColNameToArrayKey($table->db_primary_key);
     $this->get('FormCss');
     $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 = (bool) $params->get('ajax_validations');
     $opts->primaryKey = $key;
     $opts->error = @$form->origerror;
     $opts->pages = $model->getPages();
     $opts->plugins = array();
     $opts->multipage_save = (int) $model->saveMultiPage();
     $opts->editable = $model->isEditable();
     $opts->start_page = $start_page;
     $opts->inlineMessage = (bool) $this->isMambot;
     // $$$rob dont int this as keys may be string
     $opts->rowid = (string) $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
     // 3.0 changed to fabrik_window_id (automatically appended by Fabrik.Window xhr request to load window data
     $opts->fabrik_window_id = JRequest::getVar('fabrik_window_id', '');
//.........這裏部分代碼省略.........
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:101,代碼來源:view.base.php

示例14: edit

    /**
     * Display the form to add or edit a group
     * @param object group
     * @param object parameters from attributes
     */
    function edit($row, $params)
    {
        $document =& JFactory::getDocument();
        JRequest::setVar('hidemainmenu', 1);
        FabrikHelperHTML::tips();
        FabrikViewGroup::setGroupToolbar();
        FabrikHelperHTML::cleanMootools();
        $js = "function submitbutton(pressbutton) {\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif (pressbutton == 'cancel') {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (form.name.value == '') {\n\t\t\t\t\talert( '" . JText::_('PLEASE ENTER A NAME', true) . "');\n\t\t\t\t} else {\n\t\t\t\t\tsubmitform( pressbutton);\n\t\t\t\t}\n\t\t\t}";
        $document->addScriptDeclaration($js);
        ?>
		<form action="index.php" method="post" name="adminForm">
		<div class="col100">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('DETAILS');
        ?>
</legend>
			<table class="admintable">
				<tr>
					<td class="key"><label for="name"><?php 
        echo JText::_('NAME');
        ?>
:</label></td>
					<td><input class="inputbox" type="text" id="name" name="name" size="75" value="<?php 
        echo $row->name;
        ?>
" /></td>
				</tr>
				<tr>
					<td class="key"><label for="label"><?php 
        echo JText::_('TITLE');
        ?>
:</label></td>
					<td><input class="inputbox" type="text" id="label" name="label" size="75" value="<?php 
        echo $row->label;
        ?>
" /></td>
				</tr>
				<tr>
					<td class="key"><label for="css"><?php 
        echo JText::_('CSS');
        ?>
:</label></td>
					<td> <textarea rows="8" cols="72" id="css" name="css" class="inputbox"><?php 
        echo $row->css;
        ?>
</textarea>
					</td>
				</tr>
				<tr>
					<td colspan="2">
				<?php 
        echo stripslashes($params->render());
        ?>
					</td>
				</tr>
			</table>
			</fieldset>
			 <fieldset class="adminform">
				<legend><?php 
        echo JText::_('PAGINATION');
        ?>
</legend>
			<?php 
        echo $params->render('params', 'pagination');
        ?>
				<input type="hidden" name="option" value="com_fabrik" />
				<input type="hidden" name="c" value="group" />
				<input type="hidden" name="task" />
				<input type="hidden" name="is_join" value="<?php 
        echo $row->is_join;
        ?>
" />
				<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			</fieldset>
			</div>
			<?php 
        echo JHTML::_('form.token');
        echo JHTML::_('behavior.keepalive');
        ?>
		</form>
	<?php 
    }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:91,代碼來源:group.php


注:本文中的FabrikHelperHTML::tips方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。