Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
Briefcase Class Reference
Inheritance diagram for Briefcase:
tariqa3Module baseModule_RELEX_TARIQANG BaseModuleWithAuthenticationAndLanguages BaseModuleWithAuthentication BaseModule mModule

Public Member Functions

 __construct ($config)
 onInitialize ()
 getPageContent ()
 selectTemplate ()
 canProcessRequest ()
 getName ()
 getTitle ()
 getDescription ()
 getLink ()
 getBreadCrumb ()
 getHeaders ()
 getDefaultTemplateFile ()

Static Public Member Functions

static sortBriefcase ($criteria, $type_id, $user, $db)
static autoImport ($user, $db, $content_id)
static selectFolderForm ($folder_id, $type_id, $level, $user, $db, $translationTable, $just_options=false, $archive=false)
static applyTemplateFolder ($folder_id, $template_id, $overwrite, $user, $db)
static applyTemplateArticle ($content_id, $template_id, $overwrite, $user, $db)
static canModifyFolder ($user_id, $folder_id, $db)
static moveItemToFolder ($user_id, $db, $source_id, $dest_id, $dest_type)
static moveFolder ($user_id, $db, $source_id, $dest_id, $dest_type)
static archiveFolder ($user_id, $db, $folder_id)
static unarchiveFolder ($user_id, $db, $folder_id)
static emptyFolder ($user_id, $db, $folder_id, $type_id, $subfolders)
static addFolder ($user_id, $db, $parent_id, $type_id, $name)
static deleteFolder ($user_id, $db, $folder_id)
static renameFolder ($user_id, $db, $folder_id, $new_name)
static doSaveArticle ($user_id, $db, $folder_id, $type_id, $article_id, $title=null)
static doSaveText ($user_id, $db, $folder_id, $title, $text)
static deleteContent ($user_id, $db, $content_id)
static renameContent ($user_id, $db, $content_id, $new_name)
static saveSearch ($user_id, $db, $GET_data, $POST_data, $title, $folder_id)
static createFolderIfNotExists ($folder_name, $type_id, $user_id, $db)
static getRealURL ($url, $db)
static url ($ids, $db)

Data Fields

const TYPE_ARTICLE = 1
const TYPE_DOCUMENT = 2
const TYPE_LOCATION = 3
const TYPE_SEARCH = 4
const TYPE_SHARED_OBJECT = 5
const CHECKBOX_SEL_TYPE = 'checkbox'
const UI_SEL_TYPE = 'ui'
const BRIEFCASE_DATE_SORT = 'date'
const BRIEFCASE_TITLE_SORT = 'title'
const BRIEFCASE_PUBLISHER_SORT = 'publisher'

Protected Member Functions

 strip_tags ($html, $download_images=false)
 getExportFolderCond ($folder_id, $selected_ids, $field_name= 'folder_id')
 exportArticles ($format=\MetaNull\Tools\xslTransform::FORMAT_PDF, $folder_id=null, $selected_ids=null, $level=0)
 setArchived ($db, $folder_id, $value)
 export ($type, $format=\MetaNull\Tools\xslTransform::FORMAT_PDF)

Static Protected Member Functions

static changeFolderType ($folder_id, $type_id, $db)

Protected Attributes

 $selection = null
 $sorting
 $archive = false
 $folder_id = null

Constructor & Destructor Documentation

__construct ( config)

Construct the Module object

Parameters:
array$configThe multidimentionnal array containing the application's configuration

Reimplemented from mModule.


Member Function Documentation

static addFolder ( user_id,
db,
parent_id,
type_id,
name 
) [static]

Adds a folder to the briefcase

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$_parent_idThe parent identifier
int$type_idThe type identifier
string$nameThe name of the new folder public
Returns:
boolean
static applyTemplateArticle ( content_id,
template_id,
overwrite,
user,
db 
) [static]

Apply a template to an external article saved in the briefcase. In case of success returns the new id or true, otherwise, returns false

Parameters:
int$content_idThe content identifier
int$template_idThe template identifier
boolean$overwriteIf true, then overwrite the existing article
tariqaUser$userThe user identifier
mMysql$dbThe database connection public
Returns:
boolean | int
static applyTemplateFolder ( folder_id,
template_id,
overwrite,
user,
db 
) [static]

