7 #include <boost/filesystem/operations.hpp>
10 #include <Wt/WStackedWidget>
32 : WContainerWidget(parent), m_pMenu(0), m_bDebug(false)
34 if ( WString::tr(
"byObjectStyleSheet").narrow() ==
"true" )
35 wApp->useStyleSheet(wApp->theme()->resourcesUrl() +
"wittyshare/Css/WsBreadcrumb.css");
36 addStyleClass(
"WsBreadcrumb");
44 WContainerWidget::load();
56 std::string newPath = newPathOrig;
57 boost::algorithm::replace_all(newPath,
"&",
"&");
63 bc.
title = startNode.get()->getDisplayName(
true);
66 std::string sWithoutPrefix = newPath;
67 std::string sPath =
"/";
68 boost::filesystem::path myPath(sWithoutPrefix);
69 if ( myPath.string() != sPath )
70 while ( myPath.has_parent_path() ) {
72 NodePtr curNode = startNode.get()->eatPath(myPath.string());
73 if ( curNode ) bc2.
title = curNode.get()->getDisplayName(
true);
74 else bc2.
title = myPath.filename().string();
75 bc2.
path = myPath.string();
78 myPath = myPath.parent_path();
79 if ( myPath.string() == sPath )
break;
81 Wt::WStackedWidget* contents =
new Wt::WStackedWidget();
82 m_pMenu =
new Wt::WMenu(contents, Wt::Horizontal);
98 asString(
option(
"directorySelectable")) ==
"false"
std::vector< breadCrump > m_vBreadCrumb
WsBreadCrumb(Wt::WContainerWidget *parent=0)
boost::shared_ptr< WsAbstractNode > NodePtr
void setDebugging(bool bDebug)
void doPathChanged(std::string newPath)
Interface that provides differents methods for accessing the FsTree as well as other features...
const boost::any & option(const std::string &attribute) const
Get an options value.
#define WsApp
Define a shortcut to the application instance.
NodePtr getAccessRoot()
return the root node of the access tree starting from the root
void onBreadCrumbSelected(Wt::WMenuItem *pMenuItem)