當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Languages::GetAllActive方法代碼示例

本文整理匯總了PHP中Languages::GetAllActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP Languages::GetAllActive方法的具體用法?PHP Languages::GetAllActive怎麽用?PHP Languages::GetAllActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Languages的用法示例。


在下文中一共展示了Languages::GetAllActive方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: AfterInsertRecord

    /**
     *	'After'-operation methods
     */
    public function AfterInsertRecord()
    {
        // clone to other languages ---
        $total_languages = Languages::GetAllActive();
        $language_id = MicroGrid::GetParameter('language_id');
        $template_code = MicroGrid::GetParameter('template_code', false);
        $template_name = MicroGrid::GetParameter('template_name', false);
        $template_subject = MicroGrid::GetParameter('template_subject', false);
        $template_content = MicroGrid::GetParameter('template_content', false);
        $is_system_template = MicroGrid::GetParameter('is_system_template', false);
        for ($i = 0; $i < $total_languages[1]; $i++) {
            if ($language_id != '' && $total_languages[0][$i]['abbreviation'] != $language_id) {
                $sql = 'INSERT INTO ' . TABLE_EMAIL_TEMPLATES . ' (
							id,
							language_id,
							template_code,
							template_name,
							template_subject,
							template_content,
							is_system_template
						) VALUES (
							NULL,
							\'' . encode_text($total_languages[0][$i]['abbreviation']) . '\',
							\'' . encode_text($template_code) . '\',
							\'' . encode_text($template_name) . '\',
							\'' . encode_text($template_subject) . '\',
							\'' . encode_text($template_content) . '\',
							' . (int) $is_system_template . '
						)';
                database_void_query($sql);
                $this->SetSQLs('insert_lan_' . $total_languages[0][$i]['abbreviation'], $sql);
            }
        }
    }
開發者ID:mozdial,項目名稱:Directory,代碼行數:37,代碼來源:EmailTemplates.class.php

示例2: PrepareTranslateFields

 /**
  * Prepare fields array for translations 
  */
 public function PrepareTranslateFields($params = array())
 {
     $output = array();
     $total_languages = Languages::GetAllActive();
     foreach ($total_languages[0] as $key => $val) {
         $output[$val['abbreviation']]['lang_name'] = $val['lang_name'];
         $output[$val['abbreviation']]['icon_image'] = $val['icon_image'];
         foreach ($params as $p_key) {
             $output[$val['abbreviation']][$p_key] = self::GetParameter($p_key . '_' . $val['abbreviation'], false);
         }
     }
     return $output;
 }
開發者ID:mozdial,項目名稱:Directory,代碼行數:16,代碼來源:MicroGrid.class.php

示例3: AfterInsertRecord

    /**
     * After-insertion function
     */
    public function AfterInsertRecord()
    {
        $name = isset($_POST['descr_name']) ? prepare_input($_POST['descr_name']) : '';
        $description = isset($_POST['descr_description']) ? prepare_input($_POST['descr_description']) : '';
        // languages array
        $total_languages = Languages::GetAllActive();
        foreach ($total_languages[0] as $key => $val) {
            $sql = 'INSERT INTO ' . TABLE_CATEGORIES_DESCRIPTION . '(
						id, category_id, language_id, name, description)
					VALUES(
						NULL, ' . $this->lastInsertId . ', \'' . $val['abbreviation'] . '\', \'' . $name . '\', \'' . $description . '\'
					)';
            if (!database_void_query($sql)) {
                // error
            }
        }
    }
開發者ID:mozdial,項目名稱:Directory,代碼行數:20,代碼來源:Categories.class.php

