Esempio n. 1
0
File: edit.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

<fieldset>
	<?php 
        echo Form::input_wrap('name', $this->blog_entry->name, array('class' => 'input-lg', 'placeholder' => __('Title')), null, Arr::get($this->errors, 'name'));
        ?>

	<?php 
        echo Form::textarea_wrap('content', $this->blog_entry->content, array('class' => 'input-lg', 'placeholder' => __('Content')), true, null, Arr::get($this->errors, 'content'), null, true);
        ?>
</fieldset>

<fieldset>
	<?php 
        echo Form::csrf();
        ?>
	<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg'));
        ?>
	<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Esempio n. 2
0
File: report.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $gallery = $this->image->gallery();
        echo Form::open(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => 'report')), array('class' => Request::current()->is_ajax() ? 'ajaxify' : ''));
        ?>

<fieldset>

	<?php 
        echo Form::control_group(Form::input('reason', null, array('class' => 'input-block-level')), array('name' => __('Reason')), null, __('You can enter an optional reason for reporting this image, e.g. why it should be removed'));
        ?>

</fieldset>

<fieldset class="form-actions">
	<?php 
        echo Form::button('save', __('Report'), array('type' => 'submit', 'class' => 'btn btn-danger btn-large'));
        ?>
	<?php 
        echo Request::current()->is_ajax() ? '' : HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => '')), __('Cancel'), array('class' => 'cancel'));
        ?>

	<?php 
        echo Form::csrf();
        ?>
</fieldset>

<?php 
        return ob_get_clean();
    }
Esempio n. 3
0
File: shouts.php Progetto: anqh/anqh
 /**
  * Create new shouts view.
  */
 public function __construct()
 {
     parent::__construct();
     $this->id = 'shouts';
     $this->title = HTML::anchor(Route::url('shouts'), __('Shouts'));
     $this->_can_shout = Permission::has(new Model_Shout(), Model_Shout::PERMISSION_CREATE);
 }
Esempio n. 4
0
File: list.php Progetto: anqh/blog
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->blog_entries) {
            return '';
        }
        ob_start();
        ?>

<ul class="unstyled">

	<?php 
        foreach ($this->blog_entries as $entry) {
            ?>
	<li><?php 
            echo HTML::anchor(Route::model($entry), HTML::chars($entry->name));
            ?>
</li>
	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 5
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<h2 id="introduction">Introduction</h2>

<p>
	Welcome to the ridiculously short developer documentation for klubitus!
</p>

<h2 id="anqh">Anqh</h2>

<p>
	Klubitus is an <em>almost</em> vanilla version of <?php 
        echo HTML::anchor('http://github.com/anqh/anqh', 'Anqh ' . Anqh::VERSION, array('class' => 'label label-info'));
        ?>
,
	an open source <?php 
        echo HTML::anchor('http://php.net', 'PHP 5.3', array('class' => 'label label-info'));
        ?>
 project built on top of <?php 
        echo HTML::anchor('http://kohanaframework.org', 'Kohana ' . Kohana::VERSION, array('class' => 'label label-info'));
        ?>
.
</p>

<?php 
        return ob_get_clean();
    }
Esempio n. 6
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $tags = $this->group->tags();
        if (empty($tags)) {
            ?>

<div class="empty">
	<?php 
            echo __('No tags yet.');
            ?>
</div>

<?php 
        } else {
            ?>

<ul>
	<?php 
            foreach ($tags as $tag) {
                ?>
	<li><?php 
                echo HTML::anchor(Route::model($tag), $tag->name);
                ?>
</li>
	<?php 
            }
            ?>
</ul>

<?php 
        }
        echo Form::open();
        ?>

