67 Commits

Author SHA1 Message Date
Brendan Heywood
bff1edbe44 MDL-51603 dataformat: Implement streaming dataformat plugin 2016-04-20 12:39:25 +10:00
Andrew Nicols
65e7fee267 Merge branch 'MDL-53327-master' of git://github.com/danpoltawski/moodle 2016-03-09 08:48:44 +08:00
Dan Poltawski
0296f08e71 MDL-53327 search: add missing pluginfo lang strings
AMOS BEGIN
 CPY [searchengine,admin],[type_search,plugin]
AMOS END
2016-03-03 17:04:24 +08:00
Marina Glancy
d2de503c80 MDL-50887 antivirus: clamav is standard plugin, missing strings 2016-03-02 15:42:35 +08:00
Helen Foster
da6ecfd8c1 MDL-52018 lang: Merge English strings from the en_fix language pack 2015-11-02 22:12:06 +01:00
David Mudrák
c20e9ae836 MDL-49329 admin: Add ability to cancel upgrade of the plugin
If there is an available archived zip with the version of the plugin
currently installed, we can use it to cancel/abort the upgrade of the
plugin. This is internally handled as the installation of the archived
zip and goes through all the validation and confirmation.

Additionally, some other parts were improved. Most notably, renderer no
longer decides itself if some installation can be cancelled but it
always asks the controller (plugin manager).

The button for installation was moved to the left so there should be
first buttons to add things, and then buttons to cancel things (which is
common in normal forms).
2015-10-09 23:37:32 +02:00
David Mudrák
4d7528f9bc MDL-49329 admin: Require confirmation before cancelling plugin install 2015-10-09 09:50:46 +02:00
David Mudrák
2d00be61f1 MDL-49329 admin: Make plugin manager able to install from local zips too
The plugin manager's method install_remote_plugins() has been changed to
install_plugins() and it is now able to install plugins from the
provided list of locally available ZIP files, too. This is used by the
Install plugins admin tool.
2015-10-09 09:50:46 +02:00
David Mudrák
531381f914 MDL-49329 admin: Support plugins installation during upgrade
The plugins check screen (displayed during core upgrade and/or plugins
upgrade) now supports installation of remote plugins. This includes
installation of missing dependencies (both single and bulk mode) and
installation of available updates (both single and bulk mode).

All the HTTP query parameters supported by admin/index.php are now
explicitly enlisted. Previously, the \core\update\deployer used
its own additional parameters (and was source of some serious problems
in the past).

The implementation uses the plugin manager as the controller and
provides an unified interface for installing any remote plugin or
plugins (be it available update or missing dependency).

As a side effect, we now validate available updates which was not
happening before.
2015-10-09 09:50:45 +02:00
David Mudrák
c948b813ae MDL-49329 admin: Add plugin manager method for installing remote packs
The new method core_plugin_manager::install_remote_plugins() will serve
as a backend for all the ways of installing ZIP packages from the moodle
plugins directory, such as installing new plugins (by clicking the
Install button in the plugins directory), installing available updates
(single and bulk mode) and installing missing dependencies (single and
bulk mode).

The method should be used both for validation pre-check screen and,
after the confirmation, for actual installation. Note that we
intentionally repeat the whole procedure after confirmation. Unzipping
plugins is cheap and fast and the ZIPs themselves are already available
in the \core\update\code_manager's cache.

We will need to add support for archiving existing code to prevent
accidental data-loss.

This basically provides what mdeploy.php was doing, but better. We now
have consistent way of installing all remote ZIP packages, always
validate them and we can perform bulk operations, too.
2015-10-09 09:50:44 +02:00
David Mudrák
8acee4b53d MDL-49329 admin: Improve the plugin package validator
Previously, the validator was used for installation of the new plugins
only. We now validate every incoming plugin package. As a result, we
must no longer insists on the target location is empty. Instead, warning
is raised.
2015-10-08 23:32:05 +02:00
David Mudrák
44371554a9 MDL-49329 admin: Improve plugins overview page rendering
Provides a bit more compact layout. Finally cleans up the relevant LESS
files and makes available updates info boxes consistent across all
screens where they are displayed.
2015-10-08 23:32:04 +02:00
David Mudrák
36977a6d08 MDL-49329 admin: If unable to install a plugin, display the reason 2015-10-08 23:32:04 +02:00
David Mudrák
0ec7d10128 MDL-49329 admin: Improve Plugins check page
Better inform about the number of plugins requiring attention vs total
plugins. Clean up the renderer.
2015-10-08 23:32:03 +02:00
David Mudrák
9137a89a1a MDL-49329 admin: Improve the UI for installing dependencies 2015-10-08 23:32:03 +02:00
David Mudrák
2f29cf6e63 MDL-49329 admin: Add ability to cancel installation of a new plugin
The plugins check screen now provides buttons to cancel installation of
a plugin. Available only for new installations (not upgrades) and for
additional plugins (not standard), given that the web server process has
write access to the plugin folder.

This has also been reported as MDL-48535.

As a part of the patch, there is improved processing of page URLs during
the upgrade. All this dancing around $reload URL is not needed once the
$PAGE->url is properly set to guide the admin on the correct page during
the upgrade process.
2015-10-08 23:32:03 +02:00
David Mudrák
f2d8ed45e3 MDL-49329 admin: Introduce new \core\update\validator class
This is not really new class. Originally, the validator was implemented
in the scope of the tool_installaddon plugin. But we need its features
in other parts at the core level (e.g. during the upgrade to validate
available missing dependencies or available updates). Looking back, it
was a mistake to have it implemented at the plugin level rather than the
core level.

So this patch moves the tool_installaddon_validator class to
\core\update\validator class, together with associated unit tests,
fixture files and strings. There were changes made in the
tool_installaddon to make use of this new class instead of the old one.

This is a great step towards the bright future, hopefully there won't be
many regressions.

AMOS BEGIN
 MOV [validationmsg_componentmatch,tool_installaddon],[validationmsg_componentmatch,core_plugin]
 MOV [validationmsg_componentmismatchname,tool_installaddon],[validationmsg_componentmismatchname,core_plugin]
 MOV [validationmsg_componentmismatchname_help,tool_installaddon],[validationmsg_componentmismatchname_help,core_plugin]
 MOV [validationmsg_componentmismatchname_info,tool_installaddon],[validationmsg_componentmismatchname_info,core_plugin]
 MOV [validationmsg_componentmismatchtype,tool_installaddon],[validationmsg_componentmismatchtype,core_plugin]
 MOV [validationmsg_componentmismatchtype_info,tool_installaddon],[validationmsg_componentmismatchtype_info,core_plugin]
 MOV [validationmsg_filenotexists,tool_installaddon],[validationmsg_filenotexists,core_plugin]
 MOV [validationmsg_filesnumber,tool_installaddon],[validationmsg_filesnumber,core_plugin]
 MOV [validationmsg_filestatus,tool_installaddon],[validationmsg_filestatus,core_plugin]
 MOV [validationmsg_filestatus_info,tool_installaddon],[validationmsg_filestatus_info,core_plugin]
 MOV [validationmsg_foundlangfile,tool_installaddon],[validationmsg_foundlangfile,core_plugin]
 MOV [validationmsg_maturity,tool_installaddon],[validationmsg_maturity,core_plugin]
 MOV [validationmsg_maturity_help,tool_installaddon],[validationmsg_maturity_help,core_plugin]
 MOV [validationmsg_missingcomponent,tool_installaddon],[validationmsg_missingcomponent,core_plugin]
 MOV [validationmsg_missingcomponent_help,tool_installaddon],[validationmsg_missingcomponent_help,core_plugin]
 MOV [validationmsg_missingcomponent_link,tool_installaddon],[validationmsg_missingcomponent_link,core_plugin]
 MOV [validationmsg_missingexpectedlangenfile,tool_installaddon],[validationmsg_missingexpectedlangenfile,core_plugin]
 MOV [validationmsg_missingexpectedlangenfile_info,tool_installaddon],[validationmsg_missingexpectedlangenfile_info,core_plugin]
 MOV [validationmsg_missinglangenfile,tool_installaddon],[validationmsg_missinglangenfile,core_plugin]
 MOV [validationmsg_missinglangenfolder,tool_installaddon],[validationmsg_missinglangenfolder,core_plugin]
 MOV [validationmsg_missingversion,tool_installaddon],[validationmsg_missingversion,core_plugin]
 MOV [validationmsg_missingversionphp,tool_installaddon],[validationmsg_missingversionphp,core_plugin]
 MOV [validationmsg_multiplelangenfiles,tool_installaddon],[validationmsg_multiplelangenfiles,core_plugin]
 MOV [validationmsg_onedir,tool_installaddon],[validationmsg_onedir,core_plugin]
 MOV [validationmsg_onedir_help,tool_installaddon],[validationmsg_onedir_help,core_plugin]
 MOV [validationmsg_pathwritable,tool_installaddon],[validationmsg_pathwritable,core_plugin]
 MOV [validationmsg_pluginversion,tool_installaddon],[validationmsg_pluginversion,core_plugin]
 MOV [validationmsg_release,tool_installaddon],[validationmsg_release,core_plugin]
 MOV [validationmsg_requiresmoodle,tool_installaddon],[validationmsg_requiresmoodle,core_plugin]
 MOV [validationmsg_rootdir,tool_installaddon],[validationmsg_rootdir,core_plugin]
 MOV [validationmsg_rootdir_help,tool_installaddon],[validationmsg_rootdir_help,core_plugin]
 MOV [validationmsg_rootdirinvalid,tool_installaddon],[validationmsg_rootdirinvalid,core_plugin]
 MOV [validationmsg_rootdirinvalid_help,tool_installaddon],[validationmsg_rootdirinvalid_help,core_plugin]
 MOV [validationmsg_targetexists,tool_installaddon],[validationmsg_targetexists,core_plugin]
 MOV [validationmsg_targetexists_help,tool_installaddon],[validationmsg_targetexists_help,core_plugin]
 MOV [validationmsg_unknowntype,tool_installaddon],[validationmsg_unknowntype,core_plugin]
 MOV [validationmsg_versionphpsyntax,tool_installaddon],[validationmsg_versionphpsyntax,core_plugin]
 MOV [validationmsglevel_debug,tool_installaddon],[validationmsglevel_debug,core_plugin]
 MOV [validationmsglevel_error,tool_installaddon],[validationmsglevel_error,core_plugin]
 MOV [validationmsglevel_info,tool_installaddon],[validationmsglevel_info,core_plugin]
 MOV [validationmsglevel_warning,tool_installaddon],[validationmsglevel_warning,core_plugin]
AMOS END
2015-10-08 23:32:03 +02:00
David Mudrák
5a92cd0b8d MDL-49329 admin: Display missing dependencies on plugins check screen
The patch improves the dependencies resolution in the plugin manager so
that the information about availability of the missing dependency is
included and can be displayed at the Plugins check screen during the
upgrade.
2015-10-08 23:32:03 +02:00
David Mudrák
fd17898c0c MDL-49329 admin: Improve the styling of the Plugins check screen
The intention here is to make the table a little bit more compact (using
less columns) and to make use of the bootstrap based label elements if
available.
2015-10-08 23:32:02 +02:00
David Mudrák
a277654f7f MDL-51261 admin: Fix the heading when displaying all plugins
Not directly related to the issue but spotted while developing it and it
is not worth of submitting in a separate issue.

At the Plugins check page, when the "Display the full list of installed
plugins" link was followed, the heading at the next page read something
like "Number of plugins requiring your attention: 357". That is
misleading as this is actually not the number of displayed plugins, not
the number of plugins requiring attention.
2015-09-24 21:02:33 +02:00
Eloy Lafuente (stronk7)
ed3e85755c Merge branch '47428-28' of git://github.com/samhemelryk/moodle 2014-09-30 23:42:58 +02:00
Sam Hemelryk
3a6ef60a5b MDL-47428 language: fixed typo 2014-09-26 10:05:24 +12:00
David Mudrák
2cdea9c7ac MDL-47069 admin: Add option to upload required ZIP at the check page
The plugins check page displays other plugins that the current one
depends on.  Previously, we always displayed the other plugin as a link
to the plugins directory. This did not work well in two scenarios:

* The admin wants/needs to upload the other plugin from the ZIP file
  (e.g. it is not available in the plugins directory),

* the other plugin is actually a standard plugin that is not supposed to
  be registered with the plugins directory.

This patch displays the Install or Upload or Check for updates links
next to the required plugin instead, as appropriate.
2014-09-25 16:54:21 +02:00
Dan Poltawski
59ba5a5952 Merge branch 'MDL-45599-master-addons' of git://github.com/mudrd8mz/moodle 2014-07-08 15:31:50 +01:00
Helen Foster
78231c9cf1 MDL-46231 Merge English strings from the en_fix language pack 2014-07-04 22:32:38 +02:00
David Mudrák
d49db5b2de MDL-45599 Stop using the 'add-on' term
We now call them all as just 'plugins' for consistency. There where we need to
explicitly distinguish the source of the plugin, we say they are 'additional
plugins' on contrary to 'standards plugins' coming with the core.
2014-07-04 13:16:53 +02:00
sam marshall
d3db4b037c MDL-44070 Conditional availability enhancements (2): subsystem, API
This commit defines the new /availability root folder, with
/availability/classes, /availability/tests, and
/availability/condition where the condition plugins will live.
Condition plugin prefix is availability_, e.g. availability_date.

Rationale for this organisation:

1. I was originally going to put this in /lib/availability but
   it has been pointed out that putting even more junk in lib
   is probably bad.
2. 'availability' and 'condition' are the two names used in code
   to refer to this system ($CFG->enableavailability).
3. The prefix has to be short enough to allow database tables
   (although in practice I assume that condition plugins will not
   normally contain database tables).

The new API includes a Boolean tree structure that controls the
availability of an item.

AMOS BEGIN
 CPY [availabilityconditions,core_condition],[restrictaccess,core_availability]
 CPY [enableavailability,core_condition],[enableavailability,core_availability]
 CPY [configenableavailability,core_condition],[enableavailability_desc,core_availability]
AMOS END
2014-04-07 20:11:33 +01:00
Petr Škoda
2f98f5d541 MDL-43117 Add release column to Plugins Overview page
This patch is based on previous patch by Marko Vidberg, thanks a lot!
2013-12-01 18:57:49 +08:00
Mark Nelson
2f00e1b245 MDL-18375 calendar: huge refactor of the initial patch
1) Moved the calendar types location to a sub-folder in the calendar directory.
2) Removed/moved language strings.
3) Removed calendar types that should be downloaded as plugins.
4) Removed a Non-English language pack for the Gregorian calendar type that
should be downloaded separately.
5) Removed custom files responsible for checking for updates and uninstalling
calendar types, which should be done by core.
6) Removed JS from the calendar_month block as there is no non-JS alternative
provided and the JS written does not make use of the YUI library to ensure
multiple browser support.
7) Removed code from the base class responsible for creating timestamps that
are saved in the DB.
8) Added PHPDocs.

Note: In the original patch we are editing core functions responsible for saving
time in the database in the calendar base class. This is very dangerous, we do
not want to touch these functions as it could cause a complete fubar of the
database. There are places we are forcing the use of the gregorian calendar as
we are passing dates generated by the PHP date function, where as sometimes
we pass dates from usergetdate (which was being overwritten to return the
date specific to the calendar). We can not expect third party modules to
change the calendar type depending on the format they pass to these functions.
2013-09-05 18:30:05 +08:00
Shamim Rezaie
6dd59aabfa MDL-18375 calendar: added multiple calendar support
Conflicts:

	course/edit_form.php
	lib/db/install.xml
	lib/form/dateselector.php
	lib/form/datetimeselector.php
	lib/setup.php
2013-09-05 18:30:05 +08:00
Petr Škoda
cd79930e4d MDL-39088 migrate module uninstallation to plugin_manager 2013-06-27 22:20:35 +02:00
Petr Škoda
5643f932e9 MDL-39088 migrate enrol uninstallation to plugin_manager 2013-06-27 22:20:35 +02:00
Petr Škoda
6584d8a861 MDL-39088 migrate block uninstallation to plugin_manager 2013-06-27 22:20:35 +02:00
Helen Foster
9f3e096899 MDL-39642 Merge English strings from the en_fix language pack 2013-05-13 09:58:43 +02:00
David Mudrák
b27c50e234 MDL-39248 Fix the plugins check screen strings
Not all add-ons require administrator's attention during the upgrade
now. They are now listed only if there is an update available for them.

Also, it's not true any more that add-ons must be updated manually. They
can be updated using the automatic deployment feature, too.
2013-04-20 00:52:47 +02:00
David Mudrák
436d94478d MDL-39087 Implement a common interface for uninstalling general plugin
Plugins may use this general tool for uninstallation and eventually
removal of the deployed source code. At the moment, this is implemented
as a wrapper for the core function uninstall_plugin() with an extra hook
in the relevant plugin info subclass.

For non-standard add-ons, the tool can remove the deployed plugin source
code as well, if the web server has required write permissions. Ideally,
all add-ons installed via the new tool_installaddon should be removable
via the web interface as well.
2013-04-12 01:42:58 +02:00
Helen Foster
ca084ef149 MDL-38352 Merge English strings from the en_fix language pack 2013-03-06 16:44:39 +01:00
Petr Škoda
bdbcb6d7fa MDL-38121 tell admins when plugin installed into wrong dir 2013-02-23 18:16:42 +01:00
David Mudrák
30e2682756 MDL-36903 Pre-check the ZIP download before executing the mdeploy.php utility
This patch makes Moodle call HTTP HEAD method via cURL to see if the ZIP
is expected to be downloadable by mdeploy.php. This is mainly intended
for SSL certificates check.
2012-11-30 16:09:58 +01:00
David Mudrák
4785c45dd8 MDL-36903 Verify the SSL certificate of available updates provider
From now on, Moodle verifies the available updates provider server. To
make it work, either there must be a valid CA certificate available in
the operating system, or the administrator has to upload the valid CA
certificate to moodledata/moodleorgca.crt (PEM format) file manually.
2012-11-30 16:09:58 +01:00
David Mudrák
0daa642894 MDL-35238 Inform the admin if the update can not be deployed due to write permissions 2012-11-09 00:20:18 +01:00
David Mudrák
85d7516313 MDL-35238 Fetch available updates using the 1.1 version of the API
If the stored response has still 1.0 version (which is expected during
the upgrade to 2.4), a debugging message is displayed. Added a string to
explain what's going on and how to recover from the state.
2012-11-08 22:33:07 +01:00
David Mudrák
08c3bc006d MDL-35238 Warn the admin if they are about to overwrite a SCM checkout 2012-11-08 22:33:07 +01:00
David Mudrák
6aa2e2881a MDL-35238 Admin renderer method to display the plugin update confirmation page 2012-11-08 22:33:06 +01:00
David Mudrák
4df8bced23 MDL-35238 Allow filtering at the Plugins overview page 2012-11-08 22:33:06 +01:00
Sam Hemelryk
fd59389ca6 MDL-25290 cache: Plugins are now standard and strings tidied 2012-10-08 09:53:52 +13:00
David Mudrak
39f15cc712 MDL-32329 check for plugin dependencies during the pre-install checking
This follows the same path as we have in CLI installers. Plugin
dependencies are checked right after the environment checks and the
install can't continue unless all dependencies are fixed.
2012-05-30 10:35:28 +02:00
Ruslan Kabalin
c9e34994cb MDL-32009 messaging: Fix using message processor term inconsistency. 2012-04-30 10:34:39 +01:00
David Mudrak
a687fcac7a MDL-20438 added a link to toggle the plugins check page back to the shorter list 2012-03-30 11:05:42 +02:00
David Mudrak
18e55c294d MDL-20438 removing the word 'extension'
It was suggested not to use this term as in moodleverse, non-standard
plugins have always been referred to as 'contributed plugins'.
2012-03-30 11:05:42 +02:00