[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] svn: /pear2/sandbox/SimpleChannelFrontend/trunk/ src/SimpleChannelFrontend/Main.php www/c
From:       Brett_Bieber <saltybeagle () php ! net>
Date:       2009-10-29 18:11:01
Message-ID: svn-saltybeagle-1256839861-290057-1886443257 () svn ! php ! net
[Download RAW message or body]

saltybeagle                              Thu, 29 Oct 2009 18:11:01 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=290057

Log:
CSS improvements. Add getURL method for retrieving route to views.

Changed paths:
    U   pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php
    A   pear2/sandbox/SimpleChannelFrontend/trunk/www/css/all.css
    A   pear2/sandbox/SimpleChannelFrontend/trunk/www/css/images/
    A   pear2/sandbox/SimpleChannelFrontend/trunk/www/css/images/header.png
    A   pear2/sandbox/SimpleChannelFrontend/trunk/www/css/scf.css
    U   pear2/sandbox/SimpleChannelFrontend/trunk/www/index.php
    U   pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php
    U   pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php
    U   pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php
    U   pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php


["svn-diffs-290057.txt" (text/x-diff)]

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php
 ===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php	2009-10-29 \
                18:10:43 UTC (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php	2009-10-29 \
18:11:01 UTC (rev 290057) @@ -36,9 +36,9 @@

     protected $options = array('view' => 'news');

-    protected $view_map = array('news'     => 'pear2\SimpleChannelFrontend\News',
-                                'packages' => \
                'pear2\SimpleChannelFrontend\PackageList',
-                                'package'  => \
'pear2\SimpleChannelFrontend\Package'); +    protected static $view_map = \
array('news'     => 'pear2\SimpleChannelFrontend\News', +                             \
'packages' => 'pear2\SimpleChannelFrontend\PackageList', +                            \
'package'  => 'pear2\SimpleChannelFrontend\Package');

     function __construct(\pear2\Pyrus\IChannelFile $channel, $options = array())
     {
@@ -73,10 +73,10 @@

     function run()
     {
-        if (!array_key_exists($this->options['view'], $this->view_map)) {
+        if (!array_key_exists($this->options['view'], static::$view_map)) {
             throw new UnregisteredViewException('No view, or incorrect view \
specified.');  }
-        $class = $this->view_map[$this->options['view']];
+        $class = static::$view_map[$this->options['view']];
         $options = array_merge($this->options, array('frontend'=>$this));
         $this->page_content = new $class($options);
     }
@@ -91,7 +91,23 @@
      */
     function registerView($route, $classname)
     {
-        $this->view_map[$route] = $classname;
+        static::$view_map[$route] = $classname;
         return $this;
     }
+
+    public static function getURL($class = null)
+    {
+        $url = '';
+        if ($class) {
+            if (is_object($class)) {
+                $class = get_class($class);
+            }
+            $route = array_keys(static::$view_map, $class);
+            if (!count($route)) {
+                throw new UnregisteredViewException('The view for that object is not \
registered'); +            }
+            $url .= '?view=' . $route[0];
+        }
+        return $url;
+    }
 }

Added: pear2/sandbox/SimpleChannelFrontend/trunk/www/css/all.css
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/css/all.css	                        \
                (rev 0)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/css/all.css	2009-10-29 18:11:01 UTC \
(rev 290057) @@ -0,0 +1,4 @@
+@import url(reset.css);
+@import url(960.css);
+@import url(text.css);
+@import url(scf.css);
\ No newline at end of file

Added: pear2/sandbox/SimpleChannelFrontend/trunk/www/css/images/header.png
===================================================================
(Binary files differ)


Property changes on: \
pear2/sandbox/SimpleChannelFrontend/trunk/www/css/images/header.png \
                ___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: pear2/sandbox/SimpleChannelFrontend/trunk/www/css/scf.css
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/css/scf.css	                        \
                (rev 0)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/css/scf.css	2009-10-29 18:11:01 UTC \
(rev 290057) @@ -0,0 +1,58 @@
+body{
+    background:url(images/header.png) #006500 repeat-x;
+}
+body a {
+    text-decoration:none;
+    border-bottom:1px dotted;
+}
+.header {
+    color:#ECECEC;
+    text-shadow:black;
+    font-size:150%;
+    height:114px;
+}
+.header a, .header a:link {
+    padding:5px;
+    color:#ECECEC;
+    -moz-border-radius:5px;
+    -webkit-border-radius:5px;
+    border-radius:5px;
+    text-decoration: none;
+    text-shadow: #000000;
+    border-bottom:none;
+}
+.header a:hover {
+    background-color: rgba(0, 0, 0, 0.2);
+}
+.header h1 {
+    font-size:2em;
+}
+ul.navigation li {
+    list-style:none;
+    display:inline;
+}
+.content {
+    margin-top:3em;
+    -moz-border-radius:10px;
+    -webkit-border-radius:10px;
+    border-radius:10px;
+    overflow:auto;
+    background-color:#F8F5EA;
+    color:#222;
+}
+ol.instructions {
+    -moz-border-radius:10px;
+    -webkit-border-radius:10px;
+    border-radius:10px;
+    padding:10px;
+    background-color:rgba(0, 0, 0, 0.8);
+    color:#FFF;
+    font-size:120%;
+    line-height:3em;
+    font-family:"andale mono", monaco, "courier new", courier;
+}
+.footer {
+    margin:10px;
+    font-size:85%;
+    color:#CCC;
+}
\ No newline at end of file

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/index.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/index.php	2009-10-29 18:10:43 UTC \
                (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/index.php	2009-10-29 18:11:01 UTC \
(rev 290057) @@ -6,5 +6,6 @@
 $savant = new pear2\Templates\Savant\Main();
 $savant->setClassToTemplateMapper(new pear2\SimpleChannelFrontend\TemplateMapper);
 $savant->setTemplatePath(array(__DIR__ . '/templates'));
+$savant->setEscape('htmlspecialchars');
 echo $savant->render($frontend);
 ?>
\ No newline at end of file

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php	2009-10-29 \
                18:10:43 UTC (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php	2009-10-29 \
18:11:01 UTC (rev 290057) @@ -4,19 +4,22 @@
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <link rel="search" title="search packages" \
                type="application/opensearchdescription+xml" \
                href="?view=searchdefinition">
     <link rel="alternate" title="My Channel Latest Releases" \
                type="application/atom+xml" href="?view=latest" />
-    <link rel="stylesheet" href="css/reset.css" />
-    <link rel="stylesheet" href="css/960.css" />
-    <link rel="stylesheet" href="css/text.css" />
-    <title>page title | <?php echo $context::$channel->name; ?></title>
+    <link rel="stylesheet" href="css/all.css" />
+    <title>page title | <?php echo pear2\SimpleChannelFrontend\Main::$channel->name; \
?></title>  </head>
   <body>
     <div class="container_12">
-        <h1><?php echo $context::$channel->summary; ?></h1>
-        <ul class="navigation">
-            <li><a href="?view=news">Home</a></li>
-            <li><a href="?view=packages">Packages</a></li>
-        </ul>
-        <?php echo $savant->render($context->page_content); ?>
+        <div class="header">
+            <h1><?php echo pear2\SimpleChannelFrontend\Main::$channel->summary; \
?></h1> +            <ul class="navigation">
+                <li><a href="<?php echo \
pear2\SimpleChannelFrontend\Main::getURL('pear2\SimpleChannelFrontend\News'); \
?>">Home</a></li> +                <li><a href="<?php echo \
pear2\SimpleChannelFrontend\Main::getURL('pear2\SimpleChannelFrontend\PackageList'); \
?>">Packages</a></li> +            </ul>
+        </div>
+        <div class="content">
+            <?php echo $savant->render($context->page_content); ?>
+        </div>
+        <div class="footer">This is a PEAR channel running \
PEAR2_SimpleChannelFrontend</div>  </div>
   </body>
 </html>

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php	2009-10-29 \
                18:10:43 UTC (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php	2009-10-29 \
18:11:01 UTC (rev 290057) @@ -9,7 +9,7 @@
     <p>Users can get started by reading
     <a href="http://pear.php.net/manual/en/installationpyrus.introduction.php">the \
introduction</a>.</p>  </div>
-    <div class="grid_2 right">
+    <div class="grid_4 right">
         <h3>Download Pyrus</h3>
         <a href="http://svn.php.net/viewvc/pear2/Pyrus/trunk/pyrus.phar?view=co">Download \
pyrus.phar</a>  </div>

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php	2009-10-29 \
                18:10:43 UTC (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php	2009-10-29 \
18:11:01 UTC (rev 290057) @@ -1,19 +1,24 @@
-<h1>Package :: <?php echo $context->package->name; ?></h1>
-<div class="three_col left">
-<?php
-echo nl2br(htmlentities($context->package->description));
-?>
-</div>
-<div class="two_col featurebox right">
-<h2>Installation</h2>
-<code>$>php pyrus.phar install <?php echo $context->package->channel . '/' . \
                $context->package->name; ?></code>
-</div>
-<div class="col right">
-    <h3>Releases</h3>
-    <ul>
-        <?php
-         foreach ($context->package as $version => $release): ?>
-        <li><?php echo $version; ?></li>
-        <?php endforeach; ?>
-    </ul>
+<div class="package">
+    <div class="grid_8 left">
+        <h2>Package :: <?php echo $context->package->name; ?></h2>
+        <p>
+            <?php
+            echo nl2br(trim($context->package->description));
+            ?>
+        </p>
+        <h3>Installation</h3>
+        <ol class="instructions">
+            <li><code>$>php pyrus.phar channel-discover <?php echo \
$context->package->channel; ?></code></li> +            <li><code>$>php pyrus.phar \
install <?php echo $context->package->channel . '/' . $context->package->name; \
?></code></li> +        </ol>
+    </div>
+    <div class="grid_4 right">
+        <h3>Releases</h3>
+        <ul>
+            <?php
+             foreach ($context->package as $version => $release): ?>
+            <li><?php echo $version; ?></li>
+            <?php endforeach; ?>
+        </ul>
+    </div>
 </div>
\ No newline at end of file

Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php	2009-10-29 \
                18:10:43 UTC (rev 290056)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php	2009-10-29 \
18:11:01 UTC (rev 290057) @@ -1,9 +1,11 @@
-<h1>Available Packages</h1>
-<ul>
-<?php
-foreach ($context->packages as $package) {
-    echo '<li><a href="./?view=package&amp;package='.$package.'">'.$package.'</a></li>';
                
-}
-
-?>
-</ul>
\ No newline at end of file
+<div class="packagelist grid_8">
+    <h1>Available Packages</h1>
+    <ul>
+    <?php
+    foreach ($context->packages as $package) {
+        echo '<li><a \
href="./?view=package&amp;package='.$package.'">'.$package.'</a></li>'; +    }
+
+    ?>
+    </ul>
+</div>
\ No newline at end of file



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic