Archived
1
0
Fork 0

Cleaning up the start and about page

This commit is contained in:
Fredric N 2011-02-26 14:12:16 +01:00
parent d09fb0e5f4
commit 07140381fe
4 changed files with 19 additions and 91 deletions

View file

@ -4,35 +4,16 @@ class IndexController extends Fiktiv_Controller_Action
{
public function indexAction()
{
// Here be dragons
//$m = new MyModel();
//echo $m->name;
// Quick access
$me = $this->dataService->User->findRandom();
echo $me;
$r = Fiktiv_Performance::benchmark(array('IndexController','test'));
echo '<pre>';
print_r($r);
echo '</pre>';
Zend_Debug::dump(Zend_Auth::getInstance()->getIdentity(), 'User');
}
public function aboutAction()
{
$lang = Zend_Registry::get('Zend_Translate')->getLocale();
$this->view->content = $this->dataService->About->getContent($lang);
}
public function test()
{
$r = rand(100,999);
for ($i=0;$i<$r;$i++) {
$s = $i+$i;
}
$abouts = new ModelAbout();
$this->view->content = $abouts->fetchAll($abouts->quoteInto('Locale = ?',$lang));
}
}

View file

@ -0,0 +1,8 @@
<?php
class ModelAbout extends Fiktiv_Model_Abstract
{
protected $_schema = 'fiktivkod';
protected $_name = 'About';
protected $_primary = 'id';
}

View file

@ -1,15 +1,6 @@
<a href="#" name="about"></a>
<h2><?=$this->translate('uw:about') ?></h2>
<br />
<p><?=$this->text($this->content['about'])?></p>
<a href="#" name="bts"></a>
<h2><?=$this->translate('uw:behind the site') ?></h2>
<br />
<p><?=$this->text($this->content['behind the site'])?></p>
<a href="#" name="cookies"></a>
<h2><?=$this->translate('uw:cookies') ?></h2>
<br />
<p><?=$this->text($this->content['cookies']) ?></p>
<?php foreach ($this->content as $chapter): ?>
<a href="#" name="<?=$chapter->Title ?>"></a>
<h2><?=$this->translate('uw:'.$chapter->Title) ?></h2>
<br />
<p><?=$chapter->Content ?></p>
<?php endforeach; ?>

View file

@ -1,55 +1,3 @@
<h1><?=ucfirst($this->app['url']) ?></h1>
<p><?=$this->translate('START_TXT') ?></p>
<?php
function get_gravatar( $email, $s = 80, $d = '404', $r = 'g', $img = false, $atts = array() ) {
$url = 'http://www.gravatar.com/avatar/';
$url .= md5( strtolower( trim( $email ) ) );
$url .= "?s=$s&d=$d&r=$r";
if ( $img ) {
$url = '<img src="' . $url . '"';
foreach ( $atts as $key => $val )
$url .= ' ' . $key . '="' . $val . '"';
$url .= ' />';
}
return $url;
}
//echo '<img src="'. get_gravatar('someone@somewhere.com') .'" />'
?>
<p>Translated: <?=$this->translate('uw:example', 'home', 'about', true) ?></p>
<form>
<fieldset>
<label for="t1">Text</label>
<input type="text" id="t1" /><br />
<label for="ta1">Areaaaa</label>
<textarea id="ta1"></textarea><br />
<input type="submit" />
</fieldset>
</form>
<table>
<tr>
<th>abc</th>
<th>bab</th>
</tr>
<tr>
<td>abc</td>
<td>bbb</td>
</tr>
</table>
<?php
$user = new User(array('firstName' => 'Kalle', 'lastName' => 'Andersson'));
$user->save();
?>
<p><?=$this->translate('START_TXT') ?></p>