if ($GroupNo == 3) { $user = new Admin(); } if ($GroupNo == 2) { $user = new Warden(); } if (!$user->isLoggedIn()) { Redirect::to('login.php'); } if (@$_POST['block_id']) { $validate = new Validate(); $validation = $validate->check($_POST, array('block_id' => array('required' => true, 'unique' => 'block'), 'num_of_rooms' => array('required' => true, 'min' => 1), 'gender_code' => array('required' => true))); if ($validation->passed()) { $block = new Block(); try { $block->add_block(array('block_id' => Input::get('block_id'), 'block_cap' => Input::get('num_of_rooms'), 'block_gen' => Input::get('gender_code'))); echo 'Block ' . Input::get('block_id') . ' added'; } catch (Exception $e) { die($e->getMessage()); } } else { echo 'Validation failed'; foreach ($validation->errors() as $error) { $displayerror .= $error . '<br>'; } Session::flash('error', $displayerror); } } if (@$_POST['room_id']) { $validate = new Validate(); $validation = $validate->check($_POST, array('room_id' => array('required' => true), 'block_id' => array('required' => true), 'room_cap' => array('required' => true, 'min' => 1), 'room_price' => array('required' => true, 'numbered' => true)));
public function save_block_children() { $this->BuilderEngine->set_page_path($_REQUEST['page_path']); $name = $_REQUEST['name']; //$page_path = mysql_real_escape_string($_REQUEST['page']); $children = json_decode($_REQUEST['children']); //$version_id = $this->versions->get_pending_page_version_id($page_path); $block = new Block($name); $block->load(); $block->remove_children(); foreach ($children as $child_name) { $child = new Block($child_name); $block->add_block($child); } $block->save(); //$this->db->query("UNLOCK TABLES"); }
<?php $block4->html('{content}'); ?> <?php $block4->set_content('<hr /> <p class="copy"> <!-- Copyright Bar --> Copyright © <a href="/index.php">Your Site</a> | Powered by <a href="http://www.builderengine.com">BuilderEngine</a> | <a href="/admin">Edit this website</a> </p> '); ?> <?php $footer->add_block($block1); ?> <?php $footer->add_block($block2); ?> <?php $footer->add_block($block3); ?> <?php $footer->add_block($block4); ?> <?php $footer->show(); ?> </div>
<?php $block1->set_resizable(false); ?> <?php $block1->add_css_class('resume'); ?> <?php $block1->set_content(' <h2>John Murphy <span class="rsmall"><span class="color">@</span> Web Guru</span></h2> <p>Duis a risus sed dolor placerat semper quis in urna. Nam risus magna, fringilla sit amet blandit viverra, dignissim eget est. Ut commodo ullamcorper risus nec mattis. Donec aliquet convallis tortor, et placerat quam posuere posuere. Morbi tincidunt posuere turpis eu laoreet. Nulla facilisi. Aenean at massa leo. Vestibulum in varius arcu.</p> <hr /> <!-- Resume --> '); ?> <?php $holder->add_block($block1); ?> <!-- 2nd Line of Blocks --> <?php $block2 = new Block('business-commodore-1-theme-resume-content'); ?> <?php $block2->set_type('resume'); ?> <?php $block2->set_resizable(false); ?> <?php $block2->add_css_class('resume');
$line3->set_content(' <div class="span9"> <!-- First line --> <p class="cbig">BuilderEngine - The HTML5 Website Builder & CMS Platform</p> <!-- Second line --> <p class="csmall">Design professional looking websites with our complete GUI controlled Design Builder that will revolutionize theme creation & updating with HTML5 / CSS3.</p> </div> <div class="span2"> <!-- Button --> <div class="button"><a href="http://www.builderengine.com">Free Account</a></div> </div> '); ?> <?php $holder->add_block($line1); ?> <?php $holder->add_block($line2); ?> <?php $holder->add_block($line3); ?> <?php $holder->show(); ?> </div> </div> </div>
'); ?> <?php $line3->add_block($block2); ?> <!-- 4th Line of Blocks --> <?php $line4 = new Block("rpost-test"); ?> <?php $line4->set_type('pro_rpost'); ?> <?php $line4->set_size('span12'); $content_holder->add_block($line1); $content_holder->add_block($line2); $content_holder->add_block($line3); $content_holder->add_block($line4); $content_holder->show(); ?> </div> </div> </div> </div> <!-- Content ends --> <?php echo get_footer();
function add_block($parent, $type) { $page_path = $_POST['page_path']; PC::page_paths($page_path); $this->BuilderEngine->set_page_path($page_path); //$this->blocks->set_page_path($this->blocks->get_page_path_of($parent)); $max_id = $this->blocks->get_max_block_id(); $new_id = $max_id + 1; $new_block_name = "custom-block-" . $new_id; $block = new Block($parent); $block->load(); $new_block = new Block($new_block_name); $new_block->set_type($type); $block->add_block($new_block); $block->save(); $new_block->set_content("Your new block."); $new_block->show(); }
<?php $line5->set_content(' <div class="span9"> <!-- First line --> <p class="cbig">BuilderEngine - The HTML5 Website Builder & CMS Platform</p> <!-- Second line --> <p class="csmall">Design professional looking websites with our complete GUI controlled Design Builder that will revolutionize theme creation & updating with HTML5 / CSS3.</p> </div> <div class="span2"> <!-- Button --> <div class="button"><a href="http://www.builderengine.com">Free Account</a></div> </div> '); ?> <?php $holder->add_block($line1); ?> <?php $holder->add_block($line2); ?> <?php $holder->add_block($line4); ?> <?php $holder->add_block($line5); ?> <?php $holder->show(); ?> </div>
?> <?php $block1->save(); ?> <?php $block2 = new Block('be-module-blog-entry-right-about'); ?> <?php $block2->set_size('span4'); ?> <?php $block2->set_default("\n <div class=\"widget\">\n <h4>About</h4>\n <p>Nulla facilisi. Sed justo dui, id erat. Morbi auctor adipiscing tempor. Phasellus condimentum rutrum aliquet. Quisque eu consectetur erat. Proin rutrum, erat eget posuere semper, <em>arcu mauris posuere tortor</em>,velit at <a href=\"#\">magna sollicitudin cursus</a> ac ultrices magna. Aliquam consequat, purus vitae auctor ullamcorper, sem velit convallis quam, a pharetra justo nunc et mauris. </p>\n </div>"); ?> <?php $right->add_block($block1); ?> <?php $right->add_block($block2); ?> <?php $right->show(); ?> </div> </div> </div> </div>
<?php $block = new Block("business-commodore-1-theme-blank-block-" . $page->id); ?> <?php $block->set_size('span12'); ?> <?php $block->set_content(' <h1>Blank Page</h1> <p>Edit this block or add an new block.</p> '); ?> <?php $holder->add_block($block); ?> <?php $holder->show(); ?> </div> </div> </div> </div> </div> </div> </div> <!-- Content ends -->