Changeset f52b4cb781b8864c533d1fa62c4907901e8ef6c2

Show
Ignore:
Timestamp:
01/28/12 19:33:05 (4 months ago)
Author:
Xemle <xemle@phtagr.org>
Children:
bfbeeb6c83b0ce896e9c2d979ae81ba618c57db4
Parents:
007340ebc33e1e059fe19baf82a214ad69905504
git-committer:
Xemle <xemle@phtagr.org> / 2012-01-28T19:33:05Z+0100
Message:

Make mobile version runnable

Files:
8 modified

Legend:

Unmodified
Added
Removed
  • Controller/AppController.php

    ree4c2b7f rf52b4cb  
    113113 
    114114    if ($this->RequestHandler->isMobile()) { 
    115       $this->view = "Theme"; 
    116       $this->theme = "mobile"; 
     115      $this->viewClass = "Theme"; 
     116      $this->theme = "Mobile"; 
    117117    } 
    118118  } 
  • View/Elements/menu.ctp

    r0fb8d7c rf52b4cb  
    2828    } 
    2929    if ($role >= ROLE_USER) { 
    30       if (!$option->get('user.browser.full', 0)) { 
     30      if (!$this->Option->get('user.browser.full', 0)) { 
    3131        $items[] = array( 
    3232          'text' => __('Upload'),  
     
    4747  } 
    4848 
    49   echo $menu->getMainMenu(array('id' => false, 'title' => false, 'items' => $items)); 
     49  echo $this->Menu->getMainMenu(array('id' => false, 'title' => false, 'items' => $items)); 
    5050?> 
  • View/Themed/Mobile/Elements/footer.ctp

    r007340e rf52b4cb  
    1 <p><?php printf(__("%s Social Web Gallery %s - mobile version", true), '&copy; 2010', $html->link('phTagr', 'http://www.phtagr.org')); ?></p> 
     1<p><?php echo __("%s Web Gallery %s - mobile version", '&copy; 2012', $this->Html->link('phTagr', 'http://www.phtagr.org')); ?></p> 
  • View/Themed/Mobile/Elements/header.ctp

    r007340e rf52b4cb  
    1 <h1><?php echo h($option->get('general.title', 'phTagr.')); ?><span class="subheader"><?php __('mobile'); ?></span></h1> 
     1<h1><?php echo h($this->Option->get('general.title', 'phTagr.')); ?><span class="subheader"><?php echo __('mobile'); ?></span></h1> 
    22<div class="login"> 
    33<?php  
    4   if ($session->check('User.id')) { 
    5     echo $html->link(__("Logout", true), '/users/logout');  
     4  if ($this->Session->check('User.id')) { 
     5    echo $this->Html->link(__("Logout"), '/users/logout');  
    66  } else { 
    7     echo $html->link(__("Login", true), '/users/login');  
     7    echo $this->Html->link(__("Login"), '/users/login');  
    88  } 
    99?> 
  • View/Themed/Mobile/Explorer/index.ctp

    r007340e rf52b4cb  
    1 <h1><?php __('Explorer'); ?></h1> 
    2 <?php echo $session->flash(); ?> 
     1<h1><?php echo __('Explorer'); ?></h1> 
     2<?php echo $this->Session->flash(); ?> 
    33 
    4 <?php $search->initialize(); ?> 
    5 <?php if ($navigator->hasPages()): ?> 
     4<?php $this->Search->initialize(); ?> 
     5<?php if ($this->Navigator->hasPages()): ?> 
    66<div class="paginator"><div class="subpaginator"> 
    7 <?php echo $navigator->prev().' '.$navigator->numbers().' '.$navigator->next(); ?> 
     7<?php echo $this->Navigator->prev().' '.$this->Navigator->numbers().' '.$this->Navigator->next(); ?> 
    88</div></div> 
    99<?php endif; ?> 
    1010 
    1111<?php  
    12   $pos = ($search->getPage(1)-1) * $search->getShow(12) + 1;  
     12  $pos = ($this->Search->getPage(1)-1) * $this->Search->getShow(12) + 1;  
    1313?> 
    1414<?php foreach($this->data as $media): ?> 
    1515<h3><?php echo $media['Media']['name']; ?></h3> 
    1616<?php 
    17   $date = $html->link( 
    18     $time->relativeTime($media['Media']['date']), 
     17  $date = $this->Html->link( 
     18    $this->Time->relativeTime($media['Media']['date']), 
    1919    '/explorer/date/' . date("Y/m/d", strtotime($media['Media']['date'])) 
    2020    ); 
    21   echo '<p>by ' . $html->link($media['User']['username'], "/explorer/user/".$media['User']['username']) . ' ' . $date . '</p>'; 
    22   $params = $search->serialize(false, array('pos' => $pos++), false, array('defaults' => array('pos' => 1))); 
    23   echo $imageData->mediaLink($media, array('type' => 'thumb', 'div' => 'thumb', 'params' => ($params ? '/' . $params : false))); 
     21  echo '<p>by ' . $this->Html->link($media['User']['username'], "/explorer/user/".$media['User']['username']) . ' ' . $date . '</p>'; 
     22  $params = $this->Search->serialize(false, array('pos' => $pos++), false, array('defaults' => array('pos' => 1))); 
     23  echo $this->ImageData->mediaLink($media, array('type' => 'thumb', 'div' => 'thumb', 'params' => ($params ? '/' . $params : false))); 
    2424  echo "<div class='meta-info'>"; 
    2525  $names = Set::extract('/Tag/name', $media); 
    2626  $links = array(); 
    2727  foreach($names as $name) { 
    28     $links[] = $html->link($name, "tag/$name"); 
     28    $links[] = $this->Html->link($name, "tag/$name"); 
    2929  } 
    3030  if (count($names)) { 
    31     echo '<p>' . __("Tags", true) . ': ' . implode(', ', $links) . '</p>'; 
     31    echo '<p>' . __("Tags") . ': ' . implode(', ', $links) . '</p>'; 
    3232  } 
    3333 
     
    3535  $links = array(); 
    3636  foreach($names as $name) { 
    37     $links[] = $html->link($name, "category/$name"); 
     37    $links[] = $this->Html->link($name, "category/$name"); 
    3838  } 
    3939  if (count($names)) { 
    40     echo '<p>' . __("Categories", true) . ': ' . implode(', ', $links) . '</p>'; 
     40    echo '<p>' . __("Categories") . ': ' . implode(', ', $links) . '</p>'; 
    4141  } 
    4242 
     
    4444  $links = array(); 
    4545  foreach($names as $name) { 
    46     $links[] = $html->link($name, "location/$name"); 
     46    $links[] = $this->Html->link($name, "location/$name"); 
    4747  } 
    4848  if (count($names)) { 
    49     echo '<p>' . __("Location", true) . ': ' . implode(', ', $links) . '</p>'; 
     49    echo '<p>' . __("Location") . ': ' . implode(', ', $links) . '</p>'; 
    5050  } 
    5151  echo "</div>"; 
     
    5353<?php endforeach; ?> 
    5454 
    55 <?php if ($navigator->hasPages()): ?> 
     55<?php if ($this->Navigator->hasPages()): ?> 
    5656<div class="paginator"><div class="subpaginator"> 
    57 <?php echo $navigator->prev().' '.$navigator->numbers().' '.$navigator->next(); ?> 
     57<?php echo $this->Navigator->prev().' '.$this->Navigator->numbers().' '.$this->Navigator->next(); ?> 
    5858</div></div> 
    5959<?php endif; ?> 
  • View/Themed/Mobile/Home/index.ctp

    r007340e rf52b4cb  
    1 <h1><?php echo h($option->get('home.welcomeText', __("Welcome to phTagr", true))); ?></h1> 
     1<h1><?php echo h($option->get('home.welcomeText', __("Welcome to phTagr"))); ?></h1> 
    22 
    3 <h3><?php __("Random Media"); ?></h3> 
     3<h3><?php echo __("Random Media"); ?></h3> 
    44<?php  
    55  if (count($randomMedia)) { 
    66    $media = $randomMedia[0]; 
    7     $params = '/'.$search->serialize(array('sort' => 'random')); 
     7    $params = '/'.$this->Search->serialize(array('sort' => 'random')); 
    88 
    9     $size = $imageData->getimagesize($media, OUTPUT_SIZE_PREVIEW); 
    10     echo $html->tag('a',  
    11       $html->tag('img', '', array( 
     9    $size = $this->ImageData->getimagesize($media, OUTPUT_SIZE_PREVIEW); 
     10    echo $this->Html->tag('a',  
     11      $this->Html->tag('img', '', array( 
    1212        'src' => Router::url("/media/preview/" . $media['Media']['id']), 
    1313        'alt' => $media['Media']['name'], 
     
    1818      )); 
    1919         
    20     $link = $search->getUri(array('sort' => 'random')); 
    21     echo "<p>" . sprintf(__("See more %s", true), $html->link(__('random media...', true), $link))."</p>"; 
     20    $link = $this->Search->getUri(array('sort' => 'random')); 
     21    echo "<p>" . sprintf(__("See more %s"), $this->Html->link(__('random media...'), $link))."</p>"; 
    2222  }  
    2323?> 
    2424 
    25 <h3><?php __("Newest Media"); ?></h3> 
     25<h3><?php echo __("Newest Media"); ?></h3> 
    2626<?php 
    2727  $cells = array(); 
     
    3131    $pos = $keys[$i] + 1; 
    3232    $media = $newMedia[$keys[$i]]; 
    33     $page = ceil($pos / $search->getShow(12)); 
    34     $params = '/'.$search->serialize(array('sort' => 'newest', 'page' => $page, 'pos' => $pos), false, false, array('defaults' => array('pos' => 1))); 
    35     $cells[] = $html->tag('a',  
    36       $html->tag('img', '', array( 
     33    $page = ceil($pos / $this->Search->getShow(12)); 
     34    $params = '/'.$this->Search->serialize(array('sort' => 'newest', 'page' => $page, 'pos' => $pos), false, false, array('defaults' => array('pos' => 1))); 
     35    $cells[] = $this->Html->tag('a',  
     36      $this->Html->tag('img', '', array( 
    3737        'src' => Router::url("/media/mini/" . $media['Media']['id']) . $params, 
    3838        'alt' => $media['Media']['name'], 
     
    4949<p><?php echo implode(' ', $cells); ?></p> 
    5050<?php 
    51   $link = $search->getUri(array('sort' => 'newest')); 
    52   echo "<p>" . sprintf(__("See %s", true), $html->link(__('all new media...', true), $link))."</p>"; 
     51  $link = $this->Search->getUri(array('sort' => 'newest')); 
     52  echo "<p>" . sprintf(__("See %s"), $this->Html->link(__('all new media...'), $link))."</p>"; 
    5353?> 
    5454<?php endif; ?> 
  • View/Themed/Mobile/Images/view.ctp

    r007340e rf52b4cb  
    11<h1><?php echo $this->data['Media']['name'] ?></h1> 
    2 <?php echo $session->flash(); ?> 
     2<?php echo $this->Session->flash(); ?> 
    33 
    44<div class="paginator"><div class="subpaginator"> 
    55<?php 
    6 echo $navigator->prevMedia().' '.$navigator->up().' '.$navigator->nextMedia(); 
     6echo $this->Navigator->prevMedia().' '.$this->Navigator->up().' '.$this->Navigator->nextMedia(); 
    77?> 
    88</div></div> 
     
    1212    echo $flowplayer->video($this->data); 
    1313  } else { 
    14     $size = $imageData->getimagesize($this->data, OUTPUT_SIZE_PREVIEW); 
    15     echo $html->tag('img', '', array( 
     14    $size = $this->ImageData->getimagesize($this->data, OUTPUT_SIZE_PREVIEW); 
     15    echo $this->Html->tag('img', '', array( 
    1616      'src' => Router::url("/media/preview/" . $this->data['Media']['id']), 
    1717      'alt' => $this->data['Media']['name'], 
     
    2424  $links = array(); 
    2525  foreach($names as $name) { 
    26     $links[] = $html->link($name, "/explorer/tag/$name"); 
     26    $links[] = $this->Html->link($name, "/explorer/tag/$name"); 
    2727  } 
    2828  if (count($names)) { 
    29     echo '<p>' . __("Tags", true) . ': ' . implode(', ', $links) . '</p>'; 
     29    echo '<p>' . __("Tags") . ': ' . implode(', ', $links) . '</p>'; 
    3030  } 
    3131 
     
    3333  $links = array(); 
    3434  foreach($names as $name) { 
    35     $links[] = $html->link($name, "/explorer/category/$name"); 
     35    $links[] = $this->Html->link($name, "/explorer/category/$name"); 
    3636  } 
    3737  if (count($names)) { 
    38     echo '<p>' . __("Categories", true) . ': ' . implode(', ', $links) . '</p>'; 
     38    echo '<p>' . __("Categories") . ': ' . implode(', ', $links) . '</p>'; 
    3939  } 
    4040 
     
    4242  $links = array(); 
    4343  foreach($names as $name) { 
    44     $links[] = $html->link($name, "/explorer/location/$name"); 
     44    $links[] = $this->Html->link($name, "/explorer/location/$name"); 
    4545  } 
    4646  if (count($names)) { 
    47     echo '<p>' . __("Location", true) . ': ' . implode(', ', $links) . '</p>'; 
     47    echo '<p>' . __("Location") . ': ' . implode(', ', $links) . '</p>'; 
    4848  } 
    4949?> 
  • View/Themed/Mobile/Layouts/default.ctp

    r007340e rf52b4cb  
    1 <?php echo $html->docType('xhtml-strict'); ?> 
     1<?php echo $this->Html->docType('xhtml-strict'); ?> 
    22<html xmlns="http://www.w3.org/1999/xhtml"> 
    33 
     
    66<meta name = "viewport" content = "initial-scale = 1.0"> 
    77<?php  
    8   echo $html->charset('UTF-8'); 
    9   echo $html->meta('icon'); 
    10   echo $html->css('mobile'); 
     8  echo $this->Html->charset('UTF-8'); 
     9  echo $this->Html->meta('icon'); 
     10  echo $this->Html->css('mobile'); 
    1111?> 
    1212</head>