Example #1
0
 /**
  * HTML view display method
  *
  * @param   string  $tpl  The name of the template file to parse
  * @return  void
  * @since   3.0
  */
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_JOOMGALLERY_AJAX_UPLOAD'), 'upload');
     $this->_doc->addScriptDeclaration('    var jg_filenamewithjs = ' . ($this->_config->get('jg_filenamewithjs') ? 'true' : 'false') . ';');
     // Load Fine Uploader resources
     $this->_doc->addStyleSheet($this->_ambit->getScript('fineuploader/fineuploader.css'));
     $this->_doc->addScript($this->_ambit->getScript('fineuploader/js/fineuploader' . (JFactory::getConfig()->get('debug') ? '' : '.min') . '.js'));
     $this->fileSizeLimit = 0;
     $this->chunkSize = 0;
     $post_max_size = @ini_get('post_max_size');
     if (!empty($post_max_size)) {
         $post_max_size = JoomHelper::iniToBytes($post_max_size);
         $this->chunkSize = (int) min(500000, (int) (0.8 * $post_max_size));
     }
     $upload_max_filesize = @ini_get('upload_max_filesize');
     if (!empty($upload_max_filesize)) {
         $upload_max_filesize = JoomHelper::iniToBytes($upload_max_filesize);
         $this->fileSizeLimit = $upload_max_filesize;
     }
     $this->editFilename = $this->_config->get('jg_useorigfilename');
     JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
     $this->form = JForm::getInstance(_JOOM_OPTION . '.ajaxupload', 'ajaxupload');
     $this->form->setFieldAttribute('access', 'default', (int) JFactory::getConfig()->get('access'));
     if ($this->_config->get('jg_useorigfilename')) {
         $this->form->setFieldAttribute('imgtitle', 'required', 'false');
     }
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Example #2
0
 protected function getInput()
 {
     $end = $this->element['end'];
     $styles = $this->element['styles'];
     $background = $this->element['background'] ? 'background-image: url(' . $this->getPathToImages() . '/images/' . $this->element['background'] . ');' : '';
     $tag = $this->element['tag'];
     if ($end == '1') {
         // $html = '</li></'.$tag.'><li>';
         $html = '</' . $tag . '><div><div>';
     } else {
         // $html = '</li><'.$tag.' style="'.$background.$styles.'" ><li>';
         $html = '</div></div><' . $tag . ' style="' . $background . $styles . '" >';
     }
     // var_dump($html);
     $identifier = 'menustyles';
     $form = new JForm($identifier);
     JForm::addFormPath(JPATH_SITE . '/modules/mod_slideshowck/elements/test');
     if (!($formexists = $form->loadFile($identifier, false))) {
         echo '<p style="color:red">' . JText::_('Problem loading the file : ' . $identifier . '.xml') . '</p>';
         return '';
     }
     $fields = $form->getFieldset();
     foreach ($fields as $key => $field) {
         // echo '<div class="ckpopup_row">';
         $html .= $form->getLabel(str_replace($identifier . "_", "", $key), $identifier);
         $html .= $form->getInput(str_replace($identifier . "_", "", $key), $identifier);
         // echo '</div>';
     }
     return $html;
 }
Example #3
0
 /**
  * Rendering Menu Params in menu editting form
  */
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath(dirname(__FILE__) . DS . "admin" . DS . "menu");
         $form->loadFile('params', false);
     }
 }
Example #4
0
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath(JPATH_SITE . '/plugins/system/yt/includes/libs/menu/params');
         $form->loadFile('params', false);
     }
 }
