Example #1
0
 /**
  *	Print the admin backend footer
  *
  */
 public function print_footer()
 {
     $footer_vars = array('BACKEND_BODY_MODULE_JS' => get_page_footers('backend'), 'LEPTON_URL' => LEPTON_URL, 'LEPTON_PATH' => LEPTON_PATH, 'ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL);
     echo $this->parser->render("@theme/footer.lte", $footer_vars);
     /**
      *	Droplet support
      *
      */
     $this->html_output_storage = ob_get_clean();
     if (true === $this->droplets_ok) {
         $this->html_output_storage = evalDroplets($this->html_output_storage);
     }
     // CSRF protection - add tokens to internal links
     if ($this->is_authenticated()) {
         if (file_exists(LEPTON_PATH . '/framework/functions/function.addTokens.php')) {
             include_once LEPTON_PATH . '/framework/functions/function.addTokens.php';
             if (function_exists('addTokens')) {
                 addTokens($this->html_output_storage, $this);
             }
         }
     }
     echo $this->html_output_storage;
 }
Example #2
0
 /**
  *	Print the admin backend footer
  *
  */
 public function print_footer()
 {
     $footer_template = new Template(THEME_PATH . '/templates');
     $footer_template->set_file('page', 'footer.htt');
     $footer_template->set_block('page', 'footer_block', 'header');
     $footer_template->set_var(array('BACKEND_BODY_MODULE_JS' => get_page_footers('backend'), 'LEPTON_URL' => LEPTON_URL, 'LEPTON_PATH' => LEPTON_PATH, 'ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL));
     $footer_template->parse('header', 'footer_block', false);
     $footer_template->pparse('output', 'page');
     /**
      *	Droplet support
      *
      */
     $this->html_output_storage = ob_get_clean();
     if (true === $this->droplets_ok) {
         $this->html_output_storage = evalDroplets($this->html_output_storage);
     }
     // CSRF protection - add tokens to internal links
     if ($this->is_authenticated()) {
         if (file_exists(LEPTON_PATH . '/framework/functions/function.addTokens.php')) {
             include_once LEPTON_PATH . '/framework/functions/function.addTokens.php';
             if (function_exists('addTokens')) {
                 addTokens($this->html_output_storage, $this);
             }
         }
     }
     echo $this->html_output_storage;
 }
Example #3
0
 * ОСТОРОЖНО
 */
foreach (['children', 'parents', 'tokens', 'children_to_parents'] as $table) {
    $query = $db->createQueryBuilder();
    $query->delete($table)->execute();
    //    $db->fetchAll('DELETE FROM ' . $table );
}
//$db->delete('children', []);
//$db->delete('parents', []);
//$db->delete('tokens', []);
//$db->delete('children_to_parents', []);
$childrens = [Children::createObj(['name' => 'Children' . uniqid()]), Children::createObj(['name' => 'TestChildren']), Children::createObj(['name' => 'Children' . uniqid()]), Children::createObj(['name' => 'Children' . uniqid()]), Children::createObj(['name' => 'Children' . uniqid()])];
saveAll($childrens);
$parents = [Parents::createObj(['login' => 'Parent' . uniqid(), 'password' => uniqid()]), Parents::createObj(['login' => 'TestParent', 'password' => 'ParentPass']), Parents::createObj(['login' => 'Parent' . uniqid(), 'password' => uniqid()]), Parents::createObj(['login' => 'Parent' . uniqid(), 'password' => uniqid()])];
saveAll($parents);
$tokens = addTokens($parents);
saveAll($tokens);
addRelation($parents, $childrens);
function addTokens($parents)
{
    $tokens = [];
    foreach ($parents as $parent) {
        $tokens[] = Tokens::createObj(['parent_id' => $parent->id, 'token' => uniqid('token-'), 'type' => rand(0, 1)]);
    }
    return $tokens;
}
function saveAll(array $collection)
{
    foreach ($collection as $el) {
        $el->save();
    }
Example #4
0
}
//Get pagecontent in buffer for Droplets and/or Filter operations
ob_start();
require LEPTON_PATH . '/templates/' . TEMPLATE . '/index.php';
$output = ob_get_clean();
// wb->preprocess() -- replace all [wblink123] with real, internal links
$wb->preprocess($output);
// Load Droplet engine and process
if (file_exists(LEPTON_PATH . '/modules/droplets/droplets.php')) {
    include_once LEPTON_PATH . '/modules/droplets/droplets.php';
    if (function_exists('evalDroplets')) {
        evalDroplets($output);
    }
}
// Output interface for Addons
if (file_exists(LEPTON_PATH . '/modules/output_interface/output_interface.php')) {
    include_once LEPTON_PATH . '/modules/output_interface/output_interface.php';
    if (function_exists('output_interface')) {
        output_interface($output);
    }
}
// CSRF protection - add tokens to internal links
if ($wb->is_authenticated()) {
    if (file_exists(LEPTON_PATH . '/framework/functions/function.addTokens.php')) {
        include_once LEPTON_PATH . '/framework/functions/function.addTokens.php';
        if (function_exists('addTokens')) {
            addTokens($output, $wb);
        }
    }
}
echo $output;