function generate_inner_html()
 {
     $user_id = PA::$login_uid;
     if (!empty($this->mode)) {
         $this->type = $this->mode;
         $user_id = !empty($this->user_id) ? $this->user_id : PA::$login_uid;
     }
     switch ($this->type) {
         case 'Videos':
             $gid = NULL;
             if (!empty($_GET['gid'])) {
                 $gid = $_GET['gid'];
             }
             if (empty($this->mode)) {
                 $TekMedia = new TekMedia();
                 $form_key = $TekMedia->generate_form($gid);
             }
             $alb_type = VIDEO_ALBUM;
             break;
         case 'Audios':
             $alb_type = AUDIO_ALBUM;
             break;
         default:
             // default to the image album if no type given
         // default to the image album if no type given
         case 'Images':
             $alb_type = IMAGE_ALBUM;
             break;
         case 'YouTube':
             $gid = NULL;
             if (!empty($_GET['gid'])) {
                 $gid = $_GET['gid'];
             }
             if (empty($this->mode)) {
                 $TekMedia = new TekMedia();
                 $form_key = $TekMedia->generate_form($gid);
             }
             $alb_type = VIDEO_ALBUM;
             break;
     }
     $all_albums = Album::load_all($user_id, $alb_type);
     $default_name = PA::$config->default_album_titles[$alb_type];
     /* setting all the album for this page */
     /* Retrive the All album of user */
     $album = array();
     $j = 0;
     if (!empty($all_albums)) {
         foreach ($all_albums as $alb) {
             $album[$j]['id'] = $alb['collection_id'];
             $album[$j]['name'] = $alb['description'];
             $j++;
         }
         $this->default_album_id = $album[0]['id'];
         $this->default_album_name = $album[0]['name'];
     }
     $this->my_all_album = $album;
     if ($this->mode == 'Videos') {
         if (@$this->view == 'remote') {
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/ajax_form_video_upload.tpl';
         } else {
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/form_video_upload.tpl';
         }
         $this->outer_template = 'empty_outer.tpl';
     } else {
         $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     if (@$this->view == 'ajax') {
         switch ($this->mode) {
             case 'YouTube':
                 $t = 'youtube';
                 break;
             case 'Videos':
                 $t = 'video';
                 break;
             case 'Images':
                 $t = 'image';
                 break;
             case 'Audios':
                 $t = 'audio';
                 break;
         }
         if (!empty($t)) {
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/ajax_' . $t . '.tpl.php';
         }
         $this->outer_template = 'empty_outer.tpl';
     }
     $inner_html_gen = new Template($tmp_file);
     $inner_html_gen->set('my_all_album', $this->my_all_album);
     $inner_html_gen->set('default_name', $default_name);
     $inner_html_gen->set('back', @$_SERVER['HTTP_REFERER']);
     $inner_html_gen->set('media_type', $this->type);
     if (!empty($form_key)) {
         $inner_html_gen->set('form_key', $form_key);
     }
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
<?php

/** !
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* [filename] is a part of PeopleAggregator.
* [description including history]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* @author [creator, or "Original Author"]
* @license http://bit.ly/aVWqRV PayAsYouGo License
* @copyright Copyright (c) 2010 Broadband Mechanics
* @package PeopleAggregator
*/
?>
<div id="image_gallery_upload" class="">
<?php 
$TekMedia = new TekMedia();
$form_key = $TekMedia->generate_form_key(@$gid);
$redirection_path = PA::$url . "/ajax/save_tekmedia.php";
// $use_tek_form = true;
if (@$use_tek_form) {
    $iframe_src = "http://www.glued.in/Integration/index.php?form_key={$form_key}";
} else {
    $form_url = PA::$url . "/ajax/upload_video_form.php";
    // need this to live on a public access server!
    if (!empty($_REQUEST['gid'])) {
        $form_url .= "?gid=" . $_REQUEST['gid'];
    }
    $iframe_src = PA::$tekmedia_iframe_form_path . "?form_key={$form_key}&get_form={$form_url}";
}
$iframe_src .= "&redirection_path={$redirection_path}&redirection_target=self";
?>