Example #5
0
	function onContentPrepareForm($form, $data)
	{
		if ($form->getName()=='com_menus.item')//Add Helix menu params to the menu item
		{
			JHtml::_('behavior.framework', true);
			$doc = JFactory::getDocument();
			JForm::addFormPath(JPATH_PLUGINS.DS.'system'.DS.'helix'.DS.'elements');
			$form->loadFile('params', false);
			
			//Load js
			$plg_path = JURI::root(true).'/plugins/system/helix/elements/menuscript.js';
			$doc->addScript($plg_path, "text/javascript");
		}
		
		if ($form->getName()=='com_modules.module') {//Add Module positions :)
			JHtml::_('behavior.framework', true);
			$doc = JFactory::getDocument();
			echo $this->getPositions();
			$templates = $this->getTemplates ();
			$groupHTML 	= array();
			foreach($templates as $template){
				$groupHTML[] = JHTML::_('select.option', $template, $template);
			}
			echo JHTML::_('select.genericlist', $groupHTML, "sp_tmpl", ' style="display:none" ', 'value', 'text', 'value');
			$plg_path = JURI::root(true).'/plugins/system/helix/elements/positions.js';
			$doc->addScript($plg_path, "text/javascript");
		}
	}	
Example #6
0
 /**
  * Method to get the row form.
  *
  * @return  mixed  JForm object on success, false on failure.
  */
 public function getForm()
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     // Get the form.
     jimport('joomla.form.form');
     JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
     JForm::addFieldPath(JPATH_COMPONENT . '/models/fields');
     $form = JForm::getInstance('com_localise.languages', 'languages', array('control' => 'filters', 'event' => 'onPrepareForm'));
     // Check for an error.
     if (JError::isError($form)) {
         $this->setError($form->getMessage());
         return false;
     }
     // Check the session for previously entered form data.
     $data = $app->getUserState('com_localise.select', array());
     // Bind the form data if present.
     if (!empty($data)) {
         $form->bind(array('select' => $data));
     }
     // Check the session for previously entered form data.
     $data = $app->getUserState('com_localise.languages.search', array());
     // Bind the form data if present.
     if (!empty($data)) {
         $form->bind(array('search' => $data));
     }
     return $form;
 }
Example #7
0
 /**
  * This method prepares a payment gateway - buttons, forms,...
  * That gateway will be displayed on the summary page as a payment option.
  *
  * @param string    $context This string gives information about that where it has been executed the trigger.
  * @param object    $item    A project data.
  * @param Joomla\Registry\Registry $params  The parameters of the component
  *
  * @return null|string
  */
 public function onPaymentExtras($context, &$item, &$params)
 {
     if (strcmp("com_crowdfunding.payment.step2", $context) != 0) {
         return null;
     }
     if ($this->app->isAdmin()) {
         return null;
     }
     $doc = JFactory::getDocument();
     /**  @var $doc JDocumentHtml */
     // Check document type
     $docType = $doc->getType();
     if (strcmp("html", $docType) != 0) {
         return null;
     }
     // Load language file of the component.
     $language = JFactory::getLanguage();
     $language->load('com_crowdfundingdata', CROWDFUNDINGDATA_PATH_COMPONENT_SITE);
     $componentParams = JComponentHelper::getParams("com_crowdfunding");
     /** @var  $componentParams Joomla\Registry\Registry */
     // Get payment session.
     $paymentSessionContext = Crowdfunding\Constants::PAYMENT_SESSION_CONTEXT . $item->id;
     $paymentSession = $this->app->getUserState($paymentSessionContext);
     if (!isset($paymentSession->step1)) {
         $path = JPath::clean(JPluginHelper::getLayoutPath('crowdfundingpayment', 'data', 'error'));
         // Render error layout.
         ob_start();
         include $path;
         return ob_get_clean();
     }
     // Get the value of therms and conditions.
     $this->terms = $paymentSession->terms;
     // Check for duplication of session ID.
     $this->prepareSessionId($item);
     // Load the form.
     JForm::addFormPath(CROWDFUNDINGDATA_PATH_COMPONENT_SITE . '/models/forms');
     JForm::addFieldPath(CROWDFUNDINGDATA_PATH_COMPONENT_SITE . '/models/fields');
     $form = JForm::getInstance('com_crowdfundingdata.record', 'record', array('control' => "jform", 'load_data' => false));
     // Prepare default name of a user.
     $user = JFactory::getUser();
     if ($user->get("id")) {
         $form->setValue("name", null, $user->get("name"));
     }
     // Set item id to the form.
     $form->setValue("project_id", null, $item->id);
     $this->form = $form;
     // Load jQuery
     JHtml::_("jquery.framework");
     // Include Chosen
     if ($this->params->get("enable_chosen", 0)) {
         JHtml::_('formbehavior.chosen', '#jform_country_id');
     }
     // Get the path for the layout file
     $path = JPath::clean(JPluginHelper::getLayoutPath('crowdfundingpayment', 'data'));
     // Render the form.
     ob_start();
     include $path;
     $html = ob_get_clean();
     return $html;
 }
Example #8
0
	/**
	 * Load user form.
	 *
	 * @return void
	 */
	protected function before()
	{
		parent::before();

		$userParams = JComponentHelper::getParams('com_users');

		// Check if user is allowed to change his name.
		$this->changeUsername = $userParams->get('change_login_name', 1);

		// Check to see if Frontend User Params have been enabled.
		if ($userParams->get('frontend_userparams', 0))
		{
			JFactory::getLanguage()->load('com_users', JPATH_ADMINISTRATOR);

			JForm::addFormPath(JPATH_ROOT . '/components/com_users/models/forms');
			JForm::addFieldPath(JPATH_ROOT . '/components/com_users/models/fields');

			JPluginHelper::importPlugin('user');

			$registry = new JRegistry($this->user->params);
			$form = JForm::getInstance('com_users.profile', 'frontend');
			$data = new StdClass;
			$data->params = $registry->toArray();
			$dispatcher = JDispatcher::getInstance();
			$dispatcher->trigger('onContentPrepareForm', array($form, $data));

			$form->bind($data);
			$this->frontendForm = $form->getFieldset('params');
		}

		$this->headerText = JText::_('COM_KUNENA_PROFILE_EDIT_USER_TITLE');
	}
Example #9
0
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath($this->_pluginPath);
         $form->loadFile('parameters', false);
     }
 }
Example #10
0
 /**
  * Method to display the view.
  *
  * @param	string	$tpl	The template file to include
  * @since	1.6
  */
 public function display($tpl = null)
 {
     JForm::addFormPath(JPATH_SITE . '/components/com_users/models/forms');
     require_once JPATH_SITE . '/components/com_users/models/profile.php';
     $userModel = JModelLegacy::getInstance('Profile', 'UsersModel');
     // Get the view data.
     $this->data = $userModel->getData();
     $this->form = $userModel->getForm();
     $this->state = $userModel->get('State');
     $this->params = JComponentHelper::getParams('com_users');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Check if a user was found.
     if (!$this->data->id) {
         JError::raiseError(404, JText::_('JERROR_USERS_PROFILE_NOT_FOUND'));
         return false;
     }
     // Check for layout override
     $active = JFactory::getApplication()->getMenu()->getActive();
     if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
     }
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));
     $this->prepareDocument();
     parent::display($tpl);
 }
Example #11
0
 public function post()
 {
     // Set variables to be used
     JMHelper::setSessionUser();
     JFactory::getLanguage()->load('com_users', JPATH_ADMINISTRATOR);
     // Include dependencies
     jimport('joomla.application.component.controller');
     jimport('joomla.form.form');
     jimport('joomla.database.table');
     JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models');
     JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_users/models/forms');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/tables');
     // Get user data
     $data = JRequest::getVar('jform', array(), 'post', 'array');
     if (!isset($data['groups'])) {
         $data['groups'] = array();
     }
     // Save user
     $model = JModel::getInstance('User', 'UsersModel');
     $model->getState('user.id');
     // This is only here to trigger populateState()
     $success = $model->save($data);
     if ($model->getError()) {
         $response = $this->getErrorResponse(400, $model->getError());
     } elseif (!$success) {
         $response = $this->getErrorResponse(400, JText::_('COM_JM_ERROR_OCURRED'));
     } else {
         $response = $this->getSuccessResponse(201, JText::_('COM_JM_SUCCESS'));
         $response->id = $model->getState('user.id');
     }
     $this->plugin->setResponse($response);
 }
