$koala->alert($itext['TXT_ERROR_ACCESS_DENIED']); } break; case 'copyPage': $sourcesite = $this->params['sourceSite']; $source = $this->params['source']; $targetsite = $this->params['targetSite']; $target = $this->params['target']; $recursive = $this->params['recursive']; $parentwindow = $this->params['openerRef']; $crosssite = false; if ($targetsite != $sourcesite) { $crosssite = true; } $jsQueue = new JSQueue(NULL, $targetsite); $extensionMgr = new ExtensionMgr(); $permissionDenied = false; if ($recursive == 0) { // Not recursive $oldpage = $source; $SourcePageMgr = new PageMgr($sourcesite); $sourcePage = $SourcePageMgr->getPage($source); $oldPageInfo = $sourcePage->get(); $oldpagepid = $oldPageInfo["ID"]; $TargetPageMgr = new PageMgr($targetsite); $targetPage = $TargetPageMgr->getPage($target); $newPageID = $TargetPageMgr->add($target); if (!$newPageID) { $permissionDenied = true; } else { $newPage = $TargetPageMgr->getPage($newPageID);
} if ($controlFormfields[$w]['FORMFIELD'] == 8) { $pageMgr = new PageMgr($co_site); $info = $pageMgr->tags->get($controlFormfields[$w]['VALUE01']); $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } $cos[0]['ENTRYMASKS'][$c]['FORMFIELDS'] = $controlFormfields; } $cos[0]['LINKID'] = $cos[0]['ENTRYMASKS'][0]['LINKID']; $output = $cos; } } } elseif (substr($objectType, 0, 3) == 'ext') { // extension mode $extensionMgr = new ExtensionMgr(); $filetypeMgr = new Filetypes(); $loop = 0; foreach ($data as $item) { $coid = $item[0]; $contentarea = $item[1]; $contentarea_id = $item[2]; $colnkid = $item[3]; $extension_id = explode('-', $item[3]); $extension_id = $extension_id[1]; $ex = $extensioninfo = $extensionMgr->get($extension_id); $extension = $extensionMgr->getExtension($ex["CODE"], $pageID, $pageInfo['VERSION'], $siteID); if ($extension) { $props = $extension->properties->getList('LISTORDER'); foreach ($props as $prop_idx => $prop) { $props[$prop_idx]['VALUE'] = $extension->properties->getValueInternal($prop['IDENTIFIER']);
$refresh = $this->request->parameters['refresh']; $roleid = $this->request->parameters['yg_id']; $roleid = explode('-', $roleid); $roleid = $roleid[0]; $isRORole = false; // Check if role is rootrole $rootGroupId = (int) sConfig()->getVar("CONFIG/SYSTEMUSERS/ROOTGROUPID"); $anonGroupId = (int) sConfig()->getVar("CONFIG/SYSTEMUSERS/ANONGROUPID"); if ($rootGroupId == $roleid) { $isRORole = true; } $maxlevels = 3; $objecttype = $site = 'system'; $privileges = sUsergroups()->permissions->getByUsergroup($roleid); $objects = array(array('ID' => 99, 'NAME' => $itext['TXT_PERM_YEAGER_LOGIN'] ? $itext['TXT_PERM_YEAGER_LOGIN'] : '******', 'LEVEL' => 1, 'PARENT' => 0, 'RREAD' => $privileges['RBACKEND'], 'CHILDREN' => 25), array('ID' => 1, 'NAME' => $itext['TXT_PERM_PAGES'] ? $itext['TXT_PERM_PAGES'] : '$TXT_PERM_PAGES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RPAGES']), array('ID' => 2, 'NAME' => $itext['TXT_PERM_CONTENTBLOCKS'] ? $itext['TXT_PERM_CONTENTBLOCKS'] : 'TXT_PERM_CONTENTBLOCKS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RCONTENTBLOCKS']), array('ID' => 3, 'NAME' => $itext['TXT_PERM_FILES'] ? $itext['TXT_PERM_FILES'] : '$TXT_PERM_FILES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RFILES']), array('ID' => 4, 'NAME' => $itext['TXT_PERM_TAGS'] ? $itext['TXT_PERM_TAGS'] : '$TXT_PERM_TAGS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RTAGS']), array('ID' => 21, 'NAME' => $itext['TXT_PERM_COMMENTS'] ? $itext['TXT_PERM_COMMENTS'] : '$TXT_PERM_COMMENTS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RCOMMENTS']), array('ID' => 19, 'NAME' => $itext['TXT_PERM_MAILINGS'] ? $itext['TXT_PERM_MAILINGS'] : '$TXT_PERM_MAILINGS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RMAILINGS']), array('ID' => 12, 'NAME' => $itext['TXT_PERM_TEMPLATES'] ? $itext['TXT_PERM_TEMPLATES'] : '$TXT_PERM_TEMPLATES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RTEMPLATES']), array('ID' => 13, 'NAME' => $itext['TXT_PERM_ENTRYMASKS'] ? $itext['TXT_PERM_ENTRYMASKS'] : '$TXT_PERM_ENTRYMASKS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RENTRYMASKS']), array('ID' => 11, 'NAME' => $itext['TXT_PERM_SITES'] ? $itext['TXT_PERM_SITES'] : '$TXT_PERM_SITES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RSITES']), array('ID' => 10, 'NAME' => $itext['TXT_PERM_DATA'] ? $itext['TXT_PERM_DATA'] : '$TXT_PERM_DATA', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RDATA']), array('ID' => 5, 'NAME' => $itext['TXT_PERM_USER'] ? $itext['TXT_PERM_USER'] : '******', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RUSERS']), array('ID' => 6, 'NAME' => $itext['TXT_PERM_USERGROUPS'] ? $itext['TXT_PERM_USERGROUPS'] : '$TXT_PERM_USERGROUPS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RUSERGROUPS']), array('ID' => 14, 'NAME' => $itext['TXT_PERM_PROPERTIES'] ? $itext['TXT_PERM_PROPERTIES'] : '$TXT_PERM_PROPERTIES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RPROPERTIES']), array('ID' => 15, 'NAME' => $itext['TXT_PERM_FILETYPES'] ? $itext['TXT_PERM_FILETYPES'] : '$TXT_PERM_FILETYPES', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RFILETYPES']), array('ID' => 16, 'NAME' => $itext['TXT_PERM_VIEWS'] ? $itext['TXT_PERM_VIEWS'] : '$TXT_PERM_VIEWS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RVIEWS']), array('ID' => 17, 'NAME' => $itext['TXT_PERM_COMMENTS_CONFIG'] ? $itext['TXT_PERM_COMMENTS_CONFIG'] : '$TXT_PERM_COMMENTS_CONFIG', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RCOMMENTCONFIG']), array('ID' => 20, 'NAME' => $itext['TXT_PERM_MAILINGS_CONFIG'] ? $itext['TXT_PERM_MAILINGS_CONFIG'] : '$TXT_PERM_MAILINGS_CONFIG', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RMAILINGCONFIG']), array('ID' => 7, 'NAME' => $itext['TXT_PERM_PAGE_EXTENSIONS'] ? $itext['TXT_PERM_PAGE_EXTENSIONS'] : '$TXT_PERM_PAGE_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXTENSIONS_PAGE']), array('ID' => 22, 'NAME' => $itext['TXT_PERM_MAILING_EXTENSIONS'] ? $itext['TXT_PERM_MAILING_EXTENSIONS'] : '$TXT_PERM_MAILING_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXTENSIONS_MAILING']), array('ID' => 23, 'NAME' => $itext['TXT_PERM_FILE_EXTENSIONS'] ? $itext['TXT_PERM_FILE_EXTENSIONS'] : '$TXT_PERM_FILE_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXTENSIONS_FILE']), array('ID' => 24, 'NAME' => $itext['TXT_PERM_CBLOCK_EXTENSIONS'] ? $itext['TXT_PERM_CBLOCK_EXTENSIONS'] : '$TXT_PERM_CBLOCK_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXTENSIONS_CBLOCK']), array('ID' => 8, 'NAME' => $itext['TXT_PERM_IMPORT_EXTENSIONS'] ? $itext['TXT_PERM_IMPORT_EXTENSIONS'] : '$TXT_PERM_IMPORT_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RIMPORT']), array('ID' => 9, 'NAME' => $itext['TXT_PERM_EXPORT_EXTENSIONS'] ? $itext['TXT_PERM_EXPORT_EXTENSIONS'] : '$TXT_PERM_EXPORT_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXPORT']), array('ID' => 18, 'NAME' => $itext['TXT_PERM_COLISTVIEW_EXTENSIONS'] ? $itext['TXT_PERM_COLISTVIEW_EXTENSIONS'] : '$TXT_PERM_COLISTVIEW_EXTENSIONS', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['REXTENSIONS_CBLISTVIEW']), array('ID' => 25, 'NAME' => $itext['TXT_PERM_UPDATER'] ? $itext['TXT_PERM_UPDATER'] : '$TXT_PERM_UPDATER', 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $privileges['RUPDATER'])); $extensionMgr = new ExtensionMgr(); $extensions = $extensionMgr->getList(0, true, true); foreach ($extensions as $extensionItem) { $extPrivileges = sUsergroups()->permissions->getList($extensionItem['CODE']); if (count($extPrivileges) > 0) { foreach ($extPrivileges as $extPrivilegeItem) { $permissions = sUsergroups()->permissions->getByUsergroup($roleid, $extensionItem['CODE']); $permValue = $permissions[$extPrivilegeItem['PRIVILEGE']]; $objects[] = array('ID' => (int) $extPrivilegeItem['ID'] + 1000, 'NAME' => $extPrivilegeItem['NAME'], 'LEVEL' => 2, 'PARENT' => 99, 'RREAD' => $permValue); } } } $objects[0]['CHILDREN'] = count($objects) - 1; $objectInfo = sUsergroups()->get($roleid); $object_permissions = array(); $object_permissions["RWRITE"] = sUsergroups()->usergroupPermissions->checkInternal(sUserMgr()->getCurrentUserID(), $roleid, "RWRITE");
$siteID = $data[1]; switch ($this->request->parameters['yg_type']) { case 'page': $objecttype = 'extpage'; break; case 'cblock': $objecttype = 'extcblock'; break; case 'file': $objecttype = 'extfile'; break; case 'mailing': $objecttype = 'extmailing'; break; } $extensionMgr = new ExtensionMgr(); switch ($objecttype) { case 'extcblock': if ($objectID) { $cblock = sCblockMgr()->getCblock($objectID); $cblockInfo = $cblock->get(); $cblockInfo['RWRITE'] = $cblock->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE"); $cblockInfo['RSTAGE'] = $cblock->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSTAGE"); if ($cblockInfo['DELETED']) { $cblockInfo['RWRITE'] = false; $cblockInfo['READONLY'] = true; $cblockInfo['RSTAGE'] = false; } // Get current locks for this token (and unlock them) $lockToken = sGuiUS() . '_' . $this->request->parameters['win_no']; $lockedObjects = sCblockMgr()->getLocksByToken($lockToken);
/** * Calls a specific Extension hook Callback method * * @param string $method * @param int $siteId Site Id * @param int $pageId Page Id * @param int $version Page version * @param mixed $args Arbitrary arguments */ function callExtensionHook($method, $siteId, $pageId, $version, $args) { $extensions = new ExtensionMgr($this->_db, $this->_uid); $all_page_extensions = $extensions->getList(EXTENSION_PAGE, true); $extarr = array(); foreach ($all_page_extensions as $all_page_extension) { $extension = $extensions->getExtension($all_page_extension["CODE"]); if ($extension && $extension->usedByPage($pageId, $version, $siteId) === true) { $extension = $extensions->getExtension($all_page_extension["CODE"], $pageId, $version, $siteId); if ($extension) { array_push($extarr, $extension); } } } foreach ($extarr as $extension) { $extension->callExtensionHook($method, $args); } }
/** * Calls a specific Extension hook Callback method * * @param string $callbackName * @param mixed ... (any type of parameters) */ function callExtensionHook() { $args = func_get_args(); $extensionMgr = new ExtensionMgr(); $all_extensions = $extensionMgr->getList(EXTENSION_ALL, true); foreach ($all_extensions as $all_extension_item) { $extension = $extensionMgr->getExtension($all_extension_item['CODE']); if ($extension) { return call_user_func_array(array($extension, 'callExtensionHook'), $args); } } }
case 'internal': $target_type = 'PAGE'; $history[$i]['NEWVALUE'] = '<div class="iconpage"></div>' . $linkInfo['NAME']; break; case 'file': $target_type = 'FILE'; $history[$i]['NEWVALUE'] = '<span onmouseover="$K.yg_hoverFileHint(\'' . $linkInfo['INFO']['FILE_ID'] . '\', event);"><span style="display:inline-block;" class="filetype ' . $linkInfo['INFO']['COLOR'] . '">' . $linkInfo['INFO']['CODE'] . '</span> ' . "<a onclick=\"\$K.yg_openObjectDetails('" . $linkInfo['INFO']['FILE_ID'] . "', 'file', '" . $linkInfo['NAME'] . "', {color:'" . $linkInfo['INFO']['COLOR'] . "',typecode:'" . $linkInfo['INFO']['CODE'] . "'});\">" . $linkInfo['NAME'] . "</a></span>"; break; } } } } } // For Extension-Logging if ($history[$i]['TEXT'] == 'TXT_EXTENSION_H_LOGENTRY') { $extensionManager = new ExtensionMgr(); $extensionInfo = $extensionManager->get($history[$i]['OLDVALUE']); $history[$i]['NEWVALUE'] = '<div class="modified">' . $extensionInfo['NAME'] . ' <em>' . $history[$i]['NEWVALUE'] . '</em></div>'; } $lastuserid = $history[$i]["UID"]; $tKey = $history[$i]['TEXT']; $pKey = $history[$i]['TAB']; $dKey = $history[$i]['DATETIME']; // Only get history entries for Yeager if (strpos($tKey, 'TXT_') === 0) { $show_entry = false; if ($filterAction == 'ONLY_VERSIONS') { if ($pKey == 'P_VERSIONS') { $show_entry = true; } else { $show_entry = false;
/** * Copies Extensions from another Mailing to this Mailing * * @param object $sourceObject Source Mailing object */ function copyExtensionsFrom(&$sourceObject) { $sourceId = $sourceObject->getID(); $sourceVersion = $sourceObject->getVersion(); $targetId = $this->getID(); $targetVersion = $this->getVersion(); $extensions = new ExtensionMgr(sYDB(), $this->_uid); $all_extensions = $extensions->getList(EXTENSION_MAILING, true); foreach ($all_extensions as $all_extension) { $extension = $extensions->getExtension($all_extension['CODE']); if ($extension && $extension->usedByMailing($sourceId, $sourceVersion) === true) { if ($extension->usedByMailing($targetId, $targetVersion) !== true) { $newfid = $extension->addToMailingInternal($targetId, $targetVersion); } $extension = $extensions->getExtension($all_extension['CODE'], $targetId, $targetVersion); $sourceext = $extensions->getExtension($all_extension['CODE'], $sourceId, $sourceVersion); if ($extension && $sourceext) { $newfid = $extension->getPropertyId(); $oldfid = $sourceext->getPropertyId(); $extension->properties->copyTo($oldfid, $newfid); } } } }
$smarty->assign('phone', $phone); $smarty->assign('fax', $fax); $smarty->assign('mobile', $mobile); $smarty->assign('website', $website); $smarty->assign('password', $password); } break; case 'usergroup': $no_traceline = true; $autosave = true; $object_permissions['RWRITE'] = sUsergroups()->usergroupPermissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, 'RWRITE'); $objectInfo = sUsergroups()->get($object); $objectdynprops = array(0 => array(0 => 'Name', 'NAME' => 'Name', 1 => 1, 'ID' => 1, 2 => 'NAME', 'IDENTIFIER' => 'NAME', 3 => 1, 'VISIBLE' => 1, 4 => 'TEXT', 'TYPE' => 'TEXT', 5 => $objectInfo['NAME'], 'VALUE' => $objectInfo['NAME'])); break; case 'extension': $extensionMgr = new ExtensionMgr(); $autosave = false; $objectInfo = $extensionMgr->get($object); if ($objectInfo["CODE"]) { $extension = $extensionMgr->getExtension($objectInfo["CODE"]); if ($extension && $objectInfo["INSTALLED"]) { switch ($siteID) { case 'extpage': if ($siteID == 'extpage') { $object_permissions['RWRITE'] = $user->checkPermission("REXTENSIONS_PAGE"); } case 'extcblock': if ($siteID == 'extcblock') { $object_permissions['RWRITE'] = $user->checkPermission("REXTENSIONS_CBLOCK"); } case 'extfile':
<?php $pageID = $this->params['page']; $siteID = $this->params['site']; if ($pageID && $siteID && is_numeric($siteID)) { $PageMgr = new PageMgr($siteID); $page = $PageMgr->getPage($pageID); $pageInfo = $page->get(); } $jsQueue = new JSQueue(NULL); $extensionMgr = new ExtensionMgr(); switch ($action) { case 'extensionExportData': $extensionid = $this->params['extensionId']; $uploadwinid = $this->params['uploadWinId']; $openerwinid = $this->params['openerWinId']; $extensioninfo = $extensionMgr->get($extensionid); if ($extensioninfo['CODE']) { $extension = $extensionMgr->getExtension($extensioninfo['CODE']); if ($extension) { $filelist = array(); $extension->export($filelist); $koala->callJSFunction('Koala.windows[\'wid_' . $uploadwinid . '\'].setCaption', $itext['TXT_EXPORT_FILES'], 'extensionexport'); $koala->queueScript('Koala.windows[\'' . $openerwinid . '\'].tabs.select(0, Koala.windows[\'' . $openerwinid . '\'].tabs.params);'); $fileIdx = 1; foreach ($filelist as $file) { $koala->callJSFunction('Koala.yg_addExtensionExportFile', $uploadwinid, $extensionid, $fileIdx, $file['FILENAME'], $file['MIME']); $fileIdx++; } // Clear all properties after export $properties = $extension->exportProperties->getList();
/** * Logs a message to the History tab of the Cblock * * @param string $message Message */ public function log($message) { if ($this->history) { $extensionManager = new ExtensionMgr(); $extensionInfo = $this->getInfo(); $this->history->add(HISTORYTYPE_CO, $extensionManager->getIdByCode($extensionInfo['CODE']), $message, 'TXT_EXTENSION_H_LOGENTRY'); } }
/** * Refreshes the internal list of Extensions * * @param string $dir Extension directory */ function refreshList($dir) { $moduledirs = getdirlist($dir); for ($m = 0; $m < count($moduledirs); $m++) { $path = $moduledirs[$m]; if (file_exists($dir . $path . "/extension.php") && file_exists($dir . $path . "/extension.xml")) { if (!$this->getIdByPath($path)) { $extConfig = new \framework\Config($dir . $path . "/extension.xml"); $extApiVersion = explode('.', (string) $extConfig->getVar("extension/api")); if ($extApiVersion[0] != EXTENSION_VERSION_MAJOR) { sLog()->error('Extension: API Version mismatch. Expected v' . EXTENSION_VERSION_MAJOR . '.x, Extension has v' . $extApiVersion[0] . '.x!'); return false; } require_once $dir . $path . "/extension.php"; $namespace = (string) $extConfig->getVar("extension/namespace"); $classname = $namespace . "\\" . (string) $extConfig->getVar("extension/class"); $code = strtolower(preg_replace("/[^A-Za-z0-9]/", "_", $classname)); try { $extension = new $classname(); } catch (Exception $e) { return; } $info = $extension->getInfo(); if ($this->getIdByCode($code) == NULL) { $this->add($code, $path, $info["NAME"], $info["DEVELOPERNAME"], $info["VERSION"], $info["DESCRIPTION"], $info["URL"], $info["TYPE"]); } } } } // Remove orphaned extensions from database $currentExtensions = $this->getList(0, false, true); foreach ($currentExtensions as $currentExtensionItem) { if (!$currentExtensionItem['INSTALLED'] && !in_array($currentExtensionItem['PATH'], $moduledirs)) { $currExtension = new Extension($currentExtensionItem['CODE']); $currExtension->uninstall(); $extMgr = new ExtensionMgr(); $extMgr->remove($currentExtensionItem['CODE']); } } }
break; case 'data': $adminAllowed = $tmpUser->checkPermission('RDATA'); switch ($extensiontype) { default: case 'import': $extensiontype = EXTENSION_IMPORT; break; case 'export': $extensiontype = EXTENSION_EXPORT; break; } break; } if ($adminAllowed) { $extensionMgr = new ExtensionMgr(); $extensionMgr->refreshList($this->approot . $this->extensiondir); $extensions = $extensionMgr->getList($extensiontype, $only_installed, true); // Filter out self-controlled extensions if ($selectiondialog || $objecttype == 'data') { $real_extensions = array(); foreach ($extensions as $extensionItem) { $currExtension = $extensionMgr->getExtension($extensionItem['CODE']); if ($currExtension && $currExtension->info['ASSIGNMENT'] != EXTENSION_ASSIGNMENT_EXT_CONTROLLED) { $real_extensions[] = $extensionItem; } } $extensions = $real_extensions; } } $smarty->assign('mode', $mode);
/** * Calls a specific Extension hook Callback method * * @param string $method * @param int $fileId File Id * @param int $version File version * @param mixed $args Arbitrary arguments */ function callExtensionHook($method, $fileId, $version, $args) { $extensions = new ExtensionMgr($this->_db, $this->_uid); $all_file_extensions = $extensions->getList(EXTENSION_FILE, true); $extarr = array(); foreach ($all_file_extensions as $all_file_extension) { $extension = $extensions->getExtension($all_file_extension['CODE']); if ($extension && $extension->usedByFile($fileId, $version) === true) { $extension = $extensions->getExtension($all_file_extension['CODE'], $fileId, $version); if ($extension) { array_push($extarr, $extension); } } } foreach ($extarr as $extension) { $extension->callExtensionHook($method, $args); } }
<?php $extensionMgr = new ExtensionMgr(); $extensionId = $this->request->parameters['extensionId']; $fileName = $this->request->parameters['fileName']; $mimeType = $this->request->parameters['mimeType']; $extensionInfo = $extensionMgr->get($extensionId); if ($extensionInfo['CODE']) { $extension = $extensionMgr->getExtension($extensionInfo['CODE']); if ($extension) { $extension->fetchFile($fileName, $mimeType, $this->approot . $this->extensiondir); } }
$cblocks = sCblockMgr()->getList(); $cblockID = $cblocks[0]['ID']; } // Add new child node $new_id = sCblockMgr()->add($cblockID, 1, $itext['TXT_NEW_FOLDER'] != '' ? $itext['TXT_NEW_FOLDER'] : '$TXT_NEW_FOLDER'); if ($new_id != false) { $jsQueue->add($new_id, HISTORYTYPE_CO, 'CBLOCK_ADD', sGuiUS(), NULL); } else { $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']); } break; case 'addCBlock': $cblockID = (int) $this->params['cblock']; $mode = $this->params['mode']; $coListExtensionId = (int) $this->params['coListExtensionId']; $extensionMgr = new ExtensionMgr(); // Check if root node is selected if ($cblockID === 'root') { // Get real CBlock-ID of Root-Node $cblocks = sCblockMgr()->getList(); $cblockID = $cblocks[0]['ID']; } // Check if copying a template cblock is requested (or creating a new one) $copyCBlock = false; if ($mode == 'list') { if ($coListExtensionId == 0) { $listviewExtensions = $extensionMgr->getList(EXTENSION_CBLOCKLISTVIEW, true); // Find default extension foreach ($listviewExtensions as $listviewExtension) { if ($listviewExtension['CODE'] == 'defaultCblockListView') { $coListExtensionId = $listviewExtension['ID'];
/** * Calls a specific Extension hook Callback method * * @param string $method * @param int $mailingId Mailing Id * @param int $version Mailing version * @param mixed $args Arbitrary arguments */ function callExtensionHook($method, $mailingId, $version, $args) { $extensions = new ExtensionMgr($this->_db, $this->_uid); $all_mailing_extensions = $extensions->getList(EXTENSION_MAILING, true); $extarr = array(); foreach ($all_mailing_extensions as $all_mailing_extension) { $extension = $extensions->getExtension($all_mailing_extension['CODE']); if ($extension && $extension->usedByMailing($mailingId, $version) === true) { $extension = $extensions->getExtension($all_mailing_extension['CODE'], $mailingId, $version); if ($extension) { array_push($extarr, $extension); } } } $origargs = $args; $ext_result = false; foreach ($extarr as $extension) { $ext_result = $extension->callExtensionHook($method, $args); if ($ext_result && $method == "beforeSend") { $args = $ext_result; } } if ($ext_result === false) { return $origargs; } else { return $ext_result; } }
$coId = $this->request->parameters['coId']; $listViewExtensionId = $this->request->parameters['listViewExtensionId']; $wid_id = explode('_', $wid); $wid_id = $wid_id[1]; $coFolderID = explode('-', $ygid); $coFolderID = $coFolderID[0]; $sortcol = $this->request->parameters['pagedir_orderby']; $sortorder = $this->request->parameters['pagedir_orderdir']; if ($sortcol == NULL) { $sortcol = 0; } if ($sortorder == NULL) { $sortorder = 1; } // Get all listview extensions $extensionMgr = new ExtensionMgr(); $listviewExtensions = $extensionMgr->getList(EXTENSION_CBLOCKLISTVIEW, true); // Check if a special listview was chosen if ($listViewExtensionId == '') { $listViewExtensionId = 0; } if ($listViewExtensionId == 0) { // Find default extension foreach ($listviewExtensions as $listviewExtension) { if ($listviewExtension['CODE'] == 'defaultCblockListView') { $listViewExtensionId = $listviewExtension['ID']; $isDefaultExtension = true; } } } if ($listViewExtensionId) {
} } } } } } } } } } //$mailing->setStatus('UNSENT'); $jsQueue->add($object, HISTORYTYPE_MAILING, 'HIGHLIGHT_MAILING', sGuiUS(), 'name'); } break; case 'extension': $extensionMgr = new ExtensionMgr(); $value = str_replace("\r", '', str_replace("\n", '\\n', $this->reponsedata[$property]->value)); $extensionInfo = $extensionMgr->get((int) $data[0]); $extension = $extensionMgr->getExtension($extensionInfo["CODE"]); if ($extension) { switch ($data[1]) { default: case 'extensions': $properties = $extension->extensionProperties; break; case 'data': switch ($extensionInfo['TYPE']) { case EXTENSION_IMPORT: // Import $properties = $extension->importProperties; break;