示例4: __construct

    function __construct($login_type = '')
    {
        parent::__construct();
        global $objSettings;
        $this->params = array();
        if (isset($_POST['first_name'])) {
            $this->params['first_name'] = prepare_input($_POST['first_name']);
        }
        if (isset($_POST['last_name'])) {
            $this->params['last_name'] = prepare_input($_POST['last_name']);
        }
        if (isset($_POST['user_name'])) {
            $this->params['user_name'] = prepare_input($_POST['user_name']);
        }
        if (isset($_POST['password'])) {
            $this->params['password'] = prepare_input($_POST['password']);
        }
        if (isset($_POST['email'])) {
            $this->params['email'] = prepare_input($_POST['email']);
        }
        if (isset($_POST['preferred_language'])) {
            $this->params['preferred_language'] = prepare_input($_POST['preferred_language']);
        }
        if (isset($_POST['account_type'])) {
            $this->params['account_type'] = prepare_input($_POST['account_type']);
        }
        if (isset($_POST['date_created'])) {
            $this->params['date_created'] = prepare_input($_POST['date_created']);
        }
        if (isset($_POST['is_active'])) {
            $this->params['is_active'] = (int) $_POST['is_active'];
        } else {
            $this->params['is_active'] = '0';
        }
        if (self::$PROJECT == 'HotelSite') {
            if (isset($_POST['hotels'])) {
                $this->params['hotels'] = prepare_input($_POST['hotels']);
            }
        }
        $this->primaryKey = 'id';
        $this->tableName = TABLE_ACCOUNTS;
        $this->dataSet = array();
        $this->error = '';
        $this->formActionURL = 'index.php?admin=admins_management';
        $this->actions = array('add' => true, 'edit' => true, 'details' => true, 'delete' => true);
        $this->actionIcons = true;
        $this->allowRefresh = true;
        $this->allowLanguages = false;
        if ($login_type == 'owner') {
            $this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'mainadmin\' || ' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
        } else {
            if ($login_type == 'mainadmin') {
                $this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
            } else {
                if ($login_type == 'admin') {
                    $this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'admin\'';
                } else {
                    if ($login_type == 'hotelowner') {
                        $this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\'';
                    }
                }
            }
        }
        $this->ORDER_CLAUSE = 'ORDER BY id ASC';
        $this->isAlterColorsAllowed = true;
        $this->isPagingAllowed = true;
        $this->pageSize = 20;
        $this->isSortingAllowed = true;
        $this->isFilteringAllowed = true;
        // define filtering fields
        $this->arrFilteringFields = array(_FIRST_NAME => array('table' => $this->tableName, 'field' => 'first_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _LAST_NAME => array('table' => $this->tableName, 'field' => 'last_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _ACTIVE => array('table' => $this->tableName, 'field' => 'is_active', 'type' => 'dropdownlist', 'source' => array('0' => _NO, '1' => _YES), 'sign' => '=', 'width' => '85px'));
        // prepare languages array
        $total_languages = Languages::GetAllActive();
        $arr_languages = array();
        foreach ($total_languages[0] as $key => $val) {
            $arr_languages[$val['abbreviation']] = $val['lang_name'];
        }
        $arr_account_types = array('admin' => _ADMIN, 'mainadmin' => _MAIN_ADMIN);
        if (self::$PROJECT == 'HotelSite') {
            $arr_account_types['hotelowner'] = _HOTEL_OWNER;
        }
        $arr_is_active = array('0' => '<span class=no>' . _NO . '</span>', '1' => '<span class=yes>' . _YES . '</span>');
        $datetime_format = get_datetime_format();
        if (self::$PROJECT == 'HotelSite') {
            $total_hotels = Hotels::GetAllActive();
            $arr_hotels = array();
            foreach ($total_hotels[0] as $key => $val) {
                $this->arrCompanies[$val['id']] = $val['name'];
            }
            $this->additionalFields = ', hotels';
            $this->accountTypeOnChange = 'onchange="javascript:AccountType_OnChange(this.value)"';
        }
        if ($objSettings->GetParameter('date_format') == 'mm/dd/yyyy') {
            $this->sqlFieldDatetimeFormat = '%b %d, %Y %H:%i';
        } else {
            $this->sqlFieldDatetimeFormat = '%d %b, %Y %H:%i';
        }
        $this->SetLocale(Application::Get('lc_time_name'));
        //----------------------------------------------------------------------
        // VIEW MODE
//.........這裏部分代碼省略.........
開發者ID:mozdial,項目名稱:Directory,代碼行數:101,代碼來源:AdminsAccounts.class.php

示例5: MenuCreate

    /**
     *	Creates new menu 
     *		@param $param - array of parameters
     */
    public function MenuCreate($params = array())
    {
        // Block operation in demo mode
        if (strtolower(SITE_MODE) == 'demo') {
            $this->error = _OPERATION_BLOCKED;
            return false;
        }
        // Get input parameters
        if (isset($params['name'])) {
            $this->menu['menu_name'] = $params['name'];
        }
        if (isset($params['menu_placement'])) {
            $this->menu['menu_placement'] = $params['menu_placement'];
        }
        if (isset($params['order'])) {
            $this->menu['menu_order'] = $params['order'];
        }
        if (isset($params['language_id'])) {
            $this->menu['language_id'] = $params['language_id'];
        }
        if (isset($params['access_level'])) {
            $this->menu['access_level'] = $params['access_level'];
        }
        // Prevent creating of empty records in our 'menus' table
        if ($this->menu['menu_name'] != '') {
            $menu_code = strtoupper(get_random_string(10));
            $total_languages = Languages::GetAllActive();
            for ($i = 0; $i < $total_languages[1]; $i++) {
                $m = self::GetAll(' menu_order ASC', TABLE_MENUS, '', $total_languages[0][$i]['abbreviation']);
                $max_order = (int) ($m[1] + 1);
                $sql = 'INSERT INTO ' . TABLE_MENUS . ' (language_id, menu_code, menu_name, menu_placement, menu_order, access_level)
						VALUES(\'' . $total_languages[0][$i]['abbreviation'] . '\', \'' . $menu_code . '\', \'' . encode_text($this->menu['menu_name']) . '\', \'' . $this->menu['menu_placement'] . '\', ' . $max_order . ', \'' . $this->menu['access_level'] . '\')';
                if (!database_void_query($sql)) {
                    $this->error = _TRY_LATER;
                    return false;
                }
            }
            return true;
        } else {
            $this->error = _MENU_NAME_EMPTY;
            return false;
        }
    }
開發者ID:mozdial,項目名稱:Directory,代碼行數:47,代碼來源:Menu.class.php

示例6: draw_important_message

            $msg = draw_important_message($objPage->error, false);
        }
        // do restore action
    } else {
        if ($act == 'restore' && $objLogin->HasPrivileges('edit_pages')) {
            if ($objPage->PageRestore()) {
                $msg = draw_success_message(_PAGE_RESTORED, false);
            } else {
                $msg = draw_important_message($objPage->error, false);
            }
        }
    }
    // start main content
    $all_pages = array();
    $all_pages = Pages::GetAll($language_id, 'removed');
    $total_languages = Languages::GetAllActive();
    draw_title_bar(prepare_breadcrumbs(array(_MENUS_AND_PAGES => '', _PAGE_MANAGEMENT => '', _TRASH_PAGES => '')));
    if ($objSession->IsMessage('notice')) {
        echo $objSession->GetMessage('notice');
    }
    echo $msg;
    ?>
	<script type="text/javascript">
	<!--
		function confirmDelete(pid){
			if(!confirm('<?php 
    echo _PAGE_DELETE_WARNING;
    ?>
')){
				return false;
			}else{
開發者ID:mozdial,項目名稱:Directory,代碼行數:31,代碼來源:pages_trash.php

示例7: GetAllActiveSelectBox

 /**
  *	Return select box with all active languages
  */
 public static function GetAllActiveSelectBox($exclude_lang = '', $selected_lang = '')
 {
     $output = '<select name="selLanguages" id="selLanguages">';
     $total_languages = Languages::GetAllActive();
     foreach ($total_languages[0] as $key => $val) {
         $output .= '<option ' . ($selected_lang == $val['abbreviation'] ? 'selected="selected"' : '') . ' ';
         if ($exclude_lang != '' && $exclude_lang != $val['abbreviation']) {
             $output .= 'value="' . $val['abbreviation'] . '">' . $val['lang_name'] . ' &raquo; ' . strtoupper($exclude_lang) . '</option>';
         } else {
             $output .= 'value="' . $val['abbreviation'] . '">' . $val['lang_name'] . '</option>';
         }
     }
     $output .= '</select>';
     return $output;
 }
開發者ID:mozdial,項目名稱:Directory,代碼行數:18,代碼來源:Languages.class.php

示例8: DrawRewriteButton

    /**	
     * Draws rewrite button
     * 		@param $draw
     */
    public function DrawRewriteButton($draw = true)
    {
        global $objSettings;
        $total_languages = Languages::GetAllActive();
        $output = '';
        $button_align_left = Application::Get('lang_dir') == 'ltr' ? 'text-align:left;' : 'text-align:right;';
        $button_align_right = Application::Get('lang_dir') == 'ltr' ? 'text-align:right;' : 'text-align:left;';
        if ($this->GetVocabularySize() <= 0) {
            $output .= '<form action="index.php?admin=vocabulary&filter_by=A" method="post">';
            $output .= draw_hidden_field('submition_type', '2', false);
            $output .= draw_token_field(false);
            $output .= '<table align="center" width="100%" border="0" cellspacing="0" cellpadding="3" class="main_text">
				  <tr valign="top">					
					<td style="' . $button_align_left . '">
						' . draw_languages_box('language_id', $total_languages[0], 'abbreviation', 'lang_name', $this->languageId, '', 'onchange="appGoTo(\'admin=vocabulary' . $this->filterByUrl . '&language_id=\'+this.value)"', false) . '
					</td>
					<td style="padding:5px;' . $button_align_right . '">
						' . prepare_permanent_link('index.php?admin=vocabulary&act=upload_form' . $this->langIdByUrl . $this->filterByUrl, '[ ' . _UPLOAD_FROM_FILE . ' ]') . '&nbsp;&nbsp;&nbsp;
					</td>
					<td width="185px" style="' . $button_align_left . '">
						<input class="form_button" type="submit" name="btnRewrite" value="' . decode_text(_BUTTON_REWRITE) . '"><br />
						<input class="form_checkbox" type="checkbox" name="all_languages" id="chk_all_languages"><label for="chk_all_languages">' . _APPLY_TO_ALL_LANGUAGES . '</label>
					</td>
				  </tr>
				  </table>
			</form>';
        }
        if ($draw) {
            echo $output;
        } else {
            return $output;
        }
    }
開發者ID:mozdial,項目名稱:Directory,代碼行數:37,代碼來源:Vocabulary.class.php

示例9: AfterInsertRecord

    /**
     * After-insertion operation
     */
    public function AfterInsertRecord()
    {
        // --- clone to other languages
        $total_languages = Languages::GetAllActive();
        $language_id = self::GetParameter('language_id', false);
        $news_code = self::GetParameter('news_code', false);
        $header_text = self::GetParameter('header_text', false);
        $body_text = self::GetParameter('body_text', false);
        $date_created = self::GetParameter('date_created', false);
        for ($i = 0; $i < $total_languages[1]; $i++) {
            if ($language_id != '' && $total_languages[0][$i]['abbreviation'] != $language_id) {
                $sql = 'INSERT INTO ' . TABLE_NEWS . ' (id, news_code, header_text, body_text, date_created, language_id)
						VALUES(NULL, \'' . encode_text($news_code) . '\', \'' . encode_text($header_text) . '\', \'' . encode_text($body_text) . '\', \'' . encode_text($date_created) . '\', \'' . encode_text($total_languages[0][$i]['abbreviation']) . '\')';
                database_void_query($sql);
                $this->SetSQLs('insert_lan_' . $total_languages[0][$i]['abbreviation'], $sql);
            }
        }
    }
開發者ID:mozdial,項目名稱:Directory,代碼行數:21,代碼來源:News.class.php

示例10: PageCreate


//.........這裏部分代碼省略.........
                    } else {
                        if (strlen($this->page['tag_title']) > 255) {
                            $msg_text = str_replace('_FIELD_', '<b>TITLE</b>', _FIELD_LENGTH_ALERT);
                            $msg_text = str_replace('_LENGTH_', '255', $msg_text);
                            $this->error = $msg_text;
                            $this->focusOnField = 'tag_title';
                            return false;
                        } else {
                            if (strlen($this->page['tag_keywords']) > 512) {
                                $msg_text = str_replace('_FIELD_', '<b>KEYWORDS</b>', _FIELD_LENGTH_ALERT);
                                $msg_text = str_replace('_LENGTH_', '512', $msg_text);
                                $this->error = $msg_text;
                                $this->focusOnField = 'tag_keywords';
                                return false;
                            } else {
                                if (strlen($this->page['tag_description']) > 512) {
                                    $msg_text = str_replace('_FIELD_', '<b>DESCRIPTION</b>', _FIELD_LENGTH_ALERT);
                                    $msg_text = str_replace('_LENGTH_', '512', $msg_text);
                                    $this->error = $msg_text;
                                    $this->focusOnField = 'tag_description';
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
        }
        if (strtolower(SITE_MODE) == 'demo') {
            $this->error = _OPERATION_BLOCKED;
            return false;
        } else {
            if ($copy_to_other_langs == 'yes') {
                $total_languages = Languages::GetAllActive();
            } else {
                $total_languages = Languages::GetAllLanguages(' priority_order ASC', '', 'abbreviation=\'' . $this->page['language_id'] . '\'');
            }
            $page_code = get_random_string(10);
            for ($i = 0; $i < $total_languages[1]; $i++) {
                // Create new record
                $sql = 'INSERT INTO ' . TABLE_PAGES . '(
						id,
						page_code,
						language_id,
						content_type,
						link_url,
						link_target,
						page_key,
						page_title,
						page_text,
						menu_id,
						menu_link,
						tag_title,
						tag_keywords,
						tag_description,
						comments_allowed,
						show_in_search,
						date_created,
						date_updated,
						finish_publishing,
						is_published,
						is_system_page,
						system_page,
						status_changed,
						access_level,
						priority_order
開發者ID:mozdial,項目名稱:Directory,代碼行數:67,代碼來源:Pages.class.php

示例11: draw_hidden_field

			<tr>
				<td	style="padding-left:5px;" colspan="3"><input class="form_button" type="submit" name="btnSubmit" value="' . _BUTTON_CHANGE . '"></td>
			</tr>
			</table>
		</form>';
    } else {
        if ($tabid == '1_2') {
            $tab_content_2 = '<form name="frmSettings" id="frmSettings" action="index.php?admin=settings" method="post">
			' . draw_hidden_field('tabid', $tabid, false) . '
			' . draw_token_field(false) . '
			
			<table width="99%" border="0" cellspacing="5" cellpadding="5" class="main_text">
			<tr valign="top">
				<td width="150px">' . _LANGUAGE . ':</td>
				<td>';
            $all_languages = Languages::GetAllActive();
            $tab_content_2 .= draw_languages_box('sel_language_id', $all_languages[0], 'abbreviation', 'lang_name', $language_id, '', 'onchange="javascript:appFormSubmit(\'frmSettings\');"', false);
            $tab_content_2 .= '</td>				
			</tr>
			</table>
		</form>

		<fieldset style="margin:10px;">
		<legend>' . _HEADERS_AND_FOOTERS . '</legend>
			<form action="index.php?admin=settings" method="post">
			' . draw_hidden_field('submition_type', 'visual_settings', false) . '
			' . draw_hidden_field('tabid', $tabid, false) . '
			' . draw_hidden_field('sel_language_id', $language_id, false) . '
			' . draw_token_field(false) . '
			
			<table width="99%" border="0" cellspacing="5" cellpadding="5" class="main_text">
開發者ID:mozdial,項目名稱:Directory,代碼行數:31,代碼來源:settings.php

示例12: __construct

    function __construct($type = '', $actions = array())
    {
        parent::__construct();
        $this->params = array();
        ///if(isset($_POST['parameter1']))   $this->params['parameter1'] = $_POST['parameter1'];
        ///if(isset($_POST['parameter2']))   $this->params['parameter2'] = $_POST['parameter2'];
        ///if(isset($_POST['parameter3']))   $this->params['parameter3'] = $_POST['parameter3'];
        // for checkboxes
        ///if(isset($_POST['parameter4']))   $this->params['parameter4'] = $_POST['parameter4']; else $this->params['parameter4'] = '0';
        $this->params['language_id'] = MicroGrid::GetParameter('language_id');
        $this->primaryKey = 'id';
        $this->tableName = TABLE_PAGES;
        $this->dataSet = array();
        $this->error = '';
        $this->formActionURL = 'index.php?admin=pages' . ($type != '' ? '&type=' . $type : '');
        $this->actions = array('add' => false, 'edit' => false, 'details' => false, 'delete' => false);
        $this->actionIcons = true;
        $this->allowRefresh = true;
        $this->allowLanguages = true;
        $this->languageId = $this->params['language_id'] != '' ? $this->params['language_id'] : Languages::GetDefaultLang();
        $this->WHERE_CLAUSE = 'WHERE
									' . $this->tableName . '.is_system_page = ' . ($type == 'system' ? '1' : '0') . ' AND 
									' . $this->tableName . '.is_home = 0 AND
									' . $this->tableName . '.is_removed = 0 AND
									' . $this->tableName . '.language_id = \'' . $this->languageId . '\'';
        $this->ORDER_CLAUSE = 'ORDER BY priority_order ASC';
        $this->isAlterColorsAllowed = true;
        $this->isPagingAllowed = true;
        $this->pageSize = 20;
        $this->isSortingAllowed = true;
        $this->isFilteringAllowed = $type == 'system' ? false : true;
        // prepare menus array
        $total_menus = Menu::GetAll(' menu_order ASC', TABLE_MENUS, '', $this->languageId);
        $arr_menus = array();
        foreach ($total_menus[0] as $key => $val) {
            $arr_menus[$val['id']] = $val['menu_name'] . ($val['menu_placement'] == 'hidden' ? ' (' . _HIDDEN . ')' : '');
        }
        // define filtering fields
        $this->arrFilteringFields = array(_MENU_WORD => array('table' => TABLE_MENUS, 'field' => 'id', 'type' => 'dropdownlist', 'source' => $arr_menus, 'sign' => '=', 'width' => '150px'));
        // prepare languages array
        $total_languages = Languages::GetAllActive();
        $arr_languages = array();
        foreach ($total_languages[0] as $key => $val) {
            $arr_languages[$val['abbreviation']] = $val['lang_name'];
        }
        $comments_allow = Modules::IsModuleInstalled('comments') ? ModulesSettings::Get('comments', 'comments_allow') : 'no';
        //----------------------------------------------------------------------
        // VIEW MODE
        //----------------------------------------------------------------------
        $this->VIEW_MODE_SQL = 'SELECT ' . $this->tableName . '.' . $this->primaryKey . ',
									' . $this->tableName . '.language_id,
									' . $this->tableName . '.content_type,
									' . $this->tableName . '.link_url,
									' . $this->tableName . '.link_target,
									' . $this->tableName . '.page_key,
									IF(' . $this->tableName . '.page_title != "", ' . $this->tableName . '.page_title, "- ' . _UNDEFINED . ' -") as page_title,
									' . $this->tableName . '.page_text,
									' . $this->tableName . '.menu_id,
									IF(' . $this->tableName . '.menu_link != "", ' . $this->tableName . '.menu_link, "- ' . _UNDEFINED . ' -") as menu_link,
									' . $this->tableName . '.comments_allowed,
									' . $this->tableName . '.is_home,
									' . $this->tableName . '.priority_order,
									IF(' . $this->tableName . '.access_level = "public", "' . _PUBLIC . '", "' . _REGISTERED . '") my_access_level,
									CASE
										WHEN ' . $this->tableName . '.is_published = 1 THEN
											IF(
												(finish_publishing = "0000-00-00" OR finish_publishing >= \'' . date('Y-m-d') . '\'),
												"<img src=\\"images/published_g.gif\\" alt=\\"\\" />",
												"<img src=\\"images/expired.gif\\" alt=\\"' . _EXPIRED . '\\" />"
											  ) 		
										ELSE "<img src=\\"images/published_x.gif\\" alt=\\"\\" />"
									END as is_published,
									IF(' . TABLE_MENUS . '.menu_name != "", ' . TABLE_MENUS . '.menu_name, "' . _NOT_AVAILABLE . '") as menu_name,
									CASE
										WHEN ' . $this->tableName . '.comments_allowed = 1 THEN
											CONCAT("<a href=\\"index.php?admin=mod_comments_management&pid=",
											' . $this->tableName . '.' . $this->primaryKey . ', "\\">", (SELECT COUNT(*) FROM ' . TABLE_COMMENTS . ' c WHERE c.article_id = ' . $this->tableName . '.' . $this->primaryKey . '),											
											(SELECT IF(COUNT(*) > 0, CONCAT("(",COUNT(*),")"), "") FROM ' . TABLE_COMMENTS . ' c WHERE c.is_published = 0 AND c.article_id = ' . $this->tableName . '.' . $this->primaryKey . '),
											"</a>")
										ELSE
											"<span class=gray>' . _NOT_ALLOWED . '</span>"
									END as comments_count,
									CONCAT(
										" <a href=\\"index.php?page=pages' . ($type == 'system' ? '&type=' . $type : '') . '&pid=", ' . $this->tableName . '.' . $this->primaryKey . ', "&mg_language_id=' . $this->languageId . '\\">' . _VIEW_WORD . '</a>
										' . ($actions['edit'] ? ' | <a href=\\"index.php?admin=pages_edit' . ($type != '' ? '&type=' . $type : '') . '&pid=", ' . $this->tableName . '.' . $this->primaryKey . ', "\\">' . _EDIT_WORD . '</a>' : '') . '
										' . ($actions['delete'] && $type != 'system' ? ' | <a href=\\"javascript:confirmRemoving(\'", ' . $this->tableName . '.' . $this->primaryKey . ', "\')\\">' . _REMOVE . '</a>' : '') . '
										") as action_links
								FROM ' . $this->tableName . '
									LEFT OUTER JOIN ' . TABLE_MENUS . ' ON ' . $this->tableName . '.menu_id=' . TABLE_MENUS . '.id';
        // define view mode fields
        $this->arrViewModeFields = array();
        $this->arrViewModeFields['menu_link'] = array('title' => _MENU_LINK, 'type' => 'label', 'align' => 'left', 'width' => '', 'maxlength' => '40');
        if ($type == 'system') {
            $this->arrViewModeFields['page_title'] = array('title' => _PAGE_HEADER, 'type' => 'label', 'align' => 'left', 'width' => '', 'maxlength' => '40');
        }
        $this->arrViewModeFields['menu_name'] = array('title' => _MENU_WORD, 'type' => 'label', 'align' => 'center', 'width' => '', 'visible' => $type == 'system' ? false : true);
        $this->arrViewModeFields['is_published'] = array('title' => _PUBLISHED, 'type' => 'label', 'align' => 'center', 'width' => '80px');
        $this->arrViewModeFields['my_access_level'] = array('title' => _ACCESS, 'type' => 'label', 'align' => 'center', 'width' => '75px');
        $this->arrViewModeFields['priority_order'] = array('title' => _ORDER, 'type' => 'label', 'align' => 'center', 'width' => '65px', 'visible' => 'true', 'movable' => true);
        $this->arrViewModeFields['comments_count'] = array('title' => _COMMENTS, 'type' => 'label', 'align' => 'center', 'width' => '90px', 'visible' => $comments_allow == 'yes' ? true : false);
//.........這裏部分代碼省略.........
開發者ID:mozdial,項目名稱:Directory,代碼行數:101,代碼來源:PagesGrid.class.php


注:本文中的Languages::GetAllActive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。