예제 #1
0
function subnav_listitems($page)
{
    $children = $page->GetChildren();
    if (count($children) > 0) {
        ?>
		<ul>
		<?php 
        foreach ($children as $child) {
            ?>
			<li>
				<a href="<?php 
            echo $child->getURL();
            ?>
"><?php 
            LayoutHelper::renderField($child, "Title");
            ?>
</a>
				<?php 
            subnav_listitems($child);
            ?>
			</li>
		<?php 
        }
        ?>
		</ul>
	<?php 
    }
}
예제 #2
0
 /**
  * Constructs this object to use the given template. The .html.php
  * extension is optional.
  *
  * @param string
  */
 public function __construct($template)
 {
     if (file_exists($template)) {
         $this->path = $template;
     } else {
         $this->path = "{$_SERVER['DOCUMENT_ROOT']}/{$this->templates_path}/" . LayoutHelper::extensionize($template, 'html.php');
     }
 }
예제 #3
0
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     jimport('joomla.filesystem.file');
     $title = JText::_('COM_HTRAININGLOGS_EDITTRAINING');
     $this->document->setTitle($title);
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/site.stylesheet.css');
     $doc->addStyleSheet('http://dev.openlayers.org/theme/default/style.css');
     $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_style.css');
     $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_map_style.css');
     LayoutHelper::parseMap($doc);
 }
예제 #4
0
<!-- @@name: Display news item -->

<h1><?php 
LayoutHelper::renderField($PAGE, "Title");
?>
</h1>