Example #12
0
 function onContentPrepareForm($form, $data)
 {
     $app = JFactory::getApplication();
     $option = $app->input->get('option');
     $show = $this->params->get('showfield');
     switch ($option) {
         case 'com_content':
             if ($show == 0) {
                 if ($app->isAdmin()) {
                     JForm::addFormPath(__DIR__ . '/forms');
                     $form->loadFile('content', false);
                 }
                 if ($app->isSite()) {
                     JForm::addFormPath(__DIR__ . '/forms');
                     $form->loadFile('content', false);
                 }
             } elseif ($show == 1) {
                 if ($app->isAdmin()) {
                     JForm::addFormPath(__DIR__ . '/forms');
                     $form->loadFile('content', false);
                 }
             } else {
                 if ($app->isSite()) {
                     JForm::addFormPath(__DIR__ . '/forms');
                     $form->loadFile('content', false);
                 }
             }
             return true;
     }
     return true;
 }
Example #13
0
 /**
  * Event method that runs on content preparation
  *
  * @param   JForm    $form  The form object
  * @param   integer  $data  The form data
  *
  * @return bool
  */
 public function onContentPrepareForm($form, $data)
 {
     if (!$form instanceof JForm) {
         $this->_subject->setError('JERROR_NOT_A_FORM');
         return false;
     }
     $name = $form->getName();
     if (!in_array($name, array('com_content.article'))) {
         return true;
     }
     $include_categories = $this->params->get('include_categories');
     if (empty($include_categories)) {
         return true;
     }
     if (empty($data)) {
         $input = JFactory::getApplication()->input;
         $data = (object) $input->post->get('jform', array(), 'array');
     }
     if (is_array($data)) {
         jimport('joomla.utilities.arrayhelper');
         $data = JArrayHelper::toObject($data);
     }
     if (empty($data->catid)) {
         return true;
     }
     if (!in_array($data->catid, $include_categories)) {
         return true;
     }
     JForm::addFormPath(__DIR__ . '/form');
     $form->loadFile('form');
     if (!empty($data->id)) {
         $data = $this->loadTest($data);
     }
     return true;
 }
 function edit()
 {
     JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('COM_JEVENTS_CONFIGURATION'));
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('COM_JEVENTS_CONFIGURATION'), 'jevents');
     //APPLY BUTTON BY PRAKASH.
     JToolBarHelper::apply('params.apply');
     //APPLY BUTTON
     JToolBarHelper::save('params.save');
     JToolBarHelper::cancel('cpanel.cpanel');
     $model = $this->getModel();
     $this->params =& $model->getParams();
     $component = JComponentHelper::getComponent(JEV_COM_COMPONENT);
     JHTML::_('behavior.tooltip');
     if (JVersion::isCompatible("1.6.0")) {
         // Get the actions for the asset.
         $actions = JAccess::getActions(JEV_COM_COMPONENT, "component");
         jimport('joomla.form.form');
         // Add the search path for the admin component config.xml file.
         JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/' . JEV_COM_COMPONENT);
         // Get the form.
         $modelForm = $model->getForm();
         $this->assignRef("form", $modelForm);
     }
 }
Example #15
0
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath($this->_resources);
         $form->loadFile('menus_edit_params', false);
     }
 }
