本文整理汇总了PHP中Innomatic\Core\InnomaticContainer类的典型用法代码示例。如果您正苦于以下问题:PHP InnomaticContainer类的具体用法?PHP InnomaticContainer怎么用?PHP InnomaticContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InnomaticContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Executes a global search in multiple types.
*
* @param mixed $searchKeys
* @param string|array $type A type or array of types to be searched for.
* @param bool $trashcan
* @param int $limit
* @param bool $restrictToPermission
* @access public
* @return void
*/
public function &globalSearch($searchKeys, $type = '', $trashcan = false, $limit = 0, $restrictToPermission = InnoworkItem::SEARCH_RESTRICT_NONE)
{
$result = array();
if ($this->container->getState() == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) {
$this->container->getLoadTimer()->mark('InnoworkCore: start global search');
}
$result['result'] = array();
$result['founditems'] = 0;
while (list($key, $value) = each($this->summary)) {
if ($value['searchable'] and ($type == '' or $type != '' and (!is_array($type) and $type == $key or is_array($type) and in_array($key, $type)))) {
$class_name = $this->summary[$key]['classname'];
if (!class_exists($class_name)) {
continue;
}
$tmp_class = new $class_name($this->rootDA, $this->domainDA);
if (!$trashcan or $trashcan and $tmp_class->mNoTrash == false) {
$result['result'][$key] = $tmp_class->search($searchKeys, '', false, $trashcan, (int) $limit, 0, $restrictToPermission);
$result['founditems'] += count($result['result'][$key]);
//$tmp_locale = new LocaleCatalog( $itemtype_query->getFields( 'catalog' ), $this->container->getCurrentUser()->getLanguage() );
}
}
}
reset($this->summary);
if ($this->container->getState() == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) {
$this->container->getLoadTimer()->mark('InnoworkCore: end global search');
}
return $result;
}
示例2: generateSource
protected function generateSource()
{
$registry = \Innomatic\Util\Registry::instance();
if (!$registry->isGlobalObject('singleton xlayersmenu')) {
$mid = new \Innomatic\Wui\Widgets\Layersmenu\XLayersMenu();
$registry->setGlobalObject('singleton xlayersmenu', $mid);
} else {
$mid = $registry->getGlobalObject('singleton xlayersmenu');
}
$container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
$mid->libdir = $container->getHome() . 'core/lib/';
$mid->libwww = $container->getBaseUrl(false) . '/shared/';
//$mid->tpldir = $container->getHome().'core/conf/';
$mid->imgdir = $this->mThemeHandler->mStyleDir;
$mid->imgwww = $this->mThemeHandler->mStyleBase . $this->mThemeHandler->mStyleName . '/';
//$mid->imgdir = $container->getHome().'shared/';
//$mid->imgwww = $container->getBaseUrl(false).'/shared/';
$mid->setMenuStructureString($this->mMenu);
$mid->setDownArrowImg(basename($this->mThemeHandler->mStyle['arrowdownshadow']));
$mid->setForwardArrowImg(basename($this->mThemeHandler->mStyle['arrowrightshadow']));
$mid->ParseStructureForMenu($this->mName);
//$mid->NewHorizontalMenu( $this->mName );
$mid->newPlainMenu($this->mName);
//$mid->setPHPTreeMenuDefaultExpansion("67|68|82");
$mid->newPHPTreeMenu($this->mName);
$mid->newTreeMenu($this->mName);
//$mid->newVerticalMenu("vermenu1", 12);
$mid->newVerticalMenu($this->mName);
//$mid->setMenuStructureString($menustring);
//$mid->parseStructureForMenu("vermenu1");
$this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' treevmenu -->' : '') . (isset($GLOBALS['gEnv']['runtime']['wui_menu']['header']) ? '' : $mid->MakeHeader()) . $mid->getTreeMenu($this->mName) . ($this->mComments ? '<!-- end ' . $this->mName . ' treevmenu -->' . "\n" : '');
$GLOBALS['gEnv']['runtime']['wui_menu']['header'] = true;
$GLOBALS['gEnv']['runtime']['wui_menu']['footer'] = $mid->MakeFooter();
return true;
}
示例3: __construct
public function __construct($rrootDb, $id = '')
{
$this->mLog = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLogger();
$this->mWebServicesLog = new \Innomatic\Logging\Logger(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/log/webservices.log');
$this->mId = $id;
if (is_object($rrootDb)) {
$this->mrRootDb = $rrootDb;
} else {
$this->mLog->logEvent('innomatic.webservicesaccount', 'Invalid Innomatic database handler', \Innomatic\Logging\Logger::ERROR);
}
if ($this->mId) {
$acc_query = $this->mrRootDb->execute('SELECT * ' . 'FROM webservices_accounts ' . 'WHERE id=' . (int) $this->mId);
if ($acc_query->getNumberRows()) {
$acc_data = $acc_query->getFields();
$this->mName = $acc_data['name'];
$this->mHost = $acc_data['host'];
$this->mPort = $acc_data['port'];
$this->mPath = $acc_data['path'];
$this->mUsername = $acc_data['username'];
$this->mPassword = $acc_data['password'];
$this->mProxy = $acc_data['proxy'];
$this->mProxyPort = $acc_data['proxyport'];
} else {
$this->mLog->logEvent('innomatic.webservicesaccount', 'Invalid account id', \Innomatic\Logging\Logger::ERROR);
}
}
}
示例4: getHTML
public function getHTML()
{
$locale_catalog = new \Innomatic\Locale\LocaleCatalog('innowork-core::misc', InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
$theme = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->getTheme();
$icon = $theme->mIconsBase . $theme->mIconsSet['light']['trash']['base'] . '/light/' . $theme->mIconsSet['light']['trash']['file'];
return '<a href="' . \Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('1innoworkcore', array(array('view', 'trashcan', ''))) . '" alt="' . $locale_catalog->getStr('trashcan.menu') . '"><img width="25" height="25" align="right" src="' . $icon . '" alt="' . $locale_catalog->getStr('trashcan.menu') . '" /></a>';
}
示例5: updateDependencies
/**
* Updates composer dependencies.
*/
public function updateDependencies()
{
$container = InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
// Keep track of the current directory
$previousDirectory = getcwd();
// Retrieve the Innomatic Platform root directory
$platformHome = RootContainer::instance('\\Innomatic\\Core\\RootContainer')->getPlatformHome();
// Switch current directory to the Innomatic Platform root
chdir($platformHome);
// Call composer install command
$input = new ArrayInput(array('command' => 'update'));
if ($container->getInterface() == InnomaticContainer::INTERFACE_CONSOLE) {
$output = new ConsoleOutput();
} else {
$output = new BufferedOutput();
}
$application = new ComposerApplication();
// Prevent application run method from exiting the script
$application->setAutoExit(false);
$application->run($input, $output);
// Switch back to the previous current directory
chdir($previousDirectory);
// Switch back to the standard Innomatic PHP error handler
set_error_handler(array($container, 'errorHandler'));
}
示例6: callHooks
public function callHooks($event, $obj, $args = '')
{
$result = false;
if ($this->rootdataaccess) {
$query = $this->rootdataaccess->execute('SELECT * FROM hooks WHERE functionapplication=' . $this->rootdataaccess->formatText($this->application) . ' AND function=' . $this->rootdataaccess->formatText($this->function) . ' AND event=' . $this->rootdataaccess->formatText($event));
if ($query) {
$result = Hook::RESULT_OK;
$innomatic = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
while (!$query->eof) {
$data = $query->getFields();
if ($innomatic->getState() == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) {
$dump = \Innomatic\Debug\InnomaticDump::instance('\\Innomatic\\Debug\\InnomaticDump');
$dump->hooks[$this->application . '::' . $this->function . '::' . $event][] = $data['hookhandler'] . ' - ' . $data['hookmethod'];
}
require_once 'shared/hooks/' . $data['hookhandler'];
// let the 'class::function' syntax be accepted in dispatch maps
if (is_string($data['hookmethod']) && strpos($data['hookmethod'], '::')) {
$data['hookmethod'] = explode('::', $data['hookmethod']);
}
// verify that function to be invoked is in fact callable
if (!is_callable($data['hookmethod'])) {
continue;
}
$func_result = call_user_func($data['hookmethod'], $obj, $args);
if ($func_result == Hook::RESULT_ABORT) {
$result = Hook::RESULT_ABORT;
}
$query->moveNext();
}
}
}
return $result;
}
示例7: execute
public function execute()
{
$result = true;
// TODO Update version check
// PHP version check
if (!(ereg("[4-9]\\.[1-9]\\.[0-9].*", phpversion()) or ereg("[5-9]\\.[0-9]\\.[0-9].*", phpversion()))) {
$result = false;
}
// File upload support
if (!(ini_get('file_uploads') == '1')) {
$result = false;
}
// XML support
if (!function_exists('xml_set_object')) {
$result = false;
}
// Zlib support
if (!function_exists('gzinflate')) {
$result = false;
}
// Database support
if (!(function_exists('mysqli_connect') or function_exists('pg_connect'))) {
$result = false;
}
// Applications extensions
$app_deps = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT moddep FROM applications_dependencies WHERE moddep LIKE ' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->formatText('%.extension'));
while (!$app_deps->eof) {
$dep = substr($app_deps->getFields('moddep'), 0, -10);
if (!extension_loaded($dep)) {
$result = false;
}
$app_deps->moveNext();
}
return $result;
}
示例8: ajaxGetDashboardWidget
public static function ajaxGetDashboardWidget($name)
{
$container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
$objResponse = new XajaxResponse();
$xml = '<void/>';
$domain_da = $container->getCurrentDomain()->getDataAccess();
$perm = new \Innomatic\Desktop\Auth\DesktopPanelAuthorizator($domain_da, $container->getCurrentUser()->getGroup());
// Check if the widget exists in the widgets list
$widget_query = $domain_da->execute('SELECT * FROM domain_dashboards_widgets WHERE name=' . $domain_da->formatText($name));
if ($widget_query->getNumberRows() > 0) {
$allowed = true;
$panel = $widget_query->getFields('panel');
// Do not show widgets tied to a panel when the panel is not accessible to the current user
if (strlen($panel)) {
$node_id = $perm->getNodeIdFromFileName($panel);
if ($perm->check($node_id, \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODETYPE_PAGE) == \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODE_NOTENABLED) {
$allowed = false;
}
}
if ($allowed) {
$class = $widget_query->getFields('class');
// Check if the class exists
if (class_exists($class, true)) {
// Fetch the widget xml definition
$widget = new $class();
$xml = $widget->getWidgetXml();
}
}
}
// Create the widget html and send it to the dashboard
$html = WuiXml::getContentFromXml('', $xml);
$objResponse->addAssign('widget_' . $name, 'innerHTML', $html);
return $objResponse;
}
示例9: __construct
public function __construct(\Innomatic\Dataaccess\DataAccess $rrootDb, $application, $itemId, $domainId = 0, $userId = 0)
{
$this->cachePath = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/temp/cache/';
$domainId = (int) $domainId;
$userId = (int) $userId;
$this->mrRootDb = $rrootDb;
if (!$rrootDb->isConnected()) {
$this->mResult = CachedItem::ITEM_NOT_FOUND;
} else {
if (strlen($itemId) and strlen($application)) {
$this->mItemId = $itemId;
$this->mApplication = $application;
$this->mDomainId = $domainId;
$this->mUserId = $userId;
$item_query = $this->mrRootDb->execute('SELECT itemfile,validator,domainid,userid FROM cache_items WHERE application=' . $this->mrRootDb->formatText($this->mApplication) . ' AND itemid=' . $this->mrRootDb->formatText($this->mItemId) . ($domainId ? ' AND domainid=' . $domainId : '') . ($userId ? ' AND userid=' . $userId : ''));
if ($item_query->getNumberRows()) {
$this->mValidator = $item_query->getFields('validator');
$this->mItemFile = $this->cachePath . $item_query->getFields('itemfile');
$this->mDomainId = $item_query->getFields('domainid');
$this->mUserId = $item_query->getFields('userid');
$this->mResult = CachedItem::ITEM_FOUND;
} else {
$this->mResult = CachedItem::ITEM_NOT_FOUND;
}
}
}
}
示例10: __construct
public function __construct($elemName, $elemArgs = '', $elemTheme = '', $dispEvents = '')
{
parent::__construct($elemName, $elemArgs, $elemTheme, $dispEvents);
$container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
if (isset($this->mArgs['hint'])) {
$this->mHint = $this->mArgs['hint'];
}
if (isset($this->mArgs['value'])) {
$this->mValue = $this->mArgs['value'];
}
if (isset($this->mArgs['disp'])) {
$this->mDisp = $this->mArgs['disp'];
}
if (isset($this->mArgs['tabindex'])) {
$this->mTabIndex = $this->mArgs['tabindex'];
}
if (isset($this->mArgs['country']) and strlen($this->mArgs['country'])) {
$this->mCountry = $this->mArgs['country'];
} else {
if ($container->isDomainStarted()) {
$this->mCountry = $container->getCurrentUser()->getCountry();
} else {
$this->mCountry = $container->getCountry();
}
}
if (isset($this->mArgs['language']) and strlen($this->mArgs['language'])) {
$this->mLanguage = $this->mArgs['language'];
} else {
if ($container->isDomainStarted()) {
$this->mLanguage = $container->getCurrentUser()->getLanguage();
} else {
$this->mLanguage = $container->getLanguage();
}
}
$this->mLocaleCountryHandler = new \Innomatic\Locale\LocaleCountry($this->mCountry);
$this->mLocaleHandler = new \Innomatic\Locale\LocaleCatalog('innomatic::wui', $this->mLanguage);
if (isset($this->mArgs['readonly'])) {
$this->mReadOnly = $this->mArgs['readonly'];
}
if (isset($this->mArgs['type'])) {
switch ($this->mArgs['type']) {
case 'date':
$this->mSize = 10;
$this->mMaxLength = 10;
$this->mType = $this->mArgs['type'];
break;
case 'time':
$this->mSize = 8;
$this->mMaxLength = 8;
$this->mType = $this->mArgs['type'];
break;
case 'shorttime':
$this->mSize = 5;
$this->mMaxLength = 5;
$this->mType = $this->mArgs['type'];
break;
}
}
}
示例11: __construct
public function __construct(\Innomatic\Dataaccess\DataAccessSourceName $dasn)
{
$this->dasn = $dasn;
$this->innomatic = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
if ($this->innomatic->getConfig()->value('RootDatabaseDebug') == '1') {
$this->debug = true;
}
}
示例12: __construct
public function __construct($groupid = 0)
{
$this->container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
$this->mrRootDb = $this->container->getDataAccess();
$this->mrDomainDA = $this->container->getCurrentDomain()->getDataAccess();
$this->domainserial = $this->container->getCurrentDomain()->domaindata['id'];
$this->groupid = $groupid;
}
示例13: _fillDefinition
protected function _fillDefinition()
{
$result = false;
$this->mDefinition = '';
if ($this->mArgs['frame'] == 'true') {
$this->mDefinition .= '<horizframe><name>toolbarframe</name><children>';
} else {
$this->mDefinition .= '<horizgroup><children>';
}
if (is_array($this->mArgs['toolbars'])) {
while (list($tbar_name, $tbar) = each($this->mArgs['toolbars'])) {
if (is_array($tbar)) {
$this->mDefinition .= '<' . ($this->mArgs['toolbar'] == 'true' ? 'toolbar' : 'horizgroup') . '>
<name>' . $tbar_name . '</name>
<children>';
while (list($button_name, $button) = each($tbar)) {
$this->mDefinition .= '<button>
<name>' . $button_name . '</name>
<args><label type="encoded">' . urlencode($button['label']) . '</label><themeimage>' . (isset($button['themeimage']) ? $button['themeimage'] : '') . '</themeimage><themeimagetype>' . (isset($button['themeimagetype']) ? $button['themeimagetype'] : '') . '</themeimagetype><image>' . (isset($button['image']) ? \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getBaseUrl(false) . '/shared/' . $button['image'] : '') . '</image><action type="encoded">' . urlencode(isset($button['action']) ? $button['action'] : '') . '</action>';
if (isset($button['needconfirm']) and isset($button['confirmmessage']) and $button['needconfirm'] == 'true' and strlen($button['confirmmessage'])) {
$this->mDefinition .= '<needconfirm>true</needconfirm><confirmmessage type="encoded">' . urlencode($button['confirmmessage']) . '</confirmmessage>';
}
if (isset($button['horiz'])) {
$this->mDefinition .= '<horiz>' . $button['horiz'] . '</horiz>';
}
if (isset($button['disabled'])) {
$this->mDefinition .= '<disabled>' . $button['disabled'] . '</disabled>';
}
if (isset($button['target'])) {
$this->mDefinition .= '<target>' . $button['target'] . '</target>';
}
if (isset($button['compact'])) {
$this->mDefinition .= '<compact>' . $button['compact'] . '</compact>';
}
if (isset($button['hint'])) {
$this->mDefinition .= '<hint type="encoded">' . urlencode($button['hint']) . '</hint>';
}
if (isset($button['formsubmit'])) {
$this->mDefinition .= '<formsubmit>' . $button['formsubmit'] . '</formsubmit>';
}
if (isset($button['nowrap'])) {
$this->mDefinition .= '<nowrap>' . $button['nowrap'] . '</nowrap>';
}
$this->mDefinition .= '</args>
</button>';
}
$this->mDefinition .= '</children>
</' . ($this->mArgs['toolbar'] == 'true' ? 'toolbar' : 'horizgroup') . '>';
}
}
}
if ($this->mArgs['frame'] == 'true') {
$this->mDefinition .= '</children></horizframe>';
} else {
$this->mDefinition .= '</children></horizgroup>';
}
return $result;
}
示例14: ___construct
/**
* Class constructor.
*
* @since 5.1
*/
public function ___construct()
{
$home = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome();
if (substr($home, -1) != '/' and substr($home, -1) != '\\') {
$home .= DIRECTORY_SEPARATOR;
}
$this->home = $home;
$this->config = new \Innomatic\Module\Server\ModuleServerConfig($this->home . 'core/conf/modules.ini');
}
示例15: domain_group_remove_groupremoved
public static function domain_group_remove_groupremoved($obj, $args)
{
$domain_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->formatText($args['domainserial']));
\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->startDomain($domain_query->getFields('domainid'));
$tmp_domain = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain();
$tmp_domain->getDataAccess()->execute('DELETE FROM innowork_core_acls WHERE groupid=' . $args['groupid']);
\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->stopDomain();
return Hook::RESULT_OK;
}