function coupleWith(FormElement $component, $url, $filter_column = null, $empty_value = '')
 {
     $this->setAttribute('rel', $component->getId());
     $this->setAttribute('data-url', UrlHelper::get($url));
     $this->filter_column = $filter_column;
     $this->related = $component;
     $this->empty_value = $empty_value;
 }
 function link($text, $path, $attributes = array(), $escape = true)
 {
     $attributes = self::formatAttributes($attributes);
     if ($escape) {
         $text = self::escape($text);
     }
     if ($path && $path[0] != '/') {
         $path = $this->module . '/' . $path;
     }
     return "<a href=\"" . UrlHelper::get($path) . "\" {$attributes} >{$text}</a>";
 }
 function rss_feed()
 {
     $this->helper->filter->validate($this->args, array(0 => array('db_in_column' => array('blog', 'blog_id'))));
     if (is_null($this->args[0])) {
         $this->plugin->Error->goto404();
     }
     $blog = $this->db->Blog->getBlogInfo($this->args[0]);
     $feed = $this->view->getFeed();
     $feed->setTitle($blog['name']);
     $feed->setLink(UrlHelper::get('/blog/rss_feed'));
     $feed->setDescription($blog['description']);
     $feeds = $this->db->from('blog_post')->where('blog_id', $this->args[0])->where('status', 'published')->orderby('pub_date', 'desc')->limit(50)->fetchAllRows();
     foreach ($feeds as $post) {
         $item = $feed->createNewItem();
         //Add elements to the feed item
         $item->setTitle($post['title']);
         $item->setLink(UrlHelper::get('/blog/post/' . $post['url_title']));
         $item->setDate($post['pub_date']);
         $item->setDescription($post['content']);
         //Now add the feed item
         $feed->addItem($item);
     }
 }
Exemple #4
0
		<th>&nbsp;</th>
		<th>Username</th>
		<th>Email</th>
	</tr>
	<?php 
$collection = $this->getVar('collection');
foreach ($collection as $item) {
    ?>
	<tr>
		<td>
			<a href="<?php 
    UrlHelper::get(array('action' => 'update', 'id' => $item->id));
    ?>
">Modifica</a>
			<span class="require-delete-confirm" data-href="<?php 
    UrlHelper::get(array('action' => 'delete', 'id' => $item->id));
    ?>
">Cancella</span>
		</td>
		<td><?php 
    echo $item->username;
    ?>
</td>
		<td><?php 
    echo $item->email;
    ?>
</td>
	</tr>
			<?php 
}
?>
 function setUrl($url)
 {
     $this->url = UrlHelper::get($url);
 }
 protected function getHeadHtml()
 {
     $html = new HtmlHelper($this->context);
     $output = '';
     foreach ($this->metas as $meta) {
         if ($meta['name']) {
             $output .= "<meta name=\"{$meta['name']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
         } elseif ($meta['http-equiv']) {
             $output .= "<meta http-equiv=\"{$meta['http-equiv']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
         }
     }
     $output .= "<title>" . HtmlHelper::escape($this->title) . "</title>\r\n";
     $output .= '<base href="' . UrlHelper::get('/') . '"/>' . "\r\n";
     if ($this->favico) {
         $output .= '<link rel="icon" type="' . $this->favico[1] . "\" href=\"" . UrlHelper::resource($this->favico[0]) . "\">\r\n";
     }
     if ($this->description) {
         $output .= '<meta name="description" content="' . HtmlHelper::escape($this->description) . "\" />\r\n";
     }
     if ($this->keywords) {
         $output .= '<meta name="keywords" content="' . HtmlHelper::escape($this->keywords) . "\" />\r\n";
     }
     foreach ($this->feeds as $feed) {
         $output .= '<link rel="alternate" type="application/rss+xml" title="RSS" href="' . UrlHelper::get($feed) . "\" />\r\n";
     }
     foreach ($this->styles as $style) {
         $output .= $html->css($style[0], $style[1]) . "\r\n";
     }
     if ($this->js_library) {
         $output .= "<script type=\"text/javascript\" src=\"{$this->js_library}\"></script>\r\n";
         $output .= $html->javascript('/' . APPU_PHAXSI . '/' . 'phaxsi-' . PhaxsiConfig::FRAMEWORK_VERSION . (AppConfig::DEBUG_MODE ? '' : '.min') . '.js') . "\r\n";
         $output .= HtmlHelper::inlineJavascript("Phaxsi.path = {" . "base: '" . UrlHelper::get('') . "'," . "local: '" . UrlHelper::localized('/') . "'," . "'public': '" . APPU_PUBLIC . "'," . "lang: '" . Lang::getCurrent() . "'}");
     }
     foreach ($this->scripts as $script) {
         $output .= $html->javascript($script) . "\r\n";
     }
     $this->styles = $this->scripts = array();
     return $output;
 }
 final function setAjaxAction($action, $update_element_id, $wait_function = 'null', $success_function = 'null')
 {
     $action = UrlHelper::get($action);
     $this->_javascript .= HtmlHelper::inlineJavascript("Event.on('{$this->_id}', 'submit', Phaxsi.Form.submit.createDelegate(this, ['{$this->_id}','{$action}', '{$update_element_id}', {$wait_function}, {$success_function}], true));");
 }
 function __construct($initial_value = '', $name = null)
 {
     parent::__construct('textarea', $initial_value, $name, true);
     $this->setValidator(array());
     $this->config = array('mode' => 'exact', 'elements' => $this->getId(), 'theme' => 'advanced', 'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,image,markettoimages,media,separator,bullist,formatselect,forecolor,backcolor,emotions,code', 'theme_advanced_buttons2' => '', 'theme_advanced_buttons3' => '', 'relative_urls' => false, 'height' => '250', 'verify_html' => true, 'cleanup' => true, 'document_base_url' => UrlHelper::get('/'), 'plugins' => 'advimage,media,emotions,paste', 'content_css' => UrlHelper::resource('/phaxsi/extensions/tinycss.css'), 'theme_advanced_statusbar_location' => 'bottom', 'theme_advanced_resizing' => true, 'theme_advanced_resize_horizontal' => false, 'theme_advanced_toolbar_location' => 'top');
 }