<?php 
LayoutHelper::renderField($PAGE, "Content");
예제 #5
0
 /**
  * function_description
  *
  * @param   object  $tpl  template
  *
  * @return return_description
  */
 public function display($tpl = null)
 {
     // ToDo split in jtg and geoposition
     $user = JFactory::getUser();
     $user_id = (int) $user->id;
     //		$mainframe = JFactory::getApplication();
     //		$cfg = HTraininglogsHelper::getConfig();
     //$gpsData = new GpsDataClass($cfg->unit);
     $document = JFactory::getDocument();
     jimport('joomla.filesystem.file');
     // Load Openlayers stylesheet first (for overridding)
     // TODO add openlayers style in JTrackGallery (url may vary!)
     $document->addStyleSheet('http://dev.openlayers.org/theme/default/style.css');
     $document->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_style.css');
     $document->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_map_style.css');
     // Then load jtg_map stylesheet
     // Then override style with user templates
     //$template = $mainframe->getTemplate();
     //$template_jtg_map_style = 'templates/' . $template . '/css/jtg_map_style.css';
     /*if ( JFile::exists($template_jtg_map_style))
     		{
     			$document->addStyleSheet(JUri::base(true) . '/templates/' . $template . '/css/jtg_map_style.css');
     		}*/
     //$sitename = $document->getTitle() . " - " . $mainframe->getCfg('sitename');
     //$mapsxml = JPATH_COMPONENT_ADMINISTRATOR . '/views/maps/maps.xml';
     //$this->params_maps = new JRegistry('com_htraininglogs', $mapsxml);
     //$params = JComponentHelper::getParams('com_htraininglogs');
     //print_r($params);exit;
     LayoutHelper::parseMap($document);
     // Show Tracks in Overview-Map?
     //$tracks = (bool) $params->get('jtg_param_tracks');
     //		$model = $this->getModel();
     //		$latlons=$model->getlatlons($user_id);
     //		$cats = $model->getCatsData();
     //		$sortedcats = $model->getCatsData(true);
     //		$where = LayoutHelper::filterTracks($cats);
     //		$access = HtraininglogsHelper::giveAccessLevel();
     //$otherfiles = $params->get('jtg_param_otherfiles');
     //$mayisee = HtraininglogsHelper::MayIsee($where, $access, $otherfiles);
     /*		$boxlinktext = array(
     				0 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_PUBLIC'),
     				1 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_REGISTERED'),
     				2 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_SPECIAL'),
     				9 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_PRIVATE')
     		);
     
     	/*	if ((bool) $params->get('jtg_param_lh'))
     		{
     			$lh = LayoutHelper::navigation();
     		}
     		else
     		{
     			$lh = null;
     		}*/
     //		$footer = LayoutHelper::footer();
     //		$disclaimericons = LayoutHelper::disclaimericons();
     //		$rows = $model->getTracksData(null, null, $where);
     $geo = JRoute::_('index.php?option=com_htraininglogs&view=getpos', false);
     //		$this->newest =	null;
     /*	if ($params->get('jtg_param_newest') != 0)
     		{
     			$this->newest =	LayoutHelper::parseTopNewest($where, $mayisee, $model, $params->get('jtg_param_newest'));
     		}
     
     		$this->hits = null;
     
     		if ($params->get('jtg_param_mostklicks') != 0)
     		{
     			$this->hits = LayoutHelper::parseTopHits($where, $mayisee, $model, $params->get('jtg_param_mostklicks'));
     		}
     
     		$this->best = null;
     
     		if ($params->get('jtg_param_best') != 0)
     		{
     			$this->best = LayoutHelper::parseTopBest($where, $mayisee, $model, $params->get('jtg_param_best'), $params->get('jtg_param_vote_show_stars'));
     		}
     
     		$this->rand = null;
     
     		if ($params->get('jtg_param_rand') != 0)
     		{
     			$this->rand = LayoutHelper::parseTopRand($where, $mayisee, $model, $params->get('jtg_param_rand'));
     		}
     
     //		$toptracks = LayoutHelper::parseToptracks($params);
     		$published = "\na.published = 1 AND a.hidden = 0";
     
     		switch ($mayisee)
     		{
     			case null:
     				switch ($where)
     				{
     					case "":
     						$where = " WHERE " . $published;
     						break;
     					default:
     						$where = " WHERE " . $where . " AND " . $published;
     						break;
     				}
     				break;
     			default:
     				$where = " WHERE " . $mayisee . " AND " . $published;
     				break;
     		}
     */
     //	$this->lh = $lh;
     //	$this->latlons = $latlons;
     //	$this->boxlinktext = $boxlinktext;
     //	$this->footer = $footer;
     //	$this->disclaimericons = $disclaimericons;
     //	$this->gpsData = $gpsData;
     //$this->rows = $rows;
     //$this->where = $where;
     //$this->cats = $cats;
     //$this->sortedcats = $sortedcats;
     //	$this->cfg = $cfg;
     $this->geo = $geo;
     //	$this->toptracks = $toptracks;
     //	$this->tracks = $tracks;
     //	$this->params = $params;
     parent::display($tpl);
 }
예제 #6
0
 /**
  * Renders a template in the current directory named like a Rails
  * partial template. For example, if $partial were the string
  * "subnav", this method would attempt to render a template named
  * "_subnav.html.php".
  *
  * Currently, the partial must be in the current directory.
  *
  * Returns the same thing as render().
  *
  * @param string
  * @return string
  */
 public function render_partial($partial)
 {
     $basename = preg_replace('/^_/', '', basename($partial));
     $path = '_' . LayoutHelper::extensionize($basename, 'html.php');
     return $this->render($path);
 }
예제 #7
0
    $numItems = $PAGE->getField("Number of Items")->getValue();
}
$children = PageHelper::getDescendants($strParentNode, $strContentType);
foreach ($children as $child) {
    $aryFileInfo = $child->getFileInfo();
    ?>
		<item>
			<title><?php 
    LayoutHelper::renderField($child, "Title");
    ?>
</title>
			<link><?php 
    echo $child->getURL();
    ?>
</link>
			<description><?php 
    LayoutHelper::renderField($child, "Description");
    ?>
</description>
			<pubDate><?php 
    echo Date("D, d F Y H:i:s e", $aryFileInfo["modified"]);
    ?>
</pubDate>
			<guid><?php 
    echo $child->getURL();
    ?>
</guid>
		</item>

<?php 
}
예제 #8
0
 /**
  * Test filterElements with value containing '=' sign
  */
 public function testFilterElementParamsValueContainsEqual()
 {
     $content = 'Lorem [element:map plugin="plugandrent" tricky-query="te=st" ]';
     $View = $this->getMock('View');
     $Layout = new LayoutHelper($View);
     $View->expects($this->once())->method('element')->with($this->equalTo('map'), $this->equalTo(array('tricky-query' => 'te=st')), $this->equalTo(array('plugin' => 'plugandrent')));
     $Layout->filterElements($content);
 }
