function wbMain()
{
    wbCore::init();
    list($module, $class, $method) = wbRequest::getController();
    // theme override
    $theme = wbRequest::getVarClean('theme');
    if (!empty($theme)) {
        wbPage::setTheme($theme);
    }
    $page = wbRequest::getVarClean('page');
    if (!empty($page)) {
        wbPage::setPage($page);
    }
    ob_start();
    $modView = wbModule::getView($module, $class, $method);
    if (ob_get_length() > 0) {
        $rawOutput = ob_get_contents();
        $modView = 'The following lines were printed in raw mode by module, however this
                      should not happen. The module is probably directly calling functions
                      like echo, print, or printf. Please modify the module to exclude direct output.
                      The module is violating Webi architecture principles.<br /><br />' . $rawOutput . '<br /><br />This is the real module output:<br /><br />' . $modView;
    }
    ob_end_clean();
    wbPage::render($modView);
}
    public static function main()
    {
        if (!wbUser::isLoggedIn()) {
            $redirecturl = wbModule::url('bds', 'bds', 'main');
            wbResponse::Redirect(wbModule::url('base', 'base', 'loginform', array('redirecturl' => urlencode($redirecturl))));
        }
        $loadjsmod = wbRequest::getVarClean('loadjsmod', 'str', '');
        wbPage::setPage('jspage');
        $userInfo = wbUser::getSession();
        $role = '';
        if (isset($userInfo['roles'][0]['role_name'])) {
            $role = strtolower($userInfo['roles'][0]['role_name']);
        }
        $script = <<<HEREDOC
    Webi.ROUTE_URL = "ws.php?type=json&module=bds";
    var _UNAME = "{$userInfo['user_name']}";
    var _RNAME = "{$userInfo['user_realname']}";
    var _GNAME = "{$role}";
HEREDOC;
        wbPage::addScriptCode($script);
        wbPage::addScript('modules/bds/views/script/properties.js');
        wbPage::addScript('modules/bds/views/script/GridPanel.js');
        wbPage::addScript('modules/bds/views/script/FormPanel.js');
        wbPage::addScript('modules/bds/views/script/ModulePanel.js');
        wbPage::addScript('modules/base/views/script/roles-jsloader.php');
        wbPage::addScript('modules/bds/views/script/jsloader.php');
        return array('loadjsmod' => $loadjsmod);
    }
Exemple #3
0
 public static function menuNodes()
 {
     wbPage::setPage('blank');
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     /*try{
                 $ws_client = self::getNusoap();
             
     		    $params = array('search' => '',
     					'getParams' => json_encode($_GET),
     					'controller' => json_encode(array('module' => 'bds','class' => 'p_app_menu', 'method' => 'menunodes', 'type' => 'json' )),
     					'postParams' => json_encode($_POST),
     					'jsonItems' => '',
     					'start' => $start,
     					'limit' => $limit);
     					
                 $ws_data = self::getResultData($ws_client, $params);
     
                 $data['menu'] = $ws_data ['data'];
                 $data['total'] = $ws_data ['total'];
                 $data['message'] = $ws_data ['message'];
                 $data['success'] = $ws_data ['success'];
             }catch (Exception $e) {
                 $data['message'] = $e->getMessage();
             }
             return $data;*/
     return array();
 }
 public static function lupa_password()
 {
     wbPage::setPage('default');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'helper', 'method' => 'read_pertanyaan', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $listPertanyaan = $data['items'];
     $email = wbRequest::getVarClean('email', 'str', '');
     $npwpd = wbRequest::getVarClean('npwpd', 'str', '');
     $user_name = wbRequest::getVarClean('user_name', 'str', '');
     $question = wbRequest::getVarClean('question', 'str', '');
     $answer = wbRequest::getVarClean('answer', 'str', '');
     $errorMsg = wbRequest::getVarClean('errorMsg', 'str', '');
     return array('pertanyaan' => $listPertanyaan, 'email' => $email, 'npwpd' => $npwpd, 'user_name' => $user_name, 'question' => $question, 'answer' => $answer, 'errorMsg' => $errorMsg);
 }
Exemple #5
0
 public function transaction_info()
 {
     wbPage::setPage('blank');
     return array();
 }