Author: Tobias Schlitt
Date: 2006-07-04 10:03:10 +0200 (Tue, 04 Jul 2006)
New Revision: 3160

Log:
- Adding GoogleRankCheck example application.

Added:
   docs/examples/applications/GoogleRankCheck/
   docs/examples/applications/GoogleRankCheck/trunk/
   docs/examples/applications/GoogleRankCheck/trunk/actions/
   docs/examples/applications/GoogleRankCheck/trunk/actions/resultdetails.php
   docs/examples/applications/GoogleRankCheck/trunk/actions/searchdetails.php
   docs/examples/applications/GoogleRankCheck/trunk/actions/searchnew.php
   docs/examples/applications/GoogleRankCheck/trunk/actions/sitedetails.php
   docs/examples/applications/GoogleRankCheck/trunk/actions/sitelist.php
   docs/examples/applications/GoogleRankCheck/trunk/actions/sitenew.php
   docs/examples/applications/GoogleRankCheck/trunk/autoload.php
   docs/examples/applications/GoogleRankCheck/trunk/autoload/
   docs/examples/applications/GoogleRankCheck/trunk/autoload/grc_autoload.php
   docs/examples/applications/GoogleRankCheck/trunk/classes/
   docs/examples/applications/GoogleRankCheck/trunk/classes/google_searcher.php
   docs/examples/applications/GoogleRankCheck/trunk/config/
   docs/examples/applications/GoogleRankCheck/trunk/config/config.ini
   docs/examples/applications/GoogleRankCheck/trunk/controller.php
   docs/examples/applications/GoogleRankCheck/trunk/cron.php
   docs/examples/applications/GoogleRankCheck/trunk/css/
   docs/examples/applications/GoogleRankCheck/trunk/css/standard.css
   docs/examples/applications/GoogleRankCheck/trunk/fonts/
   docs/examples/applications/GoogleRankCheck/trunk/fonts/Vera.ttf
   docs/examples/applications/GoogleRankCheck/trunk/img/
   docs/examples/applications/GoogleRankCheck/trunk/index.php
   docs/examples/applications/GoogleRankCheck/trunk/models/
   docs/examples/applications/GoogleRankCheck/trunk/models/result.php
   docs/examples/applications/GoogleRankCheck/trunk/models/search.php
   docs/examples/applications/GoogleRankCheck/trunk/models/site.php
   docs/examples/applications/GoogleRankCheck/trunk/persistent/
   docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcresult.php
   docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsearch.php
   docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsite.php
   docs/examples/applications/GoogleRankCheck/trunk/templates/
   docs/examples/applications/GoogleRankCheck/trunk/templates/footer.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/header.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/menu.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/resultdetails.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/searchdetails.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/searchnew.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/searchnewsave.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/sitedetails.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/sitelist.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/sitenew.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templates/sitenewsave.ezt
   docs/examples/applications/GoogleRankCheck/trunk/templatesc/
   docs/examples/applications/GoogleRankCheck/trunk/templatesc/xhtml-updqr0/

Added: 
docs/examples/applications/GoogleRankCheck/trunk/actions/resultdetails.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/resultdetails.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/resultdetails.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,42 @@
+<?php
+
+class ezcGrcActionResultdetails
+{
+    
+    public $template = "resultdetails";
+
+    public $title = "Result details";
+
+    protected $rankId;
+
+    public $result;
+
+    public $search;
+
+    public $site;
+
+    public function __construct()
+    {
+        $definition = array( 
+            'result' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'int'
+            ),
+        );
+        $form = new ezcInputForm( INPUT_GET, $definition );
+        if ( !$form->hasValidData( 'result' ) )
+        {
+            throw new Exception( 'Missing or invalid result ID.' );
+        }
+        $this->resultId = $form->result;
+    }
+
+    public function run()
+    {
+        $this->result = ezcGrcController::getSession()->load( 'ezcGrcResult', 
$this->resultId );
+        $this->search = $this->result->getSearch();
+        $this->site = $this->search->getSite();
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/resultdetails.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/actions/searchdetails.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/searchdetails.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/searchdetails.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,80 @@
+<?php
+
+class ezcGrcActionSearchdetails
+{
+    
+    public $template = "searchdetails";
+
+    public $title = "Search details";
+
+    protected $searchId;
+
+    public $site;
+
+    public $search;
+
+    public $results;
+
+    public $chart;
+
+    public function __construct()
+    {
+        $definition = array( 
+            'search' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'int'
+            ),
+        );
+        $form = new ezcInputForm( INPUT_GET, $definition );
+        if ( !$form->hasValidData( 'search' ) )
+        {
+            throw new Exception( 'Missing or invalid site ID.' );
+        }
+        $this->searchId = $form->search;
+    }
+
+    public function run()
+    {
+        $this->search = ezcGrcController::getSession()->load( 'ezcGrcSearch', 
$this->searchId );
+        $this->results = $this->search->getResults();
+        $this->site = $this->search->getSite();
+        $this->chart = $this->generateChart();
+    }
+
+    private function generateChart()
+    {
+        $chartFile = "img/search_{$this->search->id}.png";
+        if ( !file_exists( $chartFile ) || filemtime( $chartFile ) < ( time() 
- 86400 ) )
+        {
+            $chart = ezcGraph::create( 'Line' );
+            
+            $chart->title = "Search for {$this->site->site} using 
\"{$this->search->query}\"";
+            $chart->palette = "Tango";
+            $chart->driver = new ezcGraphGdDriver();
+            $chart->legend = false;
+
+            $chart->options->font = "./fonts/Vera.ttf";
+
+            $chart->yAxis->axisSpace = .15;
+            $chart->yAxis->font->maxFontSize = 10;
+
+//            $chart->yAxis->min = 0;
+//            $chart->yAxis->max = 10;
+//            $chart->yAxis->minorStep = 1;
+//            $chart->yAxis->majorStep = 2;
+
+            $chart->title->font->maxFontSize = 12;
+            
+            $chartData = array();
+            foreach ( $this->results as $result )
+            {
+                $chartData[date( "m/d", $result->timestamp )] = $result->rank;
+            }
+            $chart["rankData"] = array_reverse( $chartData );
+            
+            $chart->render( 500, 200, $chartFile );
+        }
+        return $chartFile;
+    }
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/searchdetails.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/actions/searchnew.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/searchnew.php      
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/searchnew.php      
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,63 @@
+<?php
+
+class ezcGrcActionSearchnew
+{
+    
+    public $template = "searchnew";
+
+    public $title = "New search";
+
+    public $site;
+
+    public $search;
+
+    private $formDef;
+
+    public function __construct()
+    {
+        $formDef = array( 
+            'site' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'int'
+            ),
+        );
+        $form = new ezcInputForm( INPUT_GET, $formDef );
+        if ( !$form->hasValidData( 'site' ) )
+        {
+            throw new Exception( 'Missing or invalid site ID.' );
+        }
+        $this->site = ezcGrcController::getSession()->load( 'ezcGrcSite', 
$form->site );
+
+        $this->formDef = array( 
+            'query' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'string'
+            ),
+        );
+        $this->search = new ezcGrcSearch();
+        $this->search->site = $this->site->id;
+    }
+
+    public function run()
+    {
+        if ( ezcInputForm::hasPostData() )
+        {
+            $form = new ezcInputForm( INPUT_POST, $this->formDef );
+            if ( !$form->hasValidData( 'query' ) )
+            {
+                throw new Exception( 'Missing or invalid query string.' );
+            }
+            $this->search->query = $form->query;
+            try
+            {
+                ezcGrcController::getSession()->save( $this->search );
+            }
+            catch ( ezcPersistentObjectException $e )
+            {
+                throw new Exception( "Could not save search object 
<{$this->search->query}> for site <{$this->site->site}>. Reason: 
{$e->getMessage()}" );
+            }
+            $this->template = "searchnewsave";
+        }
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/searchnew.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/actions/sitedetails.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/sitedetails.php    
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/sitedetails.php    
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,41 @@
+<?php
+
+class ezcGrcActionSitedetails
+{
+    
+    public $template = "sitedetails";
+
+    public $title = "Site details";
+
+    protected $siteId;
+
+    public $site;
+
+    public $searches;
+
+    public $chart;
+
+    public function __construct()
+    {
+        $definition = array( 
+            'site' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'int'
+            ),
+        );
+        $form = new ezcInputForm( INPUT_GET, $definition );
+        if ( !$form->hasValidData( 'site' ) )
+        {
+            throw new Exception( 'Missing or invalid site ID.' );
+        }
+        $this->siteId = $form->site;
+    }
+
+    public function run()
+    {
+        $this->site = ezcGrcController::getSession()->load( 'ezcGrcSite', 
$this->siteId );
+        $this->searches = $this->site->getSearches();
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/sitedetails.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/actions/sitelist.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/sitelist.php       
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/sitelist.php       
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,24 @@
+<?php
+
+class ezcGrcActionSitelist
+{
+    
+    public $template = "sitelist";
+
+    public $title = "Main view";
+
+    public $sites = array();
+
+    public function __construct()
+    {
+        
+    }
+
+    public function run()
+    {
+        $this->sites = ezcGrcSite::getAllSites();
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/sitelist.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/actions/sitenew.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/actions/sitenew.php        
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/actions/sitenew.php        
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,48 @@
+<?php
+
+class ezcGrcActionSitenew
+{
+    
+    public $template = "sitenew";
+
+    public $title = "New site";
+
+    public $site;
+
+    private $formDef;
+
+    public function __construct()
+    {
+        $this->formDef = array( 
+            'site' => new ezcInputFormDefinitionElement(
+                ezcInputFormDefinitionElement::REQUIRED, 'string'
+            ),
+        );
+        $this->site = new ezcGrcSite();
+    }
+
+    public function run()
+    {
+        if ( ezcInputForm::hasPostData() )
+        {
+            $form = new ezcInputForm( INPUT_POST, $this->formDef );
+            if ( !$form->hasValidData( 'site' ) )
+            {
+                throw new Exception( 'Missing or invalid site URL.' );
+            }
+            $this->site->site = $form->site;
+            try
+            {
+                ezcGrcController::getSession()->save( $this->site );
+            }
+            catch ( ezcPersistentObjectException $e )
+            {
+                throw new Exception( "Could not save site object 
<{$this->site->site}>. Reason: {$e->getMessage()}" );
+            }
+            $this->template = "sitenewsave";
+        }
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/actions/sitenew.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/autoload/grc_autoload.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/autoload/grc_autoload.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/autoload/grc_autoload.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,22 @@
+<?php
+
+return array(
+    "ezcGrcSearch"       => "models/search.php",
+    "ezcGrcSite"         => "models/site.php",
+    "ezcGrcResult"       => "models/result.php", 
+    
+    "ezcGrcController"   => "controller.php",
+
+    "ezcGrcActionSitelist"       => "actions/sitelist.php",
+    "ezcGrcActionSitedetails"    => "actions/sitedetails.php",
+    "ezcGrcActionSitenew"        => "actions/sitenew.php",
+
+    "ezcGrcActionSearchdetails"  => "actions/searchdetails.php",
+    "ezcGrcActionSearchnew"      => "actions/searchnew.php",
+    
+    "ezcGrcActionResultdetails"  => "actions/resultdetails.php",
+
+    "ezcGrcGoogleSearcher"       => "classes/google_searcher.php",
+);
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/autoload/grc_autoload.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/autoload.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/autoload.php       
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/autoload.php       
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,13 @@
+<?php
+
+ini_set( "include_path", ini_get( "include_path" ) . ":" . 
"/home/dotxp/dev/ez/ezcomponents/trunk" );
+
+require_once "Base/src/base.php";
+ezcBase::addClassRepository( dirname( __FILE__ ), "autoload" );
+
+function __autoload( $class_name )
+{
+    return ezcBase::autoload( $class_name );
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/autoload.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/classes/google_searcher.php
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/classes/google_searcher.php    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/classes/google_searcher.php    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,59 @@
+<?php
+
+class ezcGrcGoogleSearcher
+{
+
+    private $soapClient;
+
+    private $apiKey;
+
+    private $maxResults;
+
+    private $currentResults = array();
+
+    private $currentIndex = 0;
+
+    private $currentQuery;
+
+    public function __construct( $apiKey )
+    {
+        $this->soapClient = new SoapClient( 
"http://api.google.com/GoogleSearch.wsdl"; );
+        $this->apiKey = $apiKey;
+    }
+
+    public function query( $query, $maxResults = 100 )
+    {
+        $this->currentIndex = 0;
+        $this->currentResults = array();
+        $this->currentQuery = $query;
+        $this->maxResults = 100;
+    }
+
+    public function fetchResult()
+    {
+        if ( $this->currentIndex === $this->maxResults )
+        {
+            return false;
+        }
+
+        if ( $this->currentIndex % 10 === 0 )
+        {
+            $this->currentResults = $this->soapClient->doGoogleSearch(
+                $this->apiKey,
+                $this->currentQuery,
+                $this->currentIndex,
+                10,
+                true,
+                "",
+                true,
+                "",
+                "",
+                ""
+            )->resultElements;
+        }
+        return $this->currentResults[( $this->currentIndex++ ) % 10];
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/classes/google_searcher.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/config/config.ini
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/config/config.ini  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/config/config.ini  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,7 @@
+[google]
+
+key="3Guks21QFHL/7FHLv53pHvZ9B07wa6Nm"
+
+[database]
+
+dsn="mysql://root:[EMAIL PROTECTED]/googlerank"


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/config/config.ini
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/controller.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/controller.php     
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/controller.php     
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,92 @@
+<?php
+
+class ezcGrcController
+{
+    private static $session;
+
+    private static $config;
+
+    private $actions = array(
+        'sitelist'          => 'ezcGrcActionSitelist',
+        'sitedetails'       => 'ezcGrcActionSitedetails',
+        'sitenew'           => 'ezcGrcActionSitenew',
+        'searchdetails'     => 'ezcGrcActionSearchdetails',
+        'searchnew'         => 'ezcGrcActionSearchnew',
+        'resultdetails'     => 'ezcGrcActionResultdetails',
+    );
+
+    private $action;
+
+    public function __construct()
+    {
+        $action = "sitelist";
+        if ( ezcInputForm::hasGetData() )
+        {
+            $definition = array( 
+                'action' => new ezcInputFormDefinitionElement(
+                    ezcInputFormDefinitionElement::REQUIRED, 'string'
+                ),
+            );
+            $form = new ezcInputForm( INPUT_GET, $definition );
+            $action = ( $form->hasValidData( 'action' ) ) ? $form->action : 
$action;
+        }
+        if ( !isset( $this->actions[$action] ) )
+        {
+            throw new Exception( "Invalid action <".htmlentities($action).">." 
);
+        }
+        $actionClass = $this->actions[$action];
+        $this->action = new $actionClass;
+        
+        $eztConfig = ezcTemplateConfiguration::getInstance();
+        $eztConfig->templatePath = dirname( __FILE__ ) . "/templates";
+        $eztConfig->compilePath = dirname( __FILE__ ) . "/templatesc";
+    }
+
+    public function run()
+    {
+        $this->action->run();
+        
+        $template = new ezcTemplate();
+        $template->send->action = $this->action;
+
+        echo $template->process( $this->action->template . ".ezt" );
+    }
+
+    public static function getSession()
+    {
+        if ( self::$session === null )
+        {
+            self::$session = new ezcPersistentSession(
+                ezcDbInstance::get(),
+                new ezcPersistentCodeManager(  dirname( __FILE__ ) . 
"/persistent" )
+            );
+        }
+        return self::$session;
+    }
+
+    public static function getConfig()
+    {
+        if ( self::$config === null )
+        {
+            self::$config = ezcConfigurationManager::getInstance();
+            self::$config->init( 'ezcConfigurationIniReader', dirname(  
__FILE__ ) . "/config" );
+        }
+        return self::$config;
+    }
+
+    public static function performAllSearches()
+    {
+        foreach ( ezcGrcSearch::getAllSearches() as $search )
+        {
+           try 
+           {
+                $res = $search->performSearch( 20 );
+                self::getSession()->save( $res );
+           }
+           catch (Exception $e)
+           {}
+        }
+    }
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/controller.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/cron.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/cron.php   2006-06-30 
07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/cron.php   2006-07-04 
08:03:10 UTC (rev 3160)
@@ -0,0 +1,12 @@
+<?php
+
+ini_set( "include_path", "/home/dotxp/dev/ez/ezcomponents/trunk:" . ini_get( 
"include_path" ) );
+
+require_once "autoload.php";
+
+$db = ezcDbFactory::create( ezcGrcController::getConfig()->getSetting( 
"config", "database", "dsn" ) );
+ezcDbInstance::set( $db );
+
+$controller = ezcGrcController::performAllSearches();
+
+?>


Property changes on: docs/examples/applications/GoogleRankCheck/trunk/cron.php
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/css/standard.css
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/css/standard.css   
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/css/standard.css   
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,41 @@
+body, p, div, table, tr, td {
+       font-family:    "Sans serif";
+}
+
+body {
+       width:                  800px;
+       border:                 1px solid #d0d0d0;
+       margin:                 10px;
+       padding:                10px;
+}
+
+h1 {
+    font-size:                 1.5em;
+}
+
+th.detaillabel {
+    width:                     150px;
+    font-weight:       bold;
+    text-align:     left;
+    vertical-align: top;
+}
+
+th.detaillabel:after {
+    content:           ":";
+}
+
+td.detailtext {
+    width:                     650px;
+}
+
+tr.light {
+       background-color:       #ffffff;
+}
+
+tr.dark {
+       background-color:       #d0d0d0;
+}
+
+a {
+       color:                  #f8981d;
+}


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/css/standard.css
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/fonts/Vera.ttf
===================================================================
(Binary files differ)


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/fonts/Vera.ttf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: docs/examples/applications/GoogleRankCheck/trunk/index.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/index.php  2006-06-30 
07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/index.php  2006-07-04 
08:03:10 UTC (rev 3160)
@@ -0,0 +1,13 @@
+<?php
+
+require_once "autoload.php";
+
+$db = ezcDbFactory::create( 
+    ezcGrcController::getConfig()->getSetting( "config", "database", "dsn" ) 
+);
+ezcDbInstance::set( $db );
+
+$controller = new ezcGrcController();
+$controller->run();
+
+?>


Property changes on: docs/examples/applications/GoogleRankCheck/trunk/index.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/models/result.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/models/result.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/models/result.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,60 @@
+<?php
+
+class ezcGrcResult
+{
+    protected $id;
+
+    public $search;
+
+    public $rank;
+
+    public $timestamp;
+
+    public $title;
+
+    public $url;
+
+    public $snippet;
+
+    public function setState( array $state )
+    {
+        foreach ( $state as $key => $val )
+        {
+            $this->$key = $val;
+        }
+    }
+
+    public function getState()
+    {
+        return array(
+            'id'        => $this->id,
+            'search'    => $this->search,
+            'rank'      => $this->rank,
+            'timestamp' => $this->timestamp,
+            'title'     => $this->title,
+            'url'       => $this->url,
+            'snippet'   => $this->snippet,
+        );
+    }
+
+    public function __get( $key )
+    {
+        switch( $key ) {
+            case "id":
+                return $this->id;
+            case "raltedSearch":
+                return $this->getSearch();
+        }
+    }
+
+    public function getSearch()
+    {
+        if ( $this->id === null )
+        {
+            throw new Exception( "Object is not persistent, yet!" );
+        }
+        return ezcGrcController::getSession()->load( "ezcGrcSearch", 
$this->search );
+    }
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/models/result.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/models/search.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/models/search.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/models/search.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,128 @@
+<?php
+
+class ezcGrcSearch
+{
+    protected $id;
+
+    public $site;
+
+    public $query;
+
+    public function setState( array $state )
+    {
+        foreach ( $state as $key => $val )
+        {
+            $this->$key = $val;
+        }
+    }
+
+    public function getState()
+    {
+        return array(
+            'id'    => $this->id,
+            'site'  => $this->site,
+            'query' => $this->query,
+        );
+    }
+
+    public function __get( $key )
+    {
+        switch ( $key )
+        {
+            case "id":
+                return $this->id;
+            case "latestResult":
+                return $this->getLatestResult();
+        }
+    }
+
+    public function getResults()
+    {
+        if ( $this->id === null )
+        {
+            throw new Exception( "Object is not persistent, yet!" );
+        }
+        $q = ezcGrcController::getSession()->createFindQuery( "ezcGrcResult" );
+        $q->where( $q->expr->eq( "search", $this->id ) )
+          ->orderBy( 'timestamp DESC' )
+          ->limit( 10 );
+        return ezcGrcController::getSession()->find( $q, "ezcGrcResult" );
+    }
+
+    public function getLatestResult()
+    {
+        if ( $this->id === null )
+        {
+            throw new Exception( "Object is not persistent, yet!" );
+        }
+        $q = ezcGrcController::getSession()->createFindQuery( "ezcGrcResult" );
+        $q->where( $q->expr->eq( "search", $this->id ) )
+          ->orderBy( 'timestamp DESC' )
+          ->limit( 1 );
+        $res = ezcGrcController::getSession()->find( $q, "ezcGrcResult" );
+        return ( sizeof( $res ) > 0 ) ? $res[0] : false;
+    }
+
+    public static function getAllSearches()
+    {
+        $q = ezcGrcController::getSession()->createFindQuery( "ezcGrcSearch" );
+        return ezcGrcController::getSession()->find( $q, "ezcGrcSearch" );
+    }
+
+    public function getSite(  )
+    {
+        if ( $this->site === null )
+        {
+            throw new Exception( "Object is not associated to a site!" );
+        }
+        $q = ezcGrcController::getSession()->createFindQuery( "ezcGrcSite" );
+        $q->where( $q->expr->eq( "id", $this->site ) );
+        $res = ezcGrcController::getSession()->find( $q, "ezcGrcSite" );
+        return ( sizeof( $res ) > 0 ) ? $res[0] : false;
+    }
+    
+    public function performSearch( $maxRes = 100 )
+    {
+        $site = $this->getSite();
+
+        $google = new ezcGrcGoogleSearcher( 
+            ezcGrcController::getConfig()->getSetting( "config", "google", 
"key" )
+        );
+        $google->query( $this->query, 20 );
+
+        $rank  = 0;
+        $found = false;
+
+        try
+        {
+            while ( ( $res = $google->fetchResult() ) !== false )
+            {
+                $rank++;
+                if ( strpos( $res->URL, $site->site ) !== false )
+                {
+                    $found = true;
+                    break;
+                }
+            }
+        }
+        catch ( SoapFault $e )
+        {
+        }
+
+        $return = new ezcGrcResult();
+        $return->search = (int)$this->id;
+        $return->timestamp = time();
+        $return->rank = ( $found !== false ) ? $rank : 0;
+
+        if ( $found === true )
+        {
+            $return->title = strip_tags( $res->title );
+            $return->url = $res->URL;
+            $return->snippet = strip_tags( $res->snippet );
+        }
+
+        return $return;
+    }
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/models/search.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/models/site.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/models/site.php    
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/models/site.php    
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,61 @@
+<?php
+
+class ezcGrcSite
+{
+    protected $id;
+
+    public $site;
+
+    public function setState( array $state )
+    {
+        foreach ( $state as $key => $val )
+        {
+            $this->$key = $val;
+        }
+    }
+
+    public function getState()
+    {
+        return array(
+            'id'    => $this->id,
+            'site'  => $this->site,
+        );
+    }
+
+    public function __get( $key )
+    {
+        switch ( $key )
+        {
+            case "id":
+                return $this->id;
+        }
+    }
+
+    /**
+     * getSearches 
+     * 
+     * @return array
+     */
+    public function getSearches()
+    {
+        if ( $this->id === null )
+        {
+            throw new Exception( "Object is not persistent, yet!" );
+        }
+        $q = ezcGrcController::getSession()->createFindQuery( "ezcGrcSearch" );
+        $q->where( $q->expr->eq( "site", $this->id ) )
+          ->orderBy( "query" );
+        return ezcGrcController::getSession()->find( $q, "ezcGrcSearch" );
+    }
+
+    public function getAllSites()
+    {
+        $q = ezcGrcController::getSession()
+             ->createFindQuery( "ezcGrcSite" )
+             ->orderBy( "site" );
+        return ezcGrcController::getSession()->find( $q, "ezcGrcSite" );
+    }
+
+}
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/models/site.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcresult.php
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcresult.php    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcresult.php    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,48 @@
+<?php
+// Autogenerated PersistentObject definition
+
+$def = new ezcPersistentObjectDefinition();
+$def->table = 'results';
+$def->class = 'ezcGrcResult';
+
+$def->idProperty               = new ezcPersistentObjectIdProperty();
+$def->idProperty->columnName   = 'id';
+$def->idProperty->propertyName = 'id';
+$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
'ezcPersistentSequenceGenerator' );
+
+
+$def->properties['rank']               = new ezcPersistentObjectProperty();
+$def->properties['rank']->columnName   = 'rank';
+$def->properties['rank']->propertyName = 'rank';
+$def->properties['rank']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_INT;
+
+
+$def->properties['search']               = new ezcPersistentObjectProperty();
+$def->properties['search']->columnName   = 'search';
+$def->properties['search']->propertyName = 'search';
+$def->properties['search']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_INT;
+
+
+$def->properties['timestamp']               = new 
ezcPersistentObjectProperty();
+$def->properties['timestamp']->columnName   = 'timestamp';
+$def->properties['timestamp']->propertyName = 'timestamp';
+$def->properties['timestamp']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_INT;
+
+$def->properties['title']               = new ezcPersistentObjectProperty();
+$def->properties['title']->columnName   = 'title';
+$def->properties['title']->propertyName = 'title';
+$def->properties['title']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_STRING;
+
+$def->properties['url']               = new ezcPersistentObjectProperty();
+$def->properties['url']->columnName   = 'url';
+$def->properties['url']->propertyName = 'url';
+$def->properties['url']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_STRING;
+
+$def->properties['snippet']               = new ezcPersistentObjectProperty();
+$def->properties['snippet']->columnName   = 'snippet';
+$def->properties['snippet']->propertyName = 'snippet';
+$def->properties['snippet']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_STRING;
+
+return $def;
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcresult.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsearch.php
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsearch.php    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsearch.php    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,27 @@
+<?php
+// Autogenerated PersistentObject definition
+
+$def = new ezcPersistentObjectDefinition();
+$def->table = 'searches';
+$def->class = 'ezcGrcSearch';
+
+$def->idProperty               = new ezcPersistentObjectIdProperty();
+$def->idProperty->columnName   = 'id';
+$def->idProperty->propertyName = 'id';
+$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
'ezcPersistentSequenceGenerator' );
+
+
+$def->properties['query']               = new ezcPersistentObjectProperty();
+$def->properties['query']->columnName   = 'query';
+$def->properties['query']->propertyName = 'query';
+$def->properties['query']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_STRING;
+
+
+$def->properties['site']               = new ezcPersistentObjectProperty();
+$def->properties['site']->columnName   = 'site';
+$def->properties['site']->propertyName = 'site';
+$def->properties['site']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_INT;
+
+return $def;
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsearch.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsite.php
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsite.php  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsite.php  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,21 @@
+<?php
+// Autogenerated PersistentObject definition
+
+$def = new ezcPersistentObjectDefinition();
+$def->table = 'sites';
+$def->class = 'ezcGrcSite';
+
+$def->idProperty               = new ezcPersistentObjectIdProperty();
+$def->idProperty->columnName   = 'id';
+$def->idProperty->propertyName = 'id';
+$def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
'ezcPersistentSequenceGenerator' );
+
+
+$def->properties['site']               = new ezcPersistentObjectProperty();
+$def->properties['site']->columnName   = 'site';
+$def->properties['site']->propertyName = 'site';
+$def->properties['site']->propertyType = 
ezcPersistentObjectProperty::PHP_TYPE_STRING;
+
+return $def;
+
+?>


Property changes on: 
docs/examples/applications/GoogleRankCheck/trunk/persistent/ezcgrcsite.php
___________________________________________________________________
Name: svn:eol-style
   + native

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/footer.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/footer.ezt       
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/footer.ezt       
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,2 @@
+</body>
+</html>

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/header.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/header.ezt       
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/header.ezt       
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,12 @@
+{use $action, $menu = array()}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="css/standard.css" />
+ <title>GoogleRankCheck - {$action->title}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+{include "menu.ezt" send $menu}

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/menu.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/menu.ezt 
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/menu.ezt 
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,16 @@
+{use $menu}
+{var
+       $menuStd = array(
+               "Main page" => array( "action" => "sitelist" ),
+       )
+}
+{
+       $menu = array_merge( $menuStd, $menu )
+}
+<table>
+<tr>
+{foreach $menu as $menuName => $menuParams}
+       <td>[<a href="index.php?{url_parameters_build( $menuParams 
)}">{$menuName}</a>]</td>
+{/foreach}
+</tr>
+</table>

Added: 
docs/examples/applications/GoogleRankCheck/trunk/templates/resultdetails.ezt
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/templates/resultdetails.ezt    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/templates/resultdetails.ezt    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,36 @@
+{use $action}
+{var 
+       $menu = array(
+               "Back to search" =>  array( "action" => "searchdetails", 
"search" => $action->search->id ),
+               "Back to site"   =>  array( "action" => "sitedetails", "site" 
=> $action->site->id ),
+       )
+}
+{include "header.ezt" send $action, $menu}
+<h1>Result details for search "{$action->search->query}" about site 
"{$action->site->site}"</h1>
+<table>
+ <tr class="light">
+  <th class="detaillabel">Site</th>
+  <td class="detailtext">{$action->site->site}</td>
+ </tr>
+ <tr class="dark">
+  <th class="detaillabel">Search term</th>
+  <td class="detailtext">{$action->search->query}</td>
+ </tr>
+ <tr class="light">
+  <th class="detaillabel">Check date</th>
+  <td class="detailtext">{date_format_timestamp( "Y-m-d H:i:s", 
$action->result->timestamp )}</td>
+ </tr>
+ <tr class="dark">
+  <th class="detaillabel">Title found</th>
+  <td class="detailtext">{$action->result->title}</td>
+ </tr>
+ <tr class="light">
+  <th class="detaillabel">URL found</th>
+  <td class="detailtext"><a href="{$action->result->url}" 
target="_blank">{$action->result->url}</a></td>
+ </tr>
+ <tr class="dark">
+  <th class="detaillabel">Snippet found</th>
+  <td class="detailtext">{$action->result->snippet}</td>
+ </tr>
+</table>
+{include "footer.ezt"}

Added: 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchdetails.ezt
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchdetails.ezt    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchdetails.ezt    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,33 @@
+{use $action}
+{var
+       $menu = array( "Back to site" => array( "action" => "sitedetails", 
"site" => $action->site-id ) )
+}
+{include "header.ezt" send $action, $menu}
+<h1>Search details for search "{$action->search->query}" about site 
"{$action->site->site}"</h1>
+<h2>Results</h2>
+ <table width="100%" class="data">
+  <tr>
+   <th>Query date</th>
+   <th>Rank</th>
+   <th>More details</th>
+  </tr>
+ {cycle $rowStyle = array( "light", "dark" )}
+ {foreach $action->results as $result}
+    <tr class="{$rowStyle}">
+     <td>
+         {date_format_timestamp( "Y-m-d H:i", $result->timestamp )}
+     </td>
+     <td>
+      {$result->rank}
+     </td>
+     <td>
+      <a href="index.php?{url_parameters_build( array( "action" => 
"resultdetails", "result" => $result->id ) )}">details</a>
+     </td>
+    </tr>
+   {increment $rowStyle}
+ {/foreach}
+ </table>
+<p style="text-align: center;">
+ <img src="{$action->chart}" border="0">
+</p>
+{include "footer.ezt"}

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/searchnew.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/searchnew.ezt    
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/searchnew.ezt    
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,24 @@
+{use $action}
+{var
+       $menu = array(
+               "Back to site" => array( "action" => "sitedetails", "site" => 
$action->site->id )
+       )
+}
+{include "header.ezt" send $action, $menu}
+<h1>New search</h1>
+<fieldset>
+<legend>Create a new search for site {$action->site->site}</legend>
+<form name="sitenew" 
action="index.php?action=searchnew&site={$action->site->id}" method="POST">
+<table>
+ <tr>
+  <td><label for="query">Query string</label></td>
+  <td><input id="query" type="text" name="query" 
value="{$action->search->query}" />
+ </tr>
+ <tr>
+  <td><label for="save">&nbsp;</label></td>
+  <td><input type="submit" name="save" value="Save" /></td>
+ </tr>
+</table>
+</form>
+</fieldset>
+{include "footer.ezt"}

Added: 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchnewsave.ezt
===================================================================
--- 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchnewsave.ezt    
    2006-06-30 07:23:57 UTC (rev 3159)
+++ 
docs/examples/applications/GoogleRankCheck/trunk/templates/searchnewsave.ezt    
    2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,14 @@
+{use $action}
+{var $menu = array(
+       "Add another query" => array( "action" => "searchnew", "site" => 
$action->site->id ),
+       "Back to site" => array( "action" => "sitedetails", "site" => 
$action->site->id ),
+)}
+{include "header.ezt" send $action, $menu}
+<h1>Created a new search query for site {$action->site->site}</h1>
+<table>
+ <tr>
+  <td>Query string</td>
+  <td>{$action->search->query}</td>
+ </tr>
+</table>
+{include "footer.ezt"}

Added: 
docs/examples/applications/GoogleRankCheck/trunk/templates/sitedetails.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/sitedetails.ezt  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/sitedetails.ezt  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,31 @@
+{use $action}
+{var
+       $menu = array(
+               "New search" => array( "action" => "searchnew", "site" => 
$action->site->id )
+       )
+}
+{include "header.ezt" send $action, $menu}
+<h1>Search queries for site {$action->site->site}</h1>
+<table width="100%" class="data">
+  <tr>
+   <th>Search query</th>
+   <th>Last google rank</th>
+   <th>Search it!</th>
+  </tr>
+ {cycle $rowStyle = array( "light", "dark" )}
+ {foreach $action->searches as $search}
+  <tr class="{$rowStyle}">
+   <td>
+    <a href="index.php?{url_parameters_build( array( "action" => 
"searchdetails", "search" => $search->id ) )}">"{$search->query}"</a>
+   </td>
+   <td>
+    {$search->latestResult->rank}
+   </td>
+   <td>
+    <a href="http://google.com/search?q={url_encode($search->query)}" 
target="_blank">search Google</a>
+   </td>
+  </tr>
+ {increment $rowStyle}
+ {/foreach}
+</table>
+{include "footer.ezt"}

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/sitelist.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/sitelist.ezt     
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/sitelist.ezt     
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,16 @@
+{use $action}
+{var 
+       $menu = array(
+               "New site" => array( "action" => "sitenew" ),
+       )
+}
+{include "header.ezt" send $action, $menu}
+<h1>Available sites</h1>
+<ul>
+{foreach $action->sites as $site}
+ <li>
+  <a href="index.php?action=sitedetails&site={$site->id}">{$site->site}</a>
+    </li>
+{/foreach}
+</ul>
+{include "footer.ezt"}

Added: docs/examples/applications/GoogleRankCheck/trunk/templates/sitenew.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/sitenew.ezt      
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/sitenew.ezt      
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,19 @@
+{use $action}
+{include "header.ezt" send $action}
+<h1>New site</h1>
+<fieldset>
+<legend>Create a new site</legend>
+<form name="sitenew" action="index.php?action=sitenew" method="POST">
+<table>
+ <tr>
+  <td><label for="site">Site URL</label></td>
+  <td><input id="site" type="text" name="site" value="{$action->site->site}" />
+ </tr>
+ <tr>
+  <td><label for="save">&nbsp;</label></td>
+  <td><input id="save" type="submit" name="save" value="Save" /></td>
+ </tr>
+</table>
+</form>
+</fieldset>
+{include "footer.ezt"}

Added: 
docs/examples/applications/GoogleRankCheck/trunk/templates/sitenewsave.ezt
===================================================================
--- docs/examples/applications/GoogleRankCheck/trunk/templates/sitenewsave.ezt  
2006-06-30 07:23:57 UTC (rev 3159)
+++ docs/examples/applications/GoogleRankCheck/trunk/templates/sitenewsave.ezt  
2006-07-04 08:03:10 UTC (rev 3160)
@@ -0,0 +1,10 @@
+{use $action}
+{include "header.ezt" send $action}
+<h1>Created a new site</h1>
+<table>
+ <tr>
+  <td>Site URL</td>
+  <td>{$action->site->site}</td>
+ </tr>
+</table>
+{include "footer.ezt"}

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to