/** internals **/
 public function __construct()
 {
     try {
         $this->config = sharing_cart_plugins::get_config('repository', $GLOBALS['USER']->id);
     } catch (Exception $e) {
         $this->config = array();
     }
     if (!is_array($this->config)) {
         $this->config = array();
     }
     $this->dir = $GLOBALS['CFG']->wwwroot . '/blocks/sharing_cart/plugins/repository';
 }
 public static function setConfig($user, $config)
 {
     return sharing_cart_plugins::set_config('repository', $config, $user->id);
 }
예제 #3
0
<?php

//$Id: settings.php,v 1.3 2009/11/30 09:17:22 akiococom Exp $
require_once dirname(__FILE__) . '/plugins.php';
sharing_cart_plugins::load();
$plugin_names = sharing_cart_plugins::enum();
if (empty($plugin_names)) {
    $settings->add(new admin_setting_heading('sharing_cart_heading', get_string('conf_plugins_heading', 'block_sharing_cart'), get_string('conf_plugins_nothing', 'block_sharing_cart')));
} else {
    $settings->add(new admin_setting_heading('sharing_cart_heading', get_string('conf_plugins_heading', 'block_sharing_cart'), null));
    $settings->add(new admin_setting_configmultiselect('sharing_cart_plugins', get_string('conf_plugins_enabled_head', 'block_sharing_cart'), get_string('conf_plugins_enabled_desc', 'block_sharing_cart'), $plugin_names, array_combine($plugin_names, $plugin_names)));
}
 private static function render_item(&$text, $depth, $item)
 {
     global $CFG, $OUTPUT;
     $text[] = str_repeat("\t", $depth + 1) . '<li class="r0" id="shared_item_' . $item['id'] . '">';
     $text[] = '<div class="icon column c0">';
     if ($depth) {
         $text[] = print_spacer(10, $depth * 10, false, true);
     }
     if (!empty($item['icon'])) {
         $text[] = $item['icon'];
     }
     $text[] = '</div>';
     $text[] = '<div class="column c1">' . $item['text'] . '</div>';
     $text[] = '<span class="commands">';
     // ディレクトリ移動[→]
     $text[] = '<a title="' . self::$str_cache->movedir . '" href="javascript:void(0);"' . ' onclick="return sharing_cart.movedir(this, ' . '\'' . addslashes(htmlspecialchars($item['path'])) . '\');">' . '<img src="' . $OUTPUT->pix_url('t/right') . '" class="iconsmall"' . ' alt="' . self::$str_cache->movedir . '" />' . '</a>';
     // 並べ替え[↓↑]
     $text[] = '<a title="' . self::$str_cache->move . '" href="javascript:void(0);"' . ' onclick="return sharing_cart.move(this, ' . '\'' . addslashes(htmlspecialchars($item['path'])) . '\');">' . '<img src="' . $OUTPUT->pix_url('t/move') . '" class="iconsmall"' . ' alt="' . self::$str_cache->move . '" />' . '</a>';
     // 削除[×]
     $text[] = '<a title="' . self::$str_cache->delete . '" href="javascript:void(0);"' . ' onclick="return sharing_cart.remove(this);">' . '<img src="' . $OUTPUT->pix_url('t/delete') . '" class="iconsmall"' . ' alt="' . self::$str_cache->delete . '" />' . '</a>';
     // コースへコピー[■→]
     $text[] = '<a title="' . self::$str_cache->restore . '" href="javascript:void(0);"' . ' onclick="return sharing_cart.restore(this);">' . '<img src="' . $OUTPUT->pix_url('i/restore') . '" class="iconsmall"' . ' alt="' . self::$str_cache->restore . '" />' . '</a>';
     // plugins
     $text = array_merge($text, sharing_cart_plugins::get_commands());
     $text[] = '</span>';
     $text[] = "</li>\n";
 }