id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
215,300
moodle/moodle
mod/forum/classes/local/factories/exporter.php
exporter.get_forum_exporter
public function get_forum_exporter( stdClass $user, forum_entity $forum, ?int $currentgroup ) : forum_exporter { return new forum_exporter($forum, [ 'legacydatamapperfactory' => $this->legacydatamapperfactory, 'capabilitymanager' => $this->managerfactory->get_...
php
public function get_forum_exporter( stdClass $user, forum_entity $forum, ?int $currentgroup ) : forum_exporter { return new forum_exporter($forum, [ 'legacydatamapperfactory' => $this->legacydatamapperfactory, 'capabilitymanager' => $this->managerfactory->get_...
[ "public", "function", "get_forum_exporter", "(", "stdClass", "$", "user", ",", "forum_entity", "$", "forum", ",", "?", "int", "$", "currentgroup", ")", ":", "forum_exporter", "{", "return", "new", "forum_exporter", "(", "$", "forum", ",", "[", "'legacydatamapp...
Construct a new forum exporter for the specified user and forum. @param stdClass $user The user viewing the forum @param forum_entity $forum The forum being viewed @param int $currentgroup The group currently being viewed @return forum_exporter
[ "Construct", "a", "new", "forum", "exporter", "for", "the", "specified", "user", "and", "forum", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/exporter.php#L92-L105
215,301
moodle/moodle
mod/forum/classes/local/factories/exporter.php
exporter.get_discussion_exporter
public function get_discussion_exporter( stdClass $user, forum_entity $forum, discussion_entity $discussion, array $groupsbyid = [], array $favouriteids = [] ) : discussion_exporter { return new discussion_exporter($discussion, [ 'context' => $forum->get_c...
php
public function get_discussion_exporter( stdClass $user, forum_entity $forum, discussion_entity $discussion, array $groupsbyid = [], array $favouriteids = [] ) : discussion_exporter { return new discussion_exporter($discussion, [ 'context' => $forum->get_c...
[ "public", "function", "get_discussion_exporter", "(", "stdClass", "$", "user", ",", "forum_entity", "$", "forum", ",", "discussion_entity", "$", "discussion", ",", "array", "$", "groupsbyid", "=", "[", "]", ",", "array", "$", "favouriteids", "=", "[", "]", "...
Construct a new discussion exporter for the specified user and forum discussion. @param stdClass $user The user viewing the forum @param forum_entity $forum The forum being viewed @param discussion_entity $discussion The discussion being viewed @param stdClass[] $groupsbyid The list of gro...
[ "Construct", "a", "new", "discussion", "exporter", "for", "the", "specified", "user", "and", "forum", "discussion", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/exporter.php#L125-L143
215,302
moodle/moodle
mod/forum/classes/local/factories/exporter.php
exporter.get_discussion_summaries_exporter
public function get_discussion_summaries_exporter( stdClass $user, forum_entity $forum, array $discussions, array $groupsbyid = [], array $groupsbyauthorid = [], array $discussionreplycount = [], array $discussionunreadcount = [], array $latestpostids = []...
php
public function get_discussion_summaries_exporter( stdClass $user, forum_entity $forum, array $discussions, array $groupsbyid = [], array $groupsbyauthorid = [], array $discussionreplycount = [], array $discussionunreadcount = [], array $latestpostids = []...
[ "public", "function", "get_discussion_summaries_exporter", "(", "stdClass", "$", "user", ",", "forum_entity", "$", "forum", ",", "array", "$", "discussions", ",", "array", "$", "groupsbyid", "=", "[", "]", ",", "array", "$", "groupsbyauthorid", "=", "[", "]", ...
Construct a new discussion summaries exporter for the specified user and set of discussions. @param stdClass $user The user viewing the forum @param forum_entity $forum The forum being viewed @param discussion_summary_entity[] $discussions The set of discussion summaries to export @param stdClass[] ...
[ "Construct", "a", "new", "discussion", "summaries", "exporter", "for", "the", "specified", "user", "and", "set", "of", "discussions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/exporter.php#L169-L199
215,303
moodle/moodle
mod/forum/classes/local/factories/exporter.php
exporter.get_posts_exporter
public function get_posts_exporter( stdClass $user, forum_entity $forum, discussion_entity $discussion, array $posts, array $authorsbyid = [], array $authorcontextids = [], array $attachmentsbypostid = [], array $groupsbyauthorid = [], post_read_re...
php
public function get_posts_exporter( stdClass $user, forum_entity $forum, discussion_entity $discussion, array $posts, array $authorsbyid = [], array $authorcontextids = [], array $attachmentsbypostid = [], array $groupsbyauthorid = [], post_read_re...
[ "public", "function", "get_posts_exporter", "(", "stdClass", "$", "user", ",", "forum_entity", "$", "forum", ",", "discussion_entity", "$", "discussion", ",", "array", "$", "posts", ",", "array", "$", "authorsbyid", "=", "[", "]", ",", "array", "$", "authorc...
Construct a new post exporter for the specified user and set of post. @param stdClass $user The user viewing the forum @param forum_entity $forum The forum being viewed @param discussion_entity $discussion The discussion that the post is in @param post_entity[] $posts The set of posts to be exporte...
[ "Construct", "a", "new", "post", "exporter", "for", "the", "specified", "user", "and", "set", "of", "post", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/factories/exporter.php#L227-L260
215,304
moodle/moodle
mod/forum/classes/local/data_mappers/legacy/forum.php
forum.to_legacy_objects
public function to_legacy_objects(array $forums) : array { return array_map(function(forum_entity $forum) { return (object) [ 'id' => $forum->get_id(), 'course' => $forum->get_course_id(), 'type' => $forum->get_type(), 'name' => $forum-...
php
public function to_legacy_objects(array $forums) : array { return array_map(function(forum_entity $forum) { return (object) [ 'id' => $forum->get_id(), 'course' => $forum->get_course_id(), 'type' => $forum->get_type(), 'name' => $forum-...
[ "public", "function", "to_legacy_objects", "(", "array", "$", "forums", ")", ":", "array", "{", "return", "array_map", "(", "function", "(", "forum_entity", "$", "forum", ")", "{", "return", "(", "object", ")", "[", "'id'", "=>", "$", "forum", "->", "get...
Convert a list of forum entities into stdClasses. @param forum_entity[] $forums The forums to convert. @return stdClass[]
[ "Convert", "a", "list", "of", "forum", "entities", "into", "stdClasses", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/data_mappers/legacy/forum.php#L45-L77
215,305
moodle/moodle
cache/stores/memcached/addinstanceform.php
cachestore_memcached_addinstance_form.validation
public function validation($data, $files) { $errors = parent::validation($data, $files); if (isset($data['clustered']) && ($data['clustered'] == 1)) { // Set servers is required with in cluster mode. if (!isset($data['setservers'])) { $errors['setservers'] = get_...
php
public function validation($data, $files) { $errors = parent::validation($data, $files); if (isset($data['clustered']) && ($data['clustered'] == 1)) { // Set servers is required with in cluster mode. if (!isset($data['setservers'])) { $errors['setservers'] = get_...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "isset", "(", "$", "data", "[", "'clustered'", "]", ")", ...
Perform minimal validation on the settings form. @param array $data @param array $files
[ "Perform", "minimal", "validation", "on", "the", "settings", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/memcached/addinstanceform.php#L117-L146
215,306
moodle/moodle
question/type/ddimageortext/edit_ddimageortext_form.php
qtype_ddimageortext_edit_form.definition_draggable_items
protected function definition_draggable_items($mform, $itemrepeatsatstart) { $mform->addElement('header', 'draggableitemheader', get_string('draggableitems', 'qtype_ddimageortext')); $mform->addElement('advcheckbox', 'shuffleanswers', ' ', ...
php
protected function definition_draggable_items($mform, $itemrepeatsatstart) { $mform->addElement('header', 'draggableitemheader', get_string('draggableitems', 'qtype_ddimageortext')); $mform->addElement('advcheckbox', 'shuffleanswers', ' ', ...
[ "protected", "function", "definition_draggable_items", "(", "$", "mform", ",", "$", "itemrepeatsatstart", ")", "{", "$", "mform", "->", "addElement", "(", "'header'", ",", "'draggableitemheader'", ",", "get_string", "(", "'draggableitems'", ",", "'qtype_ddimageortext'...
Drag items.
[ "Drag", "items", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/ddimageortext/edit_ddimageortext_form.php#L126-L136
215,307
moodle/moodle
question/type/ddimageortext/edit_ddimageortext_form.php
qtype_ddimageortext_edit_form.drop_zone
protected function drop_zone($mform, $imagerepeats) { $dropzoneitem = array(); $grouparray = array(); $grouparray[] = $mform->createElement('text', 'xleft', get_string('xleft', 'qtype_ddimageortext'), ...
php
protected function drop_zone($mform, $imagerepeats) { $dropzoneitem = array(); $grouparray = array(); $grouparray[] = $mform->createElement('text', 'xleft', get_string('xleft', 'qtype_ddimageortext'), ...
[ "protected", "function", "drop_zone", "(", "$", "mform", ",", "$", "imagerepeats", ")", "{", "$", "dropzoneitem", "=", "array", "(", ")", ";", "$", "grouparray", "=", "array", "(", ")", ";", "$", "grouparray", "[", "]", "=", "$", "mform", "->", "crea...
Drop zones.
[ "Drop", "zones", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/ddimageortext/edit_ddimageortext_form.php#L179-L204
215,308
moodle/moodle
lib/google/src/Google/Cache/Memcache.php
Google_Cache_Memcache.connect
private function connect() { if ($this->connection) { return; } if (class_exists("Memcached")) { $this->mc = new Memcached(); $this->mc->addServer($this->host, $this->port); $this->connection = true; } else { $this->connection = memcache_pconnect($this->host, $this->por...
php
private function connect() { if ($this->connection) { return; } if (class_exists("Memcached")) { $this->mc = new Memcached(); $this->mc->addServer($this->host, $this->port); $this->connection = true; } else { $this->connection = memcache_pconnect($this->host, $this->por...
[ "private", "function", "connect", "(", ")", "{", "if", "(", "$", "this", "->", "connection", ")", "{", "return", ";", "}", "if", "(", "class_exists", "(", "\"Memcached\"", ")", ")", "{", "$", "this", "->", "mc", "=", "new", "Memcached", "(", ")", "...
Lazy initialiser for memcache connection. Uses pconnect for to take advantage of the persistence pool where possible.
[ "Lazy", "initialiser", "for", "memcache", "connection", ".", "Uses", "pconnect", "for", "to", "take", "advantage", "of", "the", "persistence", "pool", "where", "possible", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/Cache/Memcache.php#L163-L183
215,309
moodle/moodle
analytics/classes/user.php
user.instance
public static function instance($user, ?\context $context = null) { $userid = $user; if (!is_scalar($userid)) { $userid = $user->id; } if (self::$cachedid === $userid) { return self::$cachedinstance; } $cachedinstance = new \core_analytics\user(...
php
public static function instance($user, ?\context $context = null) { $userid = $user; if (!is_scalar($userid)) { $userid = $user->id; } if (self::$cachedid === $userid) { return self::$cachedinstance; } $cachedinstance = new \core_analytics\user(...
[ "public", "static", "function", "instance", "(", "$", "user", ",", "?", "\\", "context", "$", "context", "=", "null", ")", "{", "$", "userid", "=", "$", "user", ";", "if", "(", "!", "is_scalar", "(", "$", "userid", ")", ")", "{", "$", "userid", "...
Returns an analytics user instance. Lazy load of analysable data. @param int|\stdClass $user User object or user id @param \context|null $context @return \core_analytics\user
[ "Returns", "an", "analytics", "user", "instance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/user.php#L100-L115
215,310
moodle/moodle
analytics/classes/user.php
user.load
protected function load() { // The instance constructor could be already loaded with the full user object. Using email // because it is a required user field. if (empty($this->user->email)) { $this->user = \core_user::get_user($this->user->id); } $this->usercontext ...
php
protected function load() { // The instance constructor could be already loaded with the full user object. Using email // because it is a required user field. if (empty($this->user->email)) { $this->user = \core_user::get_user($this->user->id); } $this->usercontext ...
[ "protected", "function", "load", "(", ")", "{", "// The instance constructor could be already loaded with the full user object. Using email", "// because it is a required user field.", "if", "(", "empty", "(", "$", "this", "->", "user", "->", "email", ")", ")", "{", "$", ...
Loads the analytics user object. @return void
[ "Loads", "the", "analytics", "user", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/user.php#L131-L145
215,311
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.init_plugin
function init_plugin($authtype) { $this->pluginconfig = 'auth_'.$authtype; $this->config = get_config($this->pluginconfig); if (empty($this->config->ldapencoding)) { $this->config->ldapencoding = 'utf-8'; } if (empty($this->config->user_type)) { $this->con...
php
function init_plugin($authtype) { $this->pluginconfig = 'auth_'.$authtype; $this->config = get_config($this->pluginconfig); if (empty($this->config->ldapencoding)) { $this->config->ldapencoding = 'utf-8'; } if (empty($this->config->user_type)) { $this->con...
[ "function", "init_plugin", "(", "$", "authtype", ")", "{", "$", "this", "->", "pluginconfig", "=", "'auth_'", ".", "$", "authtype", ";", "$", "this", "->", "config", "=", "get_config", "(", "$", "this", "->", "pluginconfig", ")", ";", "if", "(", "empty...
Init plugin config from database settings depending on the plugin auth type.
[ "Init", "plugin", "config", "from", "database", "settings", "depending", "on", "the", "plugin", "auth", "type", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L92-L118
215,312
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.user_exists
function user_exists($username) { $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); // Returns true if given username exists on ldap $users = $this->ldap_get_userlist('('.$this->config->user_attribute.'='.ldap_filter_addslashes($extusername).')'); retur...
php
function user_exists($username) { $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); // Returns true if given username exists on ldap $users = $this->ldap_get_userlist('('.$this->config->user_attribute.'='.ldap_filter_addslashes($extusername).')'); retur...
[ "function", "user_exists", "(", "$", "username", ")", "{", "$", "extusername", "=", "core_text", "::", "convert", "(", "$", "username", ",", "'utf-8'", ",", "$", "this", "->", "config", "->", "ldapencoding", ")", ";", "// Returns true if given username exists on...
Checks if user exists on LDAP @param string $username
[ "Checks", "if", "user", "exists", "on", "LDAP" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L339-L345
215,313
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.user_signup
function user_signup($user, $notify=true) { global $CFG, $DB, $PAGE, $OUTPUT; require_once($CFG->dirroot.'/user/profile/lib.php'); require_once($CFG->dirroot.'/user/lib.php'); if ($this->user_exists($user->username)) { print_error('auth_ldap_user_exists', 'auth_ldap'); ...
php
function user_signup($user, $notify=true) { global $CFG, $DB, $PAGE, $OUTPUT; require_once($CFG->dirroot.'/user/profile/lib.php'); require_once($CFG->dirroot.'/user/lib.php'); if ($this->user_exists($user->username)) { print_error('auth_ldap_user_exists', 'auth_ldap'); ...
[ "function", "user_signup", "(", "$", "user", ",", "$", "notify", "=", "true", ")", "{", "global", "$", "CFG", ",", "$", "DB", ",", "$", "PAGE", ",", "$", "OUTPUT", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/user/profile/lib.php'", ...
Sign up a new user ready for confirmation. Password is passed in plaintext. @param object $user new user object @param boolean $notify print notice with link and terminate @return boolean success
[ "Sign", "up", "a", "new", "user", "ready", "for", "confirmation", ".", "Password", "is", "passed", "in", "plaintext", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L524-L575
215,314
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.password_expire
function password_expire($username) { $result = 0; $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); $ldapconnection = $this->ldap_connect(); $user_dn = $this->ldap_find_userdn($ldapconnection, $extusername); $search_attribs = array($this->conf...
php
function password_expire($username) { $result = 0; $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); $ldapconnection = $this->ldap_connect(); $user_dn = $this->ldap_find_userdn($ldapconnection, $extusername); $search_attribs = array($this->conf...
[ "function", "password_expire", "(", "$", "username", ")", "{", "$", "result", "=", "0", ";", "$", "extusername", "=", "core_text", "::", "convert", "(", "$", "username", ",", "'utf-8'", ",", "$", "this", "->", "config", "->", "ldapencoding", ")", ";", ...
Return number of days to user password expires If userpassword does not expire it should return 0. If password is already expired it should return negative value. @param mixed $username username @return integer
[ "Return", "number", "of", "days", "to", "user", "password", "expires" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L626-L656
215,315
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_bulk_insert
function ldap_bulk_insert($username) { global $DB, $CFG; $username = core_text::strtolower($username); // usernames are __always__ lowercase. $DB->insert_record_raw('tmp_extuser', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost...
php
function ldap_bulk_insert($username) { global $DB, $CFG; $username = core_text::strtolower($username); // usernames are __always__ lowercase. $DB->insert_record_raw('tmp_extuser', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost...
[ "function", "ldap_bulk_insert", "(", "$", "username", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "$", "username", "=", "core_text", "::", "strtolower", "(", "$", "username", ")", ";", "// usernames are __always__ lowercase.", "$", "DB", "->", "inse...
Bulk insert in SQL's temp table
[ "Bulk", "insert", "in", "SQL", "s", "temp", "table" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L954-L961
215,316
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.is_role
private function is_role($username, $role) { if (empty($this->config->{$role['settingname']}) or empty($this->config->memberattribute)) { return null; } $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); $ldapconnection = $this->ldap_connect...
php
private function is_role($username, $role) { if (empty($this->config->{$role['settingname']}) or empty($this->config->memberattribute)) { return null; } $extusername = core_text::convert($username, 'utf-8', $this->config->ldapencoding); $ldapconnection = $this->ldap_connect...
[ "private", "function", "is_role", "(", "$", "username", ",", "$", "role", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "config", "->", "{", "$", "role", "[", "'settingname'", "]", "}", ")", "or", "empty", "(", "$", "this", "->", "config", ...
Check if user has LDAP group membership. Returns true if user should be assigned role. @param mixed $username username (without system magic quotes). @param array $role Array of role's shortname, localname, and settingname for the config value. @return mixed result null if role/LDAP context is not configured, boolean...
[ "Check", "if", "user", "has", "LDAP", "group", "membership", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1053-L1076
215,317
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_expirationtime2unix
function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) { $result = false; switch ($this->config->user_type) { case 'edir': $yr=substr($time, 0, 4); $mo=substr($time, 4, 2); $dt=substr($time, 6, 2); $hr=substr($time...
php
function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) { $result = false; switch ($this->config->user_type) { case 'edir': $yr=substr($time, 0, 4); $mo=substr($time, 4, 2); $dt=substr($time, 6, 2); $hr=substr($time...
[ "function", "ldap_expirationtime2unix", "(", "$", "time", ",", "$", "ldapconnection", ",", "$", "user_dn", ")", "{", "$", "result", "=", "false", ";", "switch", "(", "$", "this", "->", "config", "->", "user_type", ")", "{", "case", "'edir'", ":", "$", ...
Take expirationtime and return it as unix timestamp in seconds Takes expiration timestamp as read from LDAP and returns it as unix timestamp in seconds Depends on $this->config->user_type variable @param mixed time Time stamp read from LDAP as it is. @param string $ldapconnection Only needed for Active Directory. @...
[ "Take", "expirationtime", "and", "return", "it", "as", "unix", "timestamp", "in", "seconds" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1417-L1440
215,318
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_unix2expirationtime
function ldap_unix2expirationtime($time) { $result = false; switch ($this->config->user_type) { case 'edir': $result=date('YmdHis', $time).'Z'; break; case 'rfc2307': case 'rfc2307bis': $result = $time ; // Already in co...
php
function ldap_unix2expirationtime($time) { $result = false; switch ($this->config->user_type) { case 'edir': $result=date('YmdHis', $time).'Z'; break; case 'rfc2307': case 'rfc2307bis': $result = $time ; // Already in co...
[ "function", "ldap_unix2expirationtime", "(", "$", "time", ")", "{", "$", "result", "=", "false", ";", "switch", "(", "$", "this", "->", "config", "->", "user_type", ")", "{", "case", "'edir'", ":", "$", "result", "=", "date", "(", "'YmdHis'", ",", "$",...
Takes unix timestamp and returns it formated for storing in LDAP @param integer unix time stamp
[ "Takes", "unix", "timestamp", "and", "returns", "it", "formated", "for", "storing", "in", "LDAP" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1447-L1462
215,319
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_attributes
function ldap_attributes () { $moodleattributes = array(); // If we have custom fields then merge them with user fields. $customfields = $this->get_custom_user_profile_fields(); if (!empty($customfields) && !empty($this->userfields)) { $userfields = array_merge($this->userfie...
php
function ldap_attributes () { $moodleattributes = array(); // If we have custom fields then merge them with user fields. $customfields = $this->get_custom_user_profile_fields(); if (!empty($customfields) && !empty($this->userfields)) { $userfields = array_merge($this->userfie...
[ "function", "ldap_attributes", "(", ")", "{", "$", "moodleattributes", "=", "array", "(", ")", ";", "// If we have custom fields then merge them with user fields.", "$", "customfields", "=", "$", "this", "->", "get_custom_user_profile_fields", "(", ")", ";", "if", "("...
Returns user attribute mappings between moodle and LDAP @return array
[ "Returns", "user", "attribute", "mappings", "between", "moodle", "and", "LDAP" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1470-L1491
215,320
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_get_userlist
function ldap_get_userlist($filter='*') { $fresult = array(); $ldapconnection = $this->ldap_connect(); if ($filter == '*') { $filter = '(&('.$this->config->user_attribute.'=*)'.$this->config->objectclass.')'; } $contexts = explode(';', $this->config->contexts); ...
php
function ldap_get_userlist($filter='*') { $fresult = array(); $ldapconnection = $this->ldap_connect(); if ($filter == '*') { $filter = '(&('.$this->config->user_attribute.'=*)'.$this->config->objectclass.')'; } $contexts = explode(';', $this->config->contexts); ...
[ "function", "ldap_get_userlist", "(", "$", "filter", "=", "'*'", ")", "{", "$", "fresult", "=", "array", "(", ")", ";", "$", "ldapconnection", "=", "$", "this", "->", "ldap_connect", "(", ")", ";", "if", "(", "$", "filter", "==", "'*'", ")", "{", "...
Returns all usernames from LDAP @param $filter An LDAP search filter to select desired users @return array of LDAP user names converted to UTF-8
[ "Returns", "all", "usernames", "from", "LDAP" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1499-L1552
215,321
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.change_password_url
function change_password_url() { if (empty($this->config->stdchangepassword)) { if (!empty($this->config->changepasswordurl)) { return new moodle_url($this->config->changepasswordurl); } else { return null; } } else { return...
php
function change_password_url() { if (empty($this->config->stdchangepassword)) { if (!empty($this->config->changepasswordurl)) { return new moodle_url($this->config->changepasswordurl); } else { return null; } } else { return...
[ "function", "change_password_url", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "config", "->", "stdchangepassword", ")", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "config", "->", "changepasswordurl", ")", ")", "{", "retu...
Returns the URL for changing the user's password, or empty if the default can be used. @return moodle_url
[ "Returns", "the", "URL", "for", "changing", "the", "user", "s", "password", "or", "empty", "if", "the", "default", "can", "be", "used", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1588-L1598
215,322
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.loginpage_hook
function loginpage_hook() { global $CFG, $SESSION; // HTTPS is potentially required //httpsrequired(); - this must be used before setting the URL, it is already done on the login/index.php if (($_SERVER['REQUEST_METHOD'] === 'GET' // Only on initial GET of loginpage ...
php
function loginpage_hook() { global $CFG, $SESSION; // HTTPS is potentially required //httpsrequired(); - this must be used before setting the URL, it is already done on the login/index.php if (($_SERVER['REQUEST_METHOD'] === 'GET' // Only on initial GET of loginpage ...
[ "function", "loginpage_hook", "(", ")", "{", "global", "$", "CFG", ",", "$", "SESSION", ";", "// HTTPS is potentially required", "//httpsrequired(); - this must be used before setting the URL, it is already done on the login/index.php", "if", "(", "(", "$", "_SERVER", "[", "'...
Will get called before the login page is shownr. Ff NTLM SSO is enabled, and the user is in the right network, we'll redirect to the magic NTLM page for SSO...
[ "Will", "get", "called", "before", "the", "login", "page", "is", "shownr", ".", "Ff", "NTLM", "SSO", "is", "enabled", "and", "the", "user", "is", "in", "the", "right", "network", "we", "ll", "redirect", "to", "the", "magic", "NTLM", "page", "for", "SSO...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1606-L1662
215,323
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ntlmsso_magic
function ntlmsso_magic($sesskey) { if (isset($_SERVER['REMOTE_USER']) && !empty($_SERVER['REMOTE_USER'])) { // HTTP __headers__ seem to be sent in ISO-8859-1 encoding // (according to my reading of RFC-1945, RFC-2616 and RFC-2617 and // my local tests), so we need to convert...
php
function ntlmsso_magic($sesskey) { if (isset($_SERVER['REMOTE_USER']) && !empty($_SERVER['REMOTE_USER'])) { // HTTP __headers__ seem to be sent in ISO-8859-1 encoding // (according to my reading of RFC-1945, RFC-2616 and RFC-2617 and // my local tests), so we need to convert...
[ "function", "ntlmsso_magic", "(", "$", "sesskey", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "'REMOTE_USER'", "]", ")", "&&", "!", "empty", "(", "$", "_SERVER", "[", "'REMOTE_USER'", "]", ")", ")", "{", "// HTTP __headers__ seem to be sent in IS...
To be called from a page running under NTLM's "Integrated Windows Authentication". If successful, it will set a special "cookie" (not an HTTP cookie!) in cache_flags under the $this->pluginconfig/ntlmsess "plugin" and return true. The "cookie" will be picked up by ntlmsso_finish() to complete the process. On failure ...
[ "To", "be", "called", "from", "a", "page", "running", "under", "NTLM", "s", "Integrated", "Windows", "Authentication", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1681-L1712
215,324
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.sync_roles
function sync_roles($user) { global $DB; $roles = get_ldap_assignable_role_names(2); // Admin user. foreach ($roles as $role) { $isrole = $this->is_role($user->username, $role); if ($isrole === null) { continue; // Nothing to sync - role/LDAP contexts no...
php
function sync_roles($user) { global $DB; $roles = get_ldap_assignable_role_names(2); // Admin user. foreach ($roles as $role) { $isrole = $this->is_role($user->username, $role); if ($isrole === null) { continue; // Nothing to sync - role/LDAP contexts no...
[ "function", "sync_roles", "(", "$", "user", ")", "{", "global", "$", "DB", ";", "$", "roles", "=", "get_ldap_assignable_role_names", "(", "2", ")", ";", "// Admin user.", "foreach", "(", "$", "roles", "as", "$", "role", ")", "{", "$", "isrole", "=", "$...
Sync roles for this user. @param object $user The user to sync (without system magic quotes).
[ "Sync", "roles", "for", "this", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1770-L1791
215,325
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.ldap_get_ad_pwdexpire
function ldap_get_ad_pwdexpire($pwdlastset, $ldapconn, $user_dn){ global $CFG; if (!function_exists('bcsub')) { error_log($this->errorlogtag.get_string ('needbcmath', 'auth_ldap')); return 0; } // If UF_DONT_EXPIRE_PASSWD flag is set in user's // userAcc...
php
function ldap_get_ad_pwdexpire($pwdlastset, $ldapconn, $user_dn){ global $CFG; if (!function_exists('bcsub')) { error_log($this->errorlogtag.get_string ('needbcmath', 'auth_ldap')); return 0; } // If UF_DONT_EXPIRE_PASSWD flag is set in user's // userAcc...
[ "function", "ldap_get_ad_pwdexpire", "(", "$", "pwdlastset", ",", "$", "ldapconn", ",", "$", "user_dn", ")", "{", "global", "$", "CFG", ";", "if", "(", "!", "function_exists", "(", "'bcsub'", ")", ")", "{", "error_log", "(", "$", "this", "->", "errorlogt...
Get password expiration time for a given user from Active Directory @param string $pwdlastset The time last time we changed the password. @param resource $lcapconn The open LDAP connection. @param string $user_dn The distinguished name of the user we are checking. @return string $unixtime
[ "Get", "password", "expiration", "time", "for", "a", "given", "user", "from", "Active", "Directory" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L1802-L1943
215,326
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.is_user_suspended
protected function is_user_suspended($user) { if (!$this->config->suspended_attribute || !isset($user->suspended)) { return false; } if ($this->config->suspended_attribute == 'useraccountcontrol' && $this->config->user_type == 'ad') { return (bool)($user->suspended & AUTH...
php
protected function is_user_suspended($user) { if (!$this->config->suspended_attribute || !isset($user->suspended)) { return false; } if ($this->config->suspended_attribute == 'useraccountcontrol' && $this->config->user_type == 'ad') { return (bool)($user->suspended & AUTH...
[ "protected", "function", "is_user_suspended", "(", "$", "user", ")", "{", "if", "(", "!", "$", "this", "->", "config", "->", "suspended_attribute", "||", "!", "isset", "(", "$", "user", "->", "suspended", ")", ")", "{", "return", "false", ";", "}", "if...
Check if a user is suspended. This function is intended to be used after calling get_userinfo_asobj. This is needed because LDAP doesn't have a notion of disabled users, however things like MS Active Directory support it and expose information through a field. @param object $user the user object returned by get_userin...
[ "Check", "if", "a", "user", "is", "suspended", ".", "This", "function", "is", "intended", "to", "be", "used", "after", "calling", "get_userinfo_asobj", ".", "This", "is", "needed", "because", "LDAP", "doesn", "t", "have", "a", "notion", "of", "disabled", "...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L2081-L2090
215,327
moodle/moodle
auth/ldap/auth.php
auth_plugin_ldap.get_profile_keys
protected function get_profile_keys($fetchall = false) { $keys = array_keys(get_object_vars($this->config)); $updatekeys = []; foreach ($keys as $key) { if (preg_match('/^field_updatelocal_(.+)$/', $key, $match)) { // If we have a field to update it from and it must b...
php
protected function get_profile_keys($fetchall = false) { $keys = array_keys(get_object_vars($this->config)); $updatekeys = []; foreach ($keys as $key) { if (preg_match('/^field_updatelocal_(.+)$/', $key, $match)) { // If we have a field to update it from and it must b...
[ "protected", "function", "get_profile_keys", "(", "$", "fetchall", "=", "false", ")", "{", "$", "keys", "=", "array_keys", "(", "get_object_vars", "(", "$", "this", "->", "config", ")", ")", ";", "$", "updatekeys", "=", "[", "]", ";", "foreach", "(", "...
Get the list of profile fields. @param bool $fetchall Fetch all, not just those for update. @return array
[ "Get", "the", "list", "of", "profile", "fields", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/ldap/auth.php#L2192-L2211
215,328
moodle/moodle
lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
HTMLPurifier_ConfigSchema_Validator.validate
public function validate($interchange) { $this->interchange = $interchange; $this->aliases = array(); // PHP is a bit lax with integer <=> string conversions in // arrays, so we don't use the identical !== comparison foreach ($interchange->directives as $i => $directive) { ...
php
public function validate($interchange) { $this->interchange = $interchange; $this->aliases = array(); // PHP is a bit lax with integer <=> string conversions in // arrays, so we don't use the identical !== comparison foreach ($interchange->directives as $i => $directive) { ...
[ "public", "function", "validate", "(", "$", "interchange", ")", "{", "$", "this", "->", "interchange", "=", "$", "interchange", ";", "$", "this", "->", "aliases", "=", "array", "(", ")", ";", "// PHP is a bit lax with integer <=> string conversions in", "// arrays...
Validates a fully-formed interchange object. @param HTMLPurifier_ConfigSchema_Interchange $interchange @return bool
[ "Validates", "a", "fully", "-", "formed", "interchange", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php#L46-L60
215,329
moodle/moodle
lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
HTMLPurifier_ConfigSchema_Validator.validateId
public function validateId($id) { $id_string = $id->toString(); $this->context[] = "id '$id_string'"; if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { // handled by InterchangeBuilder $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_...
php
public function validateId($id) { $id_string = $id->toString(); $this->context[] = "id '$id_string'"; if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { // handled by InterchangeBuilder $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_...
[ "public", "function", "validateId", "(", "$", "id", ")", "{", "$", "id_string", "=", "$", "id", "->", "toString", "(", ")", ";", "$", "this", "->", "context", "[", "]", "=", "\"id '$id_string'\"", ";", "if", "(", "!", "$", "id", "instanceof", "HTMLPu...
Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. @param HTMLPurifier_ConfigSchema_Interchange_Id $id
[ "Validates", "a", "HTMLPurifier_ConfigSchema_Interchange_Id", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php#L66-L80
215,330
moodle/moodle
lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
HTMLPurifier_ConfigSchema_Validator.validateDirective
public function validateDirective($d) { $id = $d->id->toString(); $this->context[] = "directive '$id'"; $this->validateId($d->id); $this->with($d, 'description') ->assertNotEmpty(); // BEGIN - handled by InterchangeBuilder $this->with($d, 'type') ...
php
public function validateDirective($d) { $id = $d->id->toString(); $this->context[] = "directive '$id'"; $this->validateId($d->id); $this->with($d, 'description') ->assertNotEmpty(); // BEGIN - handled by InterchangeBuilder $this->with($d, 'type') ...
[ "public", "function", "validateDirective", "(", "$", "d", ")", "{", "$", "id", "=", "$", "d", "->", "id", "->", "toString", "(", ")", ";", "$", "this", "->", "context", "[", "]", "=", "\"directive '$id'\"", ";", "$", "this", "->", "validateId", "(", ...
Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. @param HTMLPurifier_ConfigSchema_Interchange_Directive $d
[ "Validates", "a", "HTMLPurifier_ConfigSchema_Interchange_Directive", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php#L86-L122
215,331
moodle/moodle
lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php
HTMLPurifier_ConfigSchema_Validator.error
protected function error($target, $msg) { if ($target !== false) { $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); } else { $prefix = ucfirst($this->getFormattedContext()); } throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' ...
php
protected function error($target, $msg) { if ($target !== false) { $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); } else { $prefix = ucfirst($this->getFormattedContext()); } throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' ...
[ "protected", "function", "error", "(", "$", "target", ",", "$", "msg", ")", "{", "if", "(", "$", "target", "!==", "false", ")", "{", "$", "prefix", "=", "ucfirst", "(", "$", "target", ")", ".", "' in '", ".", "$", "this", "->", "getFormattedContext",...
Emits an error, providing helpful context. @throws HTMLPurifier_ConfigSchema_Exception
[ "Emits", "an", "error", "providing", "helpful", "context", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/ConfigSchema/Validator.php#L228-L236
215,332
moodle/moodle
blocks/recent_activity/renderer.php
block_recent_activity_renderer.recent_activity
public function recent_activity($course, $timestart, $recentenrolments, $structuralchanges, $modulesrecentactivity) { $output = html_writer::tag('div', get_string('activitysince', '', userdate($timestart)), array('class' => 'activityhead')); $output .= html_...
php
public function recent_activity($course, $timestart, $recentenrolments, $structuralchanges, $modulesrecentactivity) { $output = html_writer::tag('div', get_string('activitysince', '', userdate($timestart)), array('class' => 'activityhead')); $output .= html_...
[ "public", "function", "recent_activity", "(", "$", "course", ",", "$", "timestart", ",", "$", "recentenrolments", ",", "$", "structuralchanges", ",", "$", "modulesrecentactivity", ")", "{", "$", "output", "=", "html_writer", "::", "tag", "(", "'div'", ",", "...
Renders HTML to display recent_activity block @param stdClass $course @param int $timestart @param array $recentenrolments array of changes in enrolments @param array $structuralchanges array of changes in course structure @param array $modulesrecentactivity array of changes in modules (provided by modules) @return st...
[ "Renders", "HTML", "to", "display", "recent_activity", "block" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/recent_activity/renderer.php#L46-L98
215,333
moodle/moodle
blocks/recent_activity/renderer.php
block_recent_activity_renderer.structural_change
protected function structural_change($change) { $cm = $change['module']; switch ($change['action']) { case 'delete mod': $text = get_string('deletedactivity', 'moodle', $cm->modfullname); break; case 'add mod': $text = get_string('a...
php
protected function structural_change($change) { $cm = $change['module']; switch ($change['action']) { case 'delete mod': $text = get_string('deletedactivity', 'moodle', $cm->modfullname); break; case 'add mod': $text = get_string('a...
[ "protected", "function", "structural_change", "(", "$", "change", ")", "{", "$", "cm", "=", "$", "change", "[", "'module'", "]", ";", "switch", "(", "$", "change", "[", "'action'", "]", ")", "{", "case", "'delete mod'", ":", "$", "text", "=", "get_stri...
Renders HTML for one change in course structure @see block_recent_activity::get_structural_changes() @param array $change array containing attributes 'action' - one of: 'add mod', 'update mod', 'delete mod' 'module' - instance of cm_info (for 'delete mod' it is an object with attributes modname and modfullname) @retur...
[ "Renders", "HTML", "for", "one", "change", "in", "course", "structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/recent_activity/renderer.php#L109-L127
215,334
moodle/moodle
repository/merlot/lib.php
repository_merlot.search
public function search($search_text, $page = 0) { $ret = array(); $ret['nologin'] = true; $ret['list'] = $this->_get_collection($this->keyword, $this->author); return $ret; }
php
public function search($search_text, $page = 0) { $ret = array(); $ret['nologin'] = true; $ret['list'] = $this->_get_collection($this->keyword, $this->author); return $ret; }
[ "public", "function", "search", "(", "$", "search_text", ",", "$", "page", "=", "0", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "$", "ret", "[", "'nologin'", "]", "=", "true", ";", "$", "ret", "[", "'list'", "]", "=", "$", "this", "->",...
Look for a link in merlot.org @param string $search_text @return array
[ "Look", "for", "a", "link", "in", "merlot", ".", "org" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/merlot/lib.php#L67-L72
215,335
moodle/moodle
repository/merlot/lib.php
repository_merlot.get_listing
public function get_listing($path = '', $page = '') { $ret = array(); $ret['nologin'] = true; $ret['list'] = $this->_get_collection($this->keyword); return $ret; }
php
public function get_listing($path = '', $page = '') { $ret = array(); $ret['nologin'] = true; $ret['list'] = $this->_get_collection($this->keyword); return $ret; }
[ "public", "function", "get_listing", "(", "$", "path", "=", "''", ",", "$", "page", "=", "''", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "$", "ret", "[", "'nologin'", "]", "=", "true", ";", "$", "ret", "[", "'list'", "]", "=", "$", "...
Get a list of links @return array
[ "Get", "a", "list", "of", "links" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/merlot/lib.php#L78-L83
215,336
moodle/moodle
repository/merlot/lib.php
repository_merlot.print_login
public function print_login(){ $ret = array(); $search = new stdClass(); $search->type = 'text'; $search->id = 'merlog_search'; $search->name = 'merlot_keyword'; $search->label = get_string('search').': '; $author = new stdClass(); $author->type = 'text'...
php
public function print_login(){ $ret = array(); $search = new stdClass(); $search->type = 'text'; $search->id = 'merlog_search'; $search->name = 'merlot_keyword'; $search->label = get_string('search').': '; $author = new stdClass(); $author->type = 'text'...
[ "public", "function", "print_login", "(", ")", "{", "$", "ret", "=", "array", "(", ")", ";", "$", "search", "=", "new", "stdClass", "(", ")", ";", "$", "search", "->", "type", "=", "'text'", ";", "$", "search", "->", "id", "=", "'merlog_search'", "...
Define a search form @return array
[ "Define", "a", "search", "form" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/merlot/lib.php#L109-L126
215,337
moodle/moodle
lib/spout/src/Spout/Common/Helper/FileSystemHelper.php
FileSystemHelper.createFolder
public function createFolder($parentFolderPath, $folderName) { $this->throwIfOperationNotInBaseFolder($parentFolderPath); $folderPath = $parentFolderPath . '/' . $folderName; $wasCreationSuccessful = mkdir($folderPath, 0777, true); if (!$wasCreationSuccessful) { throw n...
php
public function createFolder($parentFolderPath, $folderName) { $this->throwIfOperationNotInBaseFolder($parentFolderPath); $folderPath = $parentFolderPath . '/' . $folderName; $wasCreationSuccessful = mkdir($folderPath, 0777, true); if (!$wasCreationSuccessful) { throw n...
[ "public", "function", "createFolder", "(", "$", "parentFolderPath", ",", "$", "folderName", ")", "{", "$", "this", "->", "throwIfOperationNotInBaseFolder", "(", "$", "parentFolderPath", ")", ";", "$", "folderPath", "=", "$", "parentFolderPath", ".", "'/'", ".", ...
Creates an empty folder with the given name under the given parent folder. @param string $parentFolderPath The parent folder path under which the folder is going to be created @param string $folderName The name of the folder to create @return string Path of the created folder @throws \Box\Spout\Common\Exception\IOExce...
[ "Creates", "an", "empty", "folder", "with", "the", "given", "name", "under", "the", "given", "parent", "folder", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Common/Helper/FileSystemHelper.php#L35-L47
215,338
moodle/moodle
lib/spout/src/Spout/Common/Helper/FileSystemHelper.php
FileSystemHelper.createFileWithContents
public function createFileWithContents($parentFolderPath, $fileName, $fileContents) { $this->throwIfOperationNotInBaseFolder($parentFolderPath); $filePath = $parentFolderPath . '/' . $fileName; $wasCreationSuccessful = file_put_contents($filePath, $fileContents); if ($wasCreationSu...
php
public function createFileWithContents($parentFolderPath, $fileName, $fileContents) { $this->throwIfOperationNotInBaseFolder($parentFolderPath); $filePath = $parentFolderPath . '/' . $fileName; $wasCreationSuccessful = file_put_contents($filePath, $fileContents); if ($wasCreationSu...
[ "public", "function", "createFileWithContents", "(", "$", "parentFolderPath", ",", "$", "fileName", ",", "$", "fileContents", ")", "{", "$", "this", "->", "throwIfOperationNotInBaseFolder", "(", "$", "parentFolderPath", ")", ";", "$", "filePath", "=", "$", "pare...
Creates a file with the given name and content in the given folder. The parent folder must exist. @param string $parentFolderPath The parent folder path where the file is going to be created @param string $fileName The name of the file to create @param string $fileContents The contents of the file to create @return st...
[ "Creates", "a", "file", "with", "the", "given", "name", "and", "content", "in", "the", "given", "folder", ".", "The", "parent", "folder", "must", "exist", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Common/Helper/FileSystemHelper.php#L59-L71
215,339
moodle/moodle
lib/spout/src/Spout/Common/Helper/FileSystemHelper.php
FileSystemHelper.deleteFile
public function deleteFile($filePath) { $this->throwIfOperationNotInBaseFolder($filePath); if (file_exists($filePath) && is_file($filePath)) { unlink($filePath); } }
php
public function deleteFile($filePath) { $this->throwIfOperationNotInBaseFolder($filePath); if (file_exists($filePath) && is_file($filePath)) { unlink($filePath); } }
[ "public", "function", "deleteFile", "(", "$", "filePath", ")", "{", "$", "this", "->", "throwIfOperationNotInBaseFolder", "(", "$", "filePath", ")", ";", "if", "(", "file_exists", "(", "$", "filePath", ")", "&&", "is_file", "(", "$", "filePath", ")", ")", ...
Delete the file at the given path @param string $filePath Path of the file to delete @return void @throws \Box\Spout\Common\Exception\IOException If the file path is not inside of the base folder
[ "Delete", "the", "file", "at", "the", "given", "path" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Common/Helper/FileSystemHelper.php#L80-L87
215,340
moodle/moodle
lib/spout/src/Spout/Common/Helper/FileSystemHelper.php
FileSystemHelper.deleteFolderRecursively
public function deleteFolderRecursively($folderPath) { $this->throwIfOperationNotInBaseFolder($folderPath); $itemIterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($folderPath, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD...
php
public function deleteFolderRecursively($folderPath) { $this->throwIfOperationNotInBaseFolder($folderPath); $itemIterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($folderPath, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD...
[ "public", "function", "deleteFolderRecursively", "(", "$", "folderPath", ")", "{", "$", "this", "->", "throwIfOperationNotInBaseFolder", "(", "$", "folderPath", ")", ";", "$", "itemIterator", "=", "new", "\\", "RecursiveIteratorIterator", "(", "new", "\\", "Recurs...
Delete the folder at the given path as well as all its contents @param string $folderPath Path of the folder to delete @return void @throws \Box\Spout\Common\Exception\IOException If the folder path is not inside of the base folder
[ "Delete", "the", "folder", "at", "the", "given", "path", "as", "well", "as", "all", "its", "contents" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Common/Helper/FileSystemHelper.php#L96-L114
215,341
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.getChartByIndex
public function getChartByIndex($index = null) { $chartCount = count($this->chartCollection); if ($chartCount == 0) { return false; } if (is_null($index)) { $index = --$chartCount; } if (!isset($this->chartCollection[$index])) { ret...
php
public function getChartByIndex($index = null) { $chartCount = count($this->chartCollection); if ($chartCount == 0) { return false; } if (is_null($index)) { $index = --$chartCount; } if (!isset($this->chartCollection[$index])) { ret...
[ "public", "function", "getChartByIndex", "(", "$", "index", "=", "null", ")", "{", "$", "chartCount", "=", "count", "(", "$", "this", "->", "chartCollection", ")", ";", "if", "(", "$", "chartCount", "==", "0", ")", "{", "return", "false", ";", "}", "...
Get a chart by its index position @param string $index Chart index position @return false|PHPExcel_Chart @throws PHPExcel_Exception
[ "Get", "a", "chart", "by", "its", "index", "position" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L590-L604
215,342
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.getChartByName
public function getChartByName($chartName = '') { $chartCount = count($this->chartCollection); if ($chartCount == 0) { return false; } foreach ($this->chartCollection as $index => $chart) { if ($chart->getName() == $chartName) { return $this->c...
php
public function getChartByName($chartName = '') { $chartCount = count($this->chartCollection); if ($chartCount == 0) { return false; } foreach ($this->chartCollection as $index => $chart) { if ($chart->getName() == $chartName) { return $this->c...
[ "public", "function", "getChartByName", "(", "$", "chartName", "=", "''", ")", "{", "$", "chartCount", "=", "count", "(", "$", "this", "->", "chartCollection", ")", ";", "if", "(", "$", "chartCount", "==", "0", ")", "{", "return", "false", ";", "}", ...
Get a chart by name @param string $chartName Chart name @return false|PHPExcel_Chart @throws PHPExcel_Exception
[ "Get", "a", "chart", "by", "name" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L628-L640
215,343
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.refreshColumnDimensions
public function refreshColumnDimensions() { $currentColumnDimensions = $this->getColumnDimensions(); $newColumnDimensions = array(); foreach ($currentColumnDimensions as $objColumnDimension) { $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension; ...
php
public function refreshColumnDimensions() { $currentColumnDimensions = $this->getColumnDimensions(); $newColumnDimensions = array(); foreach ($currentColumnDimensions as $objColumnDimension) { $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension; ...
[ "public", "function", "refreshColumnDimensions", "(", ")", "{", "$", "currentColumnDimensions", "=", "$", "this", "->", "getColumnDimensions", "(", ")", ";", "$", "newColumnDimensions", "=", "array", "(", ")", ";", "foreach", "(", "$", "currentColumnDimensions", ...
Refresh column dimensions @return PHPExcel_Worksheet
[ "Refresh", "column", "dimensions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L647-L659
215,344
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.cellExists
public function cellExists($pCoordinate = 'A1') { // Worksheet reference? if (strpos($pCoordinate, '!') !== false) { $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtou...
php
public function cellExists($pCoordinate = 'A1') { // Worksheet reference? if (strpos($pCoordinate, '!') !== false) { $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtou...
[ "public", "function", "cellExists", "(", "$", "pCoordinate", "=", "'A1'", ")", "{", "// Worksheet reference?", "if", "(", "strpos", "(", "$", "pCoordinate", ",", "'!'", ")", "!==", "false", ")", "{", "$", "worksheetReference", "=", "PHPExcel_Worksheet", "::", ...
Does the cell at a specific coordinate exist? @param string $pCoordinate Coordinate of the cell @throws PHPExcel_Exception @return boolean
[ "Does", "the", "cell", "at", "a", "specific", "coordinate", "exist?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1242-L1282
215,345
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.setDefaultStyle
public function setDefaultStyle(PHPExcel_Style $pValue) { $this->parent->getDefaultStyle()->applyFromArray(array( 'font' => array( 'name' => $pValue->getFont()->getName(), 'size' => $pValue->getFont()->getSize(), ), )); return $this; ...
php
public function setDefaultStyle(PHPExcel_Style $pValue) { $this->parent->getDefaultStyle()->applyFromArray(array( 'font' => array( 'name' => $pValue->getFont()->getName(), 'size' => $pValue->getFont()->getSize(), ), )); return $this; ...
[ "public", "function", "setDefaultStyle", "(", "PHPExcel_Style", "$", "pValue", ")", "{", "$", "this", "->", "parent", "->", "getDefaultStyle", "(", ")", "->", "applyFromArray", "(", "array", "(", "'font'", "=>", "array", "(", "'name'", "=>", "$", "pValue", ...
Set default style - should only be used by PHPExcel_IReader implementations! @deprecated @param PHPExcel_Style $pValue @throws PHPExcel_Exception @return PHPExcel_Worksheet
[ "Set", "default", "style", "-", "should", "only", "be", "used", "by", "PHPExcel_IReader", "implementations!" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1385-L1394
215,346
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.getStyleByColumnAndRow
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null) { if (!is_null($pColumn2) && !is_null($pRow2)) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; retu...
php
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null) { if (!is_null($pColumn2) && !is_null($pRow2)) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; retu...
[ "public", "function", "getStyleByColumnAndRow", "(", "$", "pColumn", "=", "0", ",", "$", "pRow", "=", "1", ",", "$", "pColumn2", "=", "null", ",", "$", "pRow2", "=", "null", ")", "{", "if", "(", "!", "is_null", "(", "$", "pColumn2", ")", "&&", "!",...
Get style for cell by using numeric cell coordinates @param int $pColumn Numeric column coordinate of the cell @param int $pRow Numeric row coordinate of the cell @param int pColumn2 Numeric column coordinate of the range cell @param int pRow2 Numeric row coordinate of the range cell @return PHPExcel_Style
[ "Get", "style", "for", "cell", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1487-L1495
215,347
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.setSharedStyle
public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') { $this->duplicateStyle($pSharedCellStyle, $pRange); return $this; }
php
public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') { $this->duplicateStyle($pSharedCellStyle, $pRange); return $this; }
[ "public", "function", "setSharedStyle", "(", "PHPExcel_Style", "$", "pSharedCellStyle", "=", "null", ",", "$", "pRange", "=", "''", ")", "{", "$", "this", "->", "duplicateStyle", "(", "$", "pSharedCellStyle", ",", "$", "pRange", ")", ";", "return", "$", "t...
Set shared cell style to a range of cells Please note that this will overwrite existing cell styles for cells in range! @deprecated @param PHPExcel_Style $pSharedCellStyle Cell style to share @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") @throws PHPExcel_Exception @return PHPExcel...
[ "Set", "shared", "cell", "style", "to", "a", "range", "of", "cells" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1508-L1512
215,348
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.duplicateStyleArray
public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) { $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced); return $this; }
php
public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) { $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced); return $this; }
[ "public", "function", "duplicateStyleArray", "(", "$", "pStyles", "=", "null", ",", "$", "pRange", "=", "''", ",", "$", "pAdvanced", "=", "true", ")", "{", "$", "this", "->", "getStyle", "(", "$", "pRange", ")", "->", "applyFromArray", "(", "$", "pStyl...
Duplicate cell style array to a range of cells Please note that this will overwrite existing cell styles for cells in range, if they are in the styles array. For example, if you decide to set a range of cells to font bold, only include font bold in the styles array. @deprecated @param array $pStyles Array containing ...
[ "Duplicate", "cell", "style", "array", "to", "a", "range", "of", "cells" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1612-L1616
215,349
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.setBreakByColumnAndRow
public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) { return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); }
php
public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) { return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); }
[ "public", "function", "setBreakByColumnAndRow", "(", "$", "pColumn", "=", "0", ",", "$", "pRow", "=", "1", ",", "$", "pBreak", "=", "PHPExcel_Worksheet", "::", "BREAK_NONE", ")", "{", "return", "$", "this", "->", "setBreak", "(", "PHPExcel_Cell", "::", "st...
Set break on a cell by using numeric cell coordinates @param integer $pColumn Numeric column coordinate of the cell @param integer $pRow Numeric row coordinate of the cell @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) @return PHPExcel_Worksheet
[ "Set", "break", "on", "a", "cell", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1654-L1657
215,350
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.mergeCellsByColumnAndRow
public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->mergeCells($cellRange); }
php
public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->mergeCells($cellRange); }
[ "public", "function", "mergeCellsByColumnAndRow", "(", "$", "pColumn1", "=", "0", ",", "$", "pRow1", "=", "1", ",", "$", "pColumn2", "=", "0", ",", "$", "pRow2", "=", "1", ")", "{", "$", "cellRange", "=", "PHPExcel_Cell", "::", "stringFromColumnIndex", "...
Set merge on a cell range by using numeric cell coordinates @param int $pColumn1 Numeric column coordinate of the first cell @param int $pRow1 Numeric row coordinate of the first cell @param int $pColumn2 Numeric column coordinate of the last cell @param int $pRow2 Numeric row coordinate of the las...
[ "Set", "merge", "on", "a", "cell", "range", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1717-L1721
215,351
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.unmergeCells
public function unmergeCells($pRange = 'A1:A1') { // Uppercase coordinate $pRange = strtoupper($pRange); if (strpos($pRange, ':') !== false) { if (isset($this->mergeCells[$pRange])) { unset($this->mergeCells[$pRange]); } else { throw n...
php
public function unmergeCells($pRange = 'A1:A1') { // Uppercase coordinate $pRange = strtoupper($pRange); if (strpos($pRange, ':') !== false) { if (isset($this->mergeCells[$pRange])) { unset($this->mergeCells[$pRange]); } else { throw n...
[ "public", "function", "unmergeCells", "(", "$", "pRange", "=", "'A1:A1'", ")", "{", "// Uppercase coordinate", "$", "pRange", "=", "strtoupper", "(", "$", "pRange", ")", ";", "if", "(", "strpos", "(", "$", "pRange", ",", "':'", ")", "!==", "false", ")", ...
Remove merge on a cell range @param string $pRange Cell range (e.g. A1:E1) @throws PHPExcel_Exception @return PHPExcel_Worksheet
[ "Remove", "merge", "on", "a", "cell", "range" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1730-L1746
215,352
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.unmergeCellsByColumnAndRow
public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unmergeCells($cellRange); }
php
public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unmergeCells($cellRange); }
[ "public", "function", "unmergeCellsByColumnAndRow", "(", "$", "pColumn1", "=", "0", ",", "$", "pRow1", "=", "1", ",", "$", "pColumn2", "=", "0", ",", "$", "pRow2", "=", "1", ")", "{", "$", "cellRange", "=", "PHPExcel_Cell", "::", "stringFromColumnIndex", ...
Remove merge on a cell range by using numeric cell coordinates @param int $pColumn1 Numeric column coordinate of the first cell @param int $pRow1 Numeric row coordinate of the first cell @param int $pColumn2 Numeric column coordinate of the last cell @param int $pRow2 Numeric row coordinate of the ...
[ "Remove", "merge", "on", "a", "cell", "range", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1758-L1762
215,353
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.protectCells
public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) { // Uppercase coordinate $pRange = strtoupper($pRange); if (!$pAlreadyHashed) { $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword); } $this->protectedCells[...
php
public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) { // Uppercase coordinate $pRange = strtoupper($pRange); if (!$pAlreadyHashed) { $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword); } $this->protectedCells[...
[ "public", "function", "protectCells", "(", "$", "pRange", "=", "'A1'", ",", "$", "pPassword", "=", "''", ",", "$", "pAlreadyHashed", "=", "false", ")", "{", "// Uppercase coordinate", "$", "pRange", "=", "strtoupper", "(", "$", "pRange", ")", ";", "if", ...
Set protection on a cell range @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) @param string $pPassword Password to unlock the protection @param boolean $pAlreadyHashed If the password has already been hashed, set this to true @throws ...
[ "Set", "protection", "on", "a", "cell", "range" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1795-L1806
215,354
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.protectCellsByColumnAndRow
public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->protectCe...
php
public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->protectCe...
[ "public", "function", "protectCellsByColumnAndRow", "(", "$", "pColumn1", "=", "0", ",", "$", "pRow1", "=", "1", ",", "$", "pColumn2", "=", "0", ",", "$", "pRow2", "=", "1", ",", "$", "pPassword", "=", "''", ",", "$", "pAlreadyHashed", "=", "false", ...
Set protection on a cell range by using numeric cell coordinates @param int $pColumn1 Numeric column coordinate of the first cell @param int $pRow1 Numeric row coordinate of the first cell @param int $pColumn2 Numeric column coordinate of the last cell @param int $pRow2 ...
[ "Set", "protection", "on", "a", "cell", "range", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1820-L1824
215,355
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.unprotectCellsByColumnAndRow
public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unprote...
php
public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unprote...
[ "public", "function", "unprotectCellsByColumnAndRow", "(", "$", "pColumn1", "=", "0", ",", "$", "pRow1", "=", "1", ",", "$", "pColumn2", "=", "0", ",", "$", "pRow2", "=", "1", ",", "$", "pPassword", "=", "''", ",", "$", "pAlreadyHashed", "=", "false", ...
Remove protection on a cell range by using numeric cell coordinates @param int $pColumn1 Numeric column coordinate of the first cell @param int $pRow1 Numeric row coordinate of the first cell @param int $pColumn2 Numeric column coordinate of the last cell @param int $pRow2 ...
[ "Remove", "protection", "on", "a", "cell", "range", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1858-L1862
215,356
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.setAutoFilterByColumnAndRow
public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { return $this->setAutoFilter( PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2 ); }
php
public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { return $this->setAutoFilter( PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2 ); }
[ "public", "function", "setAutoFilterByColumnAndRow", "(", "$", "pColumn1", "=", "0", ",", "$", "pRow1", "=", "1", ",", "$", "pColumn2", "=", "0", ",", "$", "pRow2", "=", "1", ")", "{", "return", "$", "this", "->", "setAutoFilter", "(", "PHPExcel_Cell", ...
Set Autofilter Range by using numeric cell coordinates @param integer $pColumn1 Numeric column coordinate of the first cell @param integer $pRow1 Numeric row coordinate of the first cell @param integer $pColumn2 Numeric column coordinate of the second cell @param integer $pRow2 Numeric row co...
[ "Set", "Autofilter", "Range", "by", "using", "numeric", "cell", "coordinates" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1913-L1920
215,357
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.insertNewRowBefore
public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) { if ($pBefore >= 1) { $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); } else { throw new PHPExcel_Exception("...
php
public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) { if ($pBefore >= 1) { $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); } else { throw new PHPExcel_Exception("...
[ "public", "function", "insertNewRowBefore", "(", "$", "pBefore", "=", "1", ",", "$", "pNumRows", "=", "1", ")", "{", "if", "(", "$", "pBefore", ">=", "1", ")", "{", "$", "objReferenceHelper", "=", "PHPExcel_ReferenceHelper", "::", "getInstance", "(", ")", ...
Insert a new row, updating all possible related data @param int $pBefore Insert before this one @param int $pNumRows Number of rows to insert @throws PHPExcel_Exception @return PHPExcel_Worksheet
[ "Insert", "a", "new", "row", "updating", "all", "possible", "related", "data" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L1998-L2007
215,358
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.getComment
public function getComment($pCellCoordinate = 'A1') { // Uppercase coordinate $pCellCoordinate = strtoupper($pCellCoordinate); if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) { throw new PHPExcel_Exception('Cell coordinate string can not b...
php
public function getComment($pCellCoordinate = 'A1') { // Uppercase coordinate $pCellCoordinate = strtoupper($pCellCoordinate); if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) { throw new PHPExcel_Exception('Cell coordinate string can not b...
[ "public", "function", "getComment", "(", "$", "pCellCoordinate", "=", "'A1'", ")", "{", "// Uppercase coordinate", "$", "pCellCoordinate", "=", "strtoupper", "(", "$", "pCellCoordinate", ")", ";", "if", "(", "strpos", "(", "$", "pCellCoordinate", ",", "':'", "...
Get comment for cell @param string $pCellCoordinate Cell coordinate to get comment for @return PHPExcel_Comment @throws PHPExcel_Exception
[ "Get", "comment", "for", "cell" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L2251-L2273
215,359
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.toArray
public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { // Garbage collect... $this->garbageCollect(); // Identify the range that we need to extract from the worksheet $maxCol = $this->getHighestColumn(); $maxRow...
php
public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { // Garbage collect... $this->garbageCollect(); // Identify the range that we need to extract from the worksheet $maxCol = $this->getHighestColumn(); $maxRow...
[ "public", "function", "toArray", "(", "$", "nullValue", "=", "null", ",", "$", "calculateFormulas", "=", "true", ",", "$", "formatData", "=", "true", ",", "$", "returnCellRef", "=", "false", ")", "{", "// Garbage collect...", "$", "this", "->", "garbageColle...
Create array from worksheet @param mixed $nullValue Value returned in the array entry if a cell doesn't exist @param boolean $calculateFormulas Should formulas be calculated? @param boolean $formatData Should formatting be applied to cell values? @param boolean $returnCellRef False - Return a simple array of rows and...
[ "Create", "array", "from", "worksheet" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L2550-L2560
215,360
moodle/moodle
lib/phpexcel/PHPExcel/Worksheet.php
PHPExcel_Worksheet.extractSheetTitle
public static function extractSheetTitle($pRange, $returnRange = false) { // Sheet title included? if (($sep = strpos($pRange, '!')) === false) { return ''; } if ($returnRange) { return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1)); ...
php
public static function extractSheetTitle($pRange, $returnRange = false) { // Sheet title included? if (($sep = strpos($pRange, '!')) === false) { return ''; } if ($returnRange) { return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1)); ...
[ "public", "static", "function", "extractSheetTitle", "(", "$", "pRange", ",", "$", "returnRange", "=", "false", ")", "{", "// Sheet title included?", "if", "(", "(", "$", "sep", "=", "strpos", "(", "$", "pRange", ",", "'!'", ")", ")", "===", "false", ")"...
Extract worksheet title from range. Example: extractSheetTitle("testSheet!A1") ==> 'A1' Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1'); @param string $pRange Range to extract title from @param bool $returnRange Return range? (see example) @return mixed
[ "Extract", "worksheet", "title", "from", "range", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Worksheet.php#L2657-L2669
215,361
moodle/moodle
backup/util/helper/backup_file_manager.class.php
backup_file_manager.copy_file_moodle2backup
public static function copy_file_moodle2backup($backupid, $filerecorid) { global $DB; if (!backup_controller_dbops::backup_includes_files($backupid)) { // Only include the files if required by the controller. return; } // Normalise param if (!is_object($...
php
public static function copy_file_moodle2backup($backupid, $filerecorid) { global $DB; if (!backup_controller_dbops::backup_includes_files($backupid)) { // Only include the files if required by the controller. return; } // Normalise param if (!is_object($...
[ "public", "static", "function", "copy_file_moodle2backup", "(", "$", "backupid", ",", "$", "filerecorid", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "backup_controller_dbops", "::", "backup_includes_files", "(", "$", "backupid", ")", ")", "{", "// Onl...
Copy one file from moodle storage to backup storage
[ "Copy", "one", "file", "from", "moodle", "storage", "to", "backup", "storage" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/helper/backup_file_manager.class.php#L62-L102
215,362
moodle/moodle
lib/classes/task/asynchronous_restore_task.php
asynchronous_restore_task.execute
public function execute() { global $DB; $started = time(); $restoreid = $this->get_custom_data()->backupid; $restorerecordid = $DB->get_field('backup_controllers', 'id', array('backupid' => $restoreid), MUST_EXIST); mtrace('Processing asynchronous restore for id: ' . $restoreid)...
php
public function execute() { global $DB; $started = time(); $restoreid = $this->get_custom_data()->backupid; $restorerecordid = $DB->get_field('backup_controllers', 'id', array('backupid' => $restoreid), MUST_EXIST); mtrace('Processing asynchronous restore for id: ' . $restoreid)...
[ "public", "function", "execute", "(", ")", "{", "global", "$", "DB", ";", "$", "started", "=", "time", "(", ")", ";", "$", "restoreid", "=", "$", "this", "->", "get_custom_data", "(", ")", "->", "backupid", ";", "$", "restorerecordid", "=", "$", "DB"...
Run the adhoc task and preform the restore.
[ "Run", "the", "adhoc", "task", "and", "preform", "the", "restore", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/task/asynchronous_restore_task.php#L45-L87
215,363
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbObject.supportedPlatform
function supportedPlatform( $platform = NULL ) { return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE; }
php
function supportedPlatform( $platform = NULL ) { return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE; }
[ "function", "supportedPlatform", "(", "$", "platform", "=", "NULL", ")", "{", "return", "is_object", "(", "$", "this", "->", "parent", ")", "?", "$", "this", "->", "parent", "->", "supportedPlatform", "(", "$", "platform", ")", ":", "TRUE", ";", "}" ]
Checks whether the specified RDBMS is supported by the current database object or its ranking ancestor. @param string $platform RDBMS platform name (from ADODB platform list). @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
[ "Checks", "whether", "the", "specified", "RDBMS", "is", "supported", "by", "the", "current", "database", "object", "or", "its", "ranking", "ancestor", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L187-L189
215,364
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbObject.prefix
function prefix( $name = '' ) { return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name; }
php
function prefix( $name = '' ) { return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name; }
[ "function", "prefix", "(", "$", "name", "=", "''", ")", "{", "return", "is_object", "(", "$", "this", "->", "parent", ")", "?", "$", "this", "->", "parent", "->", "prefix", "(", "$", "name", ")", ":", "$", "name", ";", "}" ]
Returns the prefix set by the ranking ancestor of the database object. @param string $name Prefix string. @return string Prefix.
[ "Returns", "the", "prefix", "set", "by", "the", "ranking", "ancestor", "of", "the", "database", "object", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L197-L199
215,365
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.addIndex
function addIndex( $attributes ) { $name = strtoupper( $attributes['NAME'] ); $this->indexes[$name] = new dbIndex( $this, $attributes ); return $this->indexes[$name]; }
php
function addIndex( $attributes ) { $name = strtoupper( $attributes['NAME'] ); $this->indexes[$name] = new dbIndex( $this, $attributes ); return $this->indexes[$name]; }
[ "function", "addIndex", "(", "$", "attributes", ")", "{", "$", "name", "=", "strtoupper", "(", "$", "attributes", "[", "'NAME'", "]", ")", ";", "$", "this", "->", "indexes", "[", "$", "name", "]", "=", "new", "dbIndex", "(", "$", "this", ",", "$", ...
Adds an index to a table object @param array $attributes Index attributes @return object dbIndex object
[ "Adds", "an", "index", "to", "a", "table", "object" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L403-L407
215,366
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.addData
function addData( $attributes ) { if( !isset( $this->data ) ) { $this->data = new dbData( $this, $attributes ); } return $this->data; }
php
function addData( $attributes ) { if( !isset( $this->data ) ) { $this->data = new dbData( $this, $attributes ); } return $this->data; }
[ "function", "addData", "(", "$", "attributes", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "data", ")", ")", "{", "$", "this", "->", "data", "=", "new", "dbData", "(", "$", "this", ",", "$", "attributes", ")", ";", "}", "return", ...
Adds data to a table object @param array $attributes Data attributes @return object dbData object
[ "Adds", "data", "to", "a", "table", "object" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L415-L420
215,367
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.addField
function addField( $name, $type, $size = NULL, $opts = NULL ) { $field_id = $this->FieldID( $name ); // Set the field index so we know where we are $this->current_field = $field_id; // Set the field name (required) $this->fields[$field_id]['NAME'] = $name; // Set the field type (required) $this->fields...
php
function addField( $name, $type, $size = NULL, $opts = NULL ) { $field_id = $this->FieldID( $name ); // Set the field index so we know where we are $this->current_field = $field_id; // Set the field name (required) $this->fields[$field_id]['NAME'] = $name; // Set the field type (required) $this->fields...
[ "function", "addField", "(", "$", "name", ",", "$", "type", ",", "$", "size", "=", "NULL", ",", "$", "opts", "=", "NULL", ")", "{", "$", "field_id", "=", "$", "this", "->", "FieldID", "(", "$", "name", ")", ";", "// Set the field index so we know where...
Adds a field to a table object $name is the name of the table to which the field should be added. $type is an ADODB datadict field type. The following field types are supported as of ADODB 3.40: - C: varchar - X: CLOB (character large object) or largest varchar size if CLOB is not supported - C2: Multibyte varchar -...
[ "Adds", "a", "field", "to", "a", "table", "object" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L451-L474
215,368
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.addFieldOpt
function addFieldOpt( $field, $opt, $value = NULL ) { if( $this->currentPlatform ) { if( !isset( $value ) ) { $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt; // Add the option and value } else { $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value ); } } }
php
function addFieldOpt( $field, $opt, $value = NULL ) { if( $this->currentPlatform ) { if( !isset( $value ) ) { $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt; // Add the option and value } else { $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value ); } } }
[ "function", "addFieldOpt", "(", "$", "field", ",", "$", "opt", ",", "$", "value", "=", "NULL", ")", "{", "if", "(", "$", "this", "->", "currentPlatform", ")", "{", "if", "(", "!", "isset", "(", "$", "value", ")", ")", "{", "$", "this", "->", "f...
Adds a field option to the current field specifier This method adds a field option allowed by the ADOdb datadict and appends it to the given field. @param string $field Field name @param string $opt ADOdb field option @param mixed $value Field option value @return array Field specifier array
[ "Adds", "a", "field", "option", "to", "the", "current", "field", "specifier" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L487-L496
215,369
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.addTableOpt
function addTableOpt( $opt ) { if(isset($this->currentPlatform)) { $this->opts[$this->parent->db->databaseType] = $opt; } return $this->opts; }
php
function addTableOpt( $opt ) { if(isset($this->currentPlatform)) { $this->opts[$this->parent->db->databaseType] = $opt; } return $this->opts; }
[ "function", "addTableOpt", "(", "$", "opt", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "currentPlatform", ")", ")", "{", "$", "this", "->", "opts", "[", "$", "this", "->", "parent", "->", "db", "->", "databaseType", "]", "=", "$", "opt",...
Adds an option to the table This method takes a comma-separated list of table-level options and appends them to the table object. @param string $opt Table option @return array Options
[ "Adds", "an", "option", "to", "the", "table" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L507-L512
215,370
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbTable.drop
function drop() { if( isset( $this->current_field ) ) { // Drop the current field logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" ); // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field ); $this->drop_field[$this->current_f...
php
function drop() { if( isset( $this->current_field ) ) { // Drop the current field logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" ); // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field ); $this->drop_field[$this->current_f...
[ "function", "drop", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "current_field", ")", ")", "{", "// Drop the current field", "logMsg", "(", "\"Dropping field '{$this->current_field}' from table '{$this->name}'\"", ")", ";", "// $this->drop_field[$this->curr...
Marks a field or table for destruction
[ "Marks", "a", "field", "or", "table", "for", "destruction" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L630-L642
215,371
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbData.addField
function addField( $attributes ) { // check we're in a valid row if( !isset( $this->row ) || !isset( $this->data[$this->row] ) ) { return; } // Set the field index so we know where we are if( isset( $attributes['NAME'] ) ) { $this->current_field = $this->FieldID( $attributes['NAME'] ); } else { $t...
php
function addField( $attributes ) { // check we're in a valid row if( !isset( $this->row ) || !isset( $this->data[$this->row] ) ) { return; } // Set the field index so we know where we are if( isset( $attributes['NAME'] ) ) { $this->current_field = $this->FieldID( $attributes['NAME'] ); } else { $t...
[ "function", "addField", "(", "$", "attributes", ")", "{", "// check we're in a valid row", "if", "(", "!", "isset", "(", "$", "this", "->", "row", ")", "||", "!", "isset", "(", "$", "this", "->", "data", "[", "$", "this", "->", "row", "]", ")", ")", ...
Adds a field to the insert @param string $name Field name @return string Field list
[ "Adds", "a", "field", "to", "the", "insert" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L898-L915
215,372
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbQuerySet.buildQuery
function buildQuery( $sql = NULL ) { if( !isset( $this->query ) OR empty( $sql ) ) { return FALSE; } $this->query .= $sql; return $this->query; }
php
function buildQuery( $sql = NULL ) { if( !isset( $this->query ) OR empty( $sql ) ) { return FALSE; } $this->query .= $sql; return $this->query; }
[ "function", "buildQuery", "(", "$", "sql", "=", "NULL", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "query", ")", "OR", "empty", "(", "$", "sql", ")", ")", "{", "return", "FALSE", ";", "}", "$", "this", "->", "query", ".=", "$", ...
Appends a line to a query that is being built line by line @param string $data Line of SQL data or NULL to initialize a new query @return string SQL query string.
[ "Appends", "a", "line", "to", "a", "query", "that", "is", "being", "built", "line", "by", "line" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L1202-L1210
215,373
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbQuerySet.addQuery
function addQuery() { if( !isset( $this->query ) ) { return FALSE; } $this->queries[] = $return = trim($this->query); unset( $this->query ); return $return; }
php
function addQuery() { if( !isset( $this->query ) ) { return FALSE; } $this->queries[] = $return = trim($this->query); unset( $this->query ); return $return; }
[ "function", "addQuery", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "query", ")", ")", "{", "return", "FALSE", ";", "}", "$", "this", "->", "queries", "[", "]", "=", "$", "return", "=", "trim", "(", "$", "this", "->", "query...
Adds a completed query to the query list @return string SQL of added query
[ "Adds", "a", "completed", "query", "to", "the", "query", "list" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L1217-L1227
215,374
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbQuerySet.create
function create( &$xmls ) { foreach( $this->queries as $id => $query ) { switch( $this->prefixMethod ) { case 'AUTO': // Enable auto prefix replacement // Process object prefix. // Evaluate SQL statements to prepend prefix to objects $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\...
php
function create( &$xmls ) { foreach( $this->queries as $id => $query ) { switch( $this->prefixMethod ) { case 'AUTO': // Enable auto prefix replacement // Process object prefix. // Evaluate SQL statements to prepend prefix to objects $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\...
[ "function", "create", "(", "&", "$", "xmls", ")", "{", "foreach", "(", "$", "this", "->", "queries", "as", "$", "id", "=>", "$", "query", ")", "{", "switch", "(", "$", "this", "->", "prefixMethod", ")", "{", "case", "'AUTO'", ":", "// Enable auto pre...
Creates and returns the current query set @param object $xmls adoSchema object @return array Query set
[ "Creates", "and", "returns", "the", "current", "query", "set" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L1235-L1267
215,375
moodle/moodle
lib/adodb/adodb-xmlschema03.inc.php
dbQuerySet.prefixQuery
function prefixQuery( $regex, $query, $prefix = NULL ) { if( !isset( $prefix ) ) { return $query; } if( preg_match( $regex, $query, $match ) ) { $preamble = $match[1]; $postamble = $match[5]; $objectList = explode( ',', $match[3] ); // $prefix = $prefix . '_'; $prefixedList = ''; foreach( ...
php
function prefixQuery( $regex, $query, $prefix = NULL ) { if( !isset( $prefix ) ) { return $query; } if( preg_match( $regex, $query, $match ) ) { $preamble = $match[1]; $postamble = $match[5]; $objectList = explode( ',', $match[3] ); // $prefix = $prefix . '_'; $prefixedList = ''; foreach( ...
[ "function", "prefixQuery", "(", "$", "regex", ",", "$", "query", ",", "$", "prefix", "=", "NULL", ")", "{", "if", "(", "!", "isset", "(", "$", "prefix", ")", ")", "{", "return", "$", "query", ";", "}", "if", "(", "preg_match", "(", "$", "regex", ...
Rebuilds the query with the prefix attached to any objects @param string $regex Regex used to add prefix @param string $query SQL query string @param string $prefix Prefix to be appended to tables, indices, etc. @return string Prefixed SQL query string.
[ "Rebuilds", "the", "query", "with", "the", "prefix", "attached", "to", "any", "objects" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-xmlschema03.inc.php#L1277-L1302
215,376
moodle/moodle
backup/moodle2/backup_activity_task.class.php
backup_activity_task.define_settings
protected function define_settings() { global $CFG; require_once($CFG->libdir.'/questionlib.php'); // All the settings related to this activity will include this prefix $settingprefix = $this->modulename . '_' . $this->moduleid . '_'; // All these are common settings to be shar...
php
protected function define_settings() { global $CFG; require_once($CFG->libdir.'/questionlib.php'); // All the settings related to this activity will include this prefix $settingprefix = $this->modulename . '_' . $this->moduleid . '_'; // All these are common settings to be shar...
[ "protected", "function", "define_settings", "(", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".", "'/questionlib.php'", ")", ";", "// All the settings related to this activity will include this prefix", "$", "settingprefix", "="...
Defines the common setting that any backup activity will have
[ "Defines", "the", "common", "setting", "that", "any", "backup", "activity", "will", "have" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/moodle2/backup_activity_task.class.php#L259-L316
215,377
moodle/moodle
course/format/topics/lib.php
format_topics.update_course_format_options
public function update_course_format_options($data, $oldcourse = null) { $data = (array)$data; if ($oldcourse !== null) { $oldcourse = (array)$oldcourse; $options = $this->course_format_options(); foreach ($options as $key => $unused) { if (!array_key_...
php
public function update_course_format_options($data, $oldcourse = null) { $data = (array)$data; if ($oldcourse !== null) { $oldcourse = (array)$oldcourse; $options = $this->course_format_options(); foreach ($options as $key => $unused) { if (!array_key_...
[ "public", "function", "update_course_format_options", "(", "$", "data", ",", "$", "oldcourse", "=", "null", ")", "{", "$", "data", "=", "(", "array", ")", "$", "data", ";", "if", "(", "$", "oldcourse", "!==", "null", ")", "{", "$", "oldcourse", "=", ...
Updates format options for a course In case if course format was changed to 'topics', we try to copy options 'coursedisplay' and 'hiddensections' from the previous format. @param stdClass|array $data return value from {@link moodleform::get_data()} or array with data @param stdClass $oldcourse if this function is cal...
[ "Updates", "format", "options", "for", "a", "course" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/format/topics/lib.php#L314-L328
215,378
moodle/moodle
admin/tool/dataprivacy/classes/event/user_deleted_observer.php
user_deleted_observer.create_delete_data_request
public static function create_delete_data_request(\core\event\user_deleted $event) { // Automatic creation of deletion requests must be enabled. if (get_config('tool_dataprivacy', 'automaticdeletionrequests')) { $requesttypes = [api::DATAREQUEST_TYPE_DELETE]; $requeststatuses = [...
php
public static function create_delete_data_request(\core\event\user_deleted $event) { // Automatic creation of deletion requests must be enabled. if (get_config('tool_dataprivacy', 'automaticdeletionrequests')) { $requesttypes = [api::DATAREQUEST_TYPE_DELETE]; $requeststatuses = [...
[ "public", "static", "function", "create_delete_data_request", "(", "\\", "core", "\\", "event", "\\", "user_deleted", "$", "event", ")", "{", "// Automatic creation of deletion requests must be enabled.", "if", "(", "get_config", "(", "'tool_dataprivacy'", ",", "'automati...
Create user data deletion request when the user is deleted. @param \core\event\user_deleted $event
[ "Create", "user", "data", "deletion", "request", "when", "the", "user", "is", "deleted", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/event/user_deleted_observer.php#L46-L62
215,379
moodle/moodle
mod/feedback/classes/analytics/indicator/activity_base.php
activity_base.feedback_viewed
protected function feedback_viewed(\cm_info $cm, $contextid, $userid, $after = null) { // If stats are published any write action counts as viewed feedback. if (!empty($this->instancedata[$cm->instance]->publish_stats)) { $user = (object)['id' => $userid]; return $this->any_write...
php
protected function feedback_viewed(\cm_info $cm, $contextid, $userid, $after = null) { // If stats are published any write action counts as viewed feedback. if (!empty($this->instancedata[$cm->instance]->publish_stats)) { $user = (object)['id' => $userid]; return $this->any_write...
[ "protected", "function", "feedback_viewed", "(", "\\", "cm_info", "$", "cm", ",", "$", "contextid", ",", "$", "userid", ",", "$", "after", "=", "null", ")", "{", "// If stats are published any write action counts as viewed feedback.", "if", "(", "!", "empty", "(",...
Overwritten to mark as viewed if stats are published. @param \cm_info $cm @param int $contextid @param int $userid @param int $after @return bool
[ "Overwritten", "to", "mark", "as", "viewed", "if", "stats", "are", "published", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/analytics/indicator/activity_base.php#L47-L55
215,380
moodle/moodle
lib/lessphp/Autoloader.php
Less_Autoloader.register
public static function register(){ if( self::$registered ){ return; } self::$libDir = dirname(__FILE__); if(false === spl_autoload_register(array('Less_Autoloader', 'loadClass'))){ throw new Exception('Unable to register Less_Autoloader::loadClass as an autoloading method.'); } self::$registered = ...
php
public static function register(){ if( self::$registered ){ return; } self::$libDir = dirname(__FILE__); if(false === spl_autoload_register(array('Less_Autoloader', 'loadClass'))){ throw new Exception('Unable to register Less_Autoloader::loadClass as an autoloading method.'); } self::$registered = ...
[ "public", "static", "function", "register", "(", ")", "{", "if", "(", "self", "::", "$", "registered", ")", "{", "return", ";", "}", "self", "::", "$", "libDir", "=", "dirname", "(", "__FILE__", ")", ";", "if", "(", "false", "===", "spl_autoload_regist...
Register the autoloader in the spl autoloader @return void @throws Exception If there was an error in registration
[ "Register", "the", "autoloader", "in", "the", "spl", "autoloader" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Autoloader.php#L31-L43
215,381
moodle/moodle
lib/lessphp/Autoloader.php
Less_Autoloader.loadClass
public static function loadClass($className){ // handle only package classes if(strpos($className, 'Less_') !== 0){ return; } $className = substr($className,5); $fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; if(file_exists($fileName)){ ...
php
public static function loadClass($className){ // handle only package classes if(strpos($className, 'Less_') !== 0){ return; } $className = substr($className,5); $fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; if(file_exists($fileName)){ ...
[ "public", "static", "function", "loadClass", "(", "$", "className", ")", "{", "// handle only package classes", "if", "(", "strpos", "(", "$", "className", ",", "'Less_'", ")", "!==", "0", ")", "{", "return", ";", "}", "$", "className", "=", "substr", "(",...
Loads the class @param string $className The class to load
[ "Loads", "the", "class" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/lessphp/Autoloader.php#L60-L77
215,382
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_data
public function export_data(array $subcontext, \stdClass $data) : content_writer { $path = $this->get_path($subcontext, 'data.json'); $this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); return $this; }
php
public function export_data(array $subcontext, \stdClass $data) : content_writer { $path = $this->get_path($subcontext, 'data.json'); $this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); return $this; }
[ "public", "function", "export_data", "(", "array", "$", "subcontext", ",", "\\", "stdClass", "$", "data", ")", ":", "content_writer", "{", "$", "path", "=", "$", "this", "->", "get_path", "(", "$", "subcontext", ",", "'data.json'", ")", ";", "$", "this",...
Export the supplied data within the current context, at the supplied subcontext. @param array $subcontext The location within the current context that this data belongs. @param \stdClass $data The data to be exported @return content_writer
[ "Export", "the", "supplied", "data", "within", "the", "current", "context", "at", "the", "supplied", "subcontext", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L94-L100
215,383
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_metadata
public function export_metadata(array $subcontext, string $key, $value, string $description) : content_writer { $path = $this->get_full_path($subcontext, 'metadata.json'); if (file_exists($path)) { $data = json_decode(file_get_contents($path)); } else { $data = (object) ...
php
public function export_metadata(array $subcontext, string $key, $value, string $description) : content_writer { $path = $this->get_full_path($subcontext, 'metadata.json'); if (file_exists($path)) { $data = json_decode(file_get_contents($path)); } else { $data = (object) ...
[ "public", "function", "export_metadata", "(", "array", "$", "subcontext", ",", "string", "$", "key", ",", "$", "value", ",", "string", "$", "description", ")", ":", "content_writer", "{", "$", "path", "=", "$", "this", "->", "get_full_path", "(", "$", "s...
Export metadata about the supplied subcontext. Metadata consists of a key/value pair and a description of the value. @param array $subcontext The location within the current context that this data belongs. @param string $key The metadata name. @param string $value The met...
[ "Export", "metadata", "about", "the", "supplied", "subcontext", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L113-L131
215,384
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_related_data
public function export_related_data(array $subcontext, $name, $data) : content_writer { $path = $this->get_path($subcontext, "{$name}.json"); $this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); return $this; }
php
public function export_related_data(array $subcontext, $name, $data) : content_writer { $path = $this->get_path($subcontext, "{$name}.json"); $this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); return $this; }
[ "public", "function", "export_related_data", "(", "array", "$", "subcontext", ",", "$", "name", ",", "$", "data", ")", ":", "content_writer", "{", "$", "path", "=", "$", "this", "->", "get_path", "(", "$", "subcontext", ",", "\"{$name}.json\"", ")", ";", ...
Export a piece of related data. @param array $subcontext The location within the current context that this data belongs. @param string $name The name of the file to be exported. @param \stdClass $data The related data to export. @return content_writer
[ "Export", "a", "piece", "of", "related", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L141-L147
215,385
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_custom_file
public function export_custom_file(array $subcontext, $filename, $filecontent) : content_writer { $filename = clean_param($filename, PARAM_FILE); $path = $this->get_path($subcontext, $filename); $this->write_data($path, $filecontent); return $this; }
php
public function export_custom_file(array $subcontext, $filename, $filecontent) : content_writer { $filename = clean_param($filename, PARAM_FILE); $path = $this->get_path($subcontext, $filename); $this->write_data($path, $filecontent); return $this; }
[ "public", "function", "export_custom_file", "(", "array", "$", "subcontext", ",", "$", "filename", ",", "$", "filecontent", ")", ":", "content_writer", "{", "$", "filename", "=", "clean_param", "(", "$", "filename", ",", "PARAM_FILE", ")", ";", "$", "path", ...
Export a piece of data in a custom format. @param array $subcontext The location within the current context that this data belongs. @param string $filename The name of the file to be exported. @param string $filecontent The content to be exported.
[ "Export", "a", "piece", "of", "data", "in", "a", "custom", "format", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L156-L162
215,386
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.rewrite_pluginfile_urls
public function rewrite_pluginfile_urls(array $subcontext, $component, $filearea, $itemid, $text) : string { // Need to take into consideration the subcontext to provide the full path to this file. $subcontextpath = ''; if (!empty($subcontext)) { $subcontextpath = DIRECTORY_SEPARATOR...
php
public function rewrite_pluginfile_urls(array $subcontext, $component, $filearea, $itemid, $text) : string { // Need to take into consideration the subcontext to provide the full path to this file. $subcontextpath = ''; if (!empty($subcontext)) { $subcontextpath = DIRECTORY_SEPARATOR...
[ "public", "function", "rewrite_pluginfile_urls", "(", "array", "$", "subcontext", ",", "$", "component", ",", "$", "filearea", ",", "$", "itemid", ",", "$", "text", ")", ":", "string", "{", "// Need to take into consideration the subcontext to provide the full path to t...
Prepare a text area by processing pluginfile URLs within it. @param array $subcontext The location within the current context that this data belongs. @param string $component The name of the component that the files belong to. @param string $filearea The filearea within that compon...
[ "Prepare", "a", "text", "area", "by", "processing", "pluginfile", "URLs", "within", "it", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L174-L186
215,387
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_area_files
public function export_area_files(array $subcontext, $component, $filearea, $itemid) : content_writer { $fs = get_file_storage(); $files = $fs->get_area_files($this->context->id, $component, $filearea, $itemid); foreach ($files as $file) { $this->export_file($subcontext, $file); ...
php
public function export_area_files(array $subcontext, $component, $filearea, $itemid) : content_writer { $fs = get_file_storage(); $files = $fs->get_area_files($this->context->id, $component, $filearea, $itemid); foreach ($files as $file) { $this->export_file($subcontext, $file); ...
[ "public", "function", "export_area_files", "(", "array", "$", "subcontext", ",", "$", "component", ",", "$", "filearea", ",", "$", "itemid", ")", ":", "content_writer", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "files", "=", "$", "fs",...
Export all files within the specified component, filearea, itemid combination. @param array $subcontext The location within the current context that this data belongs. @param string $component The name of the component that the files belong to. @param string $filearea The filearea ...
[ "Export", "all", "files", "within", "the", "specified", "component", "filearea", "itemid", "combination", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L196-L204
215,388
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.export_file
public function export_file(array $subcontext, \stored_file $file) : content_writer { if (!$file->is_directory()) { $pathitems = array_merge( $subcontext, [$this->get_files_target_path($file->get_component(), $file->get_filearea(), $file->get_itemid())], ...
php
public function export_file(array $subcontext, \stored_file $file) : content_writer { if (!$file->is_directory()) { $pathitems = array_merge( $subcontext, [$this->get_files_target_path($file->get_component(), $file->get_filearea(), $file->get_itemid())], ...
[ "public", "function", "export_file", "(", "array", "$", "subcontext", ",", "\\", "stored_file", "$", "file", ")", ":", "content_writer", "{", "if", "(", "!", "$", "file", "->", "is_directory", "(", ")", ")", "{", "$", "pathitems", "=", "array_merge", "("...
Export the specified file in the target location. @param array $subcontext The location within the current context that this data belongs. @param \stored_file $file The file to be exported.
[ "Export", "the", "specified", "file", "in", "the", "target", "location", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L212-L226
215,389
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.get_context_path
protected function get_context_path() : array { $path = []; $contexts = array_reverse($this->context->get_parent_contexts(true)); foreach ($contexts as $context) { $name = $context->get_context_name(); $id = ' _.' . $context->id; $path[] = shorten_text(clean_p...
php
protected function get_context_path() : array { $path = []; $contexts = array_reverse($this->context->get_parent_contexts(true)); foreach ($contexts as $context) { $name = $context->get_context_name(); $id = ' _.' . $context->id; $path[] = shorten_text(clean_p...
[ "protected", "function", "get_context_path", "(", ")", ":", "array", "{", "$", "path", "=", "[", "]", ";", "$", "contexts", "=", "array_reverse", "(", "$", "this", "->", "context", "->", "get_parent_contexts", "(", "true", ")", ")", ";", "foreach", "(", ...
Determine the path for the current context. @return array The context path. @throws \coding_exception
[ "Determine", "the", "path", "for", "the", "current", "context", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L265-L276
215,390
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.get_path
protected function get_path(array $subcontext, string $name) : string { $subcontext = shorten_filenames($subcontext, MAX_FILENAME_SIZE, true); $name = shorten_filename($name, MAX_FILENAME_SIZE, true); // This weird code is to look for a subcontext that contains a number and append an '_' to the...
php
protected function get_path(array $subcontext, string $name) : string { $subcontext = shorten_filenames($subcontext, MAX_FILENAME_SIZE, true); $name = shorten_filename($name, MAX_FILENAME_SIZE, true); // This weird code is to look for a subcontext that contains a number and append an '_' to the...
[ "protected", "function", "get_path", "(", "array", "$", "subcontext", ",", "string", "$", "name", ")", ":", "string", "{", "$", "subcontext", "=", "shorten_filenames", "(", "$", "subcontext", ",", "MAX_FILENAME_SIZE", ",", "true", ")", ";", "$", "name", "=...
Get the relative file path within the current context, and subcontext, using the specified filename. @param string[] $subcontext The location within the current context to export this data. @param string $name The intended filename, including any extensions. @return string ...
[ "Get", "the", "relative", "file", "path", "within", "the", "current", "context", "and", "subcontext", "using", "the", "specified", "filename", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L285-L319
215,391
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.get_full_path
protected function get_full_path(array $subcontext, string $name) : string { $path = array_merge( [$this->path], [$this->get_path($subcontext, $name)] ); // Join the directory together with the name. $filepath = implode(DIRECTORY_SEPARATOR, $path); // To...
php
protected function get_full_path(array $subcontext, string $name) : string { $path = array_merge( [$this->path], [$this->get_path($subcontext, $name)] ); // Join the directory together with the name. $filepath = implode(DIRECTORY_SEPARATOR, $path); // To...
[ "protected", "function", "get_full_path", "(", "array", "$", "subcontext", ",", "string", "$", "name", ")", ":", "string", "{", "$", "path", "=", "array_merge", "(", "[", "$", "this", "->", "path", "]", ",", "[", "$", "this", "->", "get_path", "(", "...
Get the fully-qualified file path within the current context, and subcontext, using the specified filename. @param string[] $subcontext The location within the current context to export this data. @param string $name The intended filename, including any extensions. @return string ...
[ "Get", "the", "fully", "-", "qualified", "file", "path", "within", "the", "current", "context", "and", "subcontext", "using", "the", "specified", "filename", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L328-L340
215,392
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.get_files_target_path
protected function get_files_target_path($component, $filearea, $itemid) : string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; if (!empty($itemid)) { $parts[] = $itemid; } return implode(DIRECTO...
php
protected function get_files_target_path($component, $filearea, $itemid) : string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; if (!empty($itemid)) { $parts[] = $itemid; } return implode(DIRECTO...
[ "protected", "function", "get_files_target_path", "(", "$", "component", ",", "$", "filearea", ",", "$", "itemid", ")", ":", "string", "{", "// We do not need to include the component because we organise things by context.", "$", "parts", "=", "[", "'_files'", ",", "$",...
Get a path within a subcontext where exported files should be written to. @param string $component The name of the component that the files belong to. @param string $filearea The filearea within that component. @param string $itemid Which item those files belong to. @return string The path
[ "Get", "a", "path", "within", "a", "subcontext", "where", "exported", "files", "should", "be", "written", "to", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L350-L360
215,393
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.get_files_target_url
protected function get_files_target_url($component, $filearea, $itemid) : string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; if (!empty($itemid)) { $parts[] = '_' . $itemid; } return implode('/'...
php
protected function get_files_target_url($component, $filearea, $itemid) : string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; if (!empty($itemid)) { $parts[] = '_' . $itemid; } return implode('/'...
[ "protected", "function", "get_files_target_url", "(", "$", "component", ",", "$", "filearea", ",", "$", "itemid", ")", ":", "string", "{", "// We do not need to include the component because we organise things by context.", "$", "parts", "=", "[", "'_files'", ",", "$", ...
Get a relative url to the directory of the exported files within a subcontext. @param string $component The name of the component that the files belong to. @param string $filearea The filearea within that component. @param string $itemid Which item those files belong to. @return string The url
[ "Get", "a", "relative", "url", "to", "the", "directory", "of", "the", "exported", "files", "within", "a", "subcontext", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L370-L379
215,394
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.write_data
protected function write_data(string $path, string $data) { $targetpath = $this->path . DIRECTORY_SEPARATOR . $path; check_dir_exists(dirname($targetpath), true, true); if (file_put_contents($targetpath, $data) === false) { throw new \moodle_exception('cannotsavefile', 'error', '', $...
php
protected function write_data(string $path, string $data) { $targetpath = $this->path . DIRECTORY_SEPARATOR . $path; check_dir_exists(dirname($targetpath), true, true); if (file_put_contents($targetpath, $data) === false) { throw new \moodle_exception('cannotsavefile', 'error', '', $...
[ "protected", "function", "write_data", "(", "string", "$", "path", ",", "string", "$", "data", ")", "{", "$", "targetpath", "=", "$", "this", "->", "path", ".", "DIRECTORY_SEPARATOR", ".", "$", "path", ";", "check_dir_exists", "(", "dirname", "(", "$", "...
Write the data to the specified path. @param string $path The path to export the data at. @param string $data The data to be exported. @throws \moodle_exception If the file cannot be written for some reason.
[ "Write", "the", "data", "to", "the", "specified", "path", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L388-L395
215,395
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.copy_data
protected function copy_data(array $path, array $destination) { global $CFG; $filename = array_pop($destination); $destdirectory = implode(DIRECTORY_SEPARATOR, $destination); $fulldestination = $this->path . DIRECTORY_SEPARATOR . $destdirectory; check_dir_exists($fulldestination,...
php
protected function copy_data(array $path, array $destination) { global $CFG; $filename = array_pop($destination); $destdirectory = implode(DIRECTORY_SEPARATOR, $destination); $fulldestination = $this->path . DIRECTORY_SEPARATOR . $destdirectory; check_dir_exists($fulldestination,...
[ "protected", "function", "copy_data", "(", "array", "$", "path", ",", "array", "$", "destination", ")", "{", "global", "$", "CFG", ";", "$", "filename", "=", "array_pop", "(", "$", "destination", ")", ";", "$", "destdirectory", "=", "implode", "(", "DIRE...
Copy a file to the specified path. @param array $path Current location of the file. @param array $destination Destination path to copy the file to.
[ "Copy", "a", "file", "to", "the", "specified", "path", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L403-L413
215,396
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.make_tree_object
protected function make_tree_object(array $tree, array $treekey, array $currentkey = []) : Array { $newtree = []; // Try to extract the context id and then add the context object. $addcontext = function($index, $object) { if (stripos($index, '_.') !== false) { $namear...
php
protected function make_tree_object(array $tree, array $treekey, array $currentkey = []) : Array { $newtree = []; // Try to extract the context id and then add the context object. $addcontext = function($index, $object) { if (stripos($index, '_.') !== false) { $namear...
[ "protected", "function", "make_tree_object", "(", "array", "$", "tree", ",", "array", "$", "treekey", ",", "array", "$", "currentkey", "=", "[", "]", ")", ":", "Array", "{", "$", "newtree", "=", "[", "]", ";", "// Try to extract the context id and then add the...
Add more detail to the tree to help with sorting and display in the renderer. @param array $tree The file structure currently as a multidimensional array. @param array $treekey An array of the current file paths. @param array $currentkey The current short path of the tree. @return array An array of obje...
[ "Add", "more", "detail", "to", "the", "tree", "to", "help", "with", "sorting", "and", "display", "in", "the", "renderer", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L481-L544
215,397
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.check_plugin_is_installed
protected function check_plugin_is_installed(string $component) : Bool { if (!isset($this->checkedplugins[$component])) { $pluginmanager = \core_plugin_manager::instance(); $plugin = $pluginmanager->get_plugin_info($component); $this->checkedplugins[$component] = !is_null($pl...
php
protected function check_plugin_is_installed(string $component) : Bool { if (!isset($this->checkedplugins[$component])) { $pluginmanager = \core_plugin_manager::instance(); $plugin = $pluginmanager->get_plugin_info($component); $this->checkedplugins[$component] = !is_null($pl...
[ "protected", "function", "check_plugin_is_installed", "(", "string", "$", "component", ")", ":", "Bool", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "checkedplugins", "[", "$", "component", "]", ")", ")", "{", "$", "pluginmanager", "=", "\\", "...
Check to see if a specified plugin is installed. @param string $component The component name e.g. tool_log @return bool Whether this component is installed.
[ "Check", "to", "see", "if", "a", "specified", "plugin", "is", "installed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L599-L606
215,398
moodle/moodle
privacy/classes/local/request/moodle_content_writer.php
moodle_content_writer.finalise_content
public function finalise_content() : string { $this->write_html_data(); $exportfile = make_request_directory() . '/export.zip'; $fp = get_file_packer(); $fp->archive_to_pathname($this->files, $exportfile); // Reset the writer to prevent any further writes. writer::rese...
php
public function finalise_content() : string { $this->write_html_data(); $exportfile = make_request_directory() . '/export.zip'; $fp = get_file_packer(); $fp->archive_to_pathname($this->files, $exportfile); // Reset the writer to prevent any further writes. writer::rese...
[ "public", "function", "finalise_content", "(", ")", ":", "string", "{", "$", "this", "->", "write_html_data", "(", ")", ";", "$", "exportfile", "=", "make_request_directory", "(", ")", ".", "'/export.zip'", ";", "$", "fp", "=", "get_file_packer", "(", ")", ...
Perform any required finalisation steps and return the location of the finalised export. @return string
[ "Perform", "any", "required", "finalisation", "steps", "and", "return", "the", "location", "of", "the", "finalised", "export", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/privacy/classes/local/request/moodle_content_writer.php#L684-L696
215,399
moodle/moodle
mod/forum/classes/local/vaults/discussion_list.php
discussion_list.generate_count_records_sql
protected function generate_count_records_sql(string $wheresql = null) : string { $alias = $this->get_table_alias(); $db = $this->get_db(); $selectsql = "SELECT COUNT(1) FROM {" . self::TABLE . "} {$alias}"; $selectsql .= $wheresql ? ' WHERE ' . $wheresql : ''; return $selectsq...
php
protected function generate_count_records_sql(string $wheresql = null) : string { $alias = $this->get_table_alias(); $db = $this->get_db(); $selectsql = "SELECT COUNT(1) FROM {" . self::TABLE . "} {$alias}"; $selectsql .= $wheresql ? ' WHERE ' . $wheresql : ''; return $selectsq...
[ "protected", "function", "generate_count_records_sql", "(", "string", "$", "wheresql", "=", "null", ")", ":", "string", "{", "$", "alias", "=", "$", "this", "->", "get_table_alias", "(", ")", ";", "$", "db", "=", "$", "this", "->", "get_db", "(", ")", ...
Build the SQL to be used in count_records_sql. @param string|null $wheresql Where conditions for the SQL @return string
[ "Build", "the", "SQL", "to", "be", "used", "in", "count_records_sql", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion_list.php#L169-L177