Apply a template to a folder saved from the briefcase. It returns two lists: failed and success.

Parameters:
int$folder_idThe content identifier
int$template_idThe template identifier
boolean$overwriteIf true, then overwrite the existing article
tariqaUser$userThe user identifier
mMysql$dbThe database connection public
Returns:
array
static archiveFolder ( user_id,
db,
folder_id 
) [static]

Archives a folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idthe folder identifier public
Returns:
boolean
static autoImport ( user,
db,
content_id 
) [static]

Auto imports a shared article.

Parameters:
tariqaUser$userThe user
mMysql$dbThe database connection
int$content_idThe content identifier public
Returns:
int
static canModifyFolder ( user_id,
folder_id,
db 
) [static]

Tells if a user can modify a folder

Parameters:
string$user_idThe user identifier
int$folder_idThe folder identifier
mMysql$dbA database connection public
Returns:
boolean

Process all requests (this is the default module)

Reimplemented from mModule.

static changeFolderType ( folder_id,
type_id,
db 
) [static, protected]

Change the type of a folder

Parameters:
int$folder_idThe folder identifier
int$type_idThe new type identifier
mMysql$dbThe database connection protected
Returns:
void
static createFolderIfNotExists ( folder_name,
type_id,
user_id,
db 
) [static]

Creates a folder if it doesn't exists

Parameters:
string$folder_namethe folder name
int$type_idThe type of folder to be created or checked
string$user_idThe current user
mMysql$dbThe database connection public
Returns:
int
static deleteContent ( user_id,
db,
content_id 
) [static]

Deletes an item from the briefcase

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$content_idThe content identifier public
Returns:
string
static deleteFolder ( user_id,
db,
folder_id 
) [static]

Deletes a briefcase folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idThe folder identifier public
Returns:
string
static doSaveArticle ( user_id,
db,
folder_id,
type_id,
article_id,
title = null 
) [static]

Saves an article to the briefcase

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idThe folder identifier
int$type_idThe type identifier
string$article_idThe article identifier
string$titleThe article title (for google engine) [OPTIONAL] public
Returns:
int|string
static doSaveText ( user_id,
db,
folder_id,
title,
text 
) [static]

Saves a free text to the briefcase

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idThe folder identifier
string$titleThe title of the text
string$textThe text public
Returns:
int|string
static emptyFolder ( user_id,
db,
folder_id,
type_id,
subfolders 
) [static]

Empty a folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idThe folder identifier
int$type_idThe type identifier
boolean$subfoldersIf true, also delete the subfolders public
Returns:
void
export ( type,
format = \MetaNull\Tools\xslTransform::FORMAT_PDF 
) [protected]

Exports the briefcase

Parameters:
int$typeWhat to export from the briefcase (articles, searches etc.)
string$formatThe export format - default PDF [OPTIONAL] protected
Returns:
boolean
exportArticles ( format = \MetaNull\Tools\xslTransform::FORMAT_PDF,
folder_id = null,
selected_ids = null,
level = 0 
) [protected]

Exports the briefcase

Parameters:
string$formatThe output format - default PDF [OPTIONAL]
string$folder_idThe folder identifier: -1 if you don't want to consider the folders, null for root, folder_id for any folder [OPTIONAL]
array$selected_idsThe list of selected items to export [OPTIONAL]
int$levelThe depth level [OPTIONAL] protected
Returns:
boolean

Return the items of the current breadcrumb path

Returns:
tariqa3ModuleDescriptor[]

Reimplemented from tariqa3Module.

Gets the default template file public

Returns:
string|null

Reimplemented from mModule.

Returns the description of the page public

Returns:
string

Reimplemented from tariqa3Module.

getExportFolderCond ( folder_id,
selected_ids,
field_name = 'folder_id' 
) [protected]

Gets the folder sql condition

Parameters:
int$folder_idThe folder identifier
array$selected_idsThe selected articles
string$field_nameThe field to check [OPTIONAL] protected
Returns:
string

Gets the application headers sent by the module public

Returns:
array

Reimplemented from mModule.

getLink ( )

Gets the link of the module public

Returns:
string

Reimplemented from tariqa3Module.

getName ( )