<fieldset>

	<?php 
        echo Form::control_group(Form::input('name', $this->group->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
        ?>

	<?php 
        echo Form::control_group(Form::input('description', $this->group->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
        ?>

</fieldset>

<fieldset class="form-actions">
	<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
	<?php 
        echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Esempio n. 7
0
File: list.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->topics) {
            return '';
        }
        ob_start();
        ?>

<ul class="list-unstyled">

		<?php 
        foreach ($this->topics as $topic) {
            ?>
		<li>
			<?php 
            echo HTML::anchor(Route::model($topic, '?page=last#last'), Forum::topic($topic), array('title' => HTML::chars($topic->name)));
            ?>
		</li>
		<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 8
0
 /**
  * 
  * @return string
  */
 public function user()
 {
     if (empty($this->user_id)) {
         return NULL;
     }
     return HTML::anchor(Route::get('backend')->uri(array('controller' => 'users', 'action' => 'profile', 'id' => $this->user->id)), $this->user->username);
 }
Esempio n. 9
0
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Stamp
     echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
     // Location
     if ($this->event->venue) {
         echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
     } elseif ($this->event->venue_name) {
         echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
     } elseif ($this->event->city_name) {
         echo ' @ ', HTML::chars($this->event->city_name);
     }
     // Flyer
     if ($flyer = $this->event->flyer()) {
         echo '<figure>', HTML::image($flyer->image_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif ($this->event->flyer_front_url) {
         echo '<figure>', HTML::image($this->event->flyer_front_url, ['class' => 'img-responsive']), '</figure>';
     }
     // Favorites
     if ($this->event->favorite_count) {
         echo '<span class="stats"><i class="fa fa-heart"></i> ' . $this->event->favorite_count . '</span>';
     }
     return ob_get_clean();
 }
Esempio n. 10
0
File: list.php Progetto: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->topics) {
            return '';
        }
        ob_start();
        ?>

<ul class="unstyled">

		<?php 
        foreach ($this->topics as $topic) {
            ?>
		<li>
			<small class="ago"><?php 
            echo HTML::time(Date::short_span($topic->last_posted, true), $topic->last_posted);
            ?>
</small>
			<?php 
            echo HTML::anchor(Route::model($topic), '<i class="muted iconic-upload"></i>', array('title' => __('First post')));
            ?>
			<?php 
            echo HTML::anchor(Route::model($topic, '?page=last#last'), HTML::chars($topic->name), array('title' => $topic->name));
            ?>
		</li>
		<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 11
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<ul class="thumbnails">

	<?php 
        foreach ($this->flyers as $flyer) {
            $name = $flyer->event ? $flyer->event->name : $flyer->name;
            ?>

	<li class="span2">
		<?php 
            echo HTML::anchor(Route::get('flyer')->uri(array('id' => $flyer->id)), HTML::image($flyer->image->get_url('thumbnail')), array('class' => 'thumbnail'));
            ?>

		<h4><?php 
            echo HTML::anchor(Route::get('flyer')->uri(array('id' => $flyer->id)), HTML::chars($name), array('title' => HTML::chars($name)));
            ?>
</h4>
	</li>

	<?php 
        }
        ?>

</ul>


<?php 
        return ob_get_clean();
    }
Esempio n. 12
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $uri = Route::model($this->venue, 'combine');
        ?>

<ul class="unstyled">

	<?php 
        foreach ($this->venues as $venue) {
            ?>

	<li><?php 
            echo floor($venue['similarity']);
            ?>
% <?php 
            echo HTML::anchor($uri . '/' . $venue['venue']->id, HTML::chars($venue['venue']->name) . ', ' . HTML::chars($venue['venue']->city_name));
            ?>
</li>

	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 13
0
File: edit.php Progetto: anqh/blog
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

		<fieldset>
			<?php 
        echo Form::control_group(Form::input('name', $this->blog_entry->name, array('class' => 'input-xxlarge')), array('name' => __('Title')), Arr::get($this->errors, 'name'));
        ?>

			<?php 
        echo Form::control_group(Form::textarea_editor('content', $this->blog_entry->content, array('class' => 'input-xxlarge'), true), array('content' => __('Content')), Arr::get($this->errors, 'content'));
        ?>
		</fieldset>

		<fieldset class="form-actions">
			<?php 
        echo Form::csrf();
        ?>
			<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
			<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>
		</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Esempio n. 14
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (!count($this->notifications)) {
            echo new View_Alert(__('No new notifications.'), null, View_Alert::INFO);
        } else {
            ?>

<ul class="list-unstyled">

	<?php 
            foreach ($this->notifications as $id => $notification) {
                ?>
	<li><?php 
                echo HTML::anchor(Route::url('notifications') . '?dismiss=' . $id, '&times;', array('class' => 'close notification'));
                echo $notification;
                ?>
</li>
	<?php 
            }
            ?>

</ul>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 15
0
 function action_add()
 {
     if ($this->user->services->count_all() == 0) {
         $this->template->content = 'Увы, у вас нет ни одной компании чтобы добавить акцию. ' . HTML::anchor('cabinet/company/add', 'Добавить компанию');
     }
     $services = array();
     foreach ($this->user->services->find_all() as $service) {
         $services[$service->id] = $service->name;
     }
     if ($_POST) {
         $stock = ORM::factory('stock');
         try {
             $stock->values($_POST, array('text', 'service_id'));
             $stock->user_id = $this->user->id;
             $stock->active = 1;
             $stock->date = Date::formatted_time();
             $stock->save();
             // Обновляем дату редактирования у компании
             DB::update('services')->set(array('date_edited' => Date::formatted_time()))->where('id', '=', $stock->service_id)->execute();
             Message::set(Message::SUCCESS, 'Акция добавлена');
             $this->request->redirect('cabinet/stock');
         } catch (ORM_Validation_Exception $e) {
             $this->errors = $e->errors('models');
             $this->values = $_POST;
         }
     }
     $this->view = View::factory('frontend/cabinet/stock/form')->set('url', 'cabinet/stock/add')->set('values', $this->values)->set('errors', $this->errors)->set('services', $services);
     $this->template->title = $this->site_name . 'Добавление акции';
     $this->template->bc['#'] = 'Добавление акции';
     $this->template->content = $this->view;
 }
Esempio n. 16
0
File: list.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<ul class="list-unstyled">

	<?php 
        foreach ($this->venues as $venue) {
            ?>

	<li><?php 
            echo HTML::anchor(Route::model($venue), HTML::chars($venue->name));
            ?>
</li>

	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 17
0
File: upload.php Progetto: anqh/core
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (self::$_request_type == Controller::REQUEST_AJAX) {
            $cancel_attributes = array('class' => 'ajaxify');
        } else {
            $cancel_attributes = null;
        }
        echo Form::open($this->action, array('enctype' => 'multipart/form-data'));
        ?>

		<fieldset>
			<?php 
        echo Form::file('file');
        ?>
		</fieldset>

		<fieldset>
			<?php 
        echo Form::csrf();
        ?>
			<?php 
        echo Form::button('save', '<i class="icon-upload icon-white"></i> ' . __('Upload'), array('type' => 'submit', 'class' => 'btn btn-primary btn-small'));
        ?>
			<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), $cancel_attributes) : '';
        ?>
		</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Esempio n. 18
0
 /**
  * Render content.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Stamp
     echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
     // Location
     if ($this->event->venue) {
         echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
     } elseif ($this->event->venue_name) {
         echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
     } elseif ($this->event->city_name) {
         echo ' @ ', HTML::chars($this->event->city_name);
     }
     // Flyer
     if ($this->event->flyer_front) {
         echo '<figure>', HTML::image($this->event->flyer_front->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif ($this->event->flyer_back) {
         echo '<figure>', HTML::image($this->event->flyer_back->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
     } elseif (Valid::url($this->event->flyer_front_url)) {
         echo '<br /><figure>', HTML::image($this->event->flyer_front_url, array('width' => 160)), '</figure>';
     }
     // Favorites
     if ($this->event->favorite_count) {
         echo '<span class="stats"><i class="icon-heart"></i> ' . $this->event->favorite_count . '</span>';
     }
     return ob_get_clean();
 }
Esempio n. 19
0
File: UI.php Progetto: kodicms/core
 /**
  * 
  * @param string $body
  * @param array $attributes
  * @return string HTML
  */
 public static function button($body, array $attributes = NULL)
 {
     $attributes = self::_build_attribute_class($attributes, 'btn');
     if (isset($attributes['icon'])) {
         $body = $attributes['icon'] . ' ' . $body;
         unset($attributes['icon']);
     }
     if (isset($attributes['href'])) {
         $attributes['type'] = self::BUTTON_TYPE_ANCHOR;
         $href = $attributes['href'];
         unset($attributes['href']);
     } elseif (isset($attributes['name'])) {
         $attributes['type'] = self::BUTTON_TYPE_BUTTON;
     }
     if (!isset($attributes['type'])) {
         $attributes['type'] = self::BUTTON_TYPE_BUTTON;
     }
     $type = $attributes['type'];
     unset($attributes['type']);
     switch ($type) {
         case self::BUTTON_TYPE_ANCHOR:
             return HTML::anchor($href, $body, $attributes);
             break;
         default:
             return '<button' . HTML::attributes($attributes) . '>' . $body . '</button>';
             break;
     }
 }
Esempio n. 20
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if ($this->image) {
            $image = HTML::image(is_string($this->image) ? $this->image : $this->image->get_url(), array('width' => 290));
            ?>

<div id="slideshow-image">
	<?php 
            echo isset($this->link) && $this->link ? HTML::anchor($this->link, $image) : $image;
            ?>
</div>

<?php 
        } else {
            ?>

<div class="well">
	<?php 
            echo __('No images yet.');
            ?>
</div>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 21
0
File: list.php Progetto: anqh/anqh
    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->events) {
            return '';
        }
        ob_start();
        ?>

<ul class="list-unstyled">

	<?php 
        foreach ($this->events as $event) {
            ?>
	<li>
		<span title="<?php 
            echo Date::format(Date::DATETIME, $event->stamp_begin) . ($event->stamp_end ? ' - ' . Date::format(Date::TIME, $event->stamp_end) : '');
            ?>
"><?php 
            echo Date::format(Date::DM_PADDED, $event->stamp_begin);
            ?>
</span>
		<?php 
            echo HTML::anchor(Route::model($event), HTML::chars($event->name), array('class' => 'hoverable', 'title' => HTML::chars($event->name)));
            ?>
	</li>
	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 22
0
 /**
  * Get newsfeed item as HTML
  *
  * @static
  * @param   Model_NewsfeedItem  $item
  * @return  string
  */
 public static function get(Model_NewsFeedItem $item)
 {
     $text = '';
     switch ($item->type) {
         case self::TYPE_EVENT:
             $event = Model_Event::factory($item->data['event_id']);
             if ($event->loaded()) {
                 $text = __('added new event<br />:event', array(':event' => HTML::anchor(Route::model($event), '<i class="icon-calendar icon-white"></i> ' . HTML::chars($event->name), array('class' => 'hoverable'))));
             }
             break;
         case self::TYPE_EVENT_EDIT:
             $event = Model_Event::factory($item->data['event_id']);
             if ($event->loaded()) {
                 $text = __('updated event<br />:event', array(':event' => HTML::anchor(Route::model($event), '<i class="icon-calendar icon-white"></i> ' . HTML::chars($event->name), array('class' => 'hoverable'))));
             }
             break;
         case self::TYPE_FAVORITE:
             $event = Model_Event::factory($item->data['event_id']);
             if ($event->loaded()) {
                 $text = __('added event to favorites<br />:event', array(':event' => HTML::anchor(Route::model($event), '<i class="icon-heart icon-white"></i> ' . HTML::chars($event->name), array('class' => 'hoverable'))));
             }
             break;
     }
     return $text;
 }
Esempio n. 23
0
File: list.php Progetto: anqh/anqh
 /**
  * Render view.
  *
  * @return  string
  */
 public function content()
 {
     // Build short (friends) and long (others) user list
     $short = $long = array();
     $total = count($this->users);
     foreach ($this->users as $user) {
         $user = is_array($user) ? $user : Model_User::find_user_light($user);
         if ($total < 11 || Visitor::$user && Visitor::$user->is_friend($user)) {
             $short[mb_strtoupper($user['username'])] = HTML::user($user);
         } else {
             $long[mb_strtoupper($user['username'])] = HTML::user($user);
         }
     }
     ksort($long);
     // If no friends, pick random from long
     if (empty($short) && !empty($long)) {
         $shorts = (array) array_rand($long, min(10, count($long)));
         foreach ($shorts as $move) {
             $short[$move] = $long[$move];
             unset($long[$move]);
         }
     }
     ksort($short);
     ob_start();
     if (count($short)) {
         echo implode(', ', $short);
     }
     if (count($long)) {
         echo ' ', __('and'), ' ', HTML::anchor('#long', __(count($long) == 1 ? ':count other &#9662;' : ':count others &#9662;', array(':count' => count($long))), array('title' => __('Show all'), 'data-toggle' => 'collapse', 'data-target' => '#long', 'onclick' => 'return false;'));
         echo '<div id="long" class="collapse">', implode(', ', $long), '</div>';
     }
     return ob_get_clean();
 }
Esempio n. 24
0
File: tag.php Progetto: anqh/core
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

<fieldset>

	<?php 
        echo Form::control_group(Form::input('name', $this->tag->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
        ?>

	<?php 
        echo Form::control_group(Form::input('description', $this->tag->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
        ?>

</fieldset>

<fieldset class="form-actions">
	<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
	<?php 
        echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Esempio n. 25
0
File: list.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->blog_entries) {
            return '';
        }
        ob_start();
        ?>

<ul class="list-unstyled">

	<?php 
        foreach ($this->blog_entries as $entry) {
            ?>
	<li><?php 
            echo __(':blog by :author', array(':blog' => HTML::anchor(Route::model($entry), HTML::chars($entry->name)), ':author' => HTML::user($entry->author())));
            ?>
</li>
	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 26
0
 /**
  * Render view.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     $foursquare = $this->venue->foursquare();
     if (!$foursquare) {
         echo new View_Alert(__('This venue has not been linked to Foursquare yet.'), null, View_Alert::INFO);
     } else {
         // Homepage
         echo HTML::anchor(Arr::path($foursquare, 'short_url'), HTML::image(Arr::path($foursquare, 'primarycategory.iconurl'), array('alt' => HTML::chars(Arr::path($foursquare, 'primarycategory.nodename')), 'title' => HTML::chars(Arr::path($foursquare, 'primarycategory.nodename')))) . ' ' . HTML::chars(Arr::path($foursquare, 'primarycategory.nodename'))), '<br />';
         // Mayor
         if ($mayor = Arr::path($foursquare, 'stats.mayor.user')) {
             echo __('Mayor: :mayor, :city', array(':mayor' => HTML::anchor('http://foursquare.com/user/' . Arr::get($mayor, 'id'), HTML::chars(Arr::get($mayor, 'firstname')) . ' ' . HTML::chars(Arr::get($mayor, 'lastname'))), ':city' => HTML::chars($mayor['homecity']))), '<br />';
         }
         // Checkins
         echo __('Check-ins: :checkins', array(':checkins' => '<var>' . Arr::path($foursquare, 'stats.checkins') . '</var>')), '<br />';
         // Here now
         echo __('Here now: :herenow', array(':herenow' => '<var>' . Arr::path($foursquare, 'stats.herenow') . '</var>')), '<br />';
         // Tips
         if ($tips = Arr::path($foursquare, 'tips')) {
             echo '<h5>', __('Tips (:tips)', array(':tips' => '<var>' . count($tips) . '</var>')), '</h5><dl>';
             foreach (array_slice($tips, 0, 5) as $tip) {
                 echo '<dt>', HTML::anchor('http://foursquare.com/user/' . Arr::path($tip, 'user.id'), HTML::chars(Arr::path($tip, 'user.firstname')) . ' ' . HTML::chars(Arr::path($tip, 'user.lastname'))), ', ', HTML::chars(Arr::path($tip, 'user.homecity')), ':</dt>';
                 echo '<dd>', Text::auto_p(HTML::chars(Arr::path($tip, 'text'))), '</dd>';
             }
             echo '</dl>';
         }
     }
     // Admin controls
     if (Permission::has($this->venue, Model_Venue::PERMISSION_UPDATE)) {
         echo HTML::anchor('#map', __('Link to Foursquare'), array('class' => 'action', 'id' => 'link-foursquare'));
         echo $this->form();
     }
     return ob_get_clean();
 }
Esempio n. 27
0
File: index.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        foreach ($this->_group_by_city() as $city => $venues) {
            ?>

<header>
	<h4><?php 
            echo HTML::chars($city);
            ?>
</h4>
</header>

<ul class="list-unstyled row">
<?php 
            foreach ($venues as $venue) {
                ?>

	<li class="col-xs-6 col-sm-4 col-md-3"><?php 
                echo HTML::anchor(Route::model($venue), HTML::chars($venue->name));
                ?>
</li>

<?php 
            }
            ?>
</ul>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 28
0
 /**
  * Get newsfeed item as HTML
  *
  * @param   Model_NewsfeedItem  $item
  * @return  string
  */
 public static function get(Model_NewsfeedItem $item)
 {
     $text = '';
     switch ($item->type) {
         case self::TYPE_COMMENT:
             $gallery = Model_Gallery::factory($item->data['gallery_id']);
             $image = Model_Image::factory($item->data['image_id']);
             if ($gallery->loaded() && $image->loaded()) {
                 $text = __('commented to an image<br />:gallery', array(':gallery' => HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $image->id, 'action' => '')), '<i class="icon-camera icon-white"></i> ' . HTML::chars($gallery->name), array('class' => 'hoverable'))));
             }
             break;
         case self::TYPE_COMMENT_FLYER:
             $flyer = Model_Flyer::factory($item->data['flyer_id']);
             if ($flyer->loaded()) {
                 $text = __('commented to a flyer<br />:flyer', array(':flyer' => HTML::anchor(Route::url('flyer', array('id' => $flyer->id)), '<i class="icon-picture icon-white"></i> ' . ($flyer->name ? HTML::chars($flyer->name) : __('flyer')), array('class' => 'hoverable'))));
             }
             break;
         case self::TYPE_FLYER_EDIT:
             $flyer = Model_Flyer::factory($item->data['flyer_id']);
             if ($flyer->loaded()) {
                 $text = __('updated flyer<br />:flyer', array(':flyer' => HTML::anchor(Route::url('flyer', array('id' => $flyer->id)), '<i class="icon-picture icon-white"></i> ' . ($flyer->name ? HTML::chars($flyer->name) : __('flyer')), array('class' => 'hoverable'))));
             }
             break;
         case self::TYPE_NOTE:
             $gallery = Model_Gallery::factory($item->data['gallery_id']);
             $image = Model_Image::factory($item->data['image_id']);
             $user = Model_User::find_user($item->data['user_id']);
             if ($gallery->loaded() && $image->loaded() && $user->loaded()) {
                 $text = __('tagged :user to an image<br />:gallery', array(':user' => HTML::user($user), ':gallery' => HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $image->id, 'action' => '')), '<i class="icon-tag icon-white"></i> ' . HTML::chars($gallery->name), array('class' => 'hoverable'))));
             }
             break;
     }
     return $text;
 }
Esempio n. 29
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        foreach ($this->_group_by_city() as $city => $venues) {
            ?>

<article>
	<header>
		<h4><?php 
            echo HTML::chars($city);
            ?>
</h4>
	</header>

	<ul class="unstyled block-grid two-up">
	<?php 
            foreach ($venues as $venue) {
                ?>

		<li><?php 
                echo HTML::anchor(Route::model($venue), HTML::chars($venue->name));
                ?>
</li>

	<?php 
            }
            ?>
	</ul>

</article>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 30
0
 function anchor($text, $properties = array())
 {
     $a = HTML::anchor($this, $text, array('href' => $this));
     foreach ($properties as $property => $value) {
         $a->set($property, $value);
     }
     return $a;
 }