Files
ROC/library/model/src/link/cms_link_composite.e
Jocelyn Fiat 8d59d25ace Added weight into to the CMS_LINK and provide a `sort' feature for CMS_MENU and related.
Protected cms service from registering many time the same module type.
Moved library/persistence/implementation/* under library/persistence/.
Moved site/www/themes to site/themes
For SQLite storage driver, auto create sqlite db file using associated sql script (to be completed).
Added code in demo module to reuse storage for module purpose.
Always call sql_post_execution in sql_query and sql_change, and not anymore by the callers.
Removed is_web and is_html from {CMS_SETUP}, it was not used.
Reused SHARED_*_ENCODER in CMS_ENCODERS
Added CMS_API.logger rather than using directly the SHARED_LOGGER.log ...
Centralize the implementation of current_user in CMS_REQUEST_UTIL
Removed the inheritance on WSF_FILTER for node handlers, since it is useless and unused.
Added CMS_NODE_API and CMS_USER_API
Prefix html id for block generated html items with "block-", to avoid css name conflict on "main", "content" or similar.
Code cleaning
2015-02-16 13:01:06 +01:00

74 lines
1.4 KiB
Plaintext

note
description: "[
Abstraction to represent a links container in the CMS system.
]"
date: "$Date: 2015-02-09 22:29:56 +0100 (lun., 09 févr. 2015) $"
revision: "$Revision: 96596 $"
deferred class
CMS_LINK_COMPOSITE
inherit
ITERABLE [CMS_LINK]
feature -- Access
items: detachable LIST [CMS_LINK]
-- Children links.
deferred
end
feature -- Element change
extend (lnk: CMS_LINK)
-- Add `lnk' as a sub link.
deferred
end
remove (lnk: CMS_LINK)
-- Remove link `lnk' from Current container.
deferred
end
sort
-- Sort `items' and also recursively in sub items.
local
l_sorter: QUICK_SORTER [CMS_LINK]
do
create l_sorter.make (create {COMPARABLE_COMPARATOR [CMS_LINK]})
if attached items as lst then
l_sorter.sort (lst)
across
lst as ic
loop
if
attached {CMS_LINK_COMPOSITE} ic.item as l_composite and then
not l_composite.is_empty
then
l_composite.sort
end
end
end
end
feature -- status report
is_empty: BOOLEAN
-- Is container empty?
do
Result := not attached items as l_items or else l_items.is_empty
end
count: INTEGER
-- Number of immediate sub links.
do
if attached items as l_items then
Result := l_items.count
end
end
note
copyright: "2011-2015, Javier Velilla, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end