「ブロックレイアウト」の版間の差分

提供:MoodleDocs
移動先:案内検索
編集の要約なし
 
編集の要約なし
 
(2人の利用者による、間の6版が非表示)
1行目: 1行目:
{{ブロック}}
==新しいコースのためのデフォルトブロックレイアウト==
==新しいコースのためのデフォルトブロックレイアウト==
{{Moodle 1.6}}
{{Moodle 1.6}}
*Moodle1.6では、[[スティッキーブロック]]を使用することができます。
*Moodle1.6では、[[スティッキーブロック]]を使用することができます。


{{Moodle 1.5}}
{{Moodle 1.5}}
To amend the default block layout for new courses in Moodle 1.5, add one or more of the following lines (omitting the forward slashes) to ''config.php'' and amend the block names as required.
Moodle1.5で、新しいコースのデフォルトブロックレイアウトを修正するには、1つまたはそれ以上の下記の行 ( 文頭のスラッシュを削除 ) ''config.php'' に追加して、必要に応じてブロック名を修正してください。
  // These variables define DEFAULT block variables for new courses
  // These variables define DEFAULT block variables for new courses
  // If this one is set it overrides all others and is the only one used.
  // If this one is set it overrides all others and is the only one used.
18行目: 18行目:
  // These blocks are used when no other default setting is found.
  // These blocks are used when no other default setting is found.
  //      $CFG->defaultblocks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';</pre>
  //      $CFG->defaultblocks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';</pre>
(code copied from ''config-dist.php'')
( ''config-dist.php'' よりコードをコピー )


==既存のコースのブロックレイアウトをリセットする==
==既存のコースのブロックレイアウトをリセットする==


The block layout for existing courses may be reset by copying the following script into a text file, saving it as ''resetblocks.php'', copying it into the Moodle root directory, then visiting <code><nowiki>http://yourmoodlesite.org/resetblocks.php</nowiki></code>. Please note that a database backup is recommended before using the script. ;-)
既存のコースのブロックレイアウトをリセットするには、下記のスクリプトをテキストファイルにコピーして、''resetblocks.php''として保存した後、そのファイルをMoodleのルートディレクトリにコピーしてください。そして、<code><nowiki>http://yourmoodlesite.org/resetblocks.php</nowiki></code> にアクセスしてください。このスクリプトを実行する前に、データベースのバックアップを強くお勧めします。 ;-)
  <?php
  <?php
  require_once('config.php');
  require_once('config.php');
34行目: 34行目:
  ?>
  ?>


[[Category:管理者]]
[[カテゴリ:管理者]]
[[Category:ブロック]]
[[カテゴリ:ブロック]]
 
[[en:Block_layout]]

2022年2月22日 (火) 06:11時点における最新版

新しいコースのためのデフォルトブロックレイアウト

Moodle 1.6

Moodle 1.5

Moodle1.5で、新しいコースのデフォルトブロックレイアウトを修正するには、1つまたはそれ以上の下記の行 ( 文頭のスラッシュを削除 ) を config.php に追加して、必要に応じてブロック名を修正してください。

// These variables define DEFAULT block variables for new courses
// If this one is set it overrides all others and is the only one used.
//      $CFG->defaultblocks_override =    'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
//
// These variables define the specific settings for defined course formats.
// They override any settings defined in the formats own config file.
//      $CFG->defaultblocks_site = 'site_main_menu,admin,course_list:course_summary,calendar_month';
//      $CFG->defaultblocks_social =  'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,admin,course_list';
//      $CFG->defaultblocks_topics =  'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
//      $CFG->defaultblocks_weeks =  'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
// These blocks are used when no other default setting is found.

// $CFG->defaultblocks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';

( config-dist.php よりコードをコピー )

既存のコースのブロックレイアウトをリセットする

既存のコースのブロックレイアウトをリセットするには、下記のスクリプトをテキストファイルにコピーして、resetblocks.phpとして保存した後、そのファイルをMoodleのルートディレクトリにコピーしてください。そして、http://yourmoodlesite.org/resetblocks.php にアクセスしてください。このスクリプトを実行する前に、データベースのバックアップを強くお勧めします。 ;-)

<?php
require_once('config.php');
require_once($CFG->libdir.'/blocklib.php');
$courses = get_records('course');
foreach($courses as $course) {
   $page = page_create_object(PAGE_COURSE_VIEW, $course->id);
   blocks_repopulate_page($page);
}
print_heading('Done!');
?>