Esempio n. 1
0
 * data in the DB in the correct format.
 * Permissions to common methods are denied (Nobody).
 *
 * $Id$
 * @package smdoc
 */
/** METHOD PERMISSIONS */
setPermission('smdoc_news', 'class', 'create', 'News');
setPermission('smdoc_news', 'class', 'list', 'Everybody');
setPermission('smdoc_news', 'object', 'history', 'Nobody');
setPermission('smdoc_news', 'object', 'diff', 'Nobody');
setPermission('smdoc_news', 'object', 'revert', 'Nobody');
setPermission('smdoc_news', 'object', 'delete', 'News');
setPermission('smdoc_news', 'object', 'edit', 'News');
/** Class Descriptor/Meta information */
setClassMeta('smdoc_news', 'News');
setConst('NEWS_CLASS_ID', META_SMDOC_NEWS_CLASS_ID);
setConst('NEWS_CLASS_NAME', 'smdoc_news');
/**
 * Array identifying news source
 * @global array $NEWS_SOURCE
 */
global $NEWS_SOURCE;
$NEWS_SOURCE = array('table' => 'smdoc_news', 'table_create' => array(getClassname(NEWS_CLASS_ID), 'makeTable'));
/** 
 * Global containing default news categories 
 * @global array $NEWS_CATEGORIES
 */
global $NEWS_CATEGORIES;
$NEWS_CATEGORIES = array('None', 'Development', 'Stable', 'Plugins');
/**
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition to the 
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Error handling functions/class/constants.
 *
 * $Id$
 * @package smdoc
 * @subpackage error
 */
/** Include storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/** Set constants and meta data */
setClassMeta('smdoc_error', 'Error Display');
setConst('ERROR_CLASS_ID', META_SMDOC_ERROR_CLASS_ID);
setConst('ERROR_TITLE', _("Page Error"));
/** METHOD PERMISSIONS **/
setPermission('smdoc_error', 'object', 'view', 'Everybody');
/**
 * Error class.
 *
 * Used for rendering error messages
 *
 * @package smdoc
 * @subpackage error
 */
