<hr />

	<div id="jm_layoutbuilder_preview" class="jm_layoutbuilder_preview jm_layoutbuilder_build_pos"></div>

</div>

<!-- POPOVER POSITIONS -->
<div id="jm_layoutbuilder_module_positions" class="popover top hide">
	<div class="arrow"></div>
	<h3 class="popover-title"><?php 
echo JText::_('PLG_SYSTEM_JMFRAMEWORK_SELECT_MODULE_POSITION');
?>
</h3>
	<div class="popover-content">
		<?php 
echo JMFAdminTemplate::getModulePositions();
?>
		<button class="jm_layoutbuilder_remove_pos btn btn-warning"><i class="icon-remove"></i>&nbsp;&nbsp;<?php 
echo JText::_('JNONE');
?>
</button>
		<button class="jm_layoutbuilder_default_pos btn btn-primary"><i class="icon-refresh"></i>&nbsp;&nbsp;<?php 
echo JText::_('JDEFAULT');
?>
</button>
	</div>
</div>

<!-- MODAL COPY LAYOUT -->
<div id="jm_layoutbuilder_copy_modal" class="modal hide">
	<div class="modal-header">
 /**
  * After the routing we can determine which template is being used. 
  * The plugin works only with specially prepared Joomla Monster templates.
  */
 function onAfterRoute()
 {
     $app = JFactory::getApplication();
     // If it's not Joomla Monster template, the $template will be false.
     $template = $this->getTemplateName();
     if ($template) {
         // This plugin's directory
         define('JMF_FRAMEWORK_PATH', dirname(__FILE__));
         // Plugin's URL
         define('JMF_FRAMEWORK_URL', JURI::root(true) . '/plugins/system/ef4_jmframework');
         // Name of the template
         define('JMF_TPL', $template);
         // Path to template's directory
         define('JMF_TPL_PATH', JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template);
         // Template directory's URL
         define('JMF_TPL_URL', JURI::root(true) . '/templates/' . $template);
         // Flag that informs that plugin is active
         define('JMF_EXEC', 'JMF');
         // Admin assets' URL
         define('JMF_ASSETS', JURI::root(true) . '/plugins/system/ef4_jmframework/includes/assets/admin/');
         $this->loadLanguage();
         $this->template = $template;
         if ($app->isSite()) {
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'template.php';
             include_once JMF_TPL_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'jm_template.php';
             $className = false;
             if (class_exists('JMTemplate')) {
                 $className = 'JMTemplate';
             } else {
                 if (class_exists('JMTemplate' . ucfirst(str_replace('-', '', JMF_TPL)))) {
                     $className = 'JMTemplate' . ucfirst(str_replace('-', '', JMF_TPL));
                 }
             }
             $lang = JFactory::getLanguage();
             $lang->load('tpl_' . $this->template, JPATH_ADMINISTRATOR, 'en-GB', false, true) || $lang->load('tpl_' . $this->template, JMF_TPL_PATH, 'en-GB', false, true);
             $lang->load('tpl_' . $this->template, JPATH_ADMINISTRATOR, null, true, true) || $lang->load('tpl_' . $this->template, JMF_TPL_PATH, null, true, true);
             if ($className !== false) {
                 $doc = JFactory::getDocument();
                 if ($doc instanceof JDocumentHTML) {
                     $jmf = new $className($doc, true);
                     $jmf->ajax();
                     // check for ajax requests
                 }
             }
         } else {
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'template.php';
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'admin.php';
             $doc = JFactory::getDocument();
             $jmf = new JMFAdminTemplate($doc);
             $jmf->ajax();
             // check for ajax requests
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * After the routing we can determine which template is being used. 
  * The plugin works only with specially prepared Joomla Monster templates.
  */
 function onAfterRoute()
 {
     $app = JFactory::getApplication();
     // If it's not Joomla Monster template, the $template will be false.
     $template = $this->getTemplateName();
     if ($template) {
         // This plugin's directory
         define('JMF_FRAMEWORK_PATH', dirname(__FILE__));
         // Plugin's URL
         define('JMF_FRAMEWORK_URL', JURI::root(true) . '/plugins/system/ef4_jmframework');
         // Name of the template
         define('JMF_TPL', $template);
         // Path to template's directory
         define('JMF_TPL_PATH', JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template);
         // Template directory's URL
         define('JMF_TPL_URL', JURI::root(true) . '/templates/' . $template);
         // Flag that informs that plugin is active
         define('JMF_EXEC', 'JMF');
         // Admin assets' URL
         define('JMF_ASSETS', JURI::root(true) . '/plugins/system/ef4_jmframework/includes/assets/admin/');
         // Flag for DJ-jQueryMonster plugin compatibility
         define('JMF_JQUERYMONSTER', 1);
         $this->loadLanguage();
         $this->template = $template;
         if ($app->isSite()) {
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'template.php';
             include_once JMF_TPL_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'jm_template.php';
             $className = false;
             if (class_exists('JMTemplate')) {
                 $className = 'JMTemplate';
             } else {
                 if (class_exists('JMTemplate' . ucfirst(str_replace('-', '', JMF_TPL)))) {
                     $className = 'JMTemplate' . ucfirst(str_replace('-', '', JMF_TPL));
                 }
             }
             $lang = JFactory::getLanguage();
             $lang->load('tpl_' . $this->template, JPATH_ADMINISTRATOR, 'en-GB', false, true) || $lang->load('tpl_' . $this->template, JMF_TPL_PATH, 'en-GB', false, true);
             $lang->load('tpl_' . $this->template, JPATH_ADMINISTRATOR, null, true, true) || $lang->load('tpl_' . $this->template, JMF_TPL_PATH, null, true, true);
             if ($className !== false) {
                 $doc = JFactory::getDocument();
                 if ($doc instanceof JDocumentHTML) {
                     $jmf = new $className($doc, true);
                     $jmf->ajax();
                     // check for ajax requests
                 }
             }
         } else {
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'template.php';
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'admin.php';
             $doc = JFactory::getDocument();
             $jmf = new JMFAdminTemplate($doc);
             $jmf->ajax();
             // check for ajax requests
             $queue = $app->getMessageQueue();
             if ($jmf->params->get('devmode', false) && $app->input->getString('view') == 'style' && $app->input->getString('option') == 'com_templates' && $app->input->getCmd('jmajax', false) == false && $app->input->getCmd('jmtask', false) == false) {
                 $app->enqueueMessage(JText::_('PLG_SYSTEM_JMFRAMEWORK_WARNING_DEV_MODE_ENABLED'), 'message');
             }
         }
     }
 }