Cleaned demo.ecf
Fixed modules admin handler permission checking from "admin.installation_access" to "administration.installation_access". Use constants for known form id. Invoke hook form alter for user view response. Include theme when installing roc cms library.
This commit is contained in:
@@ -42,6 +42,11 @@
|
||||
<library name="embedded_video_module" location="..\..\modules\embedded_video\embedded_video.ecf" readonly="false"/>
|
||||
<library name="masquerade_auth_module" location="..\..\dev_modules\masquerade_auth\masquerade_auth.ecf" readonly="false"/>
|
||||
<library name="persistence_sqlite3" location="..\..\library\persistence\sqlite3\sqlite3.ecf" readonly="false"/>
|
||||
<!--
|
||||
By default, commented, since it depends on specific environment settings.
|
||||
<library name="persistence_store_odbc" location="..\..\library\persistence\store_odbc\store_odbc.ecf"/>
|
||||
<library name="persistence_store_mysql" location="..\..\library\persistence\store_mysql\store_mysql.ecf" />
|
||||
-->
|
||||
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf.ecf"/>
|
||||
<library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension.ecf" readonly="false"/>
|
||||
</target>
|
||||
@@ -53,34 +58,28 @@
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_standalone" extends="common">
|
||||
<option debug="true">
|
||||
<debug name="dbglog" enabled="true"/>
|
||||
</option>
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
</capability>
|
||||
<variable name="httpd_ssl_disabled" value="true"/>
|
||||
<library name="standalone_launcher" location="..\..\launcher\standalone.ecf" readonly="false"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_standalone_none" extends="demo_standalone">
|
||||
<capability>
|
||||
<concurrency support="none" use="none"/>
|
||||
<concurrency use="none"/>
|
||||
</capability>
|
||||
</target>
|
||||
<target name="demo_standalone_mt" extends="demo_standalone">
|
||||
<capability>
|
||||
<concurrency support="thread" use="thread"/>
|
||||
<concurrency use="thread"/>
|
||||
</capability>
|
||||
</target>
|
||||
<target name="demo_standalone_scoop" extends="demo_standalone">
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
<concurrency use="scoop"/>
|
||||
</capability>
|
||||
</target>
|
||||
<target name="demo_standalone_scoop_ssl" extends="demo_standalone_scoop">
|
||||
<capability>
|
||||
<concurrency support="scoop" use="scoop"/>
|
||||
<concurrency use="scoop"/>
|
||||
</capability>
|
||||
<variable name="httpd_ssl_enabled" value="true"/>
|
||||
<variable name="libcurl_http_client_disabled" value="true"/>
|
||||
@@ -89,14 +88,14 @@
|
||||
</target>
|
||||
<target name="demo_cgi" extends="common">
|
||||
<capability>
|
||||
<concurrency support="none" use="none"/>
|
||||
<concurrency use="none"/>
|
||||
</capability>
|
||||
<library name="cgi_launcher" location="..\..\launcher\cgi.ecf" readonly="false"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_libfcgi" extends="common">
|
||||
<capability>
|
||||
<concurrency support="none" use="none"/>
|
||||
<concurrency use="none"/>
|
||||
</capability>
|
||||
<library name="libfcgi_launcher" location="..\..\launcher\libfcgi.ecf" readonly="false"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
|
||||
6
examples/demo/site/themes/admin/assets/js/jquery-1.10.2.min.js
vendored
Normal file
6
examples/demo/site/themes/admin/assets/js/jquery-1.10.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
$(document).ready(function() {
|
||||
$('#gcse_search_form').submit(function() {
|
||||
window.open('', 'formpopup', 'width=600,height=600,resizeable,scrollbars');
|
||||
this.target = 'formpopup';
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
110
examples/demo/site/themes/admin/assets/scss/style.scss
Normal file
110
examples/demo/site/themes/admin/assets/scss/style.scss
Normal file
@@ -0,0 +1,110 @@
|
||||
ul.horizontal {
|
||||
li {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
#header {
|
||||
#primary.menu {
|
||||
ul {
|
||||
li {
|
||||
color: #555;
|
||||
a {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
&:hover { color: black; }
|
||||
}
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
}
|
||||
&.horizontal {
|
||||
border-bottom: solid 1px #ddd;
|
||||
li {
|
||||
border-top: solid 3px #fff;
|
||||
&:hover {
|
||||
background-color: #ffe;
|
||||
border-top: solid 3px #999;
|
||||
}
|
||||
&.active {
|
||||
font-weight: bold;
|
||||
border-top: solid 3px #ddd;
|
||||
background-color: #ddd;
|
||||
}
|
||||
&.active:hover {
|
||||
border-top: solid 3px blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#content {
|
||||
margin-left: 20px;
|
||||
#highlighted {
|
||||
position: relative;
|
||||
border: solid 1px #ddd;
|
||||
background-color: #ffc;
|
||||
width: 70%;
|
||||
left: 15%;
|
||||
right: 15%;
|
||||
padding: 5px;
|
||||
font-style: italic;
|
||||
}
|
||||
.preview {
|
||||
border: solid 1px red;
|
||||
}
|
||||
}
|
||||
.sidebar {
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
/* border: solid 1px #ccc; */
|
||||
&#sidebar_first {
|
||||
width: 250px;
|
||||
position: fixed;
|
||||
top: 45px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-right: solid 1px #ddd;
|
||||
}
|
||||
&#sidebar_second {
|
||||
width: 250px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
&+.main {
|
||||
margin-left: 200px;
|
||||
}
|
||||
}
|
||||
#primary-tabs {
|
||||
ul.horizontal {
|
||||
list-style-type: none;
|
||||
li {
|
||||
display: inline;
|
||||
padding: 2px 5px;
|
||||
border: solid 1px #ccf;
|
||||
}
|
||||
li.active {
|
||||
border-color: #99f #99f #ddd;
|
||||
border-style: solid solid none;
|
||||
border-width: 2px 1px 0;
|
||||
padding: 2px 7px 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
#message li.error {
|
||||
background-color: #f99;
|
||||
border: solid 1px red;
|
||||
padding: 5px 2px 5px 2px;
|
||||
}
|
||||
|
||||
table.with_border {
|
||||
thead td {
|
||||
font-weight: bold;
|
||||
}
|
||||
td {
|
||||
border: solid 1px #ccc;
|
||||
padding: 2px 5px 2px 5px;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ feature -- Execution
|
||||
attached {WSF_TABLE} req.query_parameter ("module_uninstallation") as tb
|
||||
then
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
if attached api.setup.string_8_item ("admin.installation_access") as l_access then
|
||||
if attached api.setup.string_8_item ("administration.installation_access") as l_access then
|
||||
if l_access.is_case_insensitive_equal ("none") then
|
||||
l_denied := True
|
||||
elseif l_access.is_case_insensitive_equal ("permission") then
|
||||
|
||||
@@ -223,6 +223,9 @@ feature -- Handler / Constants
|
||||
|
||||
feature -- Handler
|
||||
|
||||
view_account_form_id: STRING = "roccms-user-view"
|
||||
edit_account_form_id: STRING = "roccms-user-edit"
|
||||
|
||||
handle_account (api: CMS_API; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
local
|
||||
r: CMS_RESPONSE
|
||||
@@ -235,7 +238,7 @@ feature -- Handler
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
create b.make_empty
|
||||
l_user := r.user
|
||||
create f.make (r.location, "roccms-user-view")
|
||||
create f.make (r.location, view_account_form_id)
|
||||
if attached smarty_template_block (Current, "account_info", api) as l_tpl_block then
|
||||
l_tpl_block.set_weight (-10)
|
||||
r.add_block (l_tpl_block, "content")
|
||||
@@ -301,7 +304,7 @@ feature -- Handler
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
|
||||
create b.make_empty
|
||||
l_user := r.user
|
||||
create l_form.make (r.location, "roccms-user-edit")
|
||||
create l_form.make (r.location, edit_account_form_id)
|
||||
if attached smarty_template_block (Current, "account_edit", api) as l_tpl_block then
|
||||
l_tpl_block.set_weight (-10)
|
||||
r.add_block (l_tpl_block, "content")
|
||||
|
||||
@@ -157,7 +157,7 @@ feature -- Hook
|
||||
do
|
||||
if
|
||||
attached a_form.id as fid and then
|
||||
fid.same_string ("roccms-user-view")
|
||||
fid.same_string ("roccms-user-view") -- Check {CMS_AUTHENTICATION_MODULE}.view_account_form_id
|
||||
then
|
||||
if
|
||||
attached a_response.user as u and then
|
||||
|
||||
@@ -56,6 +56,7 @@ feature -- Process
|
||||
or l_user.same_as (user) -- Same user
|
||||
then
|
||||
f := new_view_form (l_user, request.request_uri, "view-user")
|
||||
api.hooks.invoke_form_alter (f, Void, Current)
|
||||
f.append_to_html (wsf_theme, b)
|
||||
else
|
||||
b.append ("You don't have the permission to view this user!")
|
||||
@@ -68,6 +69,8 @@ feature -- Process
|
||||
|
||||
feature -- Process Edit
|
||||
|
||||
view_user_form_id: STRING = "view-user"
|
||||
|
||||
new_view_form (a_user: detachable CMS_USER; a_url: READABLE_STRING_8; a_name: STRING): CMS_FORM
|
||||
-- Create a web form named `a_name' for user `a_user' (if set), using form action url `a_url'.
|
||||
local
|
||||
|
||||
@@ -29,6 +29,13 @@ feature -- API Service
|
||||
|
||||
api: CMS_API
|
||||
|
||||
feature -- Response factory
|
||||
|
||||
new_generic_response (req: WSF_REQUEST; res: WSF_RESPONSE): CMS_RESPONSE
|
||||
do
|
||||
create {GENERIC_VIEW_CMS_RESPONSE} Result.make (req, res, api)
|
||||
end
|
||||
|
||||
feature -- Response message helpers
|
||||
|
||||
redirect_to (a_location: READABLE_STRING_8; res: WSF_RESPONSE)
|
||||
|
||||
@@ -57,6 +57,7 @@ echo Install ROC as CMS ewf
|
||||
%SAFE_RMDIR% %TMP_UNSTABLE_DIR%\library\web\cms\dev_modules
|
||||
%SAFE_RMDIR% %TMP_UNSTABLE_DIR%\library\web\cms\modules
|
||||
%SAFE_RMDIR% %TMP_UNSTABLE_DIR%\library\web\cms\examples
|
||||
%SAFE_RMDIR% %TMP_UNSTABLE_DIR%\library\web\cms\themes
|
||||
|
||||
%COPYCMD% %TMP_DIR%\launcher %TMP_UNSTABLE_DIR%\library\web\cms\launcher
|
||||
%COPYCMD% %TMP_DIR%\library %TMP_UNSTABLE_DIR%\library\web\cms\library
|
||||
@@ -65,6 +66,7 @@ echo Install ROC as CMS ewf
|
||||
%COPYCMD% %TMP_DIR%\modules %TMP_UNSTABLE_DIR%\library\web\cms\modules
|
||||
%COPYCMD% %TMP_DIR%\dev_modules %TMP_UNSTABLE_DIR%\library\web\cms\dev_modules
|
||||
%COPYCMD% %TMP_DIR%\examples %TMP_UNSTABLE_DIR%\library\web\cms\examples
|
||||
%COPYCMD% %TMP_DIR%\themes %TMP_UNSTABLE_DIR%\library\web\cms\themes
|
||||
echo TOOLS
|
||||
%COPYCMD% %TMP_DIR%\tools %TMP_UNSTABLE_DIR%\library\web\cms\tools
|
||||
%SAFE_RM% %TMP_UNSTABLE_DIR%\library\web\cms\tools\install.bat
|
||||
|
||||
@@ -248,6 +248,8 @@ feature -- Execution
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif l_config_path /= Void then
|
||||
localized_print_error ({STRING_32} "Unable to read configuration file %"" + l_config_path.name + "%"!%N")
|
||||
end
|
||||
|
||||
if l_cms_path = Void then
|
||||
@@ -282,7 +284,7 @@ feature -- Execution
|
||||
print (" in %"")
|
||||
print (l_dest_dir.path.name)
|
||||
print ("%":%N")
|
||||
install_module_elements (l_module_source_path, l_dest_dir.path, Void)
|
||||
install_module_elements (l_mod_name, l_module_source_path, l_dest_dir.path, Void)
|
||||
-- install_module_elements (l_module_source_path, l_dest_dir.path, Config_dir)
|
||||
-- install_module_elements (l_module_source_path, l_dest_dir.path, Scripts_dir)
|
||||
-- install_module_elements (l_module_source_path, l_dest_dir.path, Themes_dir)
|
||||
@@ -350,7 +352,52 @@ feature -- Execution
|
||||
end
|
||||
end
|
||||
|
||||
install_module_elements (a_module_source_path: ROC_INSTALL_COPY_PARAMETERS; a_cms_module_target_path: PATH; a_element: detachable READABLE_STRING_GENERAL)
|
||||
ecf_location (a_module_name: READABLE_STRING_GENERAL; a_module_source_path: ROC_INSTALL_COPY_PARAMETERS): detachable PATH
|
||||
-- ecf location if exists.
|
||||
-- Try to find based on `a_module_name`, or dir name from `a_module_source_path`, or .. search unique .ecf file (ignoring -safe.ecf).
|
||||
local
|
||||
l_name: READABLE_STRING_GENERAL
|
||||
p: PATH
|
||||
ut: FILE_UTILITIES
|
||||
do
|
||||
p := a_module_source_path.location
|
||||
Result := p.extended (a_module_name).appended_with_extension ("ecf")
|
||||
if ut.file_path_exists (Result) then
|
||||
-- Found.
|
||||
else
|
||||
Result := Void
|
||||
if attached p.entry as e then
|
||||
Result := p.extended (e.name).appended_with_extension ("ecf")
|
||||
if not ut.file_path_exists (Result) then
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
if Result = Void then
|
||||
if attached ut.file_names (p.name) as l_filenames then
|
||||
across
|
||||
l_filenames as ic
|
||||
until
|
||||
Result /= Void
|
||||
loop
|
||||
l_name := ic.item
|
||||
if l_name.ends_with (".ecf") then
|
||||
if l_name.ends_with ("-safe.ecf") then
|
||||
-- Ignore
|
||||
else
|
||||
Result := p.extended (l_name)
|
||||
if not ut.file_path_exists (Result) then
|
||||
check existing_file: False end
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
install_module_elements (a_module_name: READABLE_STRING_GENERAL; a_module_source_path: ROC_INSTALL_COPY_PARAMETERS; a_cms_module_target_path: PATH; a_element: detachable READABLE_STRING_GENERAL)
|
||||
-- Install module site files from `a_module_source_path' to cms application `a_cms_module_target_path' under expected modules folder.
|
||||
-- If `a_element' is set, take into account only sub folder `a_element'.
|
||||
local
|
||||
@@ -380,6 +427,12 @@ feature -- Execution
|
||||
else
|
||||
link_directory (l_src_dir, l_dest_dir, True)
|
||||
end
|
||||
-- Detect ecf file (in the future, update main ecf file).
|
||||
if attached ecf_location (a_module_name, a_module_source_path) as l_ecf_loc then
|
||||
-- Found ecf file.
|
||||
elseif not a_module_name.is_case_insensitive_equal ("core") then
|
||||
localized_print_error ({STRING_32} "Missing .ecf file for " + a_module_name + "!%N")
|
||||
end
|
||||
end
|
||||
|
||||
install_theme_elements (a_theme_source_path: ROC_INSTALL_COPY_PARAMETERS; a_cms_theme_target_path: PATH; a_element: detachable READABLE_STRING_GENERAL)
|
||||
|
||||
Reference in New Issue
Block a user