本文整理汇总了PHP中Modules::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::add方法的具体用法?PHP Modules::add怎么用?PHP Modules::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules
的用法示例。
在下文中一共展示了Modules::add方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_plugin_activation
/**
*
*/
public function action_plugin_activation($file)
{
if (realpath($file) == __FILE__) {
Modules::add('Incoming Links');
// Add a periodical execution event to be triggered hourly
CronTab::add_hourly_cron('incoming_links', 'incoming_links', 'Find links to this blog.');
}
}
示例2: action_plugin_activation
public function action_plugin_activation($file)
{
if (realpath($file) == __FILE__) {
Modules::add('GetClicky');
Options::set('getclicky__cachetime', '300');
Options::set('getclicky__loggedin', 1);
}
}
示例3: action_plugin_activation
/**
* action_plugin_activation
* Registers the core modules with the Modules class. Add these modules to the
* dashboard if the dashboard is currently empty.
* @param string $file plugin file
*/
function action_plugin_activation($file)
{
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
Modules::add('Latest Entries');
Modules::add('Latest Comments');
Modules::add('Latest Log Activity');
}
}
示例4: action_plugin_activation
/**
* action: plugin_activation
*
* @access public
* @param string $file
* @return void
*/
public function action_plugin_activation($file)
{
if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
return;
}
Options::set('fireeagle__refresh_interval', 3600);
Modules::add(_t('Fire Eagle', 'fireeagle'));
}
示例5: action_plugin_activation
public function action_plugin_activation($file)
{
if (realpath($file) == __FILE__) {
Modules::add('Technorati');
Session::notice(_t('Please set your Technorati API Key in the configuration.'));
Options::set('technorati__apikey', '');
}
}
示例6: action_plugin_activation
/**
* action_plugin_activation
* Registers the core modules with the Modules class.
* @param string $file plugin file
*/
function action_plugin_activation($file)
{
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
Modules::add('My Tickets');
if (Options::get('tracdashmodule__trac_query') == null) {
Options::set('tracdashmodule__trac_query', 'enter query');
}
}
}
示例7: action_plugin_activation
public function action_plugin_activation($file = '')
{
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
ACL::create_token('snapshot', 'Manage Database Snapshots', 'Export', true);
// save the default options
Options::set('exportsnapshot__frequency', 'manually');
Options::set('exportsnapshot__type', 'blogml');
// add the module
Modules::add(_t('Snapshots', 'exportsnapshot'));
}
}
示例8: action_plugin_activation
/**
* action_plugin_activation
* Registers the core modules with the Modules class. Add these modules to the
* dashboard if the dashboard is currently empty.
* @param string $file plugin file
*/
public function action_plugin_activation($file)
{
foreach ($this->default_options as $name => $value) {
$current_value = Options::get($this->class_name . '__' . $name);
if (is_null($current_value)) {
Options::set($this->class_name . '__' . $name, $value);
}
}
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
foreach ($this->reports as $rpt => $data) {
Modules::add($data['module']);
}
}
}
示例9: dash_additem
/**
* Adds a module to the user's dashboard
* @param object form FormUI object
*/
public function dash_additem($form)
{
$new_module = $form->module->value;
Modules::add($new_module);
// return false to redisplay the form
return false;
}
示例10: action_plugin_activation
/**
* action_plugin_activation
* Registers the core modules with the Modules class. Add these modules to the
* dashboard if the dashboard is currently empty.
* @param string $file plugin file
*/
function action_plugin_activation($file)
{
if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
Modules::add('Latest Spam');
}
}
示例11: action_plugin_activation
function action_plugin_activation($file)
{
Modules::add('123LinkIt');
CronTab::add_hourly_cron('linkit_fetch', 'linkit_fetch', _t('Fetches the statistical data from the 123LinkIt site.', 'linkit'));
}
示例12: mettre_a_jour
/**
* @method void Mise a jour des modules en BD en fonction du contenu du repertoire des modules
*/
public function mettre_a_jour()
{
if ($dh = opendir($this->plugins_base_dir)) {
while ($file = readdir($dh)) {
if ($file == '.' || $file == '..') {
continue;
}
try {
// Tenter d'instancier le plugin
$instance = $this->instancier($file);
$modules = new Modules();
if ($instance instanceof PluginsPaiements) {
$modules->type = Modules::PAIEMENT;
} else {
if ($instance instanceof PluginsTransports) {
$modules->type = Modules::TRANSPORT;
} else {
if ($instance instanceof FiltreBase) {
$modules->type = Modules::FILTRE;
} else {
if ($instance instanceof PluginsClassiques) {
$modules->type = Modules::CLASSIQUE;
} else {
continue;
}
}
}
}
// On ignore
// Vérifier si le module existe en BD, et l'ajouter s'il n'y est pas
if (!$modules->charger($file)) {
$modules->nom = $file;
$modules->actif = 0;
$modules->add();
// On en profite pour le convertir en UTF-8 au passage si nécessaire.
$this->conversion_utf8($this->lire_chemin_module($modules->nom));
}
} catch (Exception $ex) {
// On ne peut pas instancier -> ignorer
}
}
@closedir($dh);
}
// Vérifier que les plugins en base existent toujours sur disque
$modules = new Modules();
$result = $modules->query('select nom from ' . Modules::TABLE);
while ($result && ($row = $modules->fetch_object($result))) {
try {
$this->lire_chemin_module($row->nom);
} catch (Exception $ex) {
// Le plugin n'existe plus sur disque -> le retirer de la BD
if ($modules->charger($row->nom)) {
$modules->delete();
// Supprimer aussi la description
$modules->query("delete from " . Modulesdesc::TABLE . " where plugin='{$modules->nom}'");
}
}
}
CacheBase::getCache()->reset_cache();
}