Returns the name of the class (what it should appear in the menu public

Returns:
string

Reimplemented from tariqa3Module.

Render the module

Returns:
string

Reimplemented from tariqa3Module.

static getRealURL ( url,
db 
) [static]

Gets the real URL from a search URL. The url can be an url from a redirected search, so in this case, just search for the real URL

Parameters:
string$urlThe url
mMysql$dbThe database connection

public

Returns:
string
getTitle ( )

Returns the title of the page public

Returns:
string

Reimplemented from tariqa3Module.

static moveFolder ( user_id,
db,
source_id,
dest_id,
dest_type 
) [static]

Moves a folder to another folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$source_idThe source folder identifier
int$dest_idThe destination folder identifier
int$dest_typeThe destination type public
Returns:
boolean
static moveItemToFolder ( user_id,
db,
source_id,
dest_id,
dest_type 
) [static]

Moves an item to a folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$source_idThe source identifier
int$dest_idThe folder destination identifier
int$dest_typeThe destination type public
Returns:
boolean

Initializes the module public

Returns:
void

Reimplemented from tariqa3Module.

static renameContent ( user_id,
db,
content_id,
new_name 
) [static]

Renames a content item

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$content_idThe content identifier
string$new_nameThe new name public
Returns:
string
static renameFolder ( user_id,
db,
folder_id,
new_name 
) [static]

Renames a folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idThe folder identifier
string$new_nameThe new name of the folder public
Returns:
string
static saveSearch ( user_id,
db,
GET_data,
POST_data,
title,
folder_id 
) [static]

Saves a search to the briefcase

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
string$GET_dataThe search form GET data to be saved
string$POST_dataThe search form POST data to be saved
string$titleThe title of the search
int$folder_idThe folder identifier public
Returns:
string
static selectFolderForm ( folder_id,
type_id,
level,
user,
db,
translationTable,
just_options = false,
archive = false 
) [static]

Retrieves the form for selecting a folder

Parameters:
int$folder_idThe folder identifier
int$type_idThe type identifier
int$levelThe current level
tariqaUser$userThe user identifier
mMysql$dbThe database connection
array$translationTableThe translation matrix
boolean$just_optionsIf set to true, return only the option's HTML code [OPTIONAL]
boolean$archiveIf set to true, returned the archived folders [OPTIONAL] public
Returns:
string | array

Retrieves the form for selecting a folder public

Returns:
string
setArchived ( db,
folder_id,
value 
) [protected]

Set the subfolders archived attribute

Parameters:
mMysql$dbThe database connection
int$folder_idThe folder identifier
$valueThe value of the parameter protected
Returns:
void
static sortBriefcase ( criteria,
type_id,
user,
db 
) [static]

Sorts the briefcase

Parameters:
string$criteriaThe criteria to sort
int$type_idThe type of items to sort;
tariqaUserThe user identifier
mMysql$dbThe database conneection protected
Returns:
void
strip_tags ( html,
download_images = false 
) [protected]

String the HTML tags using xslt

Parameters:
string$htmlThe html string
boolean$download_imagesIf true, then also download the images and give them a local link (1 - enabled, no proxy, 2 - enabled with proxy) [OPTIONAL] protected
Returns:
string
static unarchiveFolder ( user_id,
db,
folder_id 
) [static]

Archives a folder

Parameters:
string$user_idThe user identifier
mMysql$dbThe database connection
int$folder_idthe folder identifier public
Returns:
boolean
static url ( ids,
db 
) [static]

Generates an url for a given content_id

Parameters:
string[]$ids The list of briefcase_content identifiers
mMysql$dbThe mysql connection public
Returns:
BriefcaseJsUrl[]

Field Documentation

$archive = false [protected]
$folder_id = null [protected]
$selection = null [protected]
$sorting [protected]
const BRIEFCASE_DATE_SORT = 'date'
const BRIEFCASE_PUBLISHER_SORT = 'publisher'
const BRIEFCASE_TITLE_SORT = 'title'
const CHECKBOX_SEL_TYPE = 'checkbox'
const TYPE_ARTICLE = 1
const TYPE_DOCUMENT = 2
const TYPE_LOCATION = 3
const TYPE_SEARCH = 4
const TYPE_SHARED_OBJECT = 5
const UI_SEL_TYPE = 'ui'

The documentation for this class was generated from the following file: