Skip to content

Instantly share code, notes, and snippets.

<?php
require_once(TOOLKIT . '/class.administrationpage.php');
class contentExtensionBackendPagesIndex extends AdministrationPage{
private $pagecontent;
private $backenbdpages;
@andrewminton
andrewminton / navigation.xsl
Created September 13, 2013 08:35
entry Based Navigation for Symphony CMS
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*[section/@handle='pages']/entry" mode='link'>
<xsl:choose>
<xsl:when test="parent/item">
<xsl:apply-templates select='../../navigation/entry[@id=current()/parent/item/@id]' mode='link'/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select='$root'/>
<data>
<entry>
<caption mode="formatted">
<p>A fairly long looking <a href="http://www.stackoverflow.com">caption with a link</a> that goes to an external site.</p>
</caption>
</entry>
<entry>
<caption mode="unformatted">
<![CDATA[A fairly long looking <a href="http://www.stackoverflow.com">caption with a link</a> that goes to an external site.]]>
</caption>
<data>
<entry>
<caption mode="formatted">
<p>A fairly long looking <a href="http://www.stackoverflow.com">caption with a link</a> that goes to an external site.</p>
</caption>
</entry>
<entry>
<caption mode="unformatted">
<![CDATA[A fairly long looking <a href="http://www.stackoverflow.com">caption with a link</a> that goes to an external site.]]>
</caption>
@andrewminton
andrewminton / nodetostring
Created September 6, 2013 16:00
Nodetostring test
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<!--
Converts a nodeset to string, especially useful for json conversions.
===================================================================================
<data>
<navigation>
<section id="1" handle="pages">Pages</section>
<entry id="1">
<title mode="formatted" word-count="1">Home</title>
<url-handle mode="formatted" handle="home" word-count="1">home</url-handle>
</entry>
<entry id="2">
<title mode="formatted" word-count="2">Sample Page</title>
<url-handle mode="formatted" handle="sample-page" word-count="1">sample-page</url-handle>
<data>
<params>
<workspace>http://192.168.1.4/symphony/workspace</workspace>
</params>
<images>
<section id="4" handle="images">Images</section>
<entry id="42">
<image-title handle="preview">Preview</image-title>
<image size="50 KB" path="/images/projektai" type="image/jpeg">
<filename>beute-beispielfoto-gruppe.jpg</filename>
<data>
<url-segments>
<segment>firstlink</segment>
<segment>2ndlink</segment>
<segment>thirdlink</segment>
<segment>4thlink</segment>
<segment>?poop=4thlink</segment>
</url-segments>
</data>
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<title>Test fullscreen</title>
<style>
html, body {
margin: 0;
padding: 0;
<?php
class A {
private $foo="a";
protected $bar="a";
function getAstuff() {
return $this->foo.'/'.$this->bar;
}
}