/** * Draws side block with categories links * @param $draw **/ public static function DrawSideBlock($draw = true) { global $objLogin; $listings_count_field = !$objLogin->IsLoggedIn() ? 'listings_count_public' : 'listings_count'; $lang = Application::Get('lang'); ob_start(); $sql = 'SELECT ' . TABLE_CATEGORIES . '.id, ' . TABLE_CATEGORIES . '.icon, ' . TABLE_CATEGORIES . '.listings_count, ' . TABLE_CATEGORIES . '.listings_count_public, ' . TABLE_CATEGORIES . '.priority_order, ' . TABLE_CATEGORIES_DESCRIPTION . '.language_id, ' . TABLE_CATEGORIES_DESCRIPTION . '.name, ' . TABLE_CATEGORIES_DESCRIPTION . '.description FROM ' . TABLE_CATEGORIES . ' LEFT OUTER JOIN ' . TABLE_CATEGORIES_DESCRIPTION . ' ON ' . TABLE_CATEGORIES . '.id = ' . TABLE_CATEGORIES_DESCRIPTION . '.category_id WHERE ' . TABLE_CATEGORIES . '.parent_id = _CID_ AND ' . TABLE_CATEGORIES_DESCRIPTION . '.language_id = \'' . $lang . '\' ORDER BY ' . TABLE_CATEGORIES . '.priority_order ASC'; $sql_1 = str_replace('_CID_', '0', $sql); $result = database_query($sql_1, DATA_AND_ROWS, ALL_ROWS, FETCH_ASSOC); draw_block_top(_CATEGORIES); ## +---------------------------------------------------------------------------+ ## | 1. Creating & Calling: | ## +---------------------------------------------------------------------------+ ## *** define a relative (virtual) path to treemenu.class.php file define('TREEMENU_DIR', 'modules/treemenu/'); /* Ex.: 'treemenu/' */ ## *** include TreeMenu class require_once TREEMENU_DIR . 'treemenu.class.php'; ## *** create TreeMenu object $treeMenu = new TreeMenu(); $treeMenu->SetDirection(Application::Get('lang_dir')); ## +---------------------------------------------------------------------------+ ## | 2. General Settings: | ## +---------------------------------------------------------------------------+ ## *** set unique numeric (integer-valued) identifier for TreeMenu ## *** (if you want to use several independently configured TreeMenu objects on single page) $treeMenu->SetId(1); ## *** set style for TreeMenu $treeMenu->SetStyle('vista'); ## *** set TreeMenu caption //$treeMenu->SetCaption('ApPHP TreeMenu v'.$treeMenu->Version()); ## *** show debug info - false|true $treeMenu->Debug(false); ## *** specifies whether to show node(folder) icons $treeMenu->UseDefaultFolderIcons(false); ## *** set postback method: 'get', 'post' or 'ajax' $treeMenu->SetPostBackMethod('post'); ## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.) /// $treeMenu->SetHttpVars(array('id')); ## *** show number of subnodes to the left of every node - false|true $treeMenu->ShowNumSubNodes(false); ## +---------------------------------------------------------------------------+ ## | 3. Adding nodes: | ## +---------------------------------------------------------------------------+ ## *** add nodes ## arguments: ## arg #1 - node's caption ## arg #2 - file associated with this node (optional) ## arg #3 - icon associated with this node (optional) ## Example: $treeMenu->AddNode('Title', 'text.txt', 'icon.gif'); $node = array(); for ($i = 0; $i < $result[1]; $i++) { $node = $treeMenu->AddNode($result[0][$i]['name'] . ' (' . $result[0][$i][$listings_count_field] . ')', prepare_link('category', 'cid', $result[0][$i]['id'], '', $result[0][$i]['name'], '', '', true)); $node->OpenNewWindow(true); $sql_2 = str_replace('_CID_', $result[0][$i]['id'], $sql); $result_2 = database_query($sql_2, DATA_AND_ROWS, ALL_ROWS, FETCH_ASSOC); for ($j = 0; $j < $result_2[1]; $j++) { $sub_node = $node->AddNode($result_2[0][$j]['name'] . ' (' . $result_2[0][$j][$listings_count_field] . ')', prepare_link('category', 'cid', $result_2[0][$j]['id'], '', $result_2[0][$j]['name'], '', '', true)); $sub_node->OpenNewWindow(true); $sql_3 = str_replace('_CID_', $result_2[0][$j]['id'], $sql); $result_3 = database_query($sql_3, DATA_AND_ROWS, ALL_ROWS, FETCH_ASSOC); for ($k = 0; $k < $result_3[1]; $k++) { $sub_sub_node = $sub_node->AddNode($result_3[0][$k]['name'] . ' (' . $result_3[0][$k][$listings_count_field] . ')', prepare_link('category', 'cid', $result_3[0][$k]['id'], '', $result_3[0][$k]['name'], '', '', true)); $sub_sub_node->OpenNewWindow(true); } } } ## +---------------------------------------------------------------------------+ ## | 5. Draw TreeMenu: | ## +---------------------------------------------------------------------------+ $treeMenu->ShowTree(); echo '<ul><li>' . prepare_link('categories', '', '', 'all', _SEE_ALL . ' »', 'main_menu_link main_menu_last', _SEE_ALL) . '</li></ul>'; draw_block_bottom(); // save the contents of output buffer to the string $output = ob_get_contents(); ob_end_clean(); if ($draw) { echo $output; } else { return $output; } }
/** * Draws the login links and logout form */ public function DrawLoginLinks() { if (Application::Get('preview') == 'yes') { return ''; } $menu_index = '0'; $text_align = Application::Get('lang_dir') == 'ltr' ? 'text-align:left;' : 'text-align:right;padding-right:15px;'; // --------------------------------------------------------------------- // MAIN ADMIN LINKS if ($this->IsLoggedInAsAdmin()) { draw_block_top(_MENUS . ': [ <a id="lnk_all_open" href="javascript:void(0);" onclick="javascript:toggle_menus(1)">' . _OPEN . '</a> | <a id="lnk_all_close" href="javascript:void(0);" onclick="javascript:toggle_menus(0)">' . _CLOSE . '</a> ]'); draw_block_bottom(); draw_block_top(_GENERAL, $menu_index++, 'maximized'); echo '<ul>'; echo '<li>' . $this->PrepareLink('home', _HOME) . '</li>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('settings', _SETTINGS) . '</li>'; } echo '<li>' . $this->PrepareLink('ban_list', _BAN_LIST) . '</li>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('countries_management', _COUNTRIES) . '</li>'; } echo '<li>' . prepare_permanent_link('index.php?preview=yes', _PREVIEW . ' <img src="images/external_link.gif" alt="" />') . '</li>'; echo '</ul>'; draw_block_bottom(); draw_block_top(_ACCOUNTS_MANAGEMENT, $menu_index++); echo '<div class="menu_category">'; echo '<ul>'; echo '<li>' . $this->PrepareLink('my_account', _MY_ACCOUNT) . '</li>'; if (Modules::IsModuleInstalled('customers') && $this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('statistics', _STATISTICS) . '</li>'; } if ($this->IsLoggedInAs('owner')) { echo '<li>' . $this->PrepareLink('roles_management', _ROLES_AND_PRIVILEGES, '', '', array('role_privileges_management')) . '</li>'; } echo '</ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _ADMINS_MANAGEMENT . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('admins_management', _ADMINS) . '</li>'; echo '</ul>'; } if (Modules::IsModuleInstalled('customers') && $this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _CUSTOMERS_MANAGEMENT . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_customers_groups', _CUSTOMER_GROUPS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_customers_management', _CUSTOMERS) . '</li>'; echo '</ul>'; } echo '</div>'; draw_block_bottom(); if ($this->IsLoggedInAs('owner', 'mainadmin')) { draw_block_top(_LISTINGS_MANAGEMENT, $menu_index++); echo '<div class="menu_category">'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _SETTINGS . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_listings_settings', _LISTINGS_SETTINGS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_listings_locations', _LOCATIONS, '', '', array('mod_listings_sub_locations')) . '</li>'; if (Modules::IsModuleInstalled('inquiries')) { echo '<li>' . $this->PrepareLink('mod_listings_integration', _INTEGRATION) . '</li>'; } echo '</ul>'; } echo '<label>' . _LISTINGS . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_categories', _CATEGORIES) . '</li>'; echo '<li>' . $this->PrepareLink('mod_listings_management', _LISTINGS, '', '', array('mod_listings_categories')) . '</li>'; echo '</ul>'; echo '</div>'; draw_block_bottom(); } if (Modules::IsModuleInstalled('payments')) { draw_block_top(_PAYMENTS, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('mod_payments_currencies', _CURRENCIES) . '</li>'; echo '<li>' . $this->PrepareLink('mod_payments_advertise_plans', _ADVERTISE_PLANS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_payments_orders', _ORDERS) . '</li>'; } echo '<li>' . $this->PrepareLink('mod_payments_statistics', _STATISTICS) . '</li>'; echo '</ul>'; draw_block_bottom(); } if ($this->HasPrivileges('add_menus') || $this->HasPrivileges('edit_menus') || $this->HasPrivileges('add_pages') || $this->HasPrivileges('edit_pages')) { draw_block_top(_MENUS_AND_PAGES, $menu_index++); echo '<div class="menu_category">'; if ($this->HasPrivileges('add_menus') || $this->HasPrivileges('edit_menus')) { echo '<label>' . _MENU_MANAGEMENT . '</label>'; echo '<ul>'; if ($this->HasPrivileges('add_menus')) { echo '<li>' . $this->PrepareLink('menus_add', _ADD_NEW_MENU) . '</li>'; } echo '<li>' . $this->PrepareLink('menus', _EDIT_MENUS, '', '', array('menus_edit')) . '</li>'; echo '</ul>'; } if ($this->HasPrivileges('add_pages') || $this->HasPrivileges('edit_pages')) { echo '<label>' . _PAGE_MANAGEMENT . '</label>'; echo '<ul>'; if ($this->HasPrivileges('add_pages')) { echo '<li>' . $this->PrepareLink('pages_add', _PAGE_ADD_NEW) . '</li>'; } if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages_edit', _PAGE_EDIT_HOME, 'type=home') . '</li>'; } echo '<li>' . $this->PrepareLink('pages', _PAGE_EDIT_PAGES, 'type=general') . '</li>'; if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages', _PAGE_EDIT_SYS_PAGES, 'type=system') . '</li>'; } if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages_trash', _TRASH) . '</li>'; } echo '</ul>'; } echo '</div>'; draw_block_bottom(); } draw_block_top(_LANGUAGES_SETTINGS, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('languages', _LANGUAGES, '', '', array('languages_add', 'languages_edit')) . '</li>'; } echo '<li>' . $this->PrepareLink('vocabulary', _VOCABULARY, 'filter_by=A') . '</li>'; echo '</ul>'; draw_block_bottom(); if ($this->IsLoggedInAs('owner', 'mainadmin')) { draw_block_top(_MASS_MAIL_AND_TEMPLATES, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('email_templates', _EMAIL_TEMPLATES) . '</li>'; } if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('mass_mail', _MASS_MAIL) . '</li>'; } echo '</ul>'; draw_block_bottom(); } // MODULES $sql = 'SELECT * FROM ' . TABLE_MODULES . ' WHERE is_installed = 1 AND is_system = 0 ORDER BY priority_order ASC'; $modules = database_query($sql, DATA_AND_ROWS, ALL_ROWS); $modules_output = ''; for ($i = 0; $i < $modules[1]; $i++) { $output = ''; if ($modules[0][$i]['settings_access_by'] == '' || $modules[0][$i]['settings_access_by'] != '' && $this->IsLoggedInAs($modules[0][$i]['settings_access_by'])) { if ($modules[0][$i]['settings_const'] != '') { $output .= '<li>' . $this->PrepareLink($modules[0][$i]['settings_page'], constant($modules[0][$i]['settings_const'])) . '</li>'; } } if ($modules[0][$i]['management_access_by'] == '' || $modules[0][$i]['management_access_by'] != '' && $this->IsLoggedInAs($modules[0][$i]['management_access_by'])) { $management_pages = explode(',', $modules[0][$i]['management_page']); $management_consts = explode(',', $modules[0][$i]['management_const']); $management_pages_total = count($management_pages); for ($j = 0; $j < $management_pages_total; $j++) { if (isset($management_pages[$j]) && isset($management_consts[$j]) && $management_consts[$j] != '') { $output .= '<li>' . $this->PrepareLink($management_pages[$j], constant($management_consts[$j])) . '</li>'; } } } if ($output) { $modules_output .= '<label>' . constant($modules[0][$i]['name_const']) . '</label>'; $modules_output .= '<ul>' . $output . '</ul>'; } } if (!empty($modules_output)) { draw_block_top(_MODULES, $menu_index++); if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<ul>'; echo '<li>' . $this->PrepareLink('modules', _MODULES_MANAGEMENT) . '</li>'; echo '</ul>'; } echo '<div class="menu_category">' . $modules_output . '</div>'; draw_block_bottom(); } } // --------------------------------------------------------------------- // CUSTOMER LINKS if ($this->IsLoggedInAsCustomer()) { draw_block_top(_MY_ACCOUNT); echo '<ul>'; echo '<li>' . prepare_permanent_link('index.php?page=home', _HOME, '', Application::Get('page') == 'home' && Application::Get('customer') == '' ? 'active' : '') . '</li>'; echo '<li>' . $this->PrepareLink('home', _DASHBOARD) . '</li>'; echo '<li>' . $this->PrepareLink('my_account', _EDIT_MY_ACCOUNT) . '</li>'; echo '<li>' . $this->PrepareLink('my_listings', _MY_LISTINGS, '', '', array('listings_categories')) . '</li>'; if (Modules::IsModuleInstalled('payments') && ModulesSettings::Get('payments', 'is_active') == 'yes') { echo '<li>' . $this->PrepareLink('advertise', _ADVERTISE, '', '', array('advertise_prepayment', 'order_proccess')) . '</li>'; echo '<li>' . $this->PrepareLink('my_orders', _MY_ORDERS) . '</li>'; } if (Modules::IsModuleInstalled('inquiries')) { echo '<li>' . $this->PrepareLink('inquiries', _INQUIRIES) . '</li>'; } echo '</ul>'; draw_block_bottom(); } // Logout if ($this->IsLoggedIn()) { draw_block_top_empty(); echo '<form action="index.php" method="post"> ' . draw_hidden_field('submit_logout', 'logout', false) . ' ' . draw_token_field(false) . ' <input class="form_button" type="submit" name="btnLogout" value="' . _BUTTON_LOGOUT . '" /> </form>'; draw_block_bottom(); echo '<br />'; } $this->activeMenuCount = $menu_index; }
/** * Draws last inquiries side block * @param $draw */ public static function DrawLastInquiriesBlock($draw = false) { $output = draw_block_top(_INCOMING_JOBS, '', 'maximized', false); $max_inquiries = 10; $datetime_format = get_datetime_format(); $result = self::GetAllInquiries('', 'i.date_created DESC', $max_inquiries); if ($result[1] > 0) { $output .= '<ul class="incoming_jobs">'; for ($i = 0; $i < $result[1] && $i < $max_inquiries; $i++) { $output .= '<li>'; $output .= ($result[0][$i]['inquiry_type'] == '1' ? $result[0][$i]['business_name'] : $result[0][$i]['category_name']) . '<br>'; $output .= '<div class="location">' . $result[0][$i]['location_name'] . ' <div class="date_created">' . date($datetime_format, strtotime($result[0][$i]['date_created'])) . '</div></div>'; $output .= '</li>'; } $output .= '</ul>'; } else { $output .= _NO_INCOMMING_JOBS_YET; } $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }
/** * Draw directory statistics side block * @param $draw */ public static function DrawDirectoryStatistics($draw = true) { $where_condition = ' AND ((finish_publishing = \'0000-00-00 00:00:00\') OR (finish_publishing > \'' . date('Y-m-d H:i:s') . '\'))'; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_LISTINGS . ' WHERE is_published = 1' . $where_condition; $result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $listings_total = isset($result['cnt']) ? (int) $result['cnt'] : '0'; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_LISTINGS . ' WHERE is_published = 1 AND TIMESTAMPDIFF(HOUR, date_published, \'' . date('Y-m-d H:i:s') . '\') < 24'; $result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $listings_last_total = isset($result['cnt']) ? (int) $result['cnt'] : '0'; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_LISTINGS . ' WHERE is_published = 0'; $result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $listings_pending = isset($result['cnt']) ? (int) $result['cnt'] : '0'; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_CATEGORIES; $result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $categories_total = isset($result['cnt']) ? (int) $result['cnt'] : '0'; $output = draw_block_top(_DIRECTORY_STATISTICS, '', 'maximized', false); $output .= '<ul>'; $output .= '<li>' . _LISTINGS . ': ' . $listings_total . '</li>'; $output .= '<li>' . _PENDING . ': ' . $listings_pending . '</li>'; $output .= '<li>' . _NEW_SUBMISSION_IN_24H . ': ' . $listings_last_total . '</li>'; $output .= '<li>' . _CATEGORIES . ': ' . $categories_total . '</li>'; $output .= '</ul>'; $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }
/** * Draws menus * @param $menu_position * @param $draw */ public static function DrawMenu($menu_position = 'left', $draw = true) { global $objSettings, $objLogin; $output = ''; if ($menu_position == 'left') { $objLogin->DrawLoginLinks(); } // Get all menus which have items (links to pages) $menus = self::GetMenus($menu_position); $menus_count = $menus[1]; $objNews = News::Instance(); $show_news_block = ModulesSettings::Get('news', 'show_news_block'); $show_subscribe_block = ModulesSettings::Get('news', 'show_newsletter_subscribe_block'); if (Modules::IsModuleInstalled('news') && ($show_news_block == 'right side' || $show_subscribe_block == 'right side')) { $menus_count++; } $show_inquiries_block = ModulesSettings::Get('inquiries', 'show_inquiries_block'); if (Modules::IsModuleInstalled('inquiries') && $show_inquiries_block == 'right side') { $menus_count++; } if (ModulesSettings::Get('listings', 'show_categories_side_block') == $menu_position . ' side') { $output .= Categories::DrawSideBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_featured_block') == $menu_position . ' side') { $output .= Listings::DrawFeaturedBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_recent_block') == $menu_position . ' side') { $output .= Listings::DrawRecentBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_directory_statistics') == $menu_position . ' side') { $menus_count++; } if ($menus_count > 0) { $output .= '<div id="column-' . $menu_position . '-wrapper">'; } // Display all menu titles (names) according to their order for ($menu_ind = 0; $menu_ind < $menus[1]; $menu_ind++) { // Start draw new menu $output .= draw_block_top($menus[0][$menu_ind]['menu_name'], '', 'maximazed', false); $menu_links = self::GetMenuLinks($menus[0][$menu_ind]['id'], Application::Get('lang'), $menu_position); if ($menu_links[1] > 0) { $output .= '<ul>'; } for ($menu_link_ind = 0; $menu_link_ind < $menu_links[1]; $menu_link_ind++) { $class = Application::Get('page_id') == $menu_links[0][$menu_link_ind]['id'] ? ' active' : ''; if ($menu_links[0][$menu_link_ind]['content_type'] == 'link') { $output .= '<li>' . prepare_permanent_link($menu_links[0][$menu_link_ind]['link_url'], $menu_links[0][$menu_link_ind]['menu_link'], $menu_links[0][$menu_link_ind]['link_target'], 'main_menu_link' . $class) . '</li>'; } else { // draw current menu link $output .= '<li>' . prepare_link('pages', 'pid', $menu_links[0][$menu_link_ind]['id'], $menu_links[0][$menu_link_ind]['page_key'], $menu_links[0][$menu_link_ind]['menu_link'], 'main_menu_link' . $class) . '</li>'; } } if ($menu_links[1] > 0) { $output .= '</ul>'; } $output .= draw_block_bottom(false); } if ($menu_position == 'left') { if (!$objLogin->IsLoggedIn() || Application::Get('preview') == 'yes') { if (Modules::IsModuleInstalled('customers') && ModulesSettings::Get('customers', 'allow_login') == 'yes') { if (Application::Get('customer') != 'login') { $output .= Customers::DrawLoginFormBlock(false); } } } if (Modules::IsModuleInstalled('news')) { if ($show_news_block == 'left side') { $output .= $objNews->DrawNewsBlock(false); } if ($show_subscribe_block == 'left side') { $output .= $objNews->DrawSubscribeBlock(false); } } if (Modules::IsModuleInstalled('inquiries')) { if ($show_inquiries_block == 'left side') { $output .= Inquiries::DrawLastInquiriesBlock(false); } } } if ($menu_position == 'right') { if (Modules::IsModuleInstalled('inquiries')) { if ($show_inquiries_block == 'right side') { $output .= Inquiries::DrawLastInquiriesBlock(false); } } if (Modules::IsModuleInstalled('news')) { if ($show_news_block == 'right side') { $output .= $objNews->DrawNewsBlock(false); } if ($show_subscribe_block == 'right side') { $output .= $objNews->DrawSubscribeBlock(false); } } } if (ModulesSettings::Get('listings', 'show_directory_statistics') == $menu_position . ' side') { $output .= Listings::DrawDirectoryStatistics(false); } if ($menu_position == 'right') { if (Modules::IsModuleInstalled('adsense')) { $output .= '<div class="adsense-vertical">' . Adsense::GetVerticalBanerCode() . '</div>'; } } if ($menus_count > 0) { $output .= '</div>'; } $output .= '<br />'; if ($draw) { echo $output; } else { return $output; } }
/** * Draws login form on Front-End * @param $draw */ public static function DrawLoginFormBlock($draw = true) { global $objLogin; $username = ''; $password = ''; $remember_me_checked = ''; // check if remember me cookies exists if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $objLogin->CheckRememberMe($username, $password); if (!empty($username) && !empty($password)) { $remember_me_checked = 'checked="checked"'; } } $output = draw_block_top(_AUTHENTICATION, '', 'maximized', false); $output .= '<form class="customer_login" action="index.php?customer=login" method="post"> ' . draw_hidden_field('submit_login', 'login', false) . ' ' . draw_hidden_field('type', 'customer', false) . ' ' . draw_token_field(false) . ' <table border="0" cellspacing="1" cellpadding="1"> <tr><td>' . _USERNAME . ':</td></tr> <tr><td><input type="text" style="width:130px" name="user_name" id="user_name" maxlength="50" autocomplete="off" value="' . $username . '" /></td></tr> <tr><td>' . _PASSWORD . ':</td></tr> <tr><td><input type="password" style="width:130px" name="password" id="password" maxlength="20" autocomplete="off" value="' . $password . '" /></td></tr> <tr><td valign="middle">'; $output .= '<input class="form_button" type="submit" name="submit" value="' . _BUTTON_LOGIN . '" /> '; if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $output .= '<input class="form_checkbox" ' . $remember_me_checked . ' name="remember_me" value="1" type="checkbox" /> ' . _REMEMBER_ME . '<br>'; } $output .= '</td></tr> <tr><td></td></tr>'; if (ModulesSettings::Get('customers', 'allow_registration') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=create_account', _CREATE_ACCOUNT, '', 'form_link') . '</td></tr>'; } if (ModulesSettings::Get('customers', 'allow_reset_passwords') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=password_forgotten', _FORGOT_PASSWORD, '', 'form_link') . '</td></tr>'; } $output .= '</table> </form>'; $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }
/** * Draws newsletter side subscribe block * @param $draw */ public function DrawSubscribeBlock($draw = true) { $output = draw_block_top(_SUBSCRIBE_TO_NEWSLETTER, '', 'maximized', false); $output .= '<form name="frmNewsletterSubscribeBlock" class="newsletter_subscribe" action="index.php?page=newsletter" method="post">'; $output .= draw_hidden_field('task', 'subscribe', false); $output .= draw_token_field(false); $output .= '<input type="text" name="email" value="" maxlength="70" autocomplete="off" placeholder="' . _EMAIL_ADDRESS . '" />'; $output .= '<input class="form_button" type="submit" name="submit" value="' . _SUBSCRIBE . '" />'; $output .= '</form>'; $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }