private function handleAJAX_contactDetails($request_data)
 {
     $id = $request_data['contact_id'];
     $contact = UserContact::getUserContact($id);
     if (!empty($contact) && is_object($contact)) {
         $html = null;
         $name = $contact->get_contact_name();
         $email = $contact->get_contact_email();
         $contact_extra = unserialize($contact->get_contact_extra());
         if (!empty($contact_extra['general'])) {
             if (!empty($contact_extra['general']['dob'])) {
                 $bday_info = date_parse($contact_extra['general']['dob']);
                 $bday = date("F dS", mktime(0, 0, 0, $bday_info['month'], $bday_info['day'], 0));
                 $contact_extra['general']['dob'] = $bday;
             }
             $html .= "<h4 style=\"margin: 0px;\">" . __("General") . "</h4>";
             $li_contents = $this->buildHtmlList($contact_extra['general']);
             $html .= xHtml::ulistTag($li_contents, array("style" => "list-style-type: none; display: inline;"));
         }
         if (!empty($contact_extra['personal'])) {
             if (!empty($contact_extra['personal']['picture'])) {
                 $img_url = $this->normalizeImgUrl($contact_extra['personal']['picture']);
                 $img_url = PA::$url . '/resize_img.php?src=' . $img_url . '&height=98&width=98';
                 $contact_extra['personal']['picture'] = "<img src=\"{$img_url}\" alt=\"picture\" title=\"picture\" />";
             }
             $html .= "<h4 style=\"margin: 0px;\">" . __("Personal") . "</h4>";
             $li_contents = $this->buildHtmlList($contact_extra['personal']);
             $html .= xHtml::ulistTag($li_contents, array("style" => "list-style-type: none; display: inline;"));
         }
         if (!empty($contact_extra['professional'])) {
             $html .= "<h4 style=\"margin: 0px;\">" . __("Professional") . "</h4>";
             $li_contents = $this->buildHtmlList($contact_extra['professional']);
             $html .= xHtml::ulistTag($li_contents, array("style" => "list-style-type: none; display: inline;"));
         }
         if (!empty($contact_extra['extra'])) {
             if (!empty($contact_extra['extra']['business_photo'])) {
                 $img_url = $this->normalizeImgUrl($contact_extra['extra']['business_photo']);
                 $img_url = PA::$url . '/resize_img.php?src=' . $img_url . '&height=98&width=98';
                 $contact_extra['extra']['business_photo'] = "<img src=\"{$img_url}\" alt=\"picture\" title=\"picture\" />";
             }
             $html .= "<h4 style=\"margin: 0px;\">" . __("Other") . "</h4>";
             $li_contents = $this->buildHtmlList($contact_extra['extra']);
             $html .= xHtml::ulistTag($li_contents, array("style" => "list-style-type: none; display: inline;"));
         }
         echo $html;
     } else {
         echo __("No details.");
     }
     exit;
 }
} else {
    ?>
        <input type="text" class="text short" name="form_data[category]" id="form_data_category" value="" />
      <?php 
}
?>
      </div>
    </div>

    <div class="field">
      <h4><span class="required"> * </span><label for="form_data_rating"><?php 
echo __("Rating Points");
?>
</label></h4>
      <?php 
echo xHtml::selectTag(array_combine(array_values($rating_points), array_values($rating_points)), array('name' => 'form_data[rating]', 'id' => 'form_data_rating'), !empty($item['rating']) ? $item['rating'] : null);
?>
    </div>

    <div class="field">
      <h4><label for="form_data_place"><?php 
echo __("Place");
?>
</label></h4>
      <input type="text" name="form_data[place]" id="form_data_place" value="<?php 
