function generate_inner_html()
 {
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_prev = $Pagination->getPreviousPage();
     $this->page_next = $Pagination->getNextPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_template = NULL;
     switch ($this->mode) {
         case 'relations':
         case 'in_relations':
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_relation.tpl';
             break;
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public_relation.tpl';
     }
     $obj_inner_template = new Template($inner_template, $this);
     $obj_inner_template->set_object('links', $this->links);
     $obj_inner_template->set_object('gid', @$this->gid);
     $obj_inner_template->set('sub_title', @$this->sub_title);
     $obj_inner_template->set('total', $this->Paging['count']);
     $obj_inner_template->set('reciprocated_relationship_set', @$this->reciprocated_relationship_set);
     $obj_inner_template->set('relations', @$this->relations);
     $obj_inner_template->set('in_relations', @$this->in_relations);
     $obj_inner_template->set('user_name', $this->page_user);
     $obj_inner_template->set('page_prev', $this->page_prev);
     $obj_inner_template->set('page_next', $this->page_next);
     $obj_inner_template->set('page_links', $this->page_links);
     $obj_inner_template->set('view_type', $this->view_type);
     $inner_html = $obj_inner_template->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->links;
     switch ($this->mode) {
         default:
             $tmp_file = PA::$blockmodule_path . "/MediaManagementModule/center_inner_public.tpl";
     }
     $info = new Template($tmp_file);
     $info->set_object('uid', $this->uid);
     $info->set_object('links', $links);
     $info->set_object('type_image', $this->type_image);
     $info->set('page_links', $this->page_links);
     $info->set('PagingArray', $this->PagingArray);
     $inner_html = $info->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     if (empty($this->links)) {
         return "";
     }
     $links = $this->links;
     /*
      if ($links->type == 'textpad') {
      $this->title = $links->title;
      }
     */
     $pos = explode(',', $links->orientation);
     $x_loc = $pos[0];
     if ($x_loc == 2) {
         $width = AD_WIDTH_MIDDLE;
         //$height = AD_HEIGHT_MIDDLE;
     } else {
         $width = AD_WIDTH_LR;
         //$height = AD_HEIGHT_LR;
         $this->outer_template = 'cnmodule_advertisement.php';
     }
     // we never want to reduce the height of an ad, so we set $height very high
     $height = 1000;
     $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule.php';
     $inner_html_gen = new Template($tmp_file);
     $inner_html_gen->set_object('links', $links);
     $inner_html_gen->set('width', $width);
     $inner_html_gen->set('height', $height);
     $inner_html_gen->set('block_name', $this->html_block_id);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 public function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/side_inner_public.tpl';
     }
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set_object('group_details', $this->group_details);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_center_public_inner_html()
 {
     $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . "/inner_html.tpl";
     $info = new Template($tmp_file, $this);
     $info->set_object('uid', @$this->uid);
     $info->set('msg', @$this->msg);
     $info->set('array_of_errors', @$this->array_of_errors);
     $info->set('user_picture', @$this->user_picture);
     $info->set('login_name', @$this->login_name);
     $info->set('rel_type', @$this->rel_type);
     $inner_html = $info->fetch();
     return $inner_html;
 }
 function generate_inner_html($template_vars = array())
 {
     $inner_html_gen = new Template($this->inner_template);
     foreach ($template_vars as $name => $value) {
         if (is_object($value)) {
             $inner_html_gen->set_object($name, $value);
         } else {
             $inner_html_gen->set($name, $value);
         }
     }
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 public function render($template_vars, $template_path)
 {
     $template_file = getShadowedPath($template_path);
     $html = new Template($template_file);
     foreach ($template_vars as $name => $value) {
         if (is_object($value)) {
             $html->set_object($name, $value);
         } else {
             $html->set($name, $value);
         }
     }
     echo $html->fetch();
     exit;
 }
 function generate_inner_html()
 {
     $links = $this->media_data;
     // Here we get all the comment of that content
     $comment = new Comment();
     $comment->parent_id = $links->content_id;
     $comment->parent_type = TYPE_CONTENT;
     $this->Paging["count"] = $comment->get_multiples_comment($cnt = TRUE);
     $result = $comment->get_multiples_comment($cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
     $this->comments = $result;
     $param = $this->handle_field_param($links);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     $info = new Template($inner_template);
     $info->set_object('param', $param);
     $info->set_object('uid', $this->uid);
     $info->set_object('links', $links);
     $info->set_object('comments', $this->comments);
     $info->set('back', @$_SERVER['HTTP_REFERER']);
     $info->set('page_first', $this->page_first);
     $info->set('page_last', $this->page_last);
     $info->set('page_links', $this->page_links);
     // when we show Group media - check is user still Group member
     if (isset($_GET['gid'])) {
         $is_author_member = $this->is_author_group_member($links->author_id, $_GET['gid']);
         $info->set('is_author_member', $is_author_member);
     }
     $inner_html = $info->fetch();
     return $inner_html;
 }
 public function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/side_inner_public.tpl';
     }
     $this->generate_group_links();
     $this->title = chop_string(stripslashes(!empty($this->group_details) ? $this->group_details->title : NULL), GROUP_TITLE_LENGTH);
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set_object('group_details', $this->group_details);
     $inner_html_gen->set('join_this_group_string', $this->join_this_group_string);
     $inner_html_gen->set('is_member', $this->is_member);
     $inner_html_gen->set('is_admin', $this->is_admin);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 /** !!
  * Gather the list of all email templates to be displayed on the drop down
  * menu by calling { @link getEmailContainers() } and placing it in 
  * { @link $template_list }. Once a template has been selected create objects
  * to store all information for the email such as author and subject and place
  * them into ( @link $obj_inner_template }.
  * @return string $inner_html all the html to be displayed in the email,
  *		gathered by setting this equal to { @link $obj_inner_template }
  */
 function generate_inner_html()
 {
     if (!empty($_GET['template'])) {
         $this->template = $_GET['template'];
     }
     $tiny = new TinyMCE('medium');
     $email_list = EmailMessages::get_email_list();
     $template_list = $this->getEmailContainers(PA::$config_path . "/email_containers");
     $inner_template = NULL;
     $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_html.tpl';
     $obj_inner_template = new Template($inner_template);
     $obj_inner_template->set('email_list', $email_list);
     $obj_inner_template->set('template_list', $template_list);
     $obj_inner_template->set('subject', $this->subject);
     $obj_inner_template->set('message', $this->message);
     $obj_inner_template->set('category', $this->category);
     $obj_inner_template->set('template', $this->template);
     $obj_inner_template->set('description', $this->description);
     $obj_inner_template->set('configurable_variables', $this->configurable_variables);
     $obj_inner_template->set('preview', $this->preview_msg);
     $obj_inner_template->set_object('tiny_mce', $tiny);
     $inner_html = $obj_inner_template->fetch();
     return $inner_html;
 }
function uihelper_generate_center_content_permalink($cid, $show = 0)
{
    global $app;
    $image_media_gallery = FALSE;
    $back_page = PA::$url . $app->current_route;
    $content = CNContent::load_content((int) $cid, (int) PA::$login_uid);
    // filter content fields for output
    $content->title = _out($content->title);
    $content->body = _out($content->body);
    if (strstr($back_page, PA_ROUTE_CONTENT) || strstr($back_page, PA_ROUTE_PERMALINK)) {
        if ($content->parent_collection_id > 0) {
            $collection = ContentCollection::load_collection((int) $content->parent_collection_id, PA::$login_uid);
            if ($collection->type == GROUP_COLLECTION_TYPE) {
                $back_page = PA::$url . PA_ROUTE_GROUP . "/gid=" . $content->parent_collection_id;
            } else {
                $back_page = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid=" . $content->author_id;
            }
            // IF permalink content is a group content redirect to group homepage
        } else {
            //if coming from permalink page then redirect to user page
            $back_page = PA::$url . PA_ROUTE_USER_PRIVATE;
        }
    }
    $moderateduser = Group::is_admin((int) $content->parent_collection_id, (int) PA::$login_uid) ? 1 : 0;
    $back_page = urlencode($back_page);
    if (!$content->is_html) {
        $content->body = nl2br($content->body);
    }
    $media_gallery_content = NULL;
    $media_gallery_content = in_array(trim($content->type), array('Image', 'Audio', 'Video'));
    $editable = PA::$login_uid == $content->author_id || $moderateduser;
    $comments = Comment::get_comment_for_content($cid, '', 'ASC');
    $number_of_comments = count($comments);
    $content->no_of_comments = $number_of_comments;
    $trackback = CNContent::get_trackbacks_for_content($cid);
    $number_of_trackbacks = count($trackback);
    $content->no_of_trackbacks = $number_of_trackbacks;
    $content->trackback_url = PA::$url . "/pa_trackback.php?cid=" . $cid;
    $content_user = new User();
    $content_user->load((int) $content->author_id);
    $content->create_time = PA::date($content->changed, 'long');
    // date("l, F d, Y", $content->changed);
    $tags = Tag::load_tags_for_content($cid);
    if ($tags) {
        $t = array();
        for ($i = 0; $i < count($tags); $i++) {
            $name = _out($tags[$i]['name']);
            $uid = PA::$login_uid;
            $url = PA::$url . '/' . FILE_TAG_SEARCH . '?name_string=content_tag&keyword=' . $tags[$i]["name"];
            $t[] = "<a href={$url}>" . $name . "</a>";
        }
        $tag_string = "<b>Tags : </b>" . implode(", ", $t);
    } else {
        $tag_string = "";
    }
    $content->tag_entry = $tag_string;
    if (property_exists($content, 'sbname')) {
        if (substr($content->sbname, 0, 5) == 'event') {
            $content->type = 'SBEvent';
        } elseif (substr($content->sbname, 0, 6) == 'review') {
            $content->type = 'Review';
        } elseif (substr($content->sbname, 0, 11) == 'media/audio') {
            $content->type = 'Audio';
        } elseif (substr($content->sbname, 0, 11) == 'media/video') {
            $content->type = 'Video';
        } elseif (substr($content->sbname, 0, 11) == 'media/image') {
            $content->type = 'Image';
        } elseif (substr($content->sbname, 0, 14) == 'showcase/group') {
            $content->type = 'GroupShowCase';
        } elseif (substr($content->sbname, 0, 15) == 'showcase/person') {
            $content->type = 'PersonShowCase';
        }
    }
    // replace magic strings
    $content->replace_percent_strings(PA::$url);
    $type = $content->type;
    $type = $type . 'Permalink';
    // comments
    $comments_list_tpl = new Template(CURRENT_THEME_FSPATH . "/cncontent_comments.php");
    $comments_list_tpl->set('current_theme_path', PA::$theme_url);
    $comments_list_tpl->set('comments', $comments);
    $comments_list_tpl->set('author_id', $content->author_id);
    // Setting the variable for the abuse form ...
    $comments_list = $comments_list_tpl->fetch();
    //comment form
    $cnform_comment_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_comment.php");
    $cnform_comment_tpl->set('current_theme_path', PA::$theme_url);
    if (isset(PA::$login_uid)) {
        $user = new User();
        $user->load((int) PA::$login_uid);
        $login_name = $user->login_name;
        $cnform_comment_tpl->set('name', $login_name);
        $cnform_comment_tpl->set('login_name', $user->login_name);
    }
    $cnform_comment_tpl->set('cid', $cid);
    if ($content->parent_collection_id > 0) {
        $cnform_comment_tpl->set('ccid', $content->parent_collection_id);
    }
    // abuse form
    $cnform_abuse_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_abuse.php");
    /* Permalink and edit links for content */
    if ($content->parent_collection_id != -1) {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id . '&ccid=' . $content->parent_collection_id;
    } else {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id;
    }
    $params = array('permissions' => 'edit_content', 'uid' => PA::$login_uid, 'cid' => $content->content_id);
    if (PermissionsHandler::can_user(PA::$login_uid, $params)) {
        if ($media_gallery_content) {
            $edit_link = PA::$url . '/edit_media.php?cid=' . $content->content_id;
        } else {
            $edit_link = PA::$url . "/cncontent_blog.php?cid=" . $content->content_id;
        }
        $delete_link = PA::$url . PA_ROUTE_CONTENT . "?action=deleteContent&cid=" . $content->content_id . '&amp;back_page=' . $back_page;
        // handle Event separately
        if ($type == "EventPermalink") {
            $edit_link = PA::$url . '/calendar.php?cid=' . $content->content_id;
            $delete_link = $edit_link . "&delete=1" . '&amp;back_page=' . $back_page;
        }
    } else {
        $edit_link = $delete_link = NULL;
    }
    $user_link = PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $content->author_id;
    /* Code for Approval and Denial links for a content */
    if ($moderateduser && $content->is_active == 2) {
        $approval_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&apv=1';
        $denial_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&dny=1';
    } else {
        $approval_link = $denial_link = NULL;
    }
    // Show comments form to logged in users, only if comments enabled.
    global $comments_disabled;
    // fix by Z.Hron; if group content - only members of group can comment it
    $can_user_comment = true;
    if (isset($_GET['gid']) && isset(PA::$login_uid)) {
        $can_user_comment = Group::member_exists((int) $_GET['gid'], PA::$login_uid);
    }
    if (!$comments_disabled && !empty(PA::$login_uid) && $can_user_comment) {
        $cnform_comment = $cnform_comment_tpl->fetch();
        $cnform_abuse = $cnform_abuse_tpl->fetch();
    } else {
        $cnform_comment = $cnform_abuse = NULL;
    }
    if (getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php")) {
        $middle_content = new Template(getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php"));
        $middle_content->set_object('contents', $content);
        $middle_content->set('editable', $editable);
        $middle_content->set('picture_name', $content_user->picture);
        //  to set picture name for diplaying in contets
        $middle_content->set('user_id', $content_user->user_id);
        $middle_content->set('user_name', $content_user->first_name . ' ' . $content_user->last_name);
        $middle_content->set('current_theme_path', PA::$theme_url);
        $middle_content->set('back_page', $back_page);
        $middle_content->set('comments', $comments_list);
        $middle_content->set('cnform_comment', $cnform_comment);
        $middle_content->set('cnform_abuse', $cnform_abuse);
        $middle_content->set('media_gallery_content', $media_gallery_content);
        if ($show == 1) {
            $middle_content->set('show', $show);
        }
        $middle_content->set('permalink', $perma_link);
        $middle_content->set('edit_link', $edit_link);
        $middle_content->set('approval_link', $approval_link);
        $middle_content->set('denial_link', $denial_link);
        $middle_content->set('delete_link', $delete_link);
        $middle_content->set('user_link', $user_link);
        $return_content = $middle_content->fetch();
    } else {
        $return_content = '<p>Content does not have a display template.</p><p>Create a ' . $type . '.php file to display this content type.</p>';
    }
    return $return_content;
}
 /** !!
  * Generates, again using the template file, the edit page, if the media meets
  * a certain condition.
  *
  * @return string The HTML for this module.
  */
 function generate_group_inner_html()
 {
     switch ($this->mode) {
         default:
             $template_file = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_group.tpl';
     }
     $template_file_obj = new Template($template_file);
     $template_file_obj->set_object('uid', $this->uid);
     $template_file_obj->set_object('media_data', $this->media_data);
     $template_file_obj->set_object('contentcollection_type', $this->contentcollection_type);
     $inner_html = $template_file_obj->fetch();
     return $inner_html;
 }
$optional_parameters = "onload=\"{$onload}\"";
html_body($optional_parameters);
//header of group page
$header = new Template(CURRENT_THEME_FSPATH . "/header.tpl");
$header->set('current_theme_path', PA::$theme_url);
$header->set('current_theme_rel_path', PA::$theme_rel);
// find navigation link for header
$navigation = new Navigation();
$navigation_links = $navigation->get_links();
$header->set('navigation_links', $navigation_links);
$header->set('onload', $onload);
$header->tier_one_tab = $main_tier;
$header->tier_two_tab = $second_tier;
$header->tier_three_tab = $third_tier;
if (PA::$network_info) {
    $header->set_object('network_info', PA::$network_info);
}
// This block of code has to be removed when this page will be rendered using PageRenderer.
$top_navigation_bar = new Template(CURRENT_THEME_FSPATH . "/top_navigation_bar.tpl");
$top_navigation_bar->set('navigation_links', $navigation_links);
//left of group page
foreach ($leftModulesFromDB as $leftModule) {
    $file = PA::$blockmodule_path . "/{$leftModule}/{$leftModule}.php";
    require_once $file;
    $obj = new $leftModule();
    $array_left_modules[] = $obj->render();
}
//middle of group page
foreach ($middleModulesFromDB as $middleModule) {
    $file = PA::$blockmodule_path . "/{$middleModule}/{$middleModule}.php";
    require_once $file;
    function main()
    {
        if (!@PA::$config->enable_widgetization_testbench) {
            ?>

<p>Widgetization testbench must be enabled specifically by setting <code>PA::$config->enable_widgetization_testbench = TRUE</code> in local_config.php.</p>

<?php 
            exit;
        }
        $module_name = @$_GET['module'];
        if (empty($module_name)) {
            $this->show_modules();
            return;
        }
        $module_view = @$_GET['view'];
        if (empty($module_view)) {
            $module_view = "default";
        }
        $json = new Services_JSON();
        // prefix to mark parameters as being for this module
        $param_prefix = "w_" . $module_name . "_";
        // parameters to pass through to the backend
        $params = array();
        // GET or POST?
        $method = 'get';
        // If we got an HTTP POST, mark this as so
        if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_GET['wop'] == 'post') {
            $method = 'post';
        }
        // Collect parameters and pass them through
        foreach ($_REQUEST as $k => &$v) {
            if (strpos($k, $param_prefix) !== 0) {
                continue;
            }
            $params[substr($k, strlen($param_prefix))] =& $v;
        }
        $request = array('modules' => array(array('id' => 1, 'name' => $module_name, 'method' => $method, 'post_url' => PA::$url . "/widget_testbench.php?module={$module_name}&wop=post", 'param_prefix' => $param_prefix, 'args' => array('view' => $module_view, 'position' => 'center'), 'params' => $params)), 'global' => array('namespace' => 'testbench', 'user' => array('user_id' => "pa_" . PA::$login_user->user_id, 'email' => "testbench+" . PA::$login_user->email, 'first_name' => PA::$login_user->first_name, 'last_name' => PA::$login_user->last_name)));
        $request_url = PA::$url . "/widget_dispatch.php";
        if (!preg_match("|^http://(.*?)(/.*)\$|", $request_url, $m)) {
            die("couldn't parse url");
        }
        list(, $request_host, $request_path) = $m;
        $request_json = $json->encode($request);
        $post = "POST {$request_path} HTTP/1.0\nHost: {$request_host}\nConnection: close\nContent-Type: application/x-javascript\nContent-Length: " . strlen($request_json) . "\n\n{$request_json}\n";
        // actually perform POST
        $fs = fsockopen($request_host, 80, $errno, $errstr, 4);
        if (!$fs) {
            $response = array("error" => "Failed to connect to widget server");
        } else {
            fputs($fs, $post);
            $response_raw = "";
            while (!feof($fs)) {
                $resp = fread($fs, 8192);
                if ($resp === FALSE) {
                    break;
                }
                $response_raw .= $resp;
            }
            fclose($fs);
            list($response_headers, $response_body) = explode("\r\n\r\n", $response_raw, 2);
            $response = $json->decode($response_body);
        }
        $tpl = new Template(PA::$theme_path . '/widget_testbench_widget.tpl');
        $tpl->set("module_name", $module_name);
        $tpl->set("post", $post);
        $tpl->set("response_raw", $response_raw);
        $tpl->set_object("response", $response);
        echo $tpl->fetch();
    }
 /** !!
  * Parses the template to generate the HTML.
  *
  * @return string HTML.
  */
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $info = new Template($inner_template);
     // This lets us know what has just been POSTed, if anything.
     // e.g.: if $post_profile_type == 'basic', 'apply changes' has
     // just been clicked on the basic profile tab.
     $info->set('post_profile_type', !isset($_POST['submit']) ? NULL : $_POST['profile_type']);
     $info->set_object('uid', $this->uid);
     @$info->set('array_of_errors', $this->array_of_errors);
     @$info->set('user_data', $this->user_data);
     @$info->set('user_personal_data', $this->user_personal_data);
     @$info->set('user_professional_data', $this->user_professional_data);
     $info->set('blogsetting_status', $this->blogsetting_status);
     $info->set('type', $this->profile_type);
     $info->set('profile_type', $this->profile_type);
     $info->set('section_info', $this->section_info);
     $info->set_object('user_info', $this->user_info);
     $info->set('request_data', $this->request_data);
     $inner_html = $info->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     if ($this->id) {
         $this->load_data();
     }
     if ($this->ccid > 0) {
         // load that group so we can check it's access and reg type
         $this->group = Group::load_group_by_id((int) $this->ccid);
     }
     $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule.php';
     $inner_html_blog = new Template($inner_template);
     $inner_html_blog->set_object('network_info', PA::$network_info);
     $inner_html_blog->set('current_theme_path', PA::$theme_url);
     // $inner_html_blog->set('links', $this->links);
     $inner_html_blog->set('cid', $this->id);
     $inner_html_blog->set('ccid', $this->ccid);
     $inner_html_blog->set('parent_collection_id', $this->parent_collection_id);
     // some or most of the following can be empty so we use the @
     $inner_html_blog->set('blog_title', str_replace('"', '&quot;', $this->blog_title));
     $inner_html_blog->set('blog_type', $this->blog_type);
     $redirect = urldecode(isset($_GET) && isset($_GET['redirect']) ? $_GET['redirect'] : '');
     $redirect = urldecode(isset($_POST) && isset($_POST['redirect']) ? $_POST['redirect'] : $redirect);
     $pattern = '/(https?:\\/\\/)?(((www\\.)?([a-zA-Z0-9_\\.\\-]*)\\b\\.[a-z]{2,4}(\\.[a-z]{2})?)|(localhost))(:[0-9]*)?((\\/[a-zA-Z0-9_\\-\\.]*)+)?(\\.[a-z]*)?(\\?\\S+)?/';
     $redirect = preg_match($pattern, $redirect) ? $redirect : '';
     $inner_html_blog->set('redirect', urlencode($redirect));
     $inner_html_blog->set('body', $this->body);
     $inner_html_blog->set('trackback', $this->trackback);
     $inner_html_blog->set('tag_entry', $this->tag_entry);
     $inner_html_blog->set('error_msg', $this->error_msg);
     $center_content = $inner_html_blog->fetch();
     $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule_simple.php';
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set_object('network_info', PA::$network_info);
     $inner_html_gen->set('current_theme_path', PA::$theme_url);
     /* $inner_html_gen->set('title', $this->title); */
     // $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('sb_mc_type', $this->sb_mc_type);
     $inner_html_gen->set('sb_types', $this->sb_types);
     $inner_html_gen->set('center_content', $center_content);
     $inner_html_gen->set('display', $this->display);
     $inner_html_gen->set('targets', $this->targets);
     $inner_html_gen->set('show_external_blogs', $this->show_external_blogs);
     $inner_html_gen->set('user_groups', $this->get_user_groups());
     $inner_html_gen->set('group_access', $this->group->access_type);
     $inner_html_gen->set('group_reg', $this->group->rdg_type);
     $inner_html_gen->set('album_type', $this->album_type);
     $inner_html_gen->set('outputthis_error_mesg', $this->outputthis_error_mesg);
     $inner_html_gen->set('error_msg', $this->error_msg);
     if ($this->album_type != -1) {
         $inner_html_gen->set('user_albums', $this->get_user_albums());
     }
     $inner_html_gen->set('permission_to_post', $this->permission_to_post);
     $inner_html_gen->set('is_edit', $this->is_edit);
     $inner_html_gen->set('ccid', $this->ccid);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         case PRI:
             $this->outer_template = 'outer_private_side_module_userinformations.php';
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule_content.php';
             break;
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule_content.php';
             break;
     }
     $user_profile_info = new Template($inner_template);
     $user_profile_info->set('user_data_general', $this->general_info);
     $user_profile_info->set('user_data_personal', $this->personal_info);
     $user_profile_info->set('user_data_professional', $this->professional_info);
     $user_profile_info->set('user_data_social', $this->social_info);
     $user_profile_info->set_object('user', $this->user);
     $inner_html = $user_profile_info->fetch();
     return $inner_html;
 }
 /** !!
  * This is setting up all of the data to be rendered to the page, it is used by
  * {@link render() } to put the data into the template for this module.
  *
  * @returns string $inner_html  The html that is specific to this module
  */
 function generate_inner_html()
 {
     switch ($this->mode) {
         case PRI:
             $this->outer_template = 'outer_private_side_module.tpl';
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/side_inner_public.tpl';
             break;
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/side_inner_public.tpl';
             break;
     }
     $user_profile_info = new Template($inner_template);
     $user_profile_info->set('user_data_general', $this->general_info);
     $user_profile_info->set_object('user', $this->user);
     $inner_html = $user_profile_info->fetch();
     return $inner_html;
 }
    function generate_inner_html()
    {
        if ($this->id) {
            $this->load_data();
        }
        if ($this->ccid > 0) {
            // load that group so we can check it's access and reg type
            $this->group = Group::load_group_by_id((int) $this->ccid);
        }
        $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_blog.tpl';
        $inner_html_blog = new Template($inner_template);
        $inner_html_blog->set_object('network_info', PA::$network_info);
        $inner_html_blog->set('current_theme_path', PA::$theme_url);
        // $inner_html_blog->set('links', $this->links);
        $inner_html_blog->set('cid', $this->id);
        $inner_html_blog->set('ccid', $this->ccid);
        $inner_html_blog->set('parent_collection_id', $this->parent_collection_id);
        // some or most of the following can be empty so we use the @
        $inner_html_blog->set('blog_title', str_replace('"', '&quot;', @$this->blog_title));
        $inner_html_blog->set('blog_type', @$this->blog_type);
        switch ($this->blog_type) {
            case 'Contribution':
                $inner_html_blog->set('message', '<p>Comments are easy to do, but sometimes you need to think about what you\'re writing.
				So we\'re providing you with a rich text editor, which can have media (video, photos)
				embedded in the text as well as web links.  When you\'re done,
				just hit the "Publish Post" button.</p>');
                break;
            case 'Suggestion':
                $inner_html_blog->set('message', '<p>Thanks for taking the time to make us even better.  Most people
			are content with clicking the next link in Google, but not you!  You have decided to do something, take action, and help make something powerful.</p>');
                break;
            case 'BlogPost':
                $inner_html_blog->set('message', '<p>A penny for your thoughts, but I think in an depth response is worth much, much more.  Thanks
				for taking the time to leave a thoughtful tidbit of your knowledge in the Civic Commons.  Your peers will thank you.</p>');
                break;
            default:
                break;
        }
        $redirect = urldecode(isset($_GET) && isset($_GET['redirect']) ? $_GET['redirect'] : '');
        $redirect = urldecode(isset($_POST) && isset($_POST['redirect']) ? $_POST['redirect'] : $redirect);
        $pattern = '/(https?:\\/\\/)?(((www\\.)?([a-zA-Z0-9_\\.\\-]*)\\b\\.[a-z]{2,4}(\\.[a-z]{2})?)|(localhost))(:[0-9]*)?((\\/[a-zA-Z0-9_\\-\\.]*)+)?(\\.[a-z]*)?(\\?\\S+)?/';
        $redirect = preg_match($pattern, $redirect) ? $redirect : '';
        $inner_html_blog->set('redirect', urlencode($redirect));
        $inner_html_blog->set('body', @$this->body);
        $inner_html_blog->set('trackback', @$this->trackback);
        $inner_html_blog->set('tag_entry', @$this->tag_entry);
        $inner_html_blog->set('error_msg', @$this->error_msg);
        $center_content = $inner_html_blog->fetch();
        $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private_simple.tpl';
        $inner_html_gen = new Template($inner_template);
        $inner_html_gen->set_object('network_info', PA::$network_info);
        $inner_html_gen->set('current_theme_path', PA::$theme_url);
        /*$inner_html_gen->set('title', $this->title);*/
        // $inner_html_gen->set('links', $this->links);
        $inner_html_gen->set('sb_mc_type', @$this->sb_mc_type);
        $inner_html_gen->set('sb_types', @$this->sb_types);
        $inner_html_gen->set('center_content', $center_content);
        $inner_html_gen->set('display', $this->display);
        $inner_html_gen->set('targets', $this->targets);
        $inner_html_gen->set('show_external_blogs', $this->show_external_blogs);
        $inner_html_gen->set('user_groups', $this->get_user_groups());
        $inner_html_gen->set('group_access', @$this->group->access_type);
        $inner_html_gen->set('group_reg', @$this->group->rdg_type);
        $inner_html_gen->set('album_type', $this->album_type);
        $inner_html_gen->set('outputthis_error_mesg', @$this->outputthis_error_mesg);
        $inner_html_gen->set('error_msg', @$this->error_msg);
        if ($this->album_type != -1) {
            $inner_html_gen->set('user_albums', $this->get_user_albums());
        }
        $inner_html_gen->set('permission_to_post', $this->permission_to_post);
        $inner_html_gen->set('is_edit', $this->is_edit);
        $inner_html_gen->set('ccid', $this->ccid);
        $post_type_name_singular = $this->blog_type;
        if ($post_type_name_singular == 'BlogPost') {
            $post_type_name_singular = 'Post';
        }
        $inner_html_gen->set('post_type_name_singular', $post_type_name_singular);
        $inner_html = $inner_html_gen->fetch();
        return $inner_html;
    }