Exemplo n.º 1
0
    /**
     * Method to install the component.
     *
     * @param $parent
     *
     * @return boolean
     */
    public function install($parent)
    {
        // $parent is the class calling this method
        //    $parent->getParent()->setRedirectURL('index.php?option=ECR_COM_COM_NAME');
        //echo '<p>'.JText::_('ECR_UPPER_COM_COM_NAME_INSTALL_TEXT').'</p>';
        $logo = JURI::root(true) . '/media/com_easycreator/admin/images/ico/icon-128-easycreator.png';
        try {
            if (!jimport('g11n.language')) {
                //-- Get our special language file
                JLoader::import('helpers.g11n_dummy', JPATH_ADMINISTRATOR . '/components/com_easycreator');
                ?>
            <div style="padding: 0.3em; background-color: #ffc;">
                <h3 style="color: red;">EasyCreator is in "English ONLY" mode !</h3>

                <h3 style="color: red;">
                    If you like EasyCreator in your language, just install the g11n language library :
                </h3>

                <h3 style="color: red;">
                    <a href="http://joomlacode.org/gf/project/elkuku/frs/?action=FrsReleaseBrowse&frs_package_id=5915">
                        Download lib_g11n
                    </a>
                </h3>
            </div>
            <?php 
            } else {
                g11n::loadLanguage('com_easycreator');
            }
            //$xml = simplexml_load_file(ECR_XML_LOCATION);
            $xml = simplexml_load_file($parent->getParent()->getPath('manifest'));
            if (false == $xml) {
                JFactory::getApplication()->enqueueMessage(jgettext('Install manifest not found'), 'error');
                return false;
            }
        } catch (Exception $e) {
            JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
            return false;
        }
        define('ECR_VERSION', $xml->version);
        require_once JPATH_ADMINISTRATOR . '/components/com_easycreator/helpers/html.php';
        JFactory::getDocument()->addStyleSheet(JURI::root() . 'media/com_easycreator/admin/css/default.css');
        JFactory::getDocument()->addStyleSheet(JURI::root() . 'media/com_easycreator/admin/css/icon.css');
        ?>

    <div>

        <div style="float: right">
            <img
                    src="<?php 
        echo $logo;
        ?>
"
                    alt="EasyCreator Logo" title="EasyCreator Logo"/>
        </div>

        <h1>EasyCreator</h1>
        <?php 
        echo jgettext('EasyCreator is a developer tool.');
        ?>
<br/>
        <?php 
        echo jgettext('It tries to speed up the developing process of custom Joomla! extensions.');
        ?>
<br/>
        <?php 
        echo jgettext('You can create a "frame" for your extension and an installable zip package with just a few "clicks"');
        ?>

        <p>Happy coding,<br/>
            <?php 
        echo sprintf(jgettext('The %s Team.'), '<a href="https://github.com/elkuku/EasyCreator">EasyCreator</a>');
        ?>
        </p>

    </div>

    <h3 style="color: orange;">
        <?php 
        echo jgettext('Please use this extension only in local development environments.');
        ?>
    </h3>
    <p>
        <?php 
        echo sprintf(jgettext('See: <a %s>docs.joomla.org/Setting up your workstation for Joomla! development</a>'), 'href="http://docs.joomla.org/Setting_up_your_workstation_for_Joomla!_development"');
        ?>
    </p>

    <?php 
        ##ECR_MD5CHECK##
        EcrHtml::footer();
    }
Exemplo n.º 2
0
    $controller = EcrEasycreator::getController();
    $input = JFactory::getApplication()->input;
    if ('component' == $input->get('tmpl')) {
        // Perform the Request task only - raw view
        $controller->execute($input->get('task'));
    } else {
        // Display the menu
        EcrHtmlMenu::main();
        // Perform the Request task
        $controller->execute($input->get('task'));
        if (ECR_DEV_MODE && ECR_DEBUG_LANG && class_exists('g11n')) {
            g11n::debugPrintTranslateds(true);
            g11n::debugPrintTranslateds();
        }
        // Display the footer
        EcrHtml::footer();
        JDEBUG ? JProfiler::getInstance('Application')->mark('com_easycreator finished') : null;
    }
    // Restore error_reporting
    error_reporting($prevErrorReporting);
    // Redirect if set by the controller
    // We don't do this very often =;)
    $controller->redirect();
} catch (Exception $e) {
    EcrHtml::message($e);
    JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
    if (ECR_DEBUG) {
        echo '<pre>' . $e->getTraceAsString() . '</pre>';
    }
}
// Restore error_reporting