当前位置: 首页>>代码示例>>PHP>>正文


PHP elis::plugin_file方法代码示例

本文整理汇总了PHP中elis::plugin_file方法的典型用法代码示例。如果您正苦于以下问题:PHP elis::plugin_file方法的具体用法?PHP elis::plugin_file怎么用?PHP elis::plugin_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在elis的用法示例。


在下文中一共展示了elis::plugin_file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: definition

 /**
  * items in the form
  */
 public function definition()
 {
     global $CURMAN, $CFG;
     parent::definition();
     $mform =& $this->_form;
     $mform->addElement('hidden', 'id');
     $mform->setType('id', PARAM_INT);
     $mform->addElement('text', 'name', get_string('userset_name', 'local_elisprogram'));
     $mform->setType('name', PARAM_TEXT);
     $mform->addRule('name', get_string('required'), 'required', NULL, 'client');
     $mform->addHelpButton('name', 'userset_name', 'local_elisprogram');
     $mform->addElement('textarea', 'display', get_string('userset_description', 'local_elisprogram'), array('cols' => 40, 'rows' => 2));
     $mform->setType('display', PARAM_CLEAN);
     $mform->addHelpButton('display', 'userset_description', 'local_elisprogram');
     $current_cluster_id = isset($this->_customdata['obj']->id) ? $this->_customdata['obj']->id : '';
     //obtain the non-child clusters that we could become the child of, with availability
     //determined based on the edit capability
     $contexts = usersetpage::get_contexts('local/elisprogram:userset_edit');
     $non_child_clusters = cluster_get_non_child_clusters($current_cluster_id, $contexts);
     //parent dropdown
     $mform->addElement('select', 'parent', get_string('userset_parent', 'local_elisprogram'), $non_child_clusters);
     $mform->addHelpButton('parent', 'userset_parent', 'local_elisprogram');
     // allow plugins to add their own fields
     $mform->addElement('header', 'userassociationfieldset', get_string('userset_userassociation', 'local_elisprogram'));
     $plugins = get_plugin_list(userset::ENROL_PLUGIN_TYPE);
     foreach ($plugins as $plugin => $plugindir) {
         require_once elis::plugin_file(userset::ENROL_PLUGIN_TYPE . '_' . $plugin, 'lib.php');
         call_user_func('cluster_' . $plugin . '_edit_form', $this, $mform, $current_cluster_id);
     }
     // custom fields
     $this->add_custom_fields('cluster', 'local/elisprogram:userset_edit', 'local/elisprogram:userset_view', 'cluster');
     $this->add_action_buttons();
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:36,代码来源:usersetform.class.php

示例2: checkbox_control_display

/**
 * Adds an appropriate editing control to the provided form
 *
 * @param  moodleform or HTML_QuickForm  $form       The form to add the appropriate element to
 * @param  field                         $field      The definition of the field defining the controls
 * @param  boolean                       $as_filter  Whether to display a "choose" message
 * @param  string                        $contextname Optional context name/entity
 */
function checkbox_control_display($form, $mform, $customdata, $field, $as_filter = false, $contextname = 'system')
{
    if (!$form instanceof moodleform) {
        $mform = $form;
        $form->_customdata = null;
    }
    $manual = new field_owner($field->owners['manual']);
    $manual_params = unserialize($manual->params);
    if (!empty($manual_params['options_source']) || !empty($manual_params['options'])) {
        if ($as_filter || $field->multivalued) {
            //            require_once(CURMAN_DIRLOCATION.'/plugins/manual/field_controls/menu.php');
            require_once elis::plugin_file('elisfields_manual', 'field_controls/menu.php');
            return menu_control_display($form, $mform, $customdata, $field, $as_filter);
        }
        $options = array();
        if (!empty($manual_params['options'])) {
            $options = explode("\n", $manual_params['options']);
        }
        $source = '';
        if (!empty($manual_params['options_source'])) {
            $source = $manual_params['options_source'];
        }
        if (!empty($source)) {
            $srcfile = elis::plugin_file('elisfields_manual', "sources/{$source}.php");
            if (file_exists($srcfile)) {
                require_once elis::plugin_file('elisfields_manual', 'sources.php');
                require_once $srcfile;
                $classname = "manual_options_{$source}";
                $plugin = new $classname();
                if ($plugin && $plugin->is_applicable($contextname)) {
                    $options = $plugin->get_options($customdata);
                }
            }
        }
        $controls = array();
        foreach ($options as $option) {
            $option = trim($option);
            if ($field->multivalued) {
                //  FIXME: this doesn't work
                $cb = $controls[] =& $mform->createElement('checkbox', "field_{$field->shortname}", null, $option);
                $cb->updateAttributes(array('value' => $option));
            } else {
                $controls[] =& $mform->createElement('radio', "field_{$field->shortname}", null, $option, $option);
            }
        }
        $mform->addGroup($controls, "field_{$field->shortname}", $field->name, '<br />', false);
    } else {
        $checkbox = $mform->addElement('advcheckbox', "field_{$field->shortname}", $field->name);
    }
    manual_field_add_help_button($mform, "field_{$field->shortname}", $field);
}
开发者ID:jamesmcq,项目名称:elis,代码行数:59,代码来源:checkbox.php

示例3: add_custom_fields

 /**
  * Method to add ELIS entity's custom fields to entity forms
  *
  * @param string $entity        ELIS entity name: Eg. 'curriculum', 'track', 'course', 'class', 'cluster', 'user'
  * @param string $editcap      The required edit capability
  * @param string $viewcap      The required view capability
  * @param string $parententity The entity name of the parent object (optional)
  */
 function add_custom_fields($entity, $editcap, $viewcap, $parententity = '')
 {
     $mform =& $this->_form;
     $fields = field::get_for_context_level($entity);
     $fields = $fields ? $fields : array();
     if (isset($this->_customdata['obj'])) {
         if (isset($this->_customdata['obj']->id)) {
             // Use the current (existing) entity's context instance
             $contextlevel = \local_eliscore\context\helper::get_level_from_name($entity);
             $contextclass = \local_eliscore\context\helper::get_class_for_level($contextlevel);
             $context = $contextclass::instance($this->_customdata['obj']->id);
         } else {
             if (isset($this->_customdata['obj']->parent) && $parententity != '') {
                 // ELIS-6498 -- Specify the parent entity type to get the correct parent context instance as we are
                 // adding a new "child" entity
                 $contextlevel = \local_eliscore\context\helper::get_level_from_name($parententity);
                 $contextclass = \local_eliscore\context\helper::get_class_for_level($contextlevel);
                 $context = $contextclass::instance($this->_customdata['obj']->parent);
             } else {
                 if (isset($this->_customdata['obj']->courseid) && $parententity == 'course') {
                     // ELIS-6498 -- Special handling of the course -> class hierarchy is required here
                     $context = \local_elisprogram\context\course::instance($this->_customdata['obj']->courseid);
                 } else {
                     $context = context_system::instance();
                 }
             }
         }
     } else {
         $context = context_system::instance();
     }
     require_once elis::plugin_file('elisfields_manual', 'custom_fields.php');
     $lastcat = null;
     $entityid = isset($this->_customdata['obj']->id) ? $this->_customdata['obj']->id : 0;
     foreach ($fields as $rec) {
         $field = new field($rec);
         if (!isset($field->owners['manual'])) {
             continue;
         }
         // Capabilities for editing / viewing this context
         if (manual_field_is_view_or_editable($field, $context, $editcap, $viewcap, $entity, $entityid) != MANUAL_FIELD_NO_VIEW_OR_EDIT) {
             if ($lastcat != $rec->categoryid) {
                 $lastcat = $rec->categoryid;
                 $mform->addElement('header', "category_{$lastcat}", htmlspecialchars($rec->categoryname));
             }
             manual_field_add_form_element($this, $mform, $context, $this->_customdata, $field, true, $editcap, $viewcap, $entity, $entityid);
         }
     }
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:56,代码来源:cmform.class.php

示例4: menu_control_display

/**
 * Adds an appropriate editing control to the provided form
 *
 * @param  moodleform or HTML_QuickForm  $form       The form to add the appropriate element to
 * @param  field                         $field      The definition of the field defining the controls
 * @param  boolean                       $as_filter  Whether to display a "choose" message
 * @param  string                        $contextname Optional context name/entity
 */
function menu_control_display($form, $mform, $customdata, $field, $as_filter = false, $contextname = 'system')
{
    if (!$form instanceof moodleform) {
        $mform = $form;
        $form->_customdata = null;
        $customdata = null;
    }
    $manual = new field_owner($field->owners['manual']);
    if ($field->datatype != 'bool') {
        if (!isset($manual->param_options_source) || $manual->param_options_source == '') {
            $tmpoptions = explode("\n", $manual->param_options);
            if ($as_filter) {
                $options = array('' => get_string("choose"));
            }
            foreach ($tmpoptions as $key => $option) {
                $option = trim($option, "\n\r");
                $options[$option] = format_string($option);
                // multilang formatting
            }
        } else {
            $options = array();
            $source = $manual->param_options_source;
            $srcfile = elis::plugin_file('elisfields_manual', "sources/{$source}.php");
            if (file_exists($srcfile)) {
                require_once elis::plugin_file('elisfields_manual', 'sources.php');
                require_once $srcfile;
                $classname = "manual_options_{$source}";
                $plugin = new $classname();
                if ($plugin && $plugin->is_applicable($contextname)) {
                    $options = $plugin->get_options($customdata);
                }
            }
        }
    } else {
        if ($as_filter) {
            $options = array('' => get_string("choose"), 0 => get_string('no'), 1 => get_string('yes'));
        } else {
            $options = array(0 => get_string('no'), 1 => get_string('yes'));
        }
    }
    $menu = $mform->addElement('select', "field_{$field->shortname}", $field->name, $options);
    if ($field->multivalued && !$as_filter) {
        $menu->setMultiple(true);
    }
    manual_field_add_help_button($mform, "field_{$field->shortname}", $field);
}
开发者ID:jamesmcq,项目名称:elis,代码行数:54,代码来源:menu.php

示例5: sync_profile_field_settings_to_moodle

/**
 * sync_profile_field_settings_to_moodle function synchronizes ELIS custom user field settings to corresponding Moodle field if possible.
 *
 * @param  object $field  the field object to sync
 * @return mixed          void or true (may throw DB exceptions)
 * @uses   $DB
 */
function sync_profile_field_settings_to_moodle($field)
{
    global $DB;
    if (!isset($field->owners['moodle_profile']) || $field->owners['moodle_profile']->exclude == pm_moodle_profile::sync_from_moodle) {
        // not owned by the Moodle plugin, or set to sync from Moodle
        return true;
    }
    // check if sync is possible with current field settings
    if (!moodle_profile_can_sync($field->shortname)) {
        return true;
    }
    // Sync field settings first, since they could prevent field data sync
    $moodlefield = $DB->get_record('user_info_field', array('shortname' => $field->shortname));
    if (empty($moodlefield)) {
        // pre-caution
        return true;
    }
    // Check if we have settings to sync
    $ownersyncfields = get_owner_sync_fields($moodlefield->datatype);
    if (!empty($ownersyncfields)) {
        if (empty($field->owners) || !isset($field->owners['manual'])) {
            return true;
            // TBD
        }
        $fieldowner = new field_owner($field->owners['manual']);
        if (!empty($fieldowner)) {
            $sqlparts = array();
            $params = array();
            foreach ($ownersyncfields as $key => $val) {
                $sqlparts[] = "{$key} = ?";
                $optionsrc = '';
                if (!empty($fieldowner->param_options_source)) {
                    $optionsrc = $fieldowner->param_options_source;
                }
                if ($val == 'options' && !empty($optionsrc)) {
                    // special case where options from another source
                    $srcfile = elis::plugin_file('elisfields_manual', 'sources') . "/{$optionsrc}.php";
                    $nooptions = true;
                    if (is_readable($srcfile)) {
                        require_once elis::plugin_file('elisfields_manual', 'sources.php');
                        require_once $srcfile;
                        $classname = "manual_options_{$optionsrc}";
                        $plugin = new $classname();
                        if (!empty($plugin) && ($options = $plugin->get_options(array())) && !empty($options)) {
                            $nooptions = false;
                            $params[] = implode("\n", $options);
                        }
                    }
                    if ($nooptions) {
                        array_pop($sqlparts);
                    }
                } else {
                    // temp fix for CRs in options
                    if ($val == 'options') {
                        $fieldowner->{'param_' . $val} = str_replace("\r", '', $fieldowner->{'param_' . $val});
                    }
                    $params[] = $fieldowner->{'param_' . $val};
                }
            }
            if (!empty($sqlparts)) {
                $select = implode(' AND ', array_merge(array('shortname = ?'), $sqlparts));
                if (!$DB->count_records_select('user_info_field', $select, array_merge(array($field->shortname), $params))) {
                    // settings not correct, must update
                    $sql = 'UPDATE {user_info_field} SET ' . implode(', ', $sqlparts) . ' WHERE shortname = ?';
                    $DB->execute($sql, array_merge($params, array($field->shortname)));
                }
            }
        }
    }
}
开发者ID:jamesmcq,项目名称:elis,代码行数:77,代码来源:custom_fields.php

示例6: dirname

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    local_elisprogram
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2014 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 */
require_once dirname(__FILE__) . '/../../eliscore/test_config.php';
global $CFG;
require_once $CFG->dirroot . '/local/elisprogram/lib/setup.php';
// Libs.
require_once elis::file('elisprogram/healthpage.class.php');
require_once elis::plugin_file('eliscore_etl', 'health.php');
require_once elis::plugin_file('eliscore_etl', 'etl.php');
/**
 * Test health checks.
 * @group local_elisprogram
 */
class user_activity_health_testcase extends elis_database_test
{
    /**
     * Test the user_activity_health_check
     */
    public function test_etlbehindmorethanweek()
    {
        global $DB;
        $dataset = $this->createCsvDataSet(array('log' => elis::file('elisprogram/tests/fixtures/log_data.csv')));
        $this->loadDataSet($dataset);
        elis::$config->eliscore_etl->last_run = time() - DAYSECS;
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:health_check_test.php

示例7: defined

 * Copyright (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    elisprogram_usetdisppriority
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 */
defined('MOODLE_INTERNAL') || die;
require_once dirname(__FILE__) . '/../../../../../config.php';
global $CFG;
require_once $CFG->dirroot . '/local/elisprogram/lib/setup.php';
require_once elis::plugin_file('elisprogram_usetdisppriority', 'lib.php');
function xmldb_elisprogram_usetdisppriority_upgrade($oldversion = 0)
{
    $result = true;
    return $result;
}
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:upgrade.php

示例8: dirname

 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    local_eliscore
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 */
require_once dirname(__FILE__) . '/../test_config.php';
global $CFG;
require_once $CFG->dirroot . '/local/eliscore/lib/setup.php';
require_once $CFG->dirroot . '/local/eliscore/accesslib.php';
require_once elis::lib('data/customfield.class.php');
require_once elis::plugin_file('elisfields_moodleprofile', 'custom_fields.php');
// NOTE: needed because this is used in customfield.class.php :-(.
if (!defined('CONTEXT_ELIS_USER')) {
    define('CONTEXT_ELIS_USER', 15);
}
/**
 * Class for testing the syncing of custom field settings.
 *
 * @group local_eliscore
 */
class custom_field_sync_testcase extends elis_database_test
{
    /**
     * Method to create ELIS field & owner objects given test data array.
     *
     * @param array $inputarray The test data array with params to build elis field object & owner
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:custom_field_sync_test.php

示例9: manual_field_add_form_element

/**
 * Add an element to a form for a field.
 *
 * @param object $form the moodle form object we are adding the element to
 * @param object $mform the moodle quick form object belonging to the moodle form
 * @param mixed $context Moodle context
 * @param array $customdata any additional information to pass along to the element
 * @param object $field the custom field we are viewing / editing
 * @param boolean $checkrequired if true, add a required rule for this field
 * @param string $contexteditcap the edit capability to check if the field owner
 *                                 is set up to use the "edit this context" option for editing
 * @param string $contextviewcap the view capability to check if the field owner
 *                                 is set up to use the "view this context" option for viewing
 * @param int $entityid The id of the entity.  Required only if an entity is passed.
 * @param string $entity  optional entity/context name
 */
function manual_field_add_form_element($form, $mform, $context, $customdata, $field, $checkrequired = true, $contexteditcap = NULL, $contextviewcap = NULL, $entity = 'system', $entityid = 0)
{
    $isvieworeditable = manual_field_is_view_or_editable($field, $context, $contexteditcap, $contextviewcap, $entity, $entityid);
    if ($isvieworeditable == MANUAL_FIELD_NO_VIEW_OR_EDIT) {
        return;
    }
    $elem = "field_{$field->shortname}";
    $manual = new field_owner($field->owners['manual']);
    $control = $manual->param_control;
    require_once elis::plugin_file('elisfields_manual', "field_controls/{$control}.php");
    call_user_func("{$control}_control_display", $form, $mform, $customdata, $field, false, $entity);
    $manualparams = unserialize($manual->params);
    // Set default data if no over-riding value set!
    if (!isset($customdata['obj']->{$elem})) {
        $defaultdata = field_data::get_for_context_and_field(NULL, $field);
        if (!empty($defaultdata)) {
            if ($field->multivalued) {
                $values = array();
                foreach ($defaultdata as $defdata) {
                    $values[] = $defdata->data;
                }
                $defaultdata = $values;
                // implode(',', $values)
            } else {
                foreach ($defaultdata as $defdata) {
                    $defaultdata = $defdata->data;
                    break;
                }
            }
        }
        // Format decimal numbers.
        if ($field->datatype == 'num' && $manualparams['control'] != 'menu') {
            $defaultdata = $field->format_number($defaultdata);
        }
        if (!is_null($defaultdata) && !is_object($defaultdata) && $defaultdata !== false) {
            if (is_string($defaultdata)) {
                $defaultdata = trim($defaultdata, "\r\n");
                // Radio buttons!
            }
            $mform->setDefault($elem, $defaultdata);
        }
    }
    if ($isvieworeditable == MANUAL_FIELD_VIEWABLE) {
        // Have view but not edit permission.
        $mform->freeze($elem);
    } else {
        if ($checkrequired) {
            if (!empty($manualparams['required'])) {
                $mform->addRule($elem, null, 'required', null, 'client');
                // TBD
            }
        }
    }
}
开发者ID:jamesmcq,项目名称:elis,代码行数:70,代码来源:custom_fields.php

示例10: defined

<?php

defined('MOODLE_INTERNAL') || die;
require_once elis::plugin_file('elisfields_manual', 'custom_fields.php');
/**
 * Adds an appropriate editing control to the provided form
 *
 * @param  moodleform or HTML_QuickForm  $form   The form to add the appropriate element to
 * @param  field                         $field  The definition of the field defining the controls
 */
function text_control_display($form, $mform, $customdata, $field)
{
    if (!$form instanceof moodleform) {
        $mform = $form;
        $form->_customdata = null;
    }
    $param = '';
    if (isset($field->owners['manual'])) {
        $manual = new field_owner($field->owners['manual']);
        if (isset($manual->param_maxlength) && isset($manual->param_columns)) {
            $param = "maxlength=\"{$manual->param_maxlength}\" size=\"{$manual->param_columns}\"";
        }
    }
    $fieldname = "field_{$field->shortname}";
    $mform->addElement('text', $fieldname, $field->name, $param);
    $mform->setType($fieldname, PARAM_MULTILANG);
    manual_field_add_help_button($mform, $fieldname, $field);
}
function text_control_get_value($data, $field)
{
    $name = "field_{$field->shortname}";
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:text.php

示例11: __construct

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    local_elisprogram
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2013 Remote Learner.net Inc http://www.remote-learner.net
 * @author     James McQuillan <james.mcquillan@remote-learner.net>
 *
 */
require_once elis::plugin_file('usetenrol_manual', 'lib.php');
/**
 * An action to assign usersets to a user.
 */
class deepsight_action_useruserset_assign extends deepsight_action_confirm
{
    public $label = 'Assign';
    public $icon = 'elisicon-assoc';
    /**
     * Constructor.
     * @param moodle_database $DB The active database connection.
     * @param string $name The unique name of the action to use.
     * @param string $descsingle The description when the confirmation is for a single element.
     * @param string $descmultiple The description when the confirmation is for the bulk list.
     */
    public function __construct(moodle_database &$DB, $name, $descsingle = '', $descmultiple = '')
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:useruserset.action.php

示例12: get_menu_options

 /**
  * Get the menu options for field.
  * Only valid for 'menu' datatypes
  *
  * @param  object $data   optional data for menu options source class
  * @return array          the menu options for the field (empty if N/A)
  */
 public function get_menu_options($data = array())
 {
     global $DB;
     $menu_options = array();
     $params = unserialize($this->params);
     if (!empty($params['control']) && $params['control'] == field::MENU) {
         if (!empty($params['options_source'])) {
             $menu_options_src = $params['options_source'];
             require_once elis::plugin_file('elisfields_manual', 'sources.php');
             $basedir = elis::plugin_file('elisfields_manual', 'sources');
             $src_file = $basedir . '/' . $menu_options_src . '.php';
             if (file_exists($src_file)) {
                 require_once $src_file;
                 $classname = "manual_options_{$menu_options_src}";
                 $plugin = new $classname();
                 $menu_options = $plugin->get_options($data);
             } else {
                 error_log("field_owner::get_menu_options() - ERROR: no source file {$src_file} for fieldid = {$this->fieldid}");
             }
         } else {
             if (!empty($params['options'])) {
                 $options = explode("\n", $params['options']);
                 if (!empty($options)) {
                     $menu_options = array_combine($options, $options);
                 }
             } else {
                 error_log("field_owner::get_menu_options() - no menu options found for fieldid = {$this->fieldid}");
             }
         }
     }
     return $menu_options;
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:39,代码来源:customfield.class.php

示例13: __construct

 /**
  * Create a new customuserfieldtable object.
  *
  * @param mixed $items array (or other iterable) of items to be displayed
  * in the table.  Each element in the array should be an object, with
  * fields matching the names in {@var $columns} containing the data.
  * @param array $columns mapping of column IDs to column configuration.
  * The column configuration is an array with the following entries:
  * - header (optional): the plain-text name, used for the table header.
  *   Can either be a string or an array (for headers that allow sorting on
  *   multiple values, e.g. first-name/last-name).  If it is an array, then
  *   the key is an ID used for sorting (if applicable), and the value is
  *   an array of similar form to the $columns array, but only the 'header'
  *   and 'sortable' keys are used.  (Defaults to empty.)
  * - display_function (optional): the function used to display the column
  *   entry.  This can either be the name of a method, or a PHP callback.
  *   Takes two arguments: the column ID, and the item (from the $items
  *   array).  Returns a string (or something that can be cast to a string).
  *   (Defaults to the get_item_display_default method, which just returns
  *   htmlspecialchars($item->$column), where $column is the column ID.)
  * - decorator (optional): a function used to decorate the column entry
  *   (e.g. add links, change the text style, etc).  This is a PHP callback
  *   that takes three arguments: the column contents (the return value from
  *   display_function), the column ID, and the item.  (Defaults to doing
  *   nothing.)
  * - sortable (optional): whether the column can be used for sorting.  Can
  *   be either true, false, display_table::ASC (which indicates that
  *   the table is sorted by this column in the ascending direction), or
  *   display_table::DESC.  This has no effect if the header entry is an
  *   array.  (Defaults to the return value of is_sortable_default, which
  *   defaults to true unless overridden by a  subclass.)
  * - wrapped (optional): whether the column data should be wrapped if it is
  *   too long.  (Defaults to the return value of is_column_wrapped_default,
  *   which defaults to true unless overridden by a subclass.)
  * - align (optional): how the column data should be aligned (left, right,
  *   center).  (Defaults to the return value of get_column_align_default(),
  *   which defaults to left unless overridden by a subclass.)
  * @param moodle_url $base_url base url to the page, for changing sort
  * order. Only needed if the table can be sorted.
  * @param string $sort_param the name of the URL parameter to add to
  * $pageurl to specify the column to sort by.
  * @param string $sortdir_param the name of the URL parameter to add to
  * $pageurl to specify the direction of the sort.
  * @param array $attributes associative array of table attributes like:
  * 'id' => 'tableid', 'width' => '90%', 'cellpadding', 'cellspacing' ...
  */
 public function __construct($items, $columns, moodle_url $base_url = null, $sort_param = 'sort', $sortdir_param = 'dir', array $attributes = array())
 {
     parent::__construct($items, $columns, $base_url, $sort_param, $sortdir_param, $attributes);
     if (is_readable(elis::plugin_file("elisfields_moodleprofile", 'custom_fields.php'))) {
         include_once elis::plugin_file("elisfields_moodleprofile", 'custom_fields.php');
         if (function_exists('moodle_profile_can_sync')) {
             $this->cansyncfcn = 'moodle_profile_can_sync';
         }
     }
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:56,代码来源:customfieldpage.class.php

示例14:

 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    block_elisadmin
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2014 Remote Learner.net Inc http://www.remote-learner.net
 *
 */
require_once $CFG->dirroot . '/local/elisprogram/lib/setup.php';
require_once elispm::lib('lib.php');
require_once elis::plugin_file('block_elisadmin', 'lib.php');
require_once elispm::lib('menuitem.class.php');
require_once elispm::lib('data/userset.class.php');
require_once elispm::lib('deprecatedlib.php');
/// Add curriculum stylesheets...
/*
if (file_exists($CFG->dirroot.'/curriculum/styles.css')) {
//    echo '<link style="text/css" REL=StyleSheet HREF="' . $CFG->wwwroot . '/curriculum/styles.css" />';
    $CFG->stylesheets[] = $CFG->wwwroot . '/curriculum/styles.css';
}
*/
class block_elisadmin extends block_base
{
    var $currentdepth;
    var $spancounter;
    var $tempcontent;
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:block_elisadmin.php

示例15: defined

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    usetenrol_moodleprofile
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2014 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 */
defined('MOODLE_INTERNAL') || die;
require_once dirname(__FILE__) . '/../../../../../config.php';
global $CFG;
require_once $CFG->dirroot . '/local/elisprogram/lib/setup.php';
require_once elispm::lib('data/userset.class.php');
require_once elispm::lib('data/user.class.php');
require_once elis::plugin_file('usetenrol_moodleprofile', 'userset_profile.class.php');
function cluster_moodleprofile_delete_for_cluster($id)
{
    userset_profile::delete_records(new field_filter('clusterid', $id));
}
/* adds to form:
 * profile_field1 -select box
 * profile_value1 -select box corresponding to profile_field1
 *
 * profile_field2 -select box
 * profile_value2 -select box corresponding to profile_field2
 */
function cluster_moodleprofile_edit_form($form, $mform, $clusterid)
{
    global $CFG, $DB, $PAGE;
    /// Only get--at most--two profile field associations for this cluster.
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:lib.php


注:本文中的elis::plugin_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。