Roxen.git
/
server
/
config_interface
/
sites
/
add_module.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/config_interface/sites/add_module.pike:270:
if( id->variables->reload_module_list ) roxen->clear_all_modules_cache(); array(ModuleInfo) mods; roxenloader.push_compile_error_handler( ec ); mods = roxen->all_modules(); roxenloader.pop_compile_error_handler(); foreach( mods, ModuleInfo m ) { if (m->deprecated && !show_deprecated(id)) {
-
TRACE("::: DEPRECATED ModuleInfo: %O\n", m);
+
mods -= ({ m }); } if( module_nomore( m->sname, m, conf ) ) { mods -= ({ m }); } } string res = ""; string doubles="", already=""; array w = map(mods, module_class, id);
Roxen.git/server/config_interface/sites/add_module.pike:330:
continue; if( (r = class_visible( c, classes[c]->doc, sizeof(classes[c]->modules), id, fast)) && r[0] && (!search_modules || sizeof(classes[c]->modules & indices(search_modules)))) { res += r[1]; array m = classes[c]->modules; array q = m->get_name(); sort( q, m );
+
int hits = 0;
foreach(m, object q) { if( q->get_description() == "Undocumented" && q->type == 0 ) continue; if (search_modules && !search_modules[q]) continue; object b = module_nomore(q->sname, q, conf); if( !b && q->locked && (!license_key || !q->unlocked(license_key, conf)) ) { locked_modules += ({ q }); continue; }
-
+
hits += 1;
res += describe_module( q, b ); }
-
+
+
if (!hits) {
+
res +=
+
"<div class='module no-modules'>"
+
"<span class='notify info inline'>No available modules</span>"
+
"</div>";
+
}
} else { if (!search_modules) res += r[1]; } } master()->set_inhibit_compile_errors( 0 ); return ({ res, pafeaw( ec->get(), ec->get_warnings(), locked_modules) }); } string module_image( int type )
Roxen.git/server/config_interface/sites/add_module.pike:500:
x ? " open" : " closed", Roxen.html_encode_string(c), content); return ({ x, header }); } string page_normal_low(RequestID id, int|void fast) {
+
TRACE("page_normal_low: %O : faster(%O)\n", id, fast);
string desc, err; [desc,err] = get_module_list(describe_module_normal(fast), class_visible_normal, id, fast); string ret = "<div class='add-modules-wrapper'>"; if (fast) {
-
ret
+
= "<input type='hidden' name='config' value='&form.config;'>";
+
ret =
+
"<
form method='post' action='add_module.pike'>"
+
"<
input type='hidden' name='config' value='&form.config;'>"
+
"<roxen-wizard-id-variable/>" +
+
ret
;
}
-
return ret + desc + "</div>" + err;
+
return ret + desc + "</div>" +
(fast ? "</form>" : "") +
err;
} string page_normal_search(RequestID id, void|bool fast) { return "<use file='/template-insert' />\n" "<tmpl>" + page_normal_low(id, fast) + "</tmpl>"; } string page_normal( RequestID id, void|bool fast ) { string content =
-
"<
div
id='mod_results' style='display: none'>"
-
"</
div
>"
+
"<
form
id='mod_results'
method='post' action='add_module.pike'
style='display: none'>"
+
"</
form
>"
"<div id='mod_default'>" + page_normal_low(id, fast) + "</div>"; return page_base( id, content, 1, 1); } string page_fast( RequestID id ) { return page_normal(id); }
-
string describe_module_faster( object module, object block)
-
{
-
if(!block)
-
{
-
return sprintf(
-
#"
-
<tr><td colspan='2'><table width='100%%'>
-
<td>#FASTER#<font size='+2'>%s</font></td>
-
<td align='right'><span class='dimtext'>(%s)</span> %s</td></table>
-
</td></tr>
-
<tr><td valign='top'><select multiple='multiple' size='1'
-
name='module_to_add'>
-
<option value='%s'>%s</option></select>
-
</td><td valign='top'>%s<p class='dimtext'>%s</p></td>
-
</tr>
-
",
-
//Roxen.html_encode_string(strip_leading(module->get_name())),
-
Roxen.html_encode_string(module->get_name()),
-
Roxen.html_encode_string (module->sname),
-
module_image(module->type),
-
module->sname,
-
//Roxen.html_encode_string(strip_leading(module->get_name())),
-
Roxen.html_encode_string(module->get_name()),
-
module->get_description() || LOCALE(1023, "Undocumented"),
-
LOCALE(266, "Will be loaded from: ")+module->filename
-
);
-
} else {
-
if( block == module )
-
return "";
-
return "";
-
}
-
}
-
-
array(int|string) class_visible_faster( string c, string d, int size,
-
RequestID id )
-
{
-
int x;
-
string method = get_method(id);
-
string header = ("<tr><td colspan='2'><table width='100%' cellspacing='0' "
-
"border='0' cellpadding='3' bgcolor='&usr.content-titlebg;'>"
-
"<tr><td nowrap='nowrap' valign='top'>");
-
-
if (id->variables->mod_query) {
-
header+=("<gbutton hspace='5' vspace='5' dim='1'> "+LOCALE(267, "View")+
-
" </gbutton><br>"
-
"<submit-gbutton hspace='5' vspace='2'> "+LOCALE(200, "Add Modules")+
-
" </submit-gbutton>");
-
x = 1;
-
} else if( id->variables->unfolded == c ) {
-
header+=("<a name='"+Roxen.html_encode_string(c)+
-
"'></a><gbutton hspace='5' vspace='5' dim='1'> "+LOCALE(267, "View")+
-
" </gbutton><br>"
-
"<submit-gbutton hspace='5' vspace='2'> "+LOCALE(200, "Add Modules")+
-
" </submit-gbutton>");
-
x=1;
-
}
-
else
-
header+=("<a name='"+Roxen.html_encode_string(c)+
-
"'></a><gbutton hspace='5' vspace='5' "
-
"href='add_module.pike?config=&form.config;"
-
"&method=" + method +
-
"&unfolded="+Roxen.http_encode_url(c)+
-
"&&usr.set-wiz-id;#"+Roxen.http_encode_url(c)+"' > "+
-
LOCALE(267, "View")+" </gbutton>");
-
-
header+=("</td><td width='100%'>"
-
"<font color='&usr.content-titlefg;' size='+2'>"+c+"</font>"
-
"<br />"+d+"</td></tr></table></td></tr>\n");
-
-
return ({ x, header });
-
}
-
-
string page_faster_low(RequestID id)
-
{
-
string desc, err;
-
[desc,err] = get_module_list( describe_module_faster,
-
class_visible_faster, id );
-
return
-
"<form method='post' action='add_module.pike'>"
-
"<input type='hidden' name='config' value='&form.config;'>"
-
"<roxen-wizard-id-variable />"
-
"<table cellspacing='3' cellpadding='0' border='0' width='100%'>" +
-
desc +
-
"</table>"
-
"</form>" +
-
err;
-
}
-
+
string page_faster_search(RequestID id) {
-
+
TRACE("Faster search: %O\n", id);
return "<use file='/template-insert' />\n" "<tmpl>" +
-
page_
faster
_low(id) +
+
page_
normal
_low(id
, true
) +
"</tmpl>"; } string page_faster( RequestID id ) { string content =
-
"<
div
id='mod_results' style='display: none'>"
-
"</
div
>"
+
"<
form
id='mod_results'
method='post' action='add_module.pike'
style='display: none'>"
+
"</
form
>"
"<div id='mod_default'>" + page_normal_low(id, true) + "</div>"; return page_base( id, content, 0, 1); } int first; array(int|string) class_visible_compact( string c, string d, int size, RequestID id )
Roxen.git/server/config_interface/sites/add_module.pike:789:
foreach( modules, string mod ) { ModuleInfo mi = roxen.find_module( (mod/"!")[0] ); RoxenModule moo = conf->find_module( replace(mod,"!","#") ); foreach( indices(moo->query()), string v ) { if( moo->getvar( v )->get_flags() & VAR_INITIAL ) { num++;
-
res += "<tr><td colspan='3'><
h2
>"
+
res += "<tr><td colspan='3'><
h3
>"
+LOCALE(1,"Initial variables for ")+ //Roxen.html_encode_string(strip_leading(mi->get_name())) Roxen.html_encode_string(mi->get_name())
-
+"</
h2
></td></tr>"
+
+"</
h3
></td></tr>"
"<emit source='module-variables' " " configuration=\""+conf->name+"\"" " module=\""+mod+#"\"/> <emit noset='1' source='module-variables' " " configuration=\""+conf->name+"\"" " module=\""+mod+#"\"> <tr> <td width='150' valign='top' colspan='2'><b>&_.name;</b></td> <td valign='top'><eval>&_.form:none;</eval></td></tr> <tr>
Roxen.git/server/config_interface/sites/add_module.pike:904:
mixed parse( RequestID id ) { if( !config_perm( "Add Module" ) ) return LOCALE(226, "Permission denied"); if (!id->variables->config) { return Roxen.http_redirect("/sites/", id); }
-
if( id->variables->module_to_add )
+
if( id->variables->module_to_add
&& !id->variables->reload
)
{
return do_it( id );
-
+
}
Configuration conf; foreach(id->variables->config/"\0", string config) { if (conf = roxen.find_configuration(config)) { id->variables->config = config; break; } } if( !config_perm( "Site:"+conf->name ) )