Exemple #1
0
 public function dispatch($action)
 {
     mtrace('mcontroller::dispatch = ' . $action);
     if (!method_exists($this, $action)) {
         mtrace('action does not exists = ' . $action);
         try {
             $this->render($action);
         } catch (Exception $e) {
             throw new ERunTimeException(_M("App: [{$this->application}], Module: [{$this->module}], Controller: [{$this->name}] : action [{$action}] not found!"));
         }
     } else {
         try {
             $this->action = $action;
             if (MPage::isPostBack()) {
                 $actionPost = $action . 'Post';
                 if (method_exists($this, $actionPost)) {
                     $action = $actionPost;
                 }
             }
             mtrace('executing = ' . $action);
             $this->{$action}();
         } catch (Exception $e) {
             mdump($e->getMessage());
             if (\Manager::PROD()) {
                 $this->renderPrompt('error', $e->getMessage());
             } else {
                 $this->renderPrompt('error', "[<b>" . $this->name . '/' . $action . "</b>]" . $e->getMessage());
             }
         }
     }
 }
Exemple #2
0
    $query = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='{$pageId}' ORDER BY pagePosition DESC;");
    $data = mysqli_fetch_array($query);
    $pagePosition = $data["pagePosition"];
    $pageMenu = new Page();
    $pageMenu->pageParent = $pageId;
    $pageMenu->pageType = $pageType;
    $pageMenu->pageShow = "1";
    $pageMenu->pageTemp = "text_master";
    $pageMenu->pageTitle = $pageTitle;
    $pageMenu->pagePosition = intval($pagePosition) + 1;
    $pageMenu->NewPage();
    $pageParent = new Page();
    $pageParent->GetInfo($pageId);
    $query = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages ORDER BY pageId DESC;");
    $data = mysqli_fetch_array($query);
    $parentPageId = $data["pageId"];
    $pageContent = $database->handler->real_escape_string($_POST["newPageContent"]);
    $pageTextMaster = new MPage();
    $pageTextMaster->NewPage($parentPageId, $pageContent);
    if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) {
        require_once ABS_PATH . '/modules/simpleRoutes/src/class/class-route.php';
        $route = new Route();
        if ($pageMenu->pageParent == 0) {
            $route->SaveNewRoute("/" . webUriTitle($pageTitle), "p=" . $parentPageId, "");
        } else {
            $route->SaveNewRoute("/" . webUriTitle($pageParent->pageTitle) . "/" . webUriTitle($pageTitle), "p=" . $parentPageId, "");
        }
    }
    Admin::Refresh("?page=viewPages", "0");
}
require_once dirname(__FILE__) . '/tinymce/tiny_mce.php';
                        ?>
" class="buttonMin"/></td>
                                    </tr>
                                    <tr>
                                        <td colspan="4"><div class="slider" id="slider<?php 
                        echo $device[2];
                        ?>
" name="<?php 
                        echo $device[2];
                        ?>
"></div></td>
                                    </tr>
                                </table>
                            </div>
                            <?php 
                        break;
                }
                ?>
                </li>
                <?php 
            }
        }
    }
    echo '</ul>';
    echo "\t" . '</div></div>' . "\n";
}
MPage::EndBlock("body");
MPage::Render("MDash.php");
?>
 
<?php 
MPage::BeginBlock();
?>
Greeting Form Demo<?php 
MPage::EndBlock("title");
?>

<?php 
MPage::BeginBlock();
?>

<form action="result.php" method="post">
Name: <input type="text" name="name" value="" /> 
<input type="submit" value="Execute" />
</form>

<?php 
MPage::EndBlock("body");
?>

<?php 
MPage::BeginBlock();
?>
&copy; 2010 Nicolas Rodriguez 
<?php 
MPage::EndBlock("copyright");
?>

<?php 
MPage::Render("master.php");
        <?php 
if (MPage::IsDefined("stylesheet")) {
    echo MPage::PlaceHolder("stylesheet");
}
if (MPage::IsDefined("scripts")) {
    echo MPage::PlaceHolder("scripts");
}
?>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
        <div id="wrapper">
            <?php 
include "inc/header.php";
?>
            <?php 
include "inc/topmenu.php";
?>
            <div id="dash">
                <?php 
if (MPage::IsDefined("body")) {
    echo MPage::PlaceHolder("body");
}
?>
            </div>
            <?php 
include "inc/footer.php";
?>
        </div>
    </body>
</html>
    }
    ?>
                        </select>
                    </td>
                </tr>                
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <input type="hidden" name="Node" value="<?php 
    echo $device[2];
    ?>
"/>                        
                        <input type="hidden" name="Operation" value="Update"/>                        
                        <input type="submit" class="button" name="btn" value="Update"/>
                    </td>
                </tr>
            </table>

        </form>            
    </div>
</div>
    <?php 
    $count++;
}
?>

<?php 
MPage::EndBlock("body");
MPage::Render("MDefault.php");
?>
 
Exemple #7
0
<?php

/*
 *	@author: Tomáš Mičulka
 *	@version: 2.0
 *	@last_update: 7.1.2014 
 */
defined('IN_INNE') or die("Acces denied!");
require_once dirname(__FILE__) . '/../class/class-m-page.php';
$database = Mysql::getConnection();
$pageId = $_GET["pageId"];
$mPage = new MPage();
$mPage->DeletePage($pageId);
if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) {
    require_once ABS_PATH . '/modules/simpleRoutes/src/class/class-route.php';
    $route = new Route();
    $route->DeleteRouteGet("p=" . $pageId);
}
Exemple #8
0
<?php

/*
 *	@author: Tomáš Mičulka
 *	@version: 2.0
 *	@last_update: 7.1.2014 
 */
defined('IN_INNE') or die("Acces denied!");
require_once dirname(__FILE__) . '/src/class/class-m-page.php';
$database = Mysql::getConnection();
$page = new Page();
if (isset(System::$getData['p'])) {
    $pageId = System::$getData['p'];
} else {
    $pageId = WEBSITE_DEFAULT_PAGE;
}
$page->GetInfo($pageId);
if ($page->pageType == "text_master") {
    $mPage = new MPage();
    $mPage->GetInfo($pageId);
    $template = Template::getInstance();
    $template->template->assign("text_masterData", $mPage->pageContent);
}
                <th>Password</th>
                <td><input type="password" name="txtPassword" id="txtPassword" value="<?php 
if (isset($_COOKIE["Password"])) {
    echo $_COOKIE["Password"];
}
?>
"/></td>
            </tr>
            <tr>
                <td colspan="2"><input type="checkbox" name="chkRemember" id="chkRemember" value="true" checked/>Remember me?</br>
                    <input type="checkbox" name="chkKeepSignedIn" id="chkKeepSignedIn" value="true"/>Keep me signed in?</td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" class="button" value="Login"/></td>
            </tr>
            <tr>
                <td colspan="2"><?php 
if (isset($valid) && !$valid) {
    echo "Invalid login details!";
}
?>
</td>
            </tr>
        </table>
    </form>
</div>

<?php 
MPage::EndBlock("body");
MPage::Render("MLogin.php");
<body>

This is some ASP-like master page. You just have to define where you wanna put the pieces of your site and the MPage class does the rest.

<div id="menu">
<?php 
echo MPage::PlaceHolder("menuitems");
?>
</div>

<?php 
echo MPage::PlaceHolder("body");
?>

<hr />

<?php 
echo MPage::PlaceHolder("copyright");
?>

<hr />

<!-- Here goes the partial render of div.php -->
<?php 
MPage::Render("div.php");
?>

</body>
</html>