StockManiac
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
this day is displayed/processed right now
Editor plugin that is used right now. Attention: do not rely in this!
{link helpers} object for convenience
currently selected Portfolio ID
Plugin that can handle the current portfolio type
array of all plugins known by the core. It is created during the login phase and cached in the session later.
currently selected Position inside portfolio
list of portfolios of current user
name of currently running plugin. Attention: do *not* rely on this!
informations about currently logged in user
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
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 StockManiac properly with access denied message.
This should be called by external Plugins if the acl check failed. Accepts arguments just like printf() does.
Return a timestamp for the current day containing:
FIXME: this may not make much sense. But what else to use?
Analyse elements of an order and determine it's status. Return the order with status and inactive properties set.
Check if current user is allowed to access $plugin.
Check whether str is a URL. If it is not assume that http:// is meant and prepend it. Empty strings are ignored.
Check whether the current user is a admin.
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?
Public wrapper around _message()
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)
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).
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.
Public wrapper around _message()
Public wrapper around _message()
Create pager html code.
Return the percentage of $val in relation to $base. Optionally return the difference to 100.
Rebuild the list of user portfolios.
Run a single plugin. Call it according to its type.
Set date which we gone show now (positions, news, etc...). If no timestamp is given, the current date/time is used.
Set current Editor
Set current Portfolio ID.
Set current Position ID.
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 page title.
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 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.
Verify username/password against database (when first called) or verify validity flag in session (all subsequent calls).
Check expiration time of current login.
Verify database version information. Call the migration plugin if a discrepancy has been found.
Figure plugin name which can handle a certain type of portfolio.
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.
Initialize the $PLUGINS and $_SETTINGS arrays during login phase. Cache both structures in the session.
Create list of users' portfolios and cache that.
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.
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.
Return the next multiple of factor, that is larger than base.
Run a plugin by including the code
Run a plugin by redirecting the browser. Stop immediatelly after the redirect - the plugin *must* take over at this point.
Set Position Details ($PID, $PnID).
Query this information from session and/or database if nothing was given.
Load user account data and ACLs from database and initialize USER array, cache the information in session.
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