Exemplo n.º 1
0
                        <div style="font-size: 1.3em;">
                            <?php 
echo jgettext('Extension templates parts');
?>
                        </div>
                        <ul>
                            <?php 
foreach (EcrProjectHelper::getPartsGroups() as $group) {
    $js = " onmousedown=\"setAction('', '" . $path . DS . "parts', '" . $group . "');\"";
    ?>
                                <li class="pft-directory"><?php 
    echo '<div' . $js . '>' . jgettext($group) . '</div>';
    ?>
                                    <ul>
                                        <?php 
    foreach (EcrProjectHelper::getParts($group) as $part) {
        $easyPart = EcrProjectHelper::getPart($group, $part, '', '');
        if ($easyPart) {
            $toolTip = $group . '::' . $part;
            $title = $part;
            if (method_exists($easyPart, 'info')) {
                $info = $easyPart->info();
                $title = $info->title;
                $toolTip = $info->title;
                if ($info->description) {
                    $toolTip .= '::' . $info->description;
                }
            }
            $js = " onmousedown=\"setAction('', '" . $path . DS . 'parts' . DS . $group . "', '" . $part . "');\"";
            echo '<li class="pft-directory">';
            echo '<div' . $js . ' class="hasTip" title="' . $toolTip . '">';
Exemplo n.º 2
0
function drawAddElementTable()
{
    $ecr_project = JFactory::getApplication()->input->get('ecr_project');
    $link = 'index.php?option=com_easycreator&controller=ajax&task=show_part&tmpl=component';
    $link .= '&ecr_project=' . $ecr_project;
    ?>
<script type="text/javascript">
            function showPart(group, part)
            {
                document.id('addPartShow').className = ' img ajax_loading16';

                document.id('addPartShow').innerHTML = jgettext('Loading...');
                document.id('addElementMessage').innerHTML = '';

                new Request({
                    url: '<?php 
    echo $link;
    ?>
&group='+group+'&part='+part,
                    onComplete: function(response)
                    {
                        document.id('addPartShow').className = '';
                        document.id('addPartShow').set('html', response);
                        document.id('addElementMessage').innerHTML = '';
                        div_new_element.show();
                    }
                }).send();

                return false;
            }//function
        </script>
<div id="addElementMessage"></div>
<div id="addPartPartsList" style="float: left;"><?php 
    foreach (EcrProjectHelper::getPartsGroups() as $group) {
        echo '<strong style="color: blue;">' . ucfirst($group) . '</strong><br />';
        foreach (EcrProjectHelper::getParts($group) as $part) {
            $easyPart = EcrProjectHelper::getPart($group, $part, '', '');
            if ($easyPart) {
                $toolTip = $group . '::' . $part;
                $title = $part;
                if (method_exists($easyPart, 'info')) {
                    $info = $easyPart->info();
                    $title = $info->title;
                    $toolTip = $info->title;
                    if ($info->description) {
                        $toolTip .= '::' . $info->description;
                    }
                }
                echo '<div class="btn block hasTip" title="' . $toolTip . '" onclick="showPart(\'' . $group . '\', \'' . $part . '\');">' . $title . '</div>';
            }
        }
        //foreach
    }
    //foreach
    ?>
</div>
<div style="float: left; margin-left: 1em;">
	<div class="ecr_floatbox">
    	<div id="addPartShow">
    		<strong style="color: red;"><?php 
    echo jgettext('Select an element');
    ?>
</strong>
    	</div>
	</div>
</div>

<div style="clear: both;"></div>
<?php 
}