Пример #1
0
function loadSection_up($object_file, $content_pack)
{
    //superprint("load section up");
    $content_section = file_load_object($object_file);
    if ($content_section->type == "section" or $content_section->type == "site") {
        if (is_file($content_section->parent)) {
            $content_pack = loadSection_up($content_section->parent, $content_pack);
        }
        $content_pack[$content_section->id] = $content_section;
    }
    return $content_pack;
}
Пример #2
0
<?php

//superprint($_POST);
//superprint($_GET);
//superprint($content_pack["page"]);
//exit;
//superprint($objet)
$post_vars = $_POST;
switch ($process_request_operation) {
    case "edit":
        if (!is_object($object) and $object->type != $object_type) {
            break;
        }
        $object->update_object_props($post_vars);
        $parent_file = $object->parent;
        $parent = file_load_object($parent_file);
        if ($parent) {
            $parent->updateContent($object);
            $parent->save();
        } else {
            $object->save();
        }
        break;
    case "create":
        $object = createNewObject($object_type, $post_vars, $system_data_classes);
        if (is_object($object) and $object->type == $object_type) {
            $object->save();
        }
        break;
    case "delete":
        if (is_object($object) and $object->type == $object_type) {
Пример #3
0
                <th>delete</th>

            </tr>
        </thead>


        <tbody>

    <?php 
    foreach ($data_files as $key => $object_filename) {
        $obj_file_parts = pathinfo($object_filename);
        if ($obj_file_parts['extension'] != "obj") {
            continue;
        }
        $object_file = $data_dir . $object_filename;
        $object = file_load_object($object_file);
        //superprint($object_file);
        //superprint($object);
        if (!isset($object->type) or $object->type != $object_type) {
            continue;
        }
        $edit_glyphicon = "<span class=\"glyphicon  glyphicon-wrench\" ></span>\n";
        $editLink = $editLink_base . "&object_type=" . $object->type . "&object_id=" . $object->id;
        $editLinkButton = "<a href=\"" . $editLink . "\"  title=\"edit\">" . $edit_glyphicon . "</a>\n";
        $delete_glyphicon = "<span class=\"glyphicon  glyphicon-erase \" ></span>\n";
        $deleteLink = $deleteLink_base . "&object_type=" . $object->type . "&object_id=" . $object->id;
        $deleteLinkButton = "<a href=\"" . $deleteLink . "\" title=\"delete\" class=\"delete_confirm\">" . $delete_glyphicon . "</a>\n";
        ?>
                <tr>
                    <td scope="row" id="<?php 
        echo $object->type . "_" . $key;
Пример #4
0
 function delete()
 {
     // delete link in childs objects
     foreach ($this->content as $link) {
         $content = $this->loadContentObj($link);
         if (!is_object($content)) {
             continue;
         }
         $content->parent = "";
         superprint($content->title);
         superprint($content->parent);
         $content->save();
     }
     //delete link in parent
     if (is_file($this->parent)) {
         $parent = file_load_object($this->parent);
         $parent->removeContent($this->id);
         $parent->setDefaultID();
         $parent->save();
         //superprint($parent);
     }
     // delete section object
     $obj = $this->getFileName();
     if (is_file($obj)) {
         copy($obj, BACKUP_FOLDER . "/" . $this->id . ".obj");
         unlink($obj);
     }
 }
Пример #5
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/** libs */
include "system/config/const.php";
include "system/include/libs/bases.php";
include "system/include/libs/classes.php";
include "system/include/libs/boot.php";
include "system/include/libs/menus.php";
$siteFileObj = OBJECTS_FOLDER . "/site/site.obj";
$site = file_load_object($siteFileObj);
$obj = $site->getContent();
$image = new image("test");
$upload_filename = "df  sdçsd_çèsdfhsdn dsjflskdfjd .png";
$image->init_from_upload_filename($upload_filename);
superprint($image->getContentFileName());
/*
$object_file=OBJECTS_FOLDER."/process/admin_data_index.obj";
superprint($object_file);
$object=  file_load_object($object_file);


$object_file=OBJECTS_FOLDER."/process/admin_data_edit.obj";
superprint($object_file);
$object=  file_load_object($object_file);
*/
/*
Пример #6
0
 function delete()
 {
     if (is_file($this->parent)) {
         $parent = file_load_object($this->parent);
         $parent->removeContent($this->id);
         $parent->setDefaultID();
         $parent->save();
         //superprint($parent);
     }
     $obj = $this->getFileName();
     $htm = $this->getContentFile();
     if (is_file($htm)) {
         copy($htm, BACKUP_FOLDER . "/" . $this->id . ".htm");
         unlink($htm);
     }
     if (is_file($obj)) {
         copy($obj, BACKUP_FOLDER . "/" . $this->id . ".obj");
         unlink($obj);
     }
 }
Пример #7
0
function displayNavBar($section, $content_id)
{
    $li = "";
    foreach ($section->content as $key => $linkObj) {
        //if dropdown needed
        /*
         if ($linkObj->type == "section" and $content_id == $key) {
         if(isset($content_pack[$content_id])){
         displayNavBarDropDown($content_pack[$content_id]);
         }
        
         }
        * 
        */
        if ($linkObj->type == "section") {
            $sub_section = file_load_object($linkObj->url);
            if ($sub_section) {
                displayNavBarDropDown($sub_section);
            }
        } else {
            $link = BASEFILE . "?" . $linkObj->type . "=" . $key;
            if ($content_id == $key) {
                $class = "active";
            } else {
                $class = "";
            }
            echo "<li class=\"" . $class . "\"><a href=\"" . $link . "\">" . $linkObj->getTitle() . "</a></li>\n";
        }
    }
}