function display_blog($blog, $row) { if ($row['tracks'] > 0) { $img_src = "http://www.google.com/s2/favicons?domain=" . urlencode(parse_url($row['blog'], PHP_URL_HOST)); return ax_a_href_title(ax_img_src($img_src, array('class' => 'icon')), $row['blog'], 'Go to this blog'); } }
function display_jobs($jobs, $row) { $message = rtrim($row['message']); // blah $jobs = ax_a_href_title($jobs, $this->make_url(0, array('show' => 'jobLogs', 'message' => "LIKE:{$message}%", 'type' => $row['type'], 'interval' => $this->interval)), "show job logs with message {$message}"); return $jobs; }
function display_title($title, $row) { if ($row['artist'] != '') { $lastfm_link = "http://www.last.fm/music/" . urlencode($row['artist']) . "/_/" . urlencode($title); return ax_a_href_title($title, $lastfm_link, 'Go to this track on last.fm'); } else { return $title; } }
function display_errors($errors, $row) { if ($row['kind'] != 'full' && $errors != 0) { # if something looks wrong, make a link to problematic items if ($errors) { $errors = ax_a_href_title($errors, $this->make_url(0, array('show' => 'items', 'feed' => $row['id'], 'order' => 'content', 'interval' => $this->interval)), "Show problematic items for feed " . $row['id']); } } else { $errors = ""; } return $errors; }
function display_menu($show, $parent = null) { $menu = array(); foreach ($this->pages as $page) { $attrs = array(); if ($page['name'] == $show) { $attrs['class'] = 'current'; } if ($parent) { $tab = array_key_exists('parent', $page) ? $page['parent'] == $parent : False; } else { $tab = array_key_exists('tab', $page) ? $page['tab'] : True; } if ($tab) { array_push($menu, ax_li(ax_a_href_title(ucfirst($page['name']), $this->make_url(array('show' => $page['name'])), $page['descr'], $attrs))); } } return $menu; }
function display_jobs($jobs, $row) { $id = $row['item']; $jobs = ax_a_href_title(ax_raw("log→"), $this->make_url(0, array('show' => 'jobLogs', 'type' => 'LIKE:comments', 'args' => "LIKE:% {$id} %", 'interval' => '7 DAY')), "show job logs for comments of item {$id}"); return $jobs; }
function display_resource($resource, $row) { $resource = ax_a_href_title($resource, $this->make_url(0, array('show' => 'resources', 'id' => $resource)), "Only show rows with resource {$resource}."); return $resource; }
function display_comments($comments, $row) { $id = $row['id']; $comments = ax_a_href_title(ax_raw("comments→"), $this->make_url(0, array('show' => 'comments', 'item' => $id)), "show comments for item {$id}"); return $comments; }
function display_jobs($value, $row) { return ax_a_href_title(ax_raw("→"), $this->make_url(0, array('show' => 'jobLogs', 'task' => $row['id'])), "Show job logs for task " . $row['id']); }
function display_actions($action, $row) { $action = ax_a_href_title(ax_img_src("img/delete.png"), "editor/?action=delete&what=job&id=" . $row['id'] . '&url=' . urlencode($this->make_url(1)), "remove job " . $row['id'] . " from queue"); return $action; }
<?php // Results in <p class="foo">Paragraph text</p> when rendered $p = ax_p_class('Paragraph text', 'foo'); // The same can be achieved like this: $p = ax_p('Paragraph text'); $p->set_class('foo'); // Results in <div id="bar">Text here</div> when rendered $p = ax_div_id('Text here', 'bar'); // The same can be achieved like this: $div = ax_div('Text here'); $div->set_attribute('id', 'bar'); // Hyperlinks can be built like this: $link = ax_a_href('Hyperlink text', 'http://anewt.net'); $link = ax_a_href_title('Hyperlink text', 'http://anewt.net', 'This will be a tooltip'); // Images can be built like this: $img = ax_img_src_alt('example.png', 'An example image');
function display_feed_item($feed_item, $row) { return ax_a_href_title($feed_item, $this->make_url(1, array('feed_item' => $feed_item)), "View enclosures for this item"); }