class smdoc_error extends smdoc_storage
{
    /**
Esempio n. 3
0
 * Copyright (c) 2003-2004 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the 
 * Framework for Object Orientated Web Development (Foowd).
 * */
/**
 * Class for HTML and Textile formatted documents.
 *
 * $Id$
 *m  
 * @package smdoc
 * @subpackage text
 */
/** Class Descriptor/Meta information */
setClassMeta('smdoc_spec', 'HTML + Textile + Spec tracking');
setPermission('smdoc_spec', 'class', 'create', 'dev');
setPermission('smdoc_spec', 'object', 'revert', 'dev');
/**
 * HTML and Textile text object class.
 *
 * This class defines a HTML/Textile text area and 
 * methods to view and edit that area. Defines additional
 * elements for targeting/editing/documenting design intentions.
 *
 * @package smdoc
 * @subpackage text
 * @author Erin Schnabel
 */
class smdoc_spec extends smdoc_text_textile
{
Esempio n. 4
0
 * Modified by SquirrelMail Development
 * $Id$
 * 
 * @package Foowd
 */
/** Method permissions */
setPermission('foowd_workspace', 'class', 'create', 'Gods');
setPermission('foowd_workspace', 'class', 'enter', 'Gods');
setPermission('foowd_workspace', 'object', 'edit', 'Gods');
setPermission('foowd_workspace', 'object', 'enter', 'Gods');
setPermission('foowd_workspace', 'object', 'fill', 'Gods');
setPermission('foowd_workspace', 'object', 'empty', 'Gods');
setPermission('foowd_workspace', 'object', 'export', 'Gods');
setPermission('foowd_workspace', 'object', 'import', 'Gods');
/** Class descriptor */
setClassMeta('foowd_workspace', 'Workspace');
setConst('WORKSPACE_CLASS_ID', META_FOOWD_WORKSPACE_CLASS_ID);
/** Workspace settings */
setConst('WORKSPACE_EXPORT_COMPRESS', FALSE);
/**
 * The Foowd workspace class.
 *
 * Class for holding information about a workspace and providing methods for
 * placing objects in and removing them from the workspace, and exporting
 * and importing objects from XML files.
 *
 * @author Paul James
 * @package Foowd
 */
class foowd_workspace extends foowd_object
{
Esempio n. 5
0
 * Base class for creation/storage/manipulation of documents.
 *
 * Modified by SquirrelMail Development
 * $Id$
 * 
 * @package smdoc
 * @subpackage Foowd
 */
/** Method permissions */
setPermission('foowd_text_plain', 'class', 'create', 'Edit');
setPermission('foowd_text_plain', 'object', 'edit', 'Edit');
setPermission('foowd_text_plain', 'object', 'revert', 'Edit');
setPermission('foowd_text_plain', 'object', 'delete', 'Edit');
setPermission('foowd_text_plain', 'object', 'clone', 'Edit');
/** Class descriptor/Meta information */
setClassMeta('foowd_text_plain', 'Plain Text');
/* Class settings */
setConst('DIFF_COMMAND', 'diff -Bb -u5');
setConst('DIFF_ADD_REGEX', '/^\\+([^+].*)/');
setConst('DIFF_MINUS_REGEX', '/^\\-([^-].*)/');
setConst('DIFF_SAME_REGEX', '/^ (.*)/');
/**
 * Plain text object class.
 *
 * This class defines a plain text area and methods to view and edit that area.
 *
 * @author Paul James
 * @package smdoc
 * @subpackage text
 */
class foowd_text_plain extends foowd_object
 * Permissions to common methods are denied (Nobody).
 *
 * $Id$
 * @package smdoc
 */
/** METHOD PERMISSIONS */
setPermission('smdoc_storage', 'class', 'create', 'Nobody');
setPermission('smdoc_storage', 'object', 'view', 'Nobody');
setPermission('smdoc_storage', 'object', 'history', 'Nobody');
setPermission('smdoc_storage', 'object', 'admin', 'Nobody');
setPermission('smdoc_storage', 'object', 'revert', 'Nobody');
setPermission('smdoc_storage', 'object', 'delete', 'Nobody');
setPermission('smdoc_storage', 'object', 'clone', 'Nobody');
setPermission('smdoc_storage', 'object', 'xml', 'Nobody');
/** CLASS DESCRIPTOR **/
setClassMeta('smdoc_storage', 'Storage class with no permission');
/**
 * Basic class that restricts certain operations,
 * and maintains no permissions for public access
 * @package smdoc
 */
class smdoc_storage extends foowd_object
{
    /**
     * Retrieve singleton instance of storage object
     * @static
     * @param smdoc $foowd Reference to the foowd environment object.
     * @return Reference to singleton object
     */
    function &getInstance(&$foowd, $className, $classid, $objectid)
    {
Esempio n. 7
0
<?php

/**
 * Definition of Anonymous user
 * 
 * Modified by SquirrelMail Development
 * $Id$
 *
 * @package smdoc
 * @subpackage user
 */
/** Class Descriptor/Meta information */
setClassMeta('foowd_anonuser', 'Anonymous User');
/**
 * Anonymous user class.
 *
 * Used to instanciate bogus user for anoymous access where only basic user
 * data is required and it would be a waste to pull a user from the database.
 * This is here rather than in class.user.php since it is possible to use
 * foowd without class.user.php and just with the anonymous user if you don't
 * need users.
 *
 * @author Paul James
 * @package smdoc
 * @subpackage user
 */
class foowd_anonuser extends foowd_object
{
    /**
     * Constructs a new anonymous user.
     *
 * Copyright (c) 2003-2004 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the 
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Name lookup implementation used to map easy object name like 'faq' to 
 * an objectid/classid pair for retrieval.
 *
 * $Id$
 *
 * @package smdoc
 */
/** Class descriptor/Meta information */
setClassMeta('smdoc_name_lookup', 'Singleton object lookup/name manager');
setPermission('smdoc_name_lookup', 'class', 'list', 'Edit');
setConst('SHORTNAMES_ID', 1063068242);
/** Regex to validate shortname */
setConst('REGEX_SHORTNAME', '/^[a-z_-]{0,11}$/');
/** Base storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/**
 * Singleton class provides a basic mapping for 
 * well-known simple names (faq, privacy..)
 * to objectid/className pairs.
 * 
 * @package smdoc
 */
class smdoc_name_lookup extends smdoc_storage
{
Esempio n. 9
0
 * Copyright (c) 2003-2004 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Specific user extensions for the SquirrelMail documentation site.
 *
 * $Id$
 *
 * @package smdoc
 * @subpackage user
 */
/** Class Descriptor/Meta information */
setClassMeta('smdoc_user', 'SMDoc User');
setConst('USER_CLASS_ID', META_SMDOC_USER_CLASS_ID);
setConst('USER_CLASS_NAME', 'smdoc_user');
/** Include the user base class */
include_once SM_DIR . 'class.user.php';
/**
 * The smdoc extended user class.
 *
 * Class for holding information about a user and providing methods for
 * manipulating and getting information on a user.
 *
 * @package smdoc
 * @subpackage user
 */
class smdoc_user extends base_user
{
 * Copyright (c) 2003-2004 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 */
/** 
 * Defines small class for storing additional groups
 * in a single DB record.
 * 
 * $Id$
 * @package smdoc
 * @subpackage group
 */
/** Class descriptor/Meta information */
setClassMeta('smdoc_group_appext', 'Management of additional non-system groups');
setConst('APP_GROUPS_ID', -1807156497);
/** Base Storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/**
 * Small singleton class that stores additional groups in the DB
 * Managed by smdoc_group
 *
 * @package smdoc
 * @subpackage group
 */
class smdoc_group_appext extends smdoc_storage
{
    /**
     * Array containing application specific groups
     * @var array
 * Copyright (c) 2003-2004 The SquirrelMail Project Team
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the 
 * Framework for Object Orientated Web Development (Foowd).
 * */
/**
 * Class for HTML and Textile formatted documents.
 *
 * $Id$
 * 
 * @package smdoc
 * @subpackage text
 */
/** Class Descriptor/Meta information */
setClassMeta('smdoc_text_textile', 'Textile');
/**
 * HTML and Textile text object class.
 *
 * This class defines a HTML/Textile text area and 
 * methods to view and edit that area.
 *
 * @package smdoc
 * @subpackage text
 * @author Erin Schnabel
 * @author Brad Choate
 */
class smdoc_text_textile extends foowd_text_plain
{
    /**
     * Process text content. Processes content to turn the textile style code 
/**
 * Implementation of Site Translations based on Workspaces
 *
 * $Id$
 * @see foowd_workspace
 * @package smdoc
 */
/** METHOD PERMISSIONS **/
setPermission('smdoc_translation', 'class', 'create', 'Translator');
setPermission('smdoc_translation', 'class', 'enter', 'Everybody');
setPermission('smdoc_translation', 'object', 'fill', 'Translator');
setPermission('smdoc_translation', 'object', 'empty', 'Translator');
setPermission('smdoc_translation', 'object', 'export', 'Gods');
setPermission('smdoc_translation', 'object', 'import', 'Gods');
/** CLASS DESCRIPTOR **/
setClassMeta('smdoc_translation', 'Site Translation');
setConst('TRANSLATION_CLASS_ID', META_SMDOC_TRANSLATION_CLASS_ID);
setConst('TRANSLATION_DEFAULT_LANGUAGE', 'en_US');
/** Base workspace implementation */
require_once SM_DIR . 'class.workspace.php';
/**
 * Extension of workspaces to allow all-in-one-place
 * management of site and translations.
 *
 * @package smdoc
 * @subpackage translation
 */
class smdoc_translation extends foowd_workspace
{
    /**
     * filename of applicable language flag.. 
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 */
setPermission('smdoc_group_user', 'class', 'list', 'Gods');
setPermission('smdoc_group_user', 'class', 'edit', 'Gods');
/** 
 * Singleton Group Manager.
 * 
 * $Id$
 * @package smdoc
 * @subpackage group
 */
/** Base storage class. */
include_once SM_DIR . 'smdoc.class.storage.php';
/** Class descriptor/Meta information */
setClassMeta('smdoc_group_user', 'Many-to-Many Mapping of users and groups');
/** 
 * @global array $GROUP_USER_SOURCE
 */
global $GROUP_USER_SOURCE;
$GROUP_USER_SOURCE = array('table' => 'smdoc_group_user', 'table_create' => array('smdoc_group_user', 'makeTable'));
/** 
 * Small group for managing user-group pairs in a special
 * associative table.
 *
 * @package smdoc
 * @subpackage group
 */
class smdoc_group_user extends smdoc_storage
{
    /** 
Esempio n. 14
0
 /**
  * Load default class.
  *
  * Create a child of foowd_object for the given class name so that objects of
  * that type can be loaded without their original class definition.
  *
  * @static
  * @param string $className Name of the class to load.
  */
 function loadDefaultClass($className)
 {
     setClassMeta($className, _('Unknown Foowd Class'));
     eval('class ' . $className . ' extends foowd_object {}');
 }
Esempio n. 15
0
 * 
 * Modified by SquirrelMail Development
 * $Id$
 * 
 * @package smdoc
 * @subpackage Foowd
 */
/** Method permissions */
setPermission('foowd_object', 'class', 'create', 'Nobody');
setPermission('foowd_object', 'object', 'admin', 'Gods');
setPermission('foowd_object', 'object', 'revert', 'Gods');
setPermission('foowd_object', 'object', 'delete', 'Gods');
setPermission('foowd_object', 'object', 'clone', 'Translator');
setPermission('foowd_object', 'object', 'xml', 'Nobody');
/** Class descriptor/Meta information */
setClassMeta('foowd_object', 'Base Object');
/**
 * The abstract Foowd base class.
 *
 * Implements methods for saving objects to the database, calling object
 * methods, and doing useful object housekeeping and management.
 *
 * @author Paul James
 * @package Foowd
 */
class foowd_object
{
    /**
     * Reference to the Foowd object.
     *
     * @var object
Esempio n. 16
0
 *
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 *
 * $Id$
 */
/**
 * Permission and constant definitions for the smdoc extended user class.
 *
 * @package smdoc
 * @subpackage user
 */
/**
 * Set constants and meta information for the user class
 */
setClassMeta('base_user', 'Base User');
setConst('USER_CLASS_ID', META_BASE_USER_CLASS_ID);
setConst('USER_CLASS_NAME', 'base_user');
/**
 * @global array $USER_SOURCE
 */
global $USER_SOURCE;
$USER_SOURCE = array('table' => 'smdoc_user', 'table_create' => array(getClassname(USER_CLASS_ID), 'makeTable'));
setPermission('base_user', 'class', 'login', 'Everybody');
setPermission('base_user', 'class', 'logout', 'Registered');
setPermission('base_user', 'class', 'create', 'Everybody');
setPermission('base_user', 'class', 'list', 'Everybody');
setPermission('base_user', 'object', 'groups', 'Gods');
setPermission('base_user', 'object', 'update', 'Author');
setPermission('base_user', 'object', 'clone', 'Nobody');
setPermission('base_user', 'object', 'admin', 'Nobody');