Example #16
0
 /**
  * @param Jform $form
  * @param array $data
  *
  * @throws Exception
  */
 public function onContentPrepareForm(Jform $form, $data)
 {
     if (JFactory::getApplication()->isAdmin() && $form->getName() == 'com_menus.item') {
         JForm::addFormPath(__DIR__ . '/forms');
         $form->loadFile('menu_item', false);
     }
 }
Example #17
0
 /**
  * Метод для отображения формы вопроса
  * @param unknown_type $tpl
  */
 public function display($tpl = null)
 {
     $catid = JRequest::getInt('catid', null, 'GET');
     if (!$catid) {
         throw new Exception('Category id not set');
     }
     JForm::addFormPath('components/com_smfaq/models/forms');
     JForm::addFieldPath('components/com_smfaq/models/fields');
     $form = JForm::getInstance('question', 'question');
     $categories = JCategories::getInstance('SmFaq');
     $category = $categories->get($catid);
     $params = $category->getParams();
     if ($layout = $params->get('category_layout')) {
         $this->setLayout($layout);
     }
     JPluginHelper::importPlugin('smfaq');
     $dispatcher = JDispatcher::getInstance();
     $results = $dispatcher->trigger('onPrepareForm', array($form));
     // Check for errors encountered while preparing the form.
     if (count($results) && in_array(false, $results, true)) {
         // Get the last error.
         $error = $dispatcher->getError();
         if (!$error instanceof Exception) {
             throw new Exception($error);
         }
     }
     $this->assignRef('form', $form);
     $this->assignRef('params', $params);
     $this->assignRef('category', $category);
     parent::display($tpl);
 }
Example #18
0
 /**
  * @param	JForm	The form to be altered.
  * @param	array	The associated data for the form.
  * @return	boolean
  * @since	1.6
  */
 function onContentPrepareForm($form, $data)
 {
     // Load user_profile plugin language
     $lang = JFactory::getLanguage();
     $lang->load('plg_user_profilecinevi', JPATH_ADMINISTRATOR);
     if (!$form instanceof JForm) {
         $this->_subject->setError('JERROR_NOT_A_FORM');
         return false;
     }
     // Check we are manipulating a valid form.
     if (!in_array($form->getName(), array('com_users.profile', 'com_users.registration', 'com_users.user', 'com_admin.profile'))) {
         return true;
     }
     if ($form->getName() == 'com_users.profile') {
         // Add the profile fields to the form.
         JForm::addFormPath(dirname(__FILE__) . '/profiles');
         $form->loadFile('profile', false);
         // Toggle whether the perfil field is required.
         if ($this->params->get('profile-require_perfil', 1) > 0) {
             $form->setFieldAttribute('perfil', 'required', $this->params->get('profile-require_perfil') == 2, 'profilecinevi');
         } else {
             $form->removeField('perfil', 'profilecinevi');
         }
     } elseif ($form->getName() == 'com_users.registration' || $form->getName() == 'com_users.user') {
         // Add the registration fields to the form.
         JForm::addFormPath(dirname(__FILE__) . '/profiles');
         $form->loadFile('profile', false);
         // Toggle whether the perfil field is required.
         if ($this->params->get('register-require_perfil', 1) > 0) {
             $form->setFieldAttribute('perfil', 'required', $this->params->get('register-require_perfil') == 2, 'profilecinevi');
         } else {
             $form->removeField('perfil', 'profilecinevi');
         }
     }
 }