echo !empty($item['place']) ? $item['place'] : null;
?>
" class="text short" maxlength="45" />
    </div>

    <div class="field_big">
 /** !!
  * Sets up the html for the entire page. It starts by creating an array of all
  * modules that are present on the page and updates the array with the data for
  * the modules including name, type and placement.  It then reviews settings for
  * the page based on page name and id. It then checks for administrator
  * permission.  Finally it gets server data and calls { @link set_inner_template() }
  * and { @link generate_inner_html() } to create the page.
  * @param string $request_method if this is GET, get server information and
  *		initialize the page
  * @param array $request_data contains information on what to display on the page
  */
 function initializeModule($request_method, $request_data)
 {
     global $error_msg, $settings_new;
     $this->id = !empty($request_data['id']) ? $request_data['id'] : 0;
     $this->module = !empty($request_data['module']) ? $request_data['module'] : null;
     $mod_info = new ModulesInfo(array(PA::$core_dir . DIRECTORY_SEPARATOR . PA::$blockmodule_path, PA::$project_dir . DIRECTORY_SEPARATOR . PA::$blockmodule_path));
     $condition = ModulesInfo::USER_MODULES_FILTER . " || " . ModulesInfo::GROUP_MODULES_FILTER . " || " . ModulesInfo::NETWORK_MODULES_FILTER;
     $modules = $mod_info->getModulesByCondition($condition);
     $module_info = null;
     $mod_selected = null;
     $mod_select_options = array();
     $mod_select_options[" "] = " ";
     foreach ($modules as $module) {
         $mod_select_options[$module['name']] = $module['name'];
         if (@$request_data['module'] == $module['name']) {
             $mod_selected = $module['name'];
             $module_info['name'] = $module['name'];
             $module_info['module_type'] = $module['module_type'];
             $module_info['module_placement'] = $module['module_placement'];
             $module_info['status_points'] = 0;
             if (!empty($module['architecture_info']['has_init_module'])) {
                 $module_info['status_points'] += 33;
             }
             if (!empty($module['architecture_info']['has_action_handler'])) {
                 $module_info['status_points'] += 33;
             }
             if (!empty($module['architecture_info']['has_set_inner_tpl'])) {
                 $module_info['status_points'] += 33;
             }
         }
     }
     asort($mod_select_options);
     $mod_tag_attrs = array('name' => "form_data[module]", 'onchange' => "javascript: document.location='" . PA_ROUTE_CREATE_DYN_PAGE . "?action=edit&id={$this->id}&module='+this.value");
     $mod_select_tag = xHtml::selectTag($mod_select_options, $mod_tag_attrs, $mod_selected);
     $pages_default_setting = ModuleSetting::get_pages_default_setting('network');
     $selected = null;
     $current_selecion = null;
     $select_options = array();
     $select_options[" "] = "0";
     foreach ($pages_default_setting as $page_details) {
         $select_options[$page_details->page_name] = $page_details->page_id;
         if (@$request_data['id'] == $page_details->page_id) {
             $selected = $page_details->page_id;
             $current_selection = $page_details;
             $restore_settings = $page_details->getPageSettings();
         }
     }
     $tag_attrs = array('name' => "form_data[page_id]", 'onchange' => "javascript: document.location='" . PA_ROUTE_CREATE_DYN_PAGE . "?action=edit&module={$this->module}&id='+this.value");
     $select_tag = xHtml::selectTag($select_options, $tag_attrs, $selected);
     $this->outer_template = 'outer_public_center_module.tpl';
     //    $this->shared_data['OVO_JE_DODANO'] = "Ovo je dodano unutar modula!";
     $task_obj = Tasks::get_instance();
     $tasks = $task_obj->get_tasks();
     $permiss = array();
     $permiss[] = 'configure_system';
     // NOTE: system administrator permissions!!
     foreach ($tasks as $task) {
         $permiss[] = $task->task_value;
     }
     $this->adm_permissions = implode(', ', $permiss);
     if ($request_method == 'GET') {
         if (!empty($request_data['action']) && !empty($request_data['id']) && $request_data['action'] == 'edit') {
             $this->page = new DynamicPage((int) $request_data['id'], $settings_new);
             if (!empty($request_data['add'])) {
                 $this->page->addModule($request_data['add'], $this->module);
             }
             $this->page->initialize();
         }
     }
     $this->set_inner_template('center_inner_public.tpl');
     // initial template
     $this->inner_HTML = $this->generate_inner_html(array('page_id' => $this->page_id, 'page' => $this->page, 'select_tag' => $select_tag, 'type' => 'theme', 'base_url' => PA_ROUTE_CREATE_DYN_PAGE, 'mod_select_tag' => $mod_select_tag, 'module_info' => $module_info, 'adm_permissions' => $this->adm_permissions));
 }
                       } else {
                           $msg = __('We haven\'t found any contacts on your Plaxo account.');
                       }
                   } else {
                       $hasErrors = true;
                       $msg = $plx1->getLastError();
                   }
               }
           } else {
               $hasErrors = true;
               $msg = __('Username and/or password field can\'t be empty!');
           }
           break;
       default:
   }
   $tags = new xHtml();
   $js_submit = '
                  modal_hide();
                  document.forms[\'plaxo_invite_form\'].submit();
                  return false;
               ';
   $js_set_reset_all_chkbx = <<<EOT
 <script type="text/javascript" language="javascript">
   function select_all_chkbx() {
       \$("input[@id^='contact[']").each(function() {
           this.checked = "checked";
       });
   }
   function reset_all_chkbx() {
       \$("input[@id^='contact[']").each(function() {
           this.checked = "";
Exemplo n.º 5
0
 private function closeForm()
 {
     if (!$this->closed) {
         //          $this->xform .= xHtml::htmlTag( 'fieldset', null, false);
         $this->xform .= xHtml::htmlTag('form', null, false);
         $this->closed = true;
     }
 }
 /** !!
  * Gather all modules and their current status (active/inactive and where).
  * Also check to see if { @link restore_module_settings } is true in which
  * case return to the past settings by setting values to null. Once all the
  * data for the different objects to be displayed on the page has been
  * gathered pass the information into { @link generate_inner_html() }.
  * @param array $request_data contains the different selected Modules
  */
 private function setupCustomizeModuleSettings($request_data)
 {
     $page_templates = $this->page_templates;
     $this->template_selected = !empty($request_data['page_template']) ? $request_data['page_template'] : null;
     $this->side_selected = !empty($request_data['side_module']) ? $request_data['side_module'] : null;
     $this->middle_selected = !empty($request_data['middle_module']) ? $request_data['middle_module'] : null;
     $module_settings = ModuleSetting::load_setting($this->pid, $this->assoc_id, $this->settings_type);
     // @todo: Should we enable restore defaults from XML for user and group pages ?
     $from_XML = $this->settings_type == 'network' ? true : false;
     $pages_default_setting = ModuleSetting::get_pages_default_setting($this->settings_type, true, $from_XML);
     $selected = null;
     $current_selecion = null;
     $select_options = array();
     if ($this->settings_type == 'user') {
         $user_configurable_pages = array(PAGE_USER_PRIVATE, PAGE_USER_PUBLIC);
         foreach ($pages_default_setting as $page_details) {
             if (in_array($page_details->page_id, $user_configurable_pages)) {
                 $select_options[$page_details->page_name] = $page_details->page_id;
                 if ($this->pid == $page_details->page_id) {
                     $selected = $page_details->page_id;
                     $current_selection = $page_details;
                     $restore_settings = $page_details->getPageSettings();
                 }
             }
         }
     } else {
         foreach ($pages_default_setting as $page_details) {
             $select_options[$page_details->page_name] = $page_details->page_id;
             if ($this->pid == $page_details->page_id) {
                 $selected = $page_details->page_id;
                 $current_selection = $page_details;
                 $restore_settings = $page_details->getPageSettings();
             }
         }
     }
     if ($this->restore_module_settings) {
         $module_settings = $restore_settings;
         $this->template_selected = null;
         $this->side_selected = null;
         $this->middle_selected = null;
     }
     $tag_attrs = array('name' => "form_data[page_id]", 'onchange' => "javascript: document.location='" . $this->url . "&pid='+this.value");
     $select_tag = xHtml::selectTag($select_options, $tag_attrs, $selected);
     if (empty($module_settings['left'])) {
         $module_settings['left'] = array();
     }
     if (empty($module_settings['middle'])) {
         $module_settings['middle'] = array();
     }
     if (empty($module_settings['right'])) {
         $module_settings['right'] = array();
     }
     if ($this->template_selected) {
         $selected_template = $this->template_selected;
     } else {
         $page_tmpl = trim($module_settings['page_template']);
         $available_templates = array_flip($this->page_templates);
         if (array_key_exists($page_tmpl, $available_templates)) {
             $selected_template = $available_templates[$page_tmpl];
         }
     }
     $template_tag_attrs = array('name' => "form_data[page_template]", 'onchange' => "javascript: document.location='" . $this->url . "&pid={$this->pid}&page_template='+this.value");
     $template_select_tag = xHtml::selectTag(array_flip($page_templates), $template_tag_attrs, $selected_template);
     $mod_info = new CNModulesInfo(array(PA::$project_dir . DIRECTORY_SEPARATOR . PA::$blockmodule_path, PA::$core_dir . DIRECTORY_SEPARATOR . PA::$blockmodule_path));
     $side_modules = $mod_info->getModulesByCondition($this->side_modules_condition);
     $middle_modules = $mod_info->getModulesByCondition($this->middle_modules_condition);
     $side_selected = null;
     $side_current_selecion = null;
     $side_select_options = array();
     foreach ($side_modules as $s_module) {
         $side_select_options[$s_module['name']] = $s_module['name'];
         if ($this->side_selected == $s_module['name']) {
             $side_selected = $s_module['name'];
         }
     }
     $side_select_options[" "] = " ";
     ksort($side_select_options);
     $side_tag_attrs = array('name' => "add_side_module", 'onchange' => "javascript: document.location='" . $this->url . "&pid={$this->pid}&page_template={$this->template_selected}&side_module='+this.value");
     $side_select_tag = xHtml::selectTag($side_select_options, $side_tag_attrs, $side_selected);
     $middle_selected = null;
     $middle_current_selecion = null;
     $middle_select_options = array();
     foreach ($middle_modules as $s_module) {
         $middle_select_options[$s_module['name']] = $s_module['name'];
         if ($this->middle_selected == $s_module['name']) {
             $middle_selected = $s_module['name'];
         }
     }
     $middle_select_options[" "] = " ";
     ksort($middle_select_options);
     $middle_tag_attrs = array('name' => "add_middle_module", 'onchange' => "javascript: document.location='" . $this->url . "&pid={$this->pid}&page_template={$this->template_selected}&middle_module='+this.value");
     $middle_select_tag = xHtml::selectTag($middle_select_options, $middle_tag_attrs, $middle_selected);
     if (!is_null($this->middle_selected)) {
         array_push($module_settings['middle'], $this->middle_selected);
     }
     if (!is_null($this->side_selected)) {
         array_push($module_settings['left'], $this->side_selected);
     }
     $side_dissabled = 'none';
     switch ($selected_template) {
         case 'one':
             unset($module_settings['left']);
             unset($module_settings['right']);
             $side_dissabled = 'both';
             $show_columns = array('middle');
             break;
         case 'two':
         case 'two_l':
         case 'two_r':
             /*
                     $all_modules = array_merge($module_settings['left'], $module_settings['right']);
                     unset($module_settings['right']);
                     $module_settings['left'] = $all_modules;
                     $side_dissabled = 'right';
                     $show_columns = array('left', 'middle');
             */
             $show_columns = array('left', 'middle', 'right');
             break;
         case 'three':
             $show_columns = array('left', 'middle', 'right');
             break;
     }
     $this->set_inner_template('cnmodule_selector.php');
     $this->inner_HTML = $this->generate_inner_html(array('page_id' => $this->pid, 'page_url' => $this->url, 'base_url' => $this->base_url, 'uid' => $this->uid, 'gid' => $this->gid, 'module_settings' => $module_settings, 'pages_default_setting' => $pages_default_setting, 'type' => 'module', 'settings_type' => $this->settings_type, 'select_tag' => $select_tag, 'template_select_tag' => $template_select_tag, 'side_select_tag' => $side_select_tag, 'middle_select_tag' => $middle_select_tag, 'current_selection' => $current_selection, 'side_dissabled' => $side_dissabled, 'show_columns' => $show_columns));
 }
 /** !!
  * Sets up module appropriate based on the inputs
  * @param array $request_method displays module if this is GET
  * @param array $request_data contains the data for setting up the module
  * @return string returns 'skip' is $request_method is neither GET nor POST
  */
 function initializeModule($request_method, $request_data)
 {
     $this->manage_mode = isset($request_data['mmode']) ? $request_data['mmode'] : 0;
     $this->config_sect = isset($request_data['sect']) ? $request_data['sect'] : 0;
     $this->mode_tag = xHtml::selectTag(array('normal' => '0', 'expert' => '1'), array('id' => 'mmode', 'name' => 'mmode'), $this->manage_mode);
     $this->sect_tag = xHtml::selectTag(array_flip($this->sections), array('id' => 'sect', 'name' => 'sect'), $this->config_sect);
     switch ($request_method) {
         case 'GET':
             $form = $this->getConfigSection($this->config_sect, $this->manage_mode);
             $this->set_inner_template('show_config_section.tpl.php');
             $this->inner_HTML = $this->generate_inner_html(array('data' => $form, 'mode_tag' => $this->mode_tag, 'sect_tag' => $this->sect_tag, 'message' => null));
             break;
         case 'POST':
             break;
         default:
             return "skip";
     }
 }