11 if (!function_exists(
"__")){
12 function __($text, $d){
21 $modversion[
'description'] =
'Container a lot of clases and functions used by Red México Modules';
26 $modversion[
'updateurl'] =
"http://www.xoopsmexico.net/modules/vcontrol/?action=check&id=1";
28 $modversion[
'help'] =
"http://www.redmexico.com.mx/docs/common-utilities/";
37 $modversion[
'rmversion'] = array(
'major'=>2,
'minor'=>1,
'revision'=>89.1,
'stage'=>-1,
'name'=>
'Common Utilities');
41 $modversion[
'social'][0] = array(
'title' =>
__(
'Twitter',
'rmcommon'),
'type' =>
'twitter',
'url' =>
'http://www.twitter.com/bitcero/');
42 $modversion[
'social'][1] = array(
'title' =>
__(
'LinkedIn',
'rmcommon'),
'type' =>
'linkedin',
'url' =>
'http://www.linkedin.com/bitcero/');
43 $modversion[
'social'][2] = array(
'title' =>
__(
'Red México Twitter',
'rmcommon'),
'type' =>
'twitter',
'url' =>
'http://www.twitter.com/redmexico/');
44 $modversion[
'social'][3] = array(
'title' =>
__(
'Red México Facebook',
'rmcommon'),
'type' =>
'facebook',
'url' =>
'http://www.facebook.com/redmexico/');
65 $modversion[
'templates'][1][
'file'] =
'rmc_comments_display.html';
67 $modversion[
'templates'][2][
'file'] =
'rmc_comments_form.html';
68 $modversion[
'templates'][2][
'description'] =
'Shows the comments form';
74 $files = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH.
'/modules/rmcommon/lang',
'');
79 if(substr(
$file, -3)!=
'.mo')
continue;
86 'title' =>
'_MI_RMC_LANG',
88 'formtype' =>
'select',
89 'valuetype' =>
'text',
95 $fct = isset($_GET[
'fct']) ? $_GET[
'fct'] :
'';
96 $mid = isset($_GET[
'mod']) ? $_GET[
'mod'] :
'';
98 $mh = xoops_gethandler(
'module');
102 $db = XoopsDatabaseFactory::getDatabaseConnection();
104 $sql =
"SELECT conf_id FROM ".$db->prefix(
"config").
" WHERE conf_modid=".
$mod->mid().
" AND conf_name='lang'";
108 $db->queryF(
"DELETE FROM ".
$db->prefix(
"configoption").
" WHERE conf_id=$id");
109 $sql =
"INSERT INTO ".$db->prefix(
"configoption").
" (`confop_name`,`confop_value`,`conf_id`) VALUES ";
111 $sql .=
"('$opt','$opt','$id'),";
119 $dirs = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH.
'/modules/rmcommon/themes',
'');
123 if(!file_exists(XOOPS_ROOT_PATH.
'/modules/rmcommon/themes/'.
$dir.
'/admin_gui.php'))
continue;
131 'title' =>
'_MI_RMC_ADMTHEME',
133 'formtype' =>
'select',
134 'valuetype' =>
'text',
135 'default' =>
'twop6',
140 $fct = isset($_GET[
'fct']) ? $_GET[
'fct'] :
'';
141 $mid = isset($_GET[
'mod']) ? $_GET[
'mod'] :
'';
143 $mh = xoops_gethandler(
'module');
144 $mod =
$mh->getByDirname(
'rmcommon');
147 $db = XoopsDatabaseFactory::getDatabaseConnection();
149 $sql =
"SELECT conf_id FROM ".$db->prefix(
"config").
" WHERE conf_modid=".
$mod->mid().
" AND conf_name='theme'";
153 $db->queryF(
"DELETE FROM ".
$db->prefix(
"configoption").
" WHERE conf_id=$id");
154 $sql =
"INSERT INTO ".$db->prefix(
"configoption").
" (`confop_name`,`confop_value`,`conf_id`) VALUES ";
156 $sql .=
"('$opt','$opt','$id'),";
164 'name' =>
'gui_disable',
165 'title' =>
'_MI_RMC_GUIENABLE',
167 'formtype' =>
'yesno',
168 'valuetype' =>
'int',
174 'name' =>
'editor_type',
175 'title' =>
'_MI_RMC_EDITOR',
177 'formtype' =>
'select',
178 'valuetype' =>
'text',
180 'options' => array(
'_MI_RMC_EDITOR_VISUAL'=>
'tiny',
'_MI_RMC_EDITOR_HTML'=>
'html',
'_MI_RMC_EDITOR_XOOPS'=>
'xoops',
'_MI_RMC_EDITOR_SIMPLE'=>
'simple')
186 'title' =>
'_MI_RMC_ADDJQUERY',
187 'description' =>
'_MI_RMC_ADDJQUERYD',
188 'formtype' =>
'yesno',
189 'valuetype' =>
'int',
195 'name' =>
'imagestore',
196 'title' =>
'_MI_RMC_IMAGESTORE',
198 'formtype' =>
'yesno',
199 'valuetype' =>
'int',
205 'name' =>
'catsnumber',
206 'title' =>
'_MI_RMC_IMGCATSNUMBER',
208 'formtype' =>
'textbox',
209 'valuetype' =>
'int',
214 'name' =>
'imgsnumber',
215 'title' =>
'_MI_RMC_IMGSNUMBER',
217 'formtype' =>
'textbox',
218 'valuetype' =>
'int',
225 'name' =>
'secretkey',
226 'title' =>
'_MI_RMC_SECREY',
227 'description' =>
'_MI_RMC_SECREYD',
228 'formtype' =>
'textbox',
229 'valuetype' =>
'text',
236 'title' =>
'_MI_RMC_DOHTML',
238 'formtype' =>
'yesno',
239 'valuetype' =>
'int',
243 $modversion[
'config'][] = array(
244 'name' =>
'dosmileys',
245 'title' =>
'_MI_RMC_DOSMILE',
247 'formtype' =>
'yesno',
248 'valuetype' =>
'int',
252 $modversion[
'config'][] = array(
254 'title' =>
'_MI_RMC_DOXCODE',
256 'formtype' =>
'yesno',
257 'valuetype' =>
'int',
261 $modversion[
'config'][] = array(
263 'title' =>
'_MI_RMC_DOIMAGE',
265 'formtype' =>
'yesno',
266 'valuetype' =>
'int',
270 $modversion[
'config'][] = array(
272 'title' =>
'_MI_RMC_DOBR',
274 'formtype' =>
'yesno',
275 'valuetype' =>
'int',
280 $modversion[
'config'][] = array(
281 'name' =>
'enable_comments',
282 'title' =>
'_MI_RMC_ENABLECOMS',
284 'formtype' =>
'yesno',
285 'valuetype' =>
'int',
289 $modversion[
'config'][] = array(
290 'name' =>
'anonymous_comments',
291 'title' =>
'_MI_RMC_ANONCOMS',
293 'formtype' =>
'yesno',
294 'valuetype' =>
'int',
298 $modversion[
'config'][] = array(
299 'name' =>
'approve_reg_coms',
300 'title' =>
'_MI_RMC_APPROVEREG',
302 'formtype' =>
'yesno',
303 'valuetype' =>
'int',
307 $modversion[
'config'][] = array(
308 'name' =>
'approve_anon_coms',
309 'title' =>
'_MI_RMC_APPROVEANON',
311 'formtype' =>
'yesno',
312 'valuetype' =>
'int',
316 $modversion[
'config'][] = array(
317 'name' =>
'allow_edit',
318 'title' =>
'_MI_RMC_ALLOWEDIT',
320 'formtype' =>
'yesno',
321 'valuetype' =>
'int',
325 $modversion[
'config'][] = array(
326 'name' =>
'edit_limit',
327 'title' =>
'_MI_RMC_EDITLIMIT',
329 'formtype' =>
'textbox',
330 'valuetype' =>
'int',
334 $modversion[
'config'][] = array(
335 'name' =>
'mods_number',
336 'title' =>
'_MI_RMC_MODSNUMBER',
338 'formtype' =>
'textbox',
339 'valuetype' =>
'int',
344 $modversion[
'config'][] = array(
345 'name' =>
'rssimage',
346 'title' =>
'_MI_RMC_RSSIMAGE',
348 'formtype' =>
'textbox',
349 'valuetype' =>
'text',
350 'default' => XOOPS_URL.
'/modules/rmcommon/images/rssimage.png'
354 $modversion[
'config'][] = array(
355 'name' =>
'transport',
356 'title' =>
'_MI_RMC_MAILERMETH',
357 'description' =>
'_MI_RMC_MAILERMETHD',
358 'formtype' =>
'select',
359 'valuetype' =>
'text',
360 'options' => array(
'_MI_RMC_PHPMAIL'=>
'mail',
'_MI_RMC_SMTP'=>
'smtp',
'_MI_RMC_SENDMAIL'=>
'sendmail'),
361 'default' => XOOPS_URL.
'/modules/rmcommon/images/rssimage.png'
364 $modversion[
'config'][] = array(
365 'name' =>
'smtp_server',
366 'title' =>
'_MI_RMC_SMTPSERVER',
367 'description' =>
'_MI_RMC_SMTPSERVERD',
368 'formtype' =>
'textbox',
369 'valuetype' =>
'text',
373 $modversion[
'config'][] = array(
374 'name' =>
'smtp_crypt',
375 'title' =>
'_MI_RMC_ENCRYPT',
376 'description' =>
'_MI_RMC_ENCRYPTD',
377 'formtype' =>
'select',
378 'valuetype' =>
'text',
379 'options' => array(
'_MI_RMC_CRYPTNONE'=>
'none',
'_MI_RMC_CRYPTSSL'=>
'ssl',
'_MI_RMC_CRYPTTLS'=>
'tls'),
383 $modversion[
'config'][] = array(
384 'name' =>
'smtp_port',
385 'title' =>
'_MI_RMC_SMTPPORT',
386 'description' =>
'_MI_RMC_SMTPPORTD',
387 'formtype' =>
'textbox',
388 'valuetype' =>
'text',
392 $modversion[
'config'][] = array(
393 'name' =>
'smtp_user',
394 'title' =>
'_MI_RMC_SMTPUSER',
396 'formtype' =>
'textbox',
397 'valuetype' =>
'text',
401 $modversion[
'config'][] = array(
402 'name' =>
'smtp_pass',
403 'title' =>
'_MI_RMC_SMTPPASS',
405 'formtype' =>
'password',
406 'valuetype' =>
'text',
410 $modversion[
'config'][] = array(
411 'name' =>
'sendmail_path',
412 'title' =>
'_MI_RMC_SENDMAILPATH',
414 'formtype' =>
'textbox',
415 'valuetype' =>
'text',
416 'default' =>
'/usr/sbin/sendmail -bs'
419 $modversion[
'config'][] = array(
420 'name' =>
'rss_enable',
421 'title' =>
'_MI_RMC_RSSENABLE',
423 'formtype' =>
'yesno',
424 'valuetype' =>
'int',
428 $modversion[
'config'][] = array(
429 'name' =>
'blocks_enable',
430 'title' =>
'_MI_RMC_BLOCKSENABLE',
432 'formtype' =>
'yesno',
433 'valuetype' =>
'int',
437 $modversion[
'config'][] = array(
439 'title' =>
'_MI_RMC_UPDATES',
440 'description' =>
'_MI_RMC_UPDATESD',
441 'formtype' =>
'yesno',
442 'valuetype' =>
'int',
446 $modversion[
'config'][] = array(
447 'name' =>
'updatesinterval',
448 'title' =>
'_MI_RMC_UPDATESINTERVAL',
450 'formtype' =>
'textbox',
451 'valuetype' =>
'int',
457 $modversion[
'blocks'][] = array(
458 'file' =>
"comments.php",
459 'name' =>
__(
'Comments',
'rmcommon'),
460 'description' =>
__(
'Show comments from internal comments system',
'rmcommon'),
461 'show_func' =>
"rmc_bkcomments_show",
462 'edit_func' =>
"rmc_bkcomments_edit",
463 'template' =>
'rmc_bk_comments.html',
464 'options' =>
"5|1|1|1|1"
467 $modversion[
'blocks'][] = array(
468 'file' =>
"custom.php",
469 'name' =>
__(
'Custom Block',
'rmcommon'),
470 'description' =>
__(
'Allows to create a block with custom content.',
'rmcommon'),
476 if(in_array(
"rmcommon",
$amod)){
480 if(!method_exists(
$p,
'blocks'))
continue;
481 foreach(
$p->blocks() as $block){
482 $block[
'plugin'] = 1;
483 $modversion[
'blocks'][] = $block;