function indexAction() { $img_id = $_SESSION['imag_id']; $imgAccount = ImgAccountUtil::getImgAccountById($img_id, TRUE); $v_params['sys_name'] = SysPropertiesUtil::getPropertyValue("sys_name"); $v_params['sys_slog'] = SysPropertiesUtil::getPropertyValue("sys_slog"); if (NULL != $imgAccount) { $v_params['logined'] = LoginChecker::isLogined(); $v_params['in_card_count'] = CardCounter::countGDSinCard(); if ($v_params['logined'] == $img_id) { $v_params['mysc']['main'] = TRUE; } $v_params['show_addr'] = $imgAccount['show_address']; $imgAddress = ImgAddressUtil::getImgAddressById($imgAccount['img_address_id']); $v_params['addr'] = AddressUtil::makeAddressString($imgAddress); $v_params['show_phone'] = $imgAccount['show_phone']; $v_params['phone'] = $imgAccount['img_phone']; $v_params['show_skype'] = $imgAccount['show_skype']; $v_params['skype'] = $imgAccount['img_skype']; $v_params['show_icq'] = $imgAccount['show_icq']; $v_params['icq'] = $imgAccount['img_icq']; $v_params['img_name'] = $imgAccount['img_name']; $v_params['img_slog'] = $imgAccount['img_slog']; $v_params['img_all_gds_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR; $v_params['img_gds_cats_HTML'] = ImgGdsCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . IMAG_DIR . "?" . PROD_CAT_PARAM_NAME . "="); $v_params['img_gds_breadcrump_HTML'] = ImgGdsCatUtil::createBreadcrumpHTML($imgAccount['id'], $_REQUEST[PROD_CAT_PARAM_NAME]); $v_params['img_all_blog_cats_href'] = "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR; $v_params['img_blog_cats_HTML'] = ImgBlogCatUtil::createTreeHTML($imgAccount['id'], "/" . IMAG_PREFIX . $img_id . "/" . BLOG_DIR . "?" . ART_CAT_PARAM_NAME . "="); $count_img_gdss = ImgGdsUtil::countImgGdssByAccountId($imgAccount['id'], $_REQUEST[PROD_CAT_PARAM_NAME]); for ($i = 0; $i < $count_img_gdss / GDS_ON_PAGE; $i++) { $item['value'] = $i + 1; $item['current'] = $i == $_REQUEST[PAGE_PARAM_NAME]; if ($_REQUEST[PROD_CAT_PARAM_NAME]) { $item['url'] = "/" . IMAG_PREFIX . $img_id . "/?" . PROD_CAT_PARAM_NAME . "=" . $_REQUEST[PROD_CAT_PARAM_NAME] . "&" . PAGE_PARAM_NAME . "=" . $i; } else { $item['url'] = "/" . IMAG_PREFIX . $img_id . "/?" . PAGE_PARAM_NAME . "=" . $i; } $v_params['paginator'][] = $item; } $v_params['img_gdss'] = ImgGdsUtil::getImgGdssByAccountId($imgAccount['id'], $_REQUEST[PROD_CAT_PARAM_NAME], GDS_ON_PAGE * $_REQUEST[PAGE_PARAM_NAME], GDS_ON_PAGE); $v_params['img_gdss_new'] = ImgGdsUtil::getNewImgGdssByAccountId($imgAccount['id'], $_REQUEST[PROD_CAT_PARAM_NAME], GDS_ADDITIONAN_ON_PAGE); $v_params['img_gdss_recom'] = ImgGdsUtil::getRecommendedImgGdssByAccountId($imgAccount['id'], $_REQUEST[PROD_CAT_PARAM_NAME], GDS_ADDITIONAN_ON_PAGE); $v_params['img_gds_link'] = "/" . IMAG_PREFIX . $img_id . "/" . PRODUCT_DIR . "?" . PRODUCT_PARAM_NAME . "="; Application::fastView('imags/img_main', $v_params); } else { Application::fastView('main/sys_error', $v_params); } }
/** * Renders the detail page for the given venue * @param bean DetailPageModel */ private function renderDetail($model) { global $logger; $logger->debug(get_class($this) . '::detail()'); $venue = $model->getDetail(); $events = $venue->getEvents(); $options = $model->getOptions(); $tmpl = $this->createPatTemplate(); $tmpl->readTemplatesFromInput('venue_detail.pat.tpl'); $tmpl->addGlobalVar('scope', 'Venue'); // Render the primary form fields $tmpl->addVars('venue_form', BeanUtil::beanToArray($venue, true)); // scalars only // Renders the editor field $dconf = $this->getEditorConfig(Editor::MEDIUM, 'description', $venue->getDescription()); $tmpl->addVar('venue_form', 'description_editor', $this->setEditor($dconf)); // PubState Select foreach ($options['pubState'] as $ps) { $tmpl->addVar('pubState_options', 'value', $ps->value); $logger->debug("current: " . $ps->value . " | selected " . $venue->getPubState()); if ($ps->value == $venue->getPubState()) { $tmpl->addVar('pubState_options', 'selected', 'selected'); } else { $tmpl->addVar('pubState_options', 'selected', ''); } $tmpl->parseTemplate('pubState_options', 'a'); } /// Address Elements $addr = $venue->getAddress(); $tmpl->addVar('address', 'oid', $addr->getOid()); $tmpl->addVar('address', 'street', $addr->getStreet()); $tmpl->addVar('address', 'unit', $addr->getUnit()); $tmpl->addVar('address', 'city', $addr->getCity()); $tmpl->addVar('address', 'state', $addr->getState()); $tmpl->addVar('address', 'postalCode', $addr->getPostalCode()); $tmpl->addVar('address', 'phone', $addr->getPhone()); // State Select $selectedState = DEFAULT_POSTAL_STATE_KEY; if ($venue->getAddress() != null && $venue->getAddress()->getState() != null) { $selectedState = $venue->getAddress()->getState(); } $logger->debug("Selected state: " . $selectedState); foreach (AddressUtil::getUsStates() as $key => $value) { $tmpl->addVar('state_options', 'code', $key); $tmpl->addVar('state_options', 'name', $value); if ($key == $selectedState) { $tmpl->addVar('state_options', 'selected', 'selected'); $logger->debug("Found matching state to select: " . $key); } else { $tmpl->addVar('state_options', 'selected', ''); } $tmpl->parseTemplate('state_options', 'a'); } $tmpl->displayParsedTemplate('venue_form'); // Render the Tabs $tabs = new mosTabs(1); //1 = use cookies to remember selected tab $tabs->startPane("links"); if ($venue->getOid() == null) { $tabs->startTab("Notice", "new-links"); echo "<br/><br/>To assign events, first save this new venue.<br/><br/>"; $tabs->endTab(); } else { $tabs->startTab("Exhibitions", "exbt-links"); foreach ($options['exhibition'] as $exbt) { $tmpl->addVar('exhibition_options', 'oid', $exbt->getOid()); $tmpl->addVar('exhibition_options', 'title', $exbt->getTitle()); if (isset($events) && $this->bean_in_array($exbt, $events)) { $tmpl->addVar('exhibition_options', 'selected', 'selected'); } else { $tmpl->addVar('exhibition_options', 'selected', ''); } $tmpl->parseTemplate('exhibition_options', 'a'); } $tmpl->displayParsedTemplate('exbtTab'); $tabs->endTab(); $tabs->startTab("Programs", "prgm-links"); foreach ($options['program'] as $prgm) { $tmpl->addVar('program_options', 'oid', $prgm->getOid()); $tmpl->addVar('program_options', 'title', $prgm->getTitle()); if (isset($events) && $this->bean_in_array($prgm, $events)) { $tmpl->addVar('program_options', 'selected', 'selected'); } else { $tmpl->addVar('program_options', 'selected', ''); } $tmpl->parseTemplate('program_options', 'a'); } $tmpl->displayParsedTemplate('prgmTab'); $tabs->endTab(); $tabs->startTab("Courses", "crse-links"); foreach ($options['course'] as $crse) { $tmpl->addVar('course_options', 'oid', $crse->getOid()); $tmpl->addVar('course_options', 'title', $crse->getTitle()); if (isset($events) && $this->bean_in_array($crse, $events)) { $tmpl->addVar('course_options', 'selected', 'selected'); } else { $tmpl->addVar('course_options', 'selected', ''); } $tmpl->parseTemplate('course_options', 'a'); } $tmpl->displayParsedTemplate('crseTab'); $tabs->endTab(); /* $tabs->startTab("Gallery","glry-links"); foreach ($options['gallery'] as $glry) { $tmpl->addVar('gallery_options','gid',$glry['id']); $tmpl->addVar('gallery_options','name',$glry['name']); if ( $glry['id'] == $venue->getGallery() ) { $tmpl->addVar('gallery_options','selected','selected'); } else { $tmpl->addVar('gallery_options','selected',''); } $tmpl->parseTemplate('gallery_options','a'); } $tmpl->displayParsedTemplate('glryTab'); $tabs->endTab(); */ } $tmpl->displayParsedTemplate('close_form'); }