Project

General

Profile

Feature #4575

Static plugin

Added by Laurent Opprecht about 8 years ago. Updated over 7 years ago.

Status:
Feature implemented
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
30/03/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Static plugin. Display html content. Code available here


Related issues

Related to Chamilo LMS - Feature #4574: Rss pluginFeature implemented30/03/2012

Actions
Related to Chamilo LMS - Feature #4557: Add languages forlder and files for pluginFeature implemented27/03/2012

Actions

History

#1

Updated by Julio Montoya about 8 years ago

  • Status changed from New to Needs more info
  • Assignee changed from Julio Montoya to Laurent Opprecht

Bonjour Laurent,

Nice additions! I just found that you created a new class plugin.class.php instead of using plugin.lib.php.
In plugin.class.php you added also a way to import lang variables and CSS which was missing in the current code in Chamilo 1.9.

plugin.lib will work as a controller/managing for installing, uninstalling, add plugins to regions, etc and your class (plugin.class.php) will work as a class that all plugins should inherit (right now we use a simple $plugin_info array).

What do you think?

#2

Updated by Laurent Opprecht almost 8 years ago

Cheers Julio,
Indeed there is a file called plugin.lib. For me

plugin.lib Controller
plugin.class.php (and its derivatvives) Model

Using a class as a base instead of an array allows to reuse existing code - the reason why I introduced it in the first place. Not that we should start using it right now but I believe this is better than using an array. For the moment I just use the base class to export its attributes to an array to stay compatible with the current version.

#3

Updated by Laurent Opprecht almost 8 years ago

  • Assignee changed from Laurent Opprecht to Julio Montoya
#4

Updated by Laurent Opprecht almost 8 years ago

I mean

plugin.lib = controller
plugin.class = model

#5

Updated by Julio Montoya almost 8 years ago

Laurent Opprecht wrote:

I mean

plugin.lib = controller
plugin.class = model

yes, I agree with that

#6

Updated by Julio Montoya almost 8 years ago

  • Assignee changed from Julio Montoya to Laurent Opprecht
  • % Done changed from 0 to 80

one more thing, remember that the description/content of the static plugin has a limit of 255 chars, because it relies in the "settings_current.selected_value" field. So it will be fine add a notice below the fckeditor textarea.

#7

Updated by Laurent Opprecht almost 8 years ago

  • Assignee changed from Laurent Opprecht to Julio Montoya

I put a maxlength to the text fields and a rule.

#8

Updated by Julio Montoya almost 8 years ago

  • Assignee changed from Julio Montoya to Laurent Opprecht

In plugin.class.php file you will need something like this in the get_settings_form() function

$result->addRule($element, $message, $type, $format);
#9

Updated by Yannick Warnier almost 8 years ago

  • Target version set to 1.9 Beta
#10

Updated by Yannick Warnier almost 8 years ago

  • Target version changed from 1.9 Beta to 1.9 RC1

Let me know what the status is with this. As far as I can see there's still something pending with the get_settings() stuff, or am I not getting something?

#11

Updated by Laurent Opprecht almost 8 years ago

For me we can close. We could add a rule to limit text length on the server side but it is certainly not required - there is a already an html rule.

#12

Updated by Laurent Opprecht almost 8 years ago

  • % Done changed from 80 to 100
#13

Updated by Julio Montoya over 7 years ago

  • Status changed from Needs more info to Feature implemented
  • Assignee deleted (Laurent Opprecht)

Closing, maybe for other versions the plugin.class could be improved in order to add more parameters to formvalidator. Works well now

Also available in: Atom PDF