'ModuleBuilder.main("Home")',/* 'Assistant'=>'Assistant.mbAssistant.xy=Array("650, 40"); Assistant.mbAssistant.show();'*/);
function addSection($name, $title, $content, $action='activate'){
$crumb = '';
if($name == 'center'){
$crumb = $this->getBreadCrumb();
}
$this->sections[$name] = array('title'=>$title,'crumb'=>$crumb, 'content'=>$content, 'action'=>$action);
}
function getJavascript(){
if(!empty($this->sections['center'])){
if(empty($this->sections['east']))$this->addSection('east', '', '', 'deactivate');
if(empty($this->sections['east2']))$this->addSection('east2', '', '', 'deactivate');
}
$json = getJSONobj();
return $json->encode($this->sections);
}
function addCrumb($name, $action){
$this->crumbs[$name] = $action;
}
function getBreadCrumb(){
$crumbs = '';
$actions = array();
$count = 0;
foreach($this->crumbs as $name=>$action){
if($name == 'Home'){
$crumbs .= "". getStudioIcon('home', 'home', 16, 16) . '';
}else if($name=='Assistant'){
$crumbs .= "". getStudioIcon('assistant', 'assistant', 16, 16) . '';
}else{
if($count > 0){
$crumbs .= ' > ';
}else{
$crumbs .= ' | ';
}
if(empty($action)){
$crumbs .="$name";
$actions[] = "";
}else {
$crumbs .="$name";
$actions[] = $action;
}
$count++;
}
}
if($count > 1 && $actions[$count-2] != ""){
$crumbs = "". getStudioIcon('back', 'back', 16, 16) . ' '. $crumbs;
}
return $crumbs . '
';
}
function echoErrorStatus($labelName=''){
$sections = array('failure'=>true,'failMsg'=>$labelName);
$json = getJSONobj();
echo $json->encode($sections);
}
}
?>