stockmaniacStockManiac
This is the base system. It provides access to the output subsystem (templates), the database interface and generic StockManiac data. It implements core logic to handle plugins, settings, users, ... and a few other things.
Use this class to access everything.
Located in /lib/stockmaniac.class.php (line 70)
session | --gui | --dbc | --dbi | --stockmaniac
void
__construct
([string $login = FALSE], [string $pass = FALSE], [bool $logout = FALSE], [bool $skip_db_check = FALSE])
int
$DATE
(line 95)
this day is displayed/processed right now
array
$EDITORPLUGIN
(line 134)
Editor plugin that is used right now. Attention: do not rely in this!
object
$HELPERS
(line 159)
{link helpers} object for convenience
int
$ID_PORTFOLIO
(line 110)
currently selected Portfolio ID
array
$MAINPLUGIN
(line 142)
Plugin that can handle the current portfolio type
array
$PLUGINS
(line 79)
array of all plugins known by the core. It is created during the login phase and cached in the session later.
int
$PnID
(line 118)
currently selected Position inside portfolio
array
$PORTFOLIOS
(line 126)
list of portfolios of current user
string
$RUNNING_PLUGIN
(line 87)
name of currently running plugin. Attention: do *not* rely on this!
object dao_user
$USER
(line 102)
informations about currently logged in user
array
$_SETTINGS
(line 152)
Active application settings of current user. Use *_setting() methods to access these informations.
Inherited from dbc
dbc::$sql_affected_rows
dbc::$sql_error
dbc::$sql_execution_time
dbc::$_db
dbc::$_result
Inherited from gui
gui::$themes
gui::$_smarty
Inherited from session
session::$err
Constructor __construct (line 172)
Constructor
abort (line 903)
Abort StockManiac properly when something serious went wrong.
This might be called by Plugins if something is really weird. Accepts arguments just like printf() does.
abort_access_denied (line 925)
Abort StockManiac properly with access denied message.
This should be called by external Plugins if the acl check failed. Accepts arguments just like printf() does.
add_time_to_day (line 1052)
Return a timestamp for the current day containing:
FIXME: this may not make much sense. But what else to use?
analyse_order (line 1124)
Analyse elements of an order and determine it's status. Return the order with status and inactive properties set.
check_acl (line 1493)
Check if current user is allowed to access $plugin.
check_url (line 1291)
Check whether str is a URL. If it is not assume that http:// is meant and prepend it. Empty strings are ignored.
check_user_is_admin (line 1522)
Check whether the current user is a admin.
create_bar (line 1085)
Create a array of type BAR (that is display_name, url) from input array. If $baseurl is given it will be prepended to each result url.
Input array must be structured similar to $PORTFOLIOS.
ATTENTION: this does also check ACLs when $a['name'] exists in $PLUGINS. The intended effect is that such lists contain only plugins the user is actually allowed to use. The check is arguably odd at this location.
FIXME: cache bar in session to speed it up?
error (line 996)
Public wrapper around _message()
figure_max_upload_size (line 1682)
Figure out what upload size we can handle at maximum. Return number of bytes or 0 on failure of when uploading is disabled in php.ini.
This is what we tell the browser and what we use to detect too large files _before_ PHP does (to the extend we can, otherwise we might end up with broken document records)
get_setting (line 1321)
Return a single setting value or false if it was not found.
Locate it by the given option name, type, current editor and current uid. Type is optional, but defaults to plugins. The plugin name defaults to the currently running plugin (see $EDITORPLUGIN).
get_setting_select (line 1347)
Return values=>labels array for $_SETTINGS data of type 'select' or false if data type is not 'select' or $name does not exist.
Type is optional and defaults to 'plugins'. Plugin is optional and defaults to the currently running plugin.
message (line 970)
Public wrapper around _message()
notice (line 983)
Public wrapper around _message()
Pager (line 1226)
Create pager html code.
percentage (line 1019)
Return the percentage of $val in relation to $base. Optionally return the difference to 100.
reload_portfolios (line 603)
Rebuild the list of user portfolios.
run_plugin (line 480)
Run a single plugin. Call it according to its type.
set_date (line 705)
Set date which we gone show now (positions, news, etc...). If no timestamp is given, the current date/time is used.
set_editor (line 851)
Set current Editor
set_id_portfolio (line 729)
Set current Portfolio ID.
set_pnid (line 741)
Set current Position ID.
set_setting (line 1386)
Add/change a single setting.
Make sure it's stored in the database and session. Name is optional (and usually the Plugin Name). If name is not given, the curretly running $EDITORPLUGIN is assumed.
Returns 1 when a update was performed, 2 when a insert was performed and
set_title (line 884)
Set page title.
store_document (line 1544)
Store a document that was uploaded through PHPs facilities.
$doc is a element from PHPs $_FILES global. Returns the new document ID or false on error.
_add_plugin (line 550)
Add a plugin to the list of known plugins at run time. Take care that it is in the session and that smarty knows about it.
_check_login (line 302)
Verify username/password against database (when first called) or verify validity flag in session (all subsequent calls).
_check_login_expire (line 335)
Check expiration time of current login.
_check_version (line 361)
Verify database version information. Call the migration plugin if a discrepancy has been found.
_figure_portfolio_type_handler (line 625)
Figure plugin name which can handle a certain type of portfolio.
_load_account_defaults (line 447)
Load account default settings from file. Fill the 'themes' setting with all values and labels the GUI knows. That way users can choose from all available themes.
FIXME: couldn't we use the 'desc' field somehow? It would be nice.
_load_plugins (line 390)
Initialize the $PLUGINS and $_SETTINGS arrays during login phase. Cache both structures in the session.
_load_portfolios (line 564)
Create list of users' portfolios and cache that.
_merge_settings (line 1430)
Load plugin and account settings from database and merge them into $_SETTINGS.
Both, plugin and account settings are related to the current user. Datatypes are corrected on the fly if necessary.
_message (line 951)
Collect messages of varios levels and assign them to Smarty.
Collected messages are printed in the header.tpl template at next page reload. Accepts arguments just like printf() does.
_next_multiple (line 1275)
Return the next multiple of factor, that is larger than base.
_plugin_include (line 522)
Run a plugin by including the code
_plugin_redirect (line 535)
Run a plugin by redirecting the browser. Stop immediatelly after the redirect - the plugin *must* take over at this point.
_set_position_details (line 759)
Set Position Details ($PID, $PnID).
Query this information from session and/or database if nothing was given.
_set_user (line 665)
Load user account data and ACLs from database and initialize USER array, cache the information in session.
_store_uploaded_file (line 1618)
Store uploaded file in the database.
Take a element of PHPs $_FILES global as $file. Perform acceptance and security checks before storing anything. Returns true on success, false on failure.
Inherited From dbi
dbi::__construct()
dbi::sql_assign_document()
dbi::sql_check_version()
dbi::sql_close_position()
dbi::sql_delete_broken_document()
dbi::sql_delete_document()
dbi::sql_delete_setting()
dbi::sql_get_user_details()
dbi::sql_select_acls()
dbi::sql_select_comments()
dbi::sql_select_documents()
dbi::sql_select_document_content()
dbi::sql_select_first_position()
dbi::sql_select_last_insert_id()
dbi::sql_select_order()
dbi::sql_select_orders()
dbi::sql_select_portfolios()
dbi::sql_select_positions()
dbi::sql_select_position_details()
dbi::sql_select_position_uid()
dbi::sql_select_quotes()
dbi::sql_select_settings()
dbi::sql_select_split()
dbi::sql_select_stocks()
dbi::sql_select_timetags()
dbi::sql_store_document()
dbi::sql_store_document_content()
dbi::sql_store_position()
dbi::sql_store_setting()
dbi::sql_update_password()
dbi::sql_verify_password()
Inherited From dbc
dbc::__construct()
dbc::sql()
dbc::sql_escape_string()
dbc::sql_get_array_result()
dbc::sql_get_indexedlist_result()
dbc::sql_get_objectarray_result()
dbc::sql_get_object_result()
dbc::sql_get_result()
dbc::sql_max_packet_size()
dbc::sql_script()
Inherited From gui
gui::__construct()
gui::append()
gui::assign()
gui::debug()
gui::display()
gui::get_microtime()
gui::get_template_vars()
gui::get_themes()
gui::register_object()
gui::set_default_theme()
Inherited From session
session::__construct()
session::sess_destroy()
session::sess_exists()
session::sess_get_var()
session::sess_store_var()
session::sess_unset_var()
Documentation generated on Sun, 22 Aug 2010 11:20:25 +0200 by phpDocumentor 1.4.3