/**
  * Output the objects history.
  *
  * We override <code>{@link foowd_object::method_history}</code> so as to add links to the diff method.
  */
 function method_history()
 {
     $this->foowd->track('foowd_text_plain->method_history');
     $this->foowd->template->assign('detailsTitle', $this->getTitle());
     $this->foowd->template->assign('detailsCreated', date(DATETIME_FORMAT, $this->created) . ' (' . timeSince($this->created) . ' ago)');
     $this->foowd->template->assign('detailsAuthor', htmlspecialchars($this->creatorName));
     $this->foowd->template->assign('detailsType', getClassDescription($this->classid));
     if ($this->workspaceid != 0) {
         $this->foowd->template->assign('detailsWorkspace', $this->workspaceid);
     }
     $objArray = $this->foowd->getObjHistory(array('objectid' => $this->objectid, 'classid' => $this->classid));
     $currentVersion = $this->version;
     $latestVersion = $objArray[0]->version;
     unset($objArray[0]);
     $versions = array();
     foreach ($objArray as $object) {
         $version = array();
         $version['updated'] = date(DATETIME_FORMAT, $object->updated) . ' (' . timeSince($object->updated) . ' ago)';
         $version['author'] = htmlspecialchars($object->updatorName);
         $version['version'] = $object->version;
         $version['objectid'] = $object->objectid;
         $version['classid'] = $object->classid;
         if ($object->version != $latestVersion) {
             $version['revert'] = TRUE;
             $version['diff'] = TRUE;
         }
         $this->foowd->template->append('versions', $version);
     }
     $this->foowd->track();
 }
示例#2
0
    $uri_arr['objectid'] = $object->objectid;
    $uri_arr['classid'] = $object->classid;
    $uri_arr['version'] = $object->version;
    $list_objects[$i]['url'] = getURI($uri_arr);
    $list_objects[$i]['title'] = $object->title;
    if ($object->workspaceid != 0) {
        $list_objects[$i]['langid'] = smdoc_translation::getLink($foowd, $object->workspaceid);
    } else {
        $list_objects[$i]['langid'] = '&nbsp;';
    }
    if (isset($object->updatorName)) {
        $list_objects[$i]['updated'] = date(DATETIME_FORMAT, $object->updated);
        $list_objects[$i]['updated_by'] = $object->updatorName;
    } else {
        $list_objects[$i]['updated'] = date(DATETIME_FORMAT, $object->created);
        $list_objects[$i]['updated_by'] = $object->creatorName;
    }
    $list_objects[$i]['ver'] = $object->version;
    $list_objects[$i]['desc'] = getClassDescription($object->classid);
    $i++;
}
$foowd->template->assign('title', _("Recent Changes"));
$foowd->template->assign('method', '');
$foowd->template->assign_by_ref('changeList', $list_objects);
$foowd->template->assign('body_template', 'smdoc_external.changes.tpl');
$foowd->template->display();
/*
 * destroy Foowd - triggers cleanup of database object and 
 * display of debug information.
 */
$foowd->__destruct();
示例#3
0
        if (!empty($object['permissions'])) {
            $object['permissions'] = unserialize($object['permissions']);
        }
        // If viewer does not have permission to view this kind of object, skip it
        if (!$foowd->hasPermission(getClassName($object['classid']), 'view', 'OBJECT', $object['permissions'])) {
            continue;
        }
        $list_objects[$i] = $object;
        $uri_arr['objectid'] = $object['objectid'];
        $uri_arr['classid'] = $object['classid'];
        $list_objects[$i]['url'] = getURI($uri_arr);
        if ($object['workspaceid'] != 0) {
            $list_objects[$i]['langid'] = smdoc_translation::getLink($foowd, $object['workspaceid']);
        } else {
            $list_objects[$i]['langid'] = '&nbsp;';
        }
        $list_objects[$i]['updated'] = date(DATETIME_FORMAT, strtotime($object['updated']));
        $list_objects[$i]['desc'] = getClassDescription($object['classid']);
        $i++;
    }
}
$foowd->template->assign('title', _("Site Index"));
$foowd->template->assign('method', '');
$foowd->template->assign_by_ref('objectList', $list_objects);
$foowd->template->assign('body_template', 'smdoc_external.siteindex.tpl');
$foowd->template->display();
/*
 * destroy Foowd - triggers cleanup of database object and 
 * display of debug information.
 */
$foowd->__destruct();
示例#4
0
 * </pre>
 * 
 * @package smdoc
 * @subpackage extern
 */
/** 
 * Initial configuration, start session
 * @see config.default.php
 */
require 'smdoc_init.php';
/* 
 * Initialize smdoc/FOOWD environment
 */
$foowd = new smdoc($smdoc_parameters);
$class_list = array();
$classes = getFoowdClassNames();
foreach ($classes as $classid => $className) {
    if ($foowd->hasPermission($className, 'create', 'class') && strpos($className, 'user') === false) {
        $class_list[$className] = getClassDescription($classid);
    }
}
$foowd->template->assign('title', _("Create New Resource"));
$foowd->template->assign('method', '');
$foowd->template->assign_by_ref('classlist', $class_list);
$foowd->template->assign('body_template', 'smdoc_external.create.tpl');
$foowd->template->display();
/*
 * destroy Foowd - triggers cleanup of database object and 
 * display of debug information.
 */
$foowd->__destruct();