Example #19
0
 public function delete($id = null)
 {
     // Include dependencies
     jimport('joomla.application.component.controller');
     jimport('joomla.form.form');
     jimport('joomla.database.table');
     require_once JPATH_ADMINISTRATOR . '/components/com_categories/controllers/categories.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_categories/models/category.php';
     JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_categories/models/forms/');
     // Fake parameters
     $_POST['task'] = 'trash';
     $_REQUEST['task'] = 'trash';
     $_REQUEST[JUtility::getToken()] = 1;
     $_POST[JUtility::getToken()] = 1;
     JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR);
     $controller = new CategoriesControllerCategories();
     try {
         $controller->execute('trash');
     } catch (JException $e) {
         $success = false;
         $controller->set('messageType', 'error');
         $controller->set('message', $e->getMessage());
     }
     if ($controller->getError()) {
         $response = $this->getErrorResponse(400, $controller->getError());
     } elseif ('error' == $controller->get('messageType')) {
         $response = $this->getErrorResponse(400, $controller->get('message'));
     } else {
         $response = $this->getSuccessResponse(200, $controller->get('message'));
     }
     $this->plugin->setResponse($response);
 }
Example #20
0
 public function getForm($data = array(), $loadData = true)
 {
     JForm::addFormPath(JPATH_COMPONENT_ADMINISTRATOR . '/models/forms');
     JForm::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR . '/models/fields');
     $form = parent::getForm($data, $loadData);
     return $form;
 }
Example #21
0
 /**
  * Method to display the view.
  *
  * @param	string	The template file to include
  * @since	1.6
  */
 public function display($tpl = null)
 {
     //load required files
     JForm::addFormPath(JPATH_SITE . '/components/com_users/models/forms');
     JForm::addFieldPath(JPATH_SITE . '/components/com_users/models/fields');
     require_once JPATH_SITE . '/components/com_users/models/registration.php';
     //load com_users language
     $lang = JFactory::getLanguage();
     $lang->load('com_users');
     $model = JModelLegacy::getInstance('Registration', 'UsersModel');
     $app = JFactory::getApplication();
     // Get the view data.
     $this->data = $model->getData();
     $this->form = $model->getForm();
     //$this->state	= $model->get('State');
     $this->params = $app->getParams('com_hs_users');
     // Check for errors.
     if (count($errors = $model->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Check for layout override
     $active = JFactory::getApplication()->getMenu()->getActive();
     if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
     }
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));
     $this->prepareDocument();
     parent::display($tpl);
 }
 /**
  * Method to get the form.
  *
  * @param   string  $view  The view being processed
  *
  * @return  mixed  JForm object on success, false on failure.
  *
  * @since   3.1
  */
 public function getForm($view = null)
 {
     /* @var InstallationApplicationWeb $app */
     $app = JFactory::getApplication();
     if (!$view) {
         $view = $app->input->getWord('view', 'site');
     }
     // Get the form.
     JForm::addFormPath(JPATH_COMPONENT . '/model/forms');
     JForm::addFieldPath(JPATH_COMPONENT . '/model/fields');
     JForm::addRulePath(JPATH_COMPONENT . '/model/rules');
     try {
         $form = JForm::getInstance('jform', $view, array('control' => 'jform'));
     } catch (Exception $e) {
         $app->enqueueMessage($e->getMessage(), 'error');
         return false;
     }
     // Check the session for previously entered form data.
     $data = (array) $this->getOptions();
     // Bind the form data if present.
     if (!empty($data)) {
         $form->bind($data);
     }
     return $form;
 }
Example #23
0
 /**
  * Method to get the link form.
  *
  * @return	mixed	JForm object on success, false on failure.
  * @since	1.6
  */
 public function getForm($view = null)
 {
     // Initialise variables.
     $false = false;
     if (!$view) {
         $view = JRequest::getWord('view', 'language');
     }
     // Get the form.
     jimport('joomla.form.form');
     JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
     JForm::addFieldPath(JPATH_COMPONENT . '/models/fields');
     try {
         $form = JForm::getInstance('jform', $view, array('control' => 'jform'));
     } catch (Exception $e) {
         $this->setError($e->getMessage());
         return false;
     }
     // Check the session for previously entered form data.
     $data = (array) $this->getOptions();
     // Bind the form data if present.
     if (!empty($data)) {
         $form->bind($data);
     }
     return $form;
 }
