function getDefaultView() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); // 表示対象となるユーザコミュニティIDを取得 $user_community_id = $acs_user_info_row['user_community_id']; if (!$this->get_execute_privilege()) { $controller->forward(SECURE_MODULE, SECURE_ACTION); return; } // デザイン情報取得 $select_design_row_array = ACSCss::get_style_selection_list_array(ACSMsg::get_lang(), ACS_SELECTION_CSS_DIR); //$style_url = ACSSystemConfig::get_keyword_value( // ACSMsg::get_mst('system_config_group','D01'), 'DESIGN_STYLE_CSS_URL'); $style_url = ACS_SELECTION_CSS_DIR; // 設定済のマイページデザインを取得する $selection_css_row = ACSCommunity::get_contents_row($user_community_id, ACSMsg::get_mst('contents_type_master', 'D53')); $selection_css = $selection_css_row['contents_value'] == '' ? ACS_DEFAULT_SELECTION_CSS_FILE : $selection_css_row['contents_value']; // set $request->setAttribute('style_url', $style_url); $request->setAttributeByRef('acs_user_info_row', $acs_user_info_row); $request->setAttributeByRef('select_design_row_array', $select_design_row_array); $request->setAttributeByRef('user_community_id', $user_community_id); $request->setAttribute('selection_css', $selection_css); return View::INPUT; }
/** * acsスタイル選択情報の取得 * * @param string $lang 取得する情報のエンコーディング * @param string $styles_dir_path cssファイルが存在するディレクトリパス * @param string $match_pattern 対象ファイルのマッチパターン * @return array スタイル情報の配列 */ static function get_style_selection_list_array($lang, $styles_dir_path, $match_pattern = '/.*\\.css/') { $d = dir($styles_dir_path); $styles_array = array(); while (false !== ($file_entry = $d->read())) { //if (fnmatch($match_pattern, $file_entry)) { if (preg_match($match_pattern, $file_entry)) { $css = new ACSCss($styles_dir_path . '/' . $file_entry); $styles_array[$file_entry] =& $css->get_style_selection_info_array($lang); } } $d->close(); // display_order $order_index = array(); foreach ($styles_array as $key => $value) { $order_index[$key] = $value['display_order']; } asort($order_index); $sort_styles_array = array(); foreach ($order_index as $key => $value) { $sort_styles_array[] = $styles_array[$key]; } return $sort_styles_array; }