public function testRender() { $param = 'tset'; $test = '<h1>Test' . $param . '</h1>'; ob_start(); $this->module->render('testAction', $param); $output = ob_get_contents(); ob_end_clean(); $this->assertEquals($test, $output); $this->setExpectedException('\\samsonphp\\core\\exception\\ControllerActionNotFound'); $this->module->render('notFoundAction', $param); }
function render() { // $this->title = "Edit Profile"; $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $param['network_id'] = PA::$network_info->network_id; $res = Network::get_members($param); $links['registered_users'] = count($res['users_data']); $this->email_domain_array = $this->get_email_by_domain($res['users_data']); $this->blog_post = Content::load_content_id_array(0, NULL, TRUE, 'ALL', 'created', 'DESC'); $image_array = Image::load_images(); $this->images = count($image_array); $this->profile_views = User::get_profile_view_stats('profile_visitor_count'); $this->profile_visits_by_user = User::get_profile_view_stats('profile_visited_count'); $relationship_stats = array(); $maximum_relation = 0; $minimum_relation = 0; $average_relation = 0; $relationship_stats = Relation::relation_stats(); if (count($relationship_stats) > 0) { $maximum_relation = max($relationship_stats); $minimum_relation = min($relationship_stats); $average_relation = array_sum($relationship_stats) / count($relationship_stats); } $this->relationship_stats = array('min' => $minimum_relation, 'max' => $maximum_relation, 'avg' => $average_relation); $this->inner_HTML = $this->generate_inner_html($links); $content = parent::render(); return $content; }
function render() { $pollObj = new Poll(); // $current = $pollObj->load_current($_GET['gid']); $this->prev_polls = $pollObj->load_prev_polls(isset($_GET) && isset($_GET['gid']) ? $_GET['gid'] : null); if ($this->prev_polls) { foreach ($this->prev_polls as $poll) { $votes = $pollObj->load_vote($poll->poll_id); $poll->total_votes = count($votes); $options = array(); foreach (unserialize($poll->options) as $option => $s) { $options[$option]['title'] = $s; $option_votes = $pollObj->load_vote_option($poll->poll_id, $s); // echo "<pre>".print_r($option_votes,1)."</pre>"; $options[$option]['count'] = $option_votes[2]->counter; $options[$option]['percent'] = $poll->total_votes != 0 ? round($option_votes[2]->counter / $poll->total_votes * 100, 1) : 0; } $poll->options = $options; } $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; } else { $this->do_skip = TRUE; return 'skip'; } }
function render() { $this->get_recent_tags(); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { global $login_uid; $obj = new Poll(); $prev_poll = $obj->load_prevous_polls($_GET['gid']); $cnt = count($prev_poll); for ($i = 0; $i < $cnt; $i++) { $total_votes[$prev_poll[$i]->poll_id] = count($obj->load_vote($prev_poll[$i]->poll_id)); $prev_options[$i] = unserialize($prev_poll[$i]->options); $num_option = count($prev_options[$i]); for ($j = 1; $j <= $num_option; $j++) { if ($prev_options[$i]['option' . $j] != '') { $vote[] = $obj->load_vote_option($prev_poll[$i]->poll_id, $prev_options[$i]['option' . $j]); } } } $percentage = array(); for ($i = 0; $i < count($vote); $i++) { $j = $vote[$i][0]; if ($total_votes[$j] != 0) { $percentage[$j][] = round($vote[$i][2]->counter / $total_votes[$j] * 100, 1); } } $this->current_poll = $obj->load_current($_GET['gid']); $this->per_prev_poll = $percentage; $this->prev_poll = $prev_poll; $this->prev_options = $prev_options; $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $conf = new NetworkConfig(); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { global $login_uid; if ($this->type == 'group') { $this->view_all_url = "showcontent.php?gid={$this->gid}"; $group = new Group(); $group->collection_id = $this->gid; $this->links = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, $show = 5, $page = 1, $sort_by = 'created', $direction = 'DESC', TRUE); //$type = 'all',$cnt=FALSE, $show='ALL', $page=0, $sort_by='created', $direction='DESC' } else { if ($this->type == 'homepage') { //if homepage then do some additional filter //Fix for homepage // DISPLAY_ON_HOMEPAGE has value 0 // It means the posts whose display_on = 0 they will show up on the homepage $this->links = Content::get_recent_posts(array('show' => 5, 'sort_by' => 'RT.created', 'page' => 1, 'direction' => 'DESC'), 'collection_id=-1'); } else { if ($this->type == 'permalink') { $this->links = Content::get_recent_posts(array('show' => 5, 'sort_by' => 'RT.created', 'page' => 1, 'direction' => 'DESC'), 'collection_id=-1 '); } else { $this->links = Content::get_recent_posts(array('show' => 5, 'sort_by' => 'RT.created', 'page' => 1, 'direction' => 'DESC'), 'collection_id=-1 '); } } } $this->view_all_url = count($this->links) > 0 ? $this->view_all_url : ''; $this->inner_HTML = $this->generate_inner_html($this->links); $content = parent::render(); return $content; }
function render() { $this->outer = get_class_name(PAGE_LOGIN); $this->inner_HTML = $this->generate_center_public_inner_html(); $content = parent::render(); return $content; }
function render() { $this->group_details = $this->shared_data['group_info']; $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->links = NULL; $Pagination = new Pagination(); switch ($this->type) { case IMAGE: $this->links = Content::load_content_id_array($this->uid, IMAGE); $this->type_image = PA::$theme_url . "/images/type-image.gif"; break; case AUDIO: $this->links = Content::load_content_id_array($this->uid, AUDIO); $this->type_image = PA::$theme_url . "/images/type-audio.gif"; break; case VIDEO: $this->links = Content::load_content_id_array($this->uid, VIDEO); $this->type_image = PA::$theme_url . "/images/type-video.gif"; break; default: case BLOGPOST: $this->links = Content::load_content_id_array($this->uid, BLOGPOST); $this->type_image = PA::$theme_url . "/images/type-blog.gif"; break; } $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->title = __("Recover Password"); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->links = $this->get_links(); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->title = 'Flickr'; $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { switch ($this->view) { case "user": $this->mode = 'view_conversations'; switch (@$this->params['view']) { case 'message': $this->mode = 'view_message'; $this->title = __('View Message'); break; case 'compose': $this->mode = 'compose_message'; $this->title = __('Compose Message'); break; default: } break; default: return "Unknown ConversationModule view: {$this->view}"; } $this->inner_HTML = $this->generate_inner_html(); if (preg_match($this->skin, "/_inner\$/")) { $content = parent::render(); } else { $content = $this->inner_HTML; } return $content; }
function render() { //$this->title = chop_string($this->content->title, TITLE_LENGTH); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { // render $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->title = 'Ratings'; // vars used everywhere $this->subject_type = $this->params['subject_type']; // view-specific stuff switch ($this->view) { case 'item': $this->subject_id = $this->params['subject_id']; $this->item = Item::find_by_subject($this->subject_type, $this->subject_id); if (empty($this->item)) { return "Item {$this->subject_type}:{$this->subject_id} not found. Is the frontend server sending it correctly?"; } $this->ratings = $this->get_ratings($this->subject_type, $this->subject_id); $genres = split(",", $this->item->genres); $this->subject_genre = trim($genres[0]); $this->oneliners = Oneliners::get($this->subject_genre, PA::$language); case 'top': $this->items = Item::get_top_rated($this->subject_type, 5); foreach ($this->items as $item) { $item->stars = $this->stars(round($item->average_rating, 1)); } break; case 'recent_by_user': if (empty($this->uid)) { return "user_id is required"; } $this->ratings = $this->get_recent_by_user($this->uid, 5); break; default: return "Unknown RatingModule view {$this->view}"; } $this->inner_HTML = $this->generate_inner_html(); return parent::render(); }
function render() { $this->title = chop_string(stripslashes($this->group_details['title']), GROUP_TITLE_LENGTH); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->title = sprintf(__('Browse %d Groups'), $this->total_groups); $this->links = $this->get_links(); $this->inner_HTML = $this->generate_inner_html($this->links); $content = parent::render(); return $content; }
function render() { $r = get_page_user(); $this->title .= ucfirst($r->login_name); $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { global $login_uid, $page_uid; $content = null; $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { // $this->title = "Customize UI"; // $this->links = $image_data; // where is this supposed to come from?? $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }
function render() { $this->title = 'Browse ' . $this->total_network . ' Networks'; $this->links = $this->get_links(); $this->inner_HTML = $this->generate_center_category_inner_html($this->links); $content = parent::render(); return $content; }
function render() { $network = new Network(); $this->network_links = $network->get(); $this->inner_HTML = $this->generate_inner_html(); $links = parent::render(); return $links; }
function render() { global $paging; $this->Paging["page"] = $paging["page"]; $this->Paging["show"] = 40; $this->inner_HTML = $this->generate_inner_html(); return parent::render(); }
public function render() { $this->title = _n(";Browse %d networks\n0-2;Browse networks", $this->total_network); $this->links = $this->get_links(); $this->inner_HTML = $this->generate_center_category_inner_html($this->links); $content = parent::render(); return $content; }
function render() { $op = $this->op = @$this->module_params['op']; if ($this->op) { if (!empty($this->module_params['comment'])) { $target = new Comment2(); $target->load($this->module_params['comment']); } else { if (!empty($this->module_params['review'])) { $target = new Review(); $target->load($this->module_params['review']); } else { if (!empty($this->module_params['uid'])) { $target = new ShadowUser('videoplay'); $target->load_by_pa((int) $this->module_params['uid']); } } } switch ($op) { case "delete": if (!empty($this->module_params['uid'])) { $target->remove(); } else { $target->delete(); } break; case "hide": case "show": if (!empty($this->module_params['uid'])) { $target->toggle_active($op == 'hide' ? -1 : 1); } else { $target->toggle_active($op == 'hide' ? 0 : 1); } break; } } switch ($this->mode) { case "comments": $inner_template = dirname(__FILE__) . '/admin_content.tpl'; list($this->contents, $this->n, $this->n_pages, $this->page, $this->per_page) = Comment2::get_recent($this->per_page, $this->page); break; case "reviews": $inner_template = dirname(__FILE__) . '/admin_content.tpl'; list($this->contents, $this->n, $this->n_pages, $this->page, $this->per_page) = Review::get_recent($this->per_page, $this->page); break; case "users": $inner_template = dirname(__FILE__) . '/admin_users.tpl'; list($this->users, $this->n, $this->n_pages, $this->page, $this->per_page) = ShadowUser::admin_paged('videoplay', $this->per_page, $this->page); break; default: return "Unknown display type.<pre>" . print_r($this, 1) . "</pre>"; break; } $inner_html_gen =& new Template($inner_template, $this); $this->inner_HTML = $inner_html_gen->fetch(); $content = parent::render(); return $content; }
function render() { $this->title = __("Network Statistics"); $param['network_id'] = PA::$network_info->network_id; $this->network_statistics = Network::get_network_statistics($param); $this->inner_HTML = $this->generate_inner_html($this->network_statistics); $network_stats = parent::render(); return $network_stats; }
function render() { $uid = $this->uid; // Modules listing -- here $this->links = $this->get_links(); $this->inner_HTML = $this->generate_inner_html($this->links); $content = parent::render(); return $content; }