m_hierarchy (zotonic_core v1.0.0-rc.11)
Link to this section Summary
Functions
Go through the flattened tree and assign the range nrs
Return a list of all the ids below the id, excluding the id itself
Return the list of ids contained within (and including) the id.
Ensure that all resources are present in a hierarchy.
Ensure that all resources of a certain category are present in a hierarchy.
Fetch the value for the key from a model source
Transform a hierarchy to a menu structure
Return a list of all this id's ancestor nodes
Save a new hierarchy, replacing a previous one.
Fetch a 1 level deep tree
Fetch a named tree
Make a flattened list with indentations showing the level of the tree entries. Useful for select lists.
Link to this section Functions
Link to this function
append(Name0, Missing, Context)
Link to this function
assign_nrs(Diff, OldFlatNr)
Link to this function
children(Name, Id, Context)
Link to this function
contains(Name, Id, Context)
Link to this function
ensure(Category, Context)
-spec ensure(atom() | binary() | string() | integer(), #context{}) -> {ok, integer()} | {error, term()}.
Link to this function
ensure(Name, CatId, Context)
-spec ensure(atom() | binary() | string(), atom() | integer() | string(), #context{}) -> {ok, integer()}.
Link to this function
flush(Name, Context)
Link to this function
m_get(Rest, Msg, Context)
-spec m_get(list(), zotonic_model:opt_msg(), z:context()) -> zotonic_model:return().
Link to this function
parents(Name, Id, Context)
Link to this function
save(Name, Tree, Context)
Link to this function
save_nocheck(Name, NewTree, Context)
Link to this function
tree1(Tree, Context)
Link to this function
tree(Id, Context)
Link to this function
tree_flat(Name, Context)
Link to this function