Example #24
0
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath(JPATH_SITE . DS . ZT_4BACKEND_MENU_PARAMS);
         $form->loadFile('params', false);
     }
 }
Example #25
0
 function onContentPrepareForm($form, $data)
 {
     $doc = JFactory::getDocument();
     $plg_path = JURI::root(true) . '/plugins/system/helix3';
     JForm::addFormPath(JPATH_PLUGINS . '/system/helix3/params');
     if ($form->getName() == 'com_menus.item') {
         //Add Helix menu params to the menu item
         JHtml::_('jquery.framework');
         if ($data['id'] && $data['parent_id'] == 1) {
             $doc->addScript($plg_path . '/assets/js/jquery-ui.min.js');
             $doc->addStyleSheet($plg_path . '/assets/css/bootstrap.css');
             $doc->addStyleSheet($plg_path . '/assets/css/font-awesome.min.css');
             $doc->addStyleSheet($plg_path . '/assets/css/modal.css');
             $doc->addStyleSheet($plg_path . '/assets/css/menu.generator.css');
             $doc->addScript($plg_path . '/assets/js/modal.js');
             $doc->addScript($plg_path . '/assets/js/menu.generator.js');
             $form->loadFile('menu-parent', false);
         } else {
             $form->loadFile('menu-child', false);
         }
         $form->loadFile('page-title', false);
     }
     //Article Post format
     if ($form->getName() == 'com_content.article') {
         JHtml::_('jquery.framework');
         $doc->addStyleSheet($plg_path . '/assets/css/font-awesome.min.css');
         $doc->addScript($plg_path . '/assets/js/post-formats.js');
         JForm::addFormPath(JPATH_PLUGINS . '/system/helix3/params');
         $form->loadFile('post-formats', false);
     }
 }
Example #26
0
 function onContentPrepareForm($form, $data)
 {
     if ($form->getName() == 'com_menus.item') {
         $xmlFile = dirname(__FILE__) . '/params';
         JForm::addFormPath($xmlFile);
         $form->loadFile('params', false);
     }
 }
Example #27
0
File: yt.php Project: rodhoff/MNW
 function onContentPrepareForm($form, $data)
 {
     // Add param(support Mega menu) for menu item
     if ($form->getName() == 'com_menus.item') {
         JForm::addFormPath(YT_INCLUDES_PATH . J_SEPARATOR . 'libs' . J_SEPARATOR . 'menu' . J_SEPARATOR . 'params');
         $form->loadFile('params', false);
     }
 }
Example #28
0
 public function __construct($config = array())
 {
     JForm::addFieldPath(JPATH_ROOT . '/administrator/components/com_azurapagebuilder/models/fields');
     //JForm::addFormPath(JPATH_ROOT.'/templates/protostar/html/com_azurapagebuilder/forms');
     JForm::addFormPath(JPATH_ROOT . '/administrator/components/com_azurapagebuilder/models/forms');
     JForm::addFormPath(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/com_azurapagebuilder/forms');
     parent::__construct();
 }
Example #29
0
 /**
  * modified
  */
 public function __construct($data = '', $path = '')
 {
     parent::__construct($data);
     jimport('joomla.form.form');
     JForm::addFormPath($path);
     $form =& JForm::getInstance('templateDetails', JPATH_ADMINISTRATOR . '/templates/rt_missioncontrol/templateDetails.xml', array(), true, '//config');
     $this->_form = $form;
 }
Example #30
0
 /**
  * Registers the service provider with a DI container.
  *
  * @param   Container $container The DI container.
  *
  * @return  Container  Returns itself to support chaining.
  *
  * @since   1.0
  */
 public function register(Container $container)
 {
     $container->share('cck', function ($container) {
         return new CCKEngine($container->get('app'), $container->get('event.dispatcher'), $container);
     });
     \JForm::addFieldPath(__DIR__ . '/Fields');
     \JForm::addFormPath(__DIR__ . '/Resource/Form');
 }