예제 #9
0
 public static function getViewsExecuted()
 {
     return LayoutHelper::getInstance()->_page_views;
 }
예제 #10
0
 /**
  * Show Menu by Alias
  *
  * @param string $menuAlias Menu alias
  * @param array $options (optional)
  * @return string
  */
 public function menu($menuAlias, $options = array())
 {
     $options = Set::merge($options, array('element' => 'Megamenu.menu', 'dropdownClass' => 'megamenu'));
     return parent::menu($menuAlias, $options);
 }
예제 #11
0
<ul>
<?php 
$pages = LayoutHelper::getPage("/footer")->getChildren();
foreach ($pages as $page) {
    ?>
	<li><?php 
    LayoutHelper::renderLink($page);
    ?>
</li>
<?php 
}
?>
</ul>
예제 #12
0
<?php

require 'lib/LayoutHelper.php';
$helper = new LayoutHelper();
$helper->title('Layout Helper Test Page');
$helper->body_class('test-page');
$helper->js('application');
$helper->css('default', 'print[screen,print]', 'small[handheld]');
$helper->css('http://localhost/cdn/stylesheets/print.css[print]');
$helper->css('https://localhost/secure/stylesheets/secret.css');
$helper->js('http://maps.google.com/maps/api/js?sensor=false');
$helper->ie->begin('gt IE 6');
$helper->js('fancy');
$helper->css('pretty');
$helper->ie->end();
$helper->ie->begin('IE');
$helper->js('ie');
$helper->css('ie');
$helper->ie->end();
echo $helper->render('header');
?>

<h1>Test page</h1>
<p>What it do?</p>

<?php 
echo $helper->render_partial('partial');
?>

<?php 
echo $helper->render('footer');
예제 #13
0
</link>
		<description><?php 
LayoutHelper::renderField($PAGE, "Description");
?>
</description>
		<language><?php 
LayoutHelper::renderField($PAGE, "Language");
?>
</language>
		<pubDate><?php 
echo Date_Format(date_create(), "D, d F Y H:i:s e");
?>
</pubDate>
		<lastBuildDate><?php 
echo Date_Format(date_create(), "D, d F Y H:i:s e");
?>
</lastBuildDate>
		<generator>Structure CMS</generator>
		<webMaster><?php 
LayoutHelper::renderField($PAGE, "Email");
?>
</webMaster>
		<ttl>5</ttl>
	</channel>
 
<?php 
LayoutHelper::renderPlaceHolder($PAGE, "RSS");
?>
	</channel>
</rss>
예제 #14
0
			<?php 
    $edit = JTExt::_('edit');
    $delete = JTExt::_('delete');
    $edit = "title=\"" . $edit . "\" alt=\"" . $edit . "\"";
    $delete = "title=\"" . $delete . "\" alt=\"" . $delete . "\"";
    $k = 0;
    for ($i = 0, $n = count($this->rows); $i < $n; $i++) {
        $row = $this->rows[$i];
        $terrain = JtgHelper::parseMoreTerrains($this->sortedter, $row->terrain, "array");
        $terrain = implode(", ", $terrain);
        if ($this->cfg->unit == "Miles") {
            $distance = JtgHelper::getLocatedFloat(JtgHelper::getMiles($row->distance, "-", "Miles"));
        } else {
            $distance = JtgHelper::getLocatedFloat($row->distance, "-", "km");
        }
        $votes = LayoutHelper::parseVoteFloat($row->vote);
        $link = JRoute::_('index.php?option=com_jtg&view=files&layout=file&id=' . $row->id, false);
        $cats = JtgHelper::parseMoreCats($this->cats, $row->catid, "array");
        $cats = implode(", ", $cats);
        ?>
			<tr class="sectiontableentry<?php 
        echo $k;
        ?>
">
				<td align="center"><?php 
        echo $this->pagination->getRowOffset($i);
        ?>
					<a
					href="index.php?option=com_jtg&view=files&layout=form&id=<?php 
        echo $row->id;
        ?>
예제 #15
0
			</tr>
		</tfoot>
		<tbody>
			<?php 
$k = 0;
for ($i = 0, $n = count($this->rows); $i < $n; $i++) {
    $row = $this->rows[$i];
    if (!$row->title) {
        $row->title = "<font class=\"emptyEntry\">" . JText::_('COM_JTG_NO_TITLE') . "</font>";
    }
    $link = JRoute::_('index.php?option=com_jtg&view=files&layout=file&id=' . $row->id, false);
    $profile = JtgHelper::getProfileLink($row->uid, $row->user);
    $cat = JtgHelper::parseMoreCats($this->sortedcats, $row->catid, "list", true);
    $terrain = JtgHelper::parseMoreTerrains($this->sortedter, $row->terrain, "list", true);
    $hits = JtgHelper::getLocatedFloat($row->hits);
    $layoutHelper = new LayoutHelper();
    $votes = $layoutHelper->parseVoteFloat($row->vote, true);
    $links = null;
    if (!$row->distance) {
        $row->distance = 0;
    }
    if ($this->cfg->unit == "Miles") {
        $distance = JtgHelper::getLocatedFloat(JtgHelper::getMiles($row->distance, "-", "Miles"));
    } else {
        $distance = JtgHelper::getLocatedFloat($row->distance, "-", "km");
    }
    if ($profile != "") {
        $profile .= "&nbsp;";
    } else {
        $profile .= "<font class=\"emptyEntry\">" . JText::_('COM_JTG_NO_USER') . "</font>&nbsp;";
    }
예제 #16
0
</span>
			</div>
			<div id="navigation">
				<?php 
include "includes/nav.php";
?>
			</div>
			<div id="content-wrapper">
				<div id="content" class="home">
					<?php 
LayoutHelper::renderPlaceHolder($PAGE, "Main");
?>
				</div>
				<div id="side">
					<?php 
LayoutHelper::renderPlaceHolder($PAGE, "Side");
?>
				</div>
				<div class="clear-hidden"></div>
			</div>
			<div id="footer">
				<?php 
include "includes/footer.php";
?>
				<a href="http://www.jozza.net/content/home/projects/structure-cms/"><img src="<?php 
getPath("");
?>
/structurecms-logo.gif" border="0" alt="&copy; Created using StructureCMS" title="&copy; Created using StructureCMS"></a>
				<div class="clear-hidden"></div>
			</div>
		</div>
예제 #17
0
			</div>
			<div id="navigation-footer"></div>
			<div id="content-wrapper">
				<div id="side-nav">
					<?php 
include "includes/side-nav.php";
?>
				</div>
				<div id="breadcrumb">
					<?php 
include "includes/bread-crumb.php";
?>
				</div>
				<div id="content">
					<?php 
LayoutHelper::renderPlaceHolder($PAGE, "Main");
?>
				</div>
				<div class="clear-hidden"></div>
			</div>
			<div id="footer">
				<?php 
include "includes/footer.php";
?>
				<a href="http://www.jozza.net/content/home/projects/structure-cms/"><img src="<?php 
getPath("");
?>
/structurecms-logo.gif" border="0" alt="&copy; Created using StructureCMS" title="&copy; Created using StructureCMS"></a>
				<div class="clear-hidden"></div>
			</div>
		</div>