function loadView() { global $com; // the component to create the path to include if (getView() == null) { $view = 'default'; } else { $view = getView(); } $path = ROOT . 'components/com_' . $com . '/views/' . $view . '.php'; include $path; }
public function testServices() { $ins = getAuth(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Auth\IAuth::class, $ins); $ins = getView(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\IView::class, $ins); $ins = getLog(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Log\ILog::class, $ins); // $ins = getDB(); // $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\MedooDB::class, $ins); // $ins = getRedis(); // $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\PRedis::class, $ins); // $ins = getDataPool(); // $this->assertInstanceOf(\Wwtg99\DataPool\Common\IDataPool::class, $ins); $ins = getCache(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\Cache::class, $ins); $ins = getSession(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\SessionUtil::class, $ins); $ins = getCookie(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\CookieUtil::class, $ins); $ins = getOValue(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\OldValue::class, $ins); $ins = getAssets(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\AssetsManager::class, $ins); $ins = getMailer(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Mail::class, $ins); $ins = Flight::Express(); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Express::class, $ins); $ins = getPlugin('php'); $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Plugin\IPlugin::class, $ins); }
function dispWidgetAdminGenerateCode() { $oView =& getView('widget'); Context::set('in_admin', true); $this->setTemplateFile('widget_generate_code'); return $oView->dispWidgetGenerateCode(); }
/** * Override so we don't load any components on the page */ protected function __rebrand_office($view) { $this->elements['PAGE_SIDEBARS']['default'] = null; $this->elements['SEO_ENGINE_OPTIMIZER']->SetPageTitle(SwitchBoard::$siteOwner->get_site_owner()->get_name()); $tpl_args = array(); $renderer = $this->getSmarty(); if (self::$isMobile) { $this->layout = getView('site', 'mobile', 'tpl'); $renderer->render(array(get_class($this->INT), "office.mobile"), $tpl_args); } else { $renderer->render($view, $tpl_args); } }
/** * @return bool */ public function send() { $this->sendHeader(); switch ($this->resType) { case 'json': \Flight::json($this->data, $this->resCode, true, 'utf8', $this->jsonOptions); return false; case 'jsonp': \Flight::jsonp($this->data, $this->jsonpCallback, $this->resCode, true, 'utf8', $this->jsonOptions); return false; case 'view': getView()->render($this->view, $this->data); return false; case 'filter': return true; } return false; }
function dispNcartAdminAdditionSetup() { // content는 다른 모듈에서 call by reference로 받아오기에 미리 변수 선언만 해 놓음 $content = ''; $oEditorView = getView('editor'); $oEditorView->triggerDispEditorAdditionSetup($content); Context::set('setup_content', $content); $this->setTemplateFile('additionsetup'); }
function dispSocialxeTextyleTool() { // 텍스타일의 최신 버전이 아니면 직접 처리 $oTextyleView =& getView('textyle'); if (!method_exists($oTextyleView, 'initTool')) { $oTextyleModel =& getModel('textyle'); $site_module_info = Context::get('site_module_info'); $textyle = $oTextyleModel->getTextyle($site_module_info->index_module_srl); Context::set('textyle', $textyle); Context::set('custom_menu', $oTextyleModel->getTextyleCustomMenu()); $template_path = sprintf("%stpl", $oTextyleView->module_path); $this->setLayoutPath($template_path); $this->setLayoutFile('_tool_layout'); if ($_COOKIE['tclnb']) { Context::addBodyClass('lnbClose'); } else { Context::addBodyClass('lnbToggleOpen'); } // browser title 지정 Context::setBrowserTitle($textyle->get('browser_title') . ' - admin'); Context::addHtmlHeader('<link rel="shortcut icon" href="' . $textyle->getFaviconSrc() . '" />'); } // 설정 정보를 받아옴 Context::set('config', $this->config); // 서비스 목록 $provider_list = $this->providerManager->getFullProviderList(); Context::set('provider_list', $provider_list); // 템플릿 파일 지정 $this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplateFile('textyleConfig'); }
/** * @brief rss **/ function rss() { $oRss =& getView('rss'); $oDocumentModel =& getModel('document'); $oModuleModel =& getModel('module'); $homepage_info = $oModuleModel->getModuleConfig('homepage'); if ($homepage_info->use_rss != 'Y') { return new Object(-1, 'msg_rss_is_disabled'); } $output = executeQueryArray('homepage.getRssList', $args); if ($output->data) { foreach ($output->data as $key => $val) { unset($obj); $obj = new DocumentItem(0); $obj->setAttribute($val); $document_list[] = $obj; } } $oRss->rss($document_list, $homepage_info->browser_title); $this->setTemplatePath($oRss->getTemplatePath()); $this->setTemplateFile($oRss->getTemplateFile()); }
<?php if (ROUTE == '/') { include getView('hello'); }
/** * @brief rss for publish subscription **/ function rss() { $oRss =& getView('rss'); $oRss->module_info = $this->module_info; $oRss->rss(); $this->setTemplatePath($oRss->getTemplatePath()); $this->setTemplateFile($oRss->getTemplateFile()); }
$userid = required_param('userid', PARAM_ALPHANUMEXT); $response = approveGroupMemberJoin($groupid, $userid); break; case "mergeselectednodes": $groupid = required_param('groupid', PARAM_ALPHANUMEXT); $issuenodeid = required_param('issuenodeid', PARAM_ALPHANUMEXT); $ids = required_param('ids', PARAM_TEXT); $title = required_param('title', PARAM_TEXT); $desc = required_param('desc', PARAM_TEXT); $response = mergeSelectedNodes($issuenodeid, $groupid, $ids, $title, $desc); break; /** VIEWS **/ /** VIEWS **/ case "getview": $viewid = required_param('viewid', PARAM_ALPHANUMEXT); $response = getView($viewid, $style); break; case "getviewsbygroup": $groupid = required_param('groupid', PARAM_ALPHANUMEXT); $response = getViewsByGroup($groupid, $style); break; case "getviewsbynode": $nodeid = required_param('nodeid', PARAM_ALPHANUMEXT); $response = getViewsByNode($nodeid, $style); break; case "getviewnodes": $viewid = required_param('viewid', PARAM_ALPHANUMEXT); $response = getViewNodes($viewid, $style); break; case "getviewnodesbygroup": $groupid = required_param('groupid', PARAM_ALPHANUMEXT);
<?php if (!defined("__ZBXE__")) { exit; } if ($called_position != "before_display_content") { return; } // applying to only board module $oBoardView =& getView('board'); if (Context::getResponseMethod() == "XMLRPC" || Context::getRequestMethod() == 'XMLRPC' || $oBoardView->act != 'dispBoardContent') { return; } if (!$addon_info->display) { Context::addCssFile('./addons/exif/css/exif.css'); } if ($addon_info->display == '2') { Context::addCssFile('./addons/exif/css/exif2.css'); } if ($addon_info->display == '3') { Context::addCssFile('./addons/exif/css/exif3.css'); } else { Context::addJsFile('./addons/exif/js/exif.js', false, '', null, 'body'); } require_once "exif.lib.php"; // call getImageExif() with retrieved image path $pattern_image_tag = "/<img(.*?)(src=\"[^ ]*)(files\\/attach\\/images\\/[^\"]+)+([^>]*?)(>)+/i"; $pattern_documents_area = '/<!--BeforeDocument\\([0-9]+,[0-9]+\\)-->.+<!--AfterDocument\\([0-9]+,[0-9]+\\)-->/is'; $output = preg_replace_callback($pattern_documents_area, create_function('$matches', "return preg_replace_callback('{$pattern_image_tag}', 'getExifData', \$matches[0]);"), $output);
* @param userids (optional) a comma separated list of userids to get alert data for * @param root (optional) a nodeid for the root node of a data tree to process. * @return class alertdata with properties 'alertarray', 'userarray', 'nodearray'. * */ function getMapAlertsData($mapid, $url, $alerttypes, $timeout = 60, $userids = "", $root = "") { global $CFG, $HUB_CACHE; $withhistory = true; $withvotes = true; $withposts = true; class alertdata { } $data = array(); $view = getView($mapid); if (!$view instanceof Error) { $nodes = $view->nodes; $count = count($nodes); $nodeArray = array(); $userArray = array(); for ($i = 0; $i < $count; $i++) { $viewnode = $nodes[$i]; $node = $viewnode->node; $user = $node->users[0]; $userArray[$user->userid] = $user; $nodeArray[$node->nodeid] = $node; } // Add any users on connections but not on nodes (brokers). $conns = $view->connections; $countj = count($conns);
<?php require "app/components/frontsite/functions.php"; getTemplate("header"); getTemplate("navi"); getView("landing"); getView("process"); getTemplate("footer");
/** * @brief rss **/ function rss() { $oRss =& getView('rss'); $oRssModel =& getModel('rss'); $oDocumentModel =& getModel('document'); if ($this->planet->isHome()) { if ($this->module_info->use_rss != 'Y') { return new Object(-1, 'msg_rss_is_disabled'); } } else { $rss_config = $oRssModel->getRssModuleConfig($this->module_srl); if ($rss_config->open_rss != 'Y') { return new Object(-1, 'msg_rss_is_disabled'); } $args->module_srl = $this->module_srl; } $output = executeQueryArray('planet.getRssList', $args); if ($output->data) { foreach ($output->data as $key => $val) { unset($obj); $obj = new DocumentItem(0); $obj->setAttribute($val); $document_list[] = $obj; } } $oRss->rss($document_list, $this->planet->getBrowserTitle()); $this->setTemplatePath($oRss->getTemplatePath()); $this->setTemplateFile($oRss->getTemplateFile()); }
echo getView($view_files['no_results'], get_defined_vars()); exit; } //If the zillow service was able to find any properties which matched the // address, we can proceed with trying to get additional information about // the property if (count($search) > 0) { $primary_property = $search[0]; //dump($primary_property); //Let's see if there is a zestimate history chart available try { $chart = $primary_property->getChart(Pillow_Property::CHART_UNIT_DOLLAR, 275, 200); $chart_url = $chart->url; } catch (Exception $e) { $chart_url = '/images/no_data.png'; } //Let's see if there are any comparables available - try to get 5 of them. try { $comps = $primary_property->getDeepComps(5); foreach ($comps as $comp) { $comp_placemarks[] = $gc->geocode($comp->street . ' ' . $comp->city . ' ' . $comp->state . ' ' . $comp->zipcode); } //dump($comps); } catch (Exception $e) { } } else { echo getView($view_files['no_results'], get_defined_vars()); exit; } echo getView($view_files['results'], get_defined_vars()); exit;
* consequential damages (including, but not limited to, procurement of * * substitute goods or services; loss of use, data, or profits; or business * * interruption) however caused and on any theory of liability, whether in * * contract, strict liability, or tort (including negligence or otherwise) * * arising in any way out of the use of this software, even if advised of the * * possibility of such damage. * * * ********************************************************************************/ /** Author: Michelle Bachler, KMi, The Open University **/ require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php'; require_once $HUB_FLM->getCodeDirPath("ui/headerstats.php"); $nodeid = required_param("nodeid", PARAM_ALPHANUMEXT); $node = getNode($nodeid); $nodes = array(); array_push($nodes, $node); $view = getView($nodeid, 'shortactivity'); $node = $view->viewnode; $viewnodes = $view->nodes; $nodes = array(); array_push($nodes, $node); $countj = count($viewnodes); for ($j = 0; $j < $countj; $j++) { $viewnode = $viewnodes[$j]; array_push($nodes, $viewnode->node); } $data = getActivityAnalysisData($nodes); ?> <script type='text/javascript'> var NODE_ARGS = new Array(); Event.observe(window, 'load', function() {
<?php /* * Created on Jan 16, 2005 * * Created by Teemu Lahtela * (c) Lämmi * * Page template. */ // Get the view for content functions $view =& getView(); global $CSSFILE; global $JOUKKUEENNIMI; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Language" content="fi"> <meta name="GENERATOR" content="PHPEclipse 1.0"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="<?php print $CSSFILE; ?> " rel="stylesheet" type="text/css"> <link rel="alternate" type="application/rss+xml" title="KooVee II - Uutiset" href="rss.xml" /> <link rel="shortcut icon" href="kuvat/favicon.ico"> <title> <?php print $view->getTitle();
<?php //patient component loadCSS('search.css', 'patient'); $component_name = 'Patients'; //loadJS('add_payment.js','payment'); $patient_id = getVar('patient_id'); switch (getView()) { case 'search_patients': //loadView(); loadJS('search-patient.js', 'patient'); //get expected patients for practitioner to select from $patients_for_today = Patient::getPatientsForToday(); include 'views/search.php'; break; case 'patient': //loadView(); //get patient details according to patient_id in url query $patient = getPatient(getVar('patient_id')); //get user info $user = get_userdata($patient->practitioner); //get appointments $appointments = getAppointments($patient->patient_id); //get user_id $practitioner_id = get_current_user_id(); //$letterCount = letterCount();//used in de patient_menu module loadJS('patient.js', 'patient'); include 'views/patient_new.php'; break; } switch (getTask()) {
/** * display member information * * @return void */ function dispMemberAdminInfo() { $oMemberModel = getModel('member'); $oModuleModel = getModel('module'); $member_config = $oModuleModel->getModuleConfig('member'); Context::set('member_config', $member_config); $extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo); Context::set('extend_form_list', $extendForm); $memberInfo = get_object_vars(Context::get('member_info')); if (!is_array($memberInfo['group_list'])) { $memberInfo['group_list'] = array(); } Context::set('memberInfo', $memberInfo); $disableColumns = array('password', 'find_account_question'); Context::set('disableColumns', $disableColumns); $security = new Security(); $security->encodeHTML('member_config..'); $security->encodeHTML('extend_form_list...'); $oMemberView = getView('member'); $oMemberView->_getDisplayedMemberInfo($this->memberInfo, $extendForm, $member_config); $this->setTemplateFile('member_info'); }
* @copyright 2012 Copyright (C) David Deutsch * @author David Deutsch <*****@*****.**> & Team AEC - http://www.valanx.org * @license GNU/GPL v.3 http://www.gnu.org/licenses/gpl.html or, at your option, any later version */ // Dont allow direct linking defined('_JEXEC') or die('Direct Access to this location is not allowed.'); if (empty($metaUser->userid)) { aecRedirect(AECToolbox::deadsureURL('index.php')); } $trial = false; $expired = false; $invoice = false; if ($metaUser->hasSubscription) { // Make sure this really is expired if (!$metaUser->objSubscription->isExpired()) { return getView('access_denied'); } $expired = strtotime($metaUser->objSubscription->expiration); $trial = strcmp($metaUser->objSubscription->status, 'Trial') === 0; if (!$trial) { $params = $metaUser->objSubscription->params; if (isset($params['trialflag'])) { $trial = 1; } } } $invoices = aecInvoiceHelper::InvoiceCountbyUserID($metaUser->userid); if ($invoices) { $invoice = aecInvoiceHelper::lastUnclearedInvoiceIDbyUserID($metaUser->userid); } else { $invoice = null;
$vend_focus = new Vendors(); $vend_focus->retrieve_entity_info($_REQUEST['vendor_id'], "Vendors"); $focus->column_fields['bill_city'] = $vend_focus->column_fields['city']; $focus->column_fields['ship_city'] = $vend_focus->column_fields['city']; $focus->column_fields['bill_street'] = $vend_focus->column_fields['street']; $focus->column_fields['ship_street'] = $vend_focus->column_fields['street']; $focus->column_fields['bill_state'] = $vend_focus->column_fields['state']; $focus->column_fields['ship_state'] = $vend_focus->column_fields['state']; $focus->column_fields['bill_code'] = $vend_focus->column_fields['postalcode']; $focus->column_fields['ship_code'] = $vend_focus->column_fields['postalcode']; $focus->column_fields['bill_country'] = $vend_focus->column_fields['country']; $focus->column_fields['ship_country'] = $vend_focus->column_fields['country']; $focus->column_fields['bill_pobox'] = $vend_focus->column_fields['pobox']; $focus->column_fields['ship_pobox'] = $vend_focus->column_fields['pobox']; } $disp_view = getView($focus->mode); $smarty->assign('BLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields)); $smarty->assign('BASBLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields, 'BAS')); $smarty->assign('ADVBLOCKS', getBlocks($currentModule, $disp_view, $focus->mode, $focus->column_fields, 'ADV')); $smarty->assign('OP_MODE', $disp_view); $smarty->assign('APP', $app_strings); $smarty->assign('MOD', $mod_strings); $smarty->assign('MODULE', $currentModule); // TODO: Update Single Module Instance name here. $smarty->assign('SINGLE_MOD', 'SINGLE_' . $currentModule); $smarty->assign('CATEGORY', $category); $smarty->assign("THEME", $theme); $smarty->assign('IMAGE_PATH', "themes/{$theme}/images/"); $smarty->assign('ID', $focus->id); $smarty->assign('MODE', $focus->mode); $smarty->assign('CREATEMODE', isset($_REQUEST['createmode']) ? vtlib_purify($_REQUEST['createmode']) : '');
/** * Return a Group for the given groupid; */ function getConversationData($groupid) { $mapNodes = getNodesByGroup($groupid, 0, -1, 'date', 'DESC', '', 'Map', 'cif'); $checkNodes = array(); $checkConns = array(); $group = new Group($groupid); $view = new View($groupid); if (!$mapNodes instanceof Error) { $nodes = $mapNodes->nodes; $count = count($nodes); for ($i = 0; $i < $count; $i++) { if (isset($nodes[$i])) { $node = $nodes[$i]; /* // ADD MAP NODES ? if (array_key_exists($node->nodeid, $checkNodes) === FALSE) { $checkNodes[$node->nodeid] = $node->nodeid; array_push($view->nodes,$node); } } */ $nextmap = getView($node->nodeid, 'cif'); $innernodes = $nextmap->nodes; $countk = count($innernodes); for ($k = 0; $k < $countk; $k++) { $viewnode = $innernodes[$k]; $innernode = $viewnode->node; if (!$innernode instanceof Error) { if (array_key_exists($innernode->nodeid, $checkNodes) === FALSE) { $checkNodes[$innernode->nodeid] = $innernode->nodeid; array_push($view->nodes, $viewnode); } } } $connections = $nextmap->connections; $countj = count($connections); for ($j = 0; $j < $countj; $j++) { $viewcon = $connections[$j]; $con = $viewcon->connection; if (!$con instanceof Error && array_key_exists($con->connid, $checkConns) === FALSE) { $checkConns[$con->connid] = $con->connid; array_push($view->connections, $viewcon); } } } } } $group->view = $view; return $group; }
/** * @brief Additional settings page showing * For additional settings in a service module in order to establish links with other modules peyijiim **/ function dispPageAdminPageAdditionSetup() { // call by reference content from other modules to come take a year in advance for putting the variable declaration $content = ''; $oEditorView =& getView('editor'); $oEditorView->triggerDispEditorAdditionSetup($content); Context::set('setup_content', $content); // Set a template file $this->setTemplateFile('addition_setup'); $security = new Security(); $security->encodeHTML('module_info.'); }
<?php require "DBManager.inc"; require "viewer.inc"; getView("HeaderView.inc", null); $host = "mysql.hostinger.com.ua"; $dbName = "u825515718_bbrat"; $user = "******"; $password = "******"; DBManager::getInstance()->connect($host, $dbName, $user, $password); echo "<html><body><div id='feed' style='margin-left: 300px;'><div style='text-align:left'>"; $res = SQL("Select Name from Players order by Name DESC")->getAll(); foreach ($res as $player) { echo "<p>" . $player['Name'] . "</p>"; } echo "</div></div></body></html>";
function genEditableConceptInfo($interface) { global $allInterfaceObjects; global $relationTableInfo; $editableConcepts = $allInterfaceObjects[$interface]['editableConcepts']; $atomViewMap = array(); foreach ($editableConcepts as $editableConcept) { $allAtoms = getAllConceptAtoms($editableConcept); $atomsAndViews = array(); foreach ($allAtoms as $atom) { $atomsAndViews[] = array('atom' => $atom, 'view' => showViewAtom($atom, $editableConcept)); } $atomViewMap[$editableConcept] = array('hasView' => getView($editableConcept) != null, 'atomViewMap' => $atomsAndViews); } $atomKeyMapJson = json_encode($atomViewMap); echo "\n\nfunction getEditableConceptInfo() {\n"; echo " return {$atomKeyMapJson};\n"; echo "}\n"; }
/** * @ 실행된 모듈의 컨텐츠를 출력 **/ function displayContent($oModule = NULL) { // 설정된 모듈이 정상이지 않을 경우 message 모듈 객체 생성 if (!$oModule || !is_object($oModule)) { $this->error = 'msg_module_is_not_exists'; } // install 모듈이 아닐 때 DB 접속에 문제가 있으면 오류 if ($this->module != 'install' && $GLOBALS['__DB__'][Context::getDBType()]->is_connected == false) { $this->error = 'msg_dbconnect_failed'; } // 모듈 동작을 마친 후 trigger call $output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule); if (!$output->toBool()) { $this->error = $output->getMessage(); } // HTML call 이면 message view 객체 이용하도록 if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { // 에러가 발생하였을시 처리 if ($this->error) { // message 모듈 객체를 생성해서 컨텐츠 생성 $oMessageView =& getView('message'); $oMessageView->setError(-1); $oMessageView->setMessage($this->error); $oMessageView->dispMessage(); // 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경 if ($oModule) { $oModule->setTemplatePath($oMessageView->getTemplatePath()); $oModule->setTemplateFile($oMessageView->getTemplateFile()); // 그렇지 않으면 message 객체를 호출된 객체로 지정 } else { $oModule = $oMessageView; } } // 해당 모듈에 layout_srl이 있는지 확인 if ($oModule->module_info->layout_srl && !$oModule->getLayoutFile()) { // layout_srl이 있으면 해당 레이아웃 정보를 가져와 layout_path/ layout_file 위치 변경 $oLayoutModel =& getModel('layout'); $layout_info = $oLayoutModel->getLayout($oModule->module_info->layout_srl); if ($layout_info) { // 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력 if ($layout_info->extra_var_count) { foreach ($layout_info->extra_var as $var_id => $val) { if ($val->type == 'image') { if (preg_match('/^\\.\\/files\\/attach\\/images\\/(.+)/i', $val->value)) { $val->value = Context::getRequestUri() . substr($val->value, 2); } } $layout_info->{$var_id} = $val->value; } } // 레이아웃 정보중 menu를 Context::set if ($layout_info->menu_count) { foreach ($layout_info->menu as $menu_id => $menu) { if (file_exists($menu->php_file)) { @(include $menu->php_file); } Context::set($menu_id, $menu); } } // 레이아웃 정보를 Context::set Context::set('layout_info', $layout_info); $oModule->setLayoutPath($layout_info->path); $oModule->setLayoutFile('layout'); // 레이아웃이 수정되었을 경우 수정본을 지정 $edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl); if (file_exists($edited_layout)) { $oModule->setEditedLayoutFile($edited_layout); } } } } // 컨텐츠 출력 $oDisplayHandler = new DisplayHandler(); $oDisplayHandler->printContent($oModule); }
/** * Delete node * * @return Result object (or Error object) */ function delete() { global $DB, $CFG, $USER, $HUB_FLM, $HUB_SQL; try { $this->candelete(); } catch (Exception $e) { return access_denied_error(); } $this->load(); $xml = format_object('xml', $this); $dt = time(); //delete the associated topic, if this is a map node being deleted. $role = $this->role; $challengenode = ""; $deleteconnections = array(); if ($role->name == "Map") { $view = getView($this->nodeid); // find the challenge node in the map to delete afterwards. $viewnodes = $view->nodes; $count = count($viewnodes); for ($i = 0; $i < $count; $i++) { $next = $viewnodes[$i]; $nextnode = $next->node; if ($nextnode->role->name == "Challenge") { $challengenode = $nextnode; } } // get the Connections in the Map to delete afterwards $viewconns = $view->connections; $count = count($viewconns); for ($i = 0; $i < $count; $i++) { $next = $viewconns[$i]; $nextcon = $next->connection; array_push($deleteconnections, $nextcon); } } $params = array(); $params[0] = $this->nodeid; $res = $DB->delete($HUB_SQL->DATAMODEL_NODE_DELETE, $params); if ($res) { auditIdea($USER->userid, $this->nodeid, $this->name, $this->description, $CFG->actionDelete, $xml); // NOT SURE THIS IS REQUIRED NOW AS IT SHOULD HAPPEN ON CASCADE DELETE IN THE DATABASE // update the related connections (triples) $params = array(); $params[0] = $this->nodeid; $params[1] = $this->nodeid; $resArray = $DB->select($HUB_SQL->DATAMODEL_NODE_DELETE_TRIPLE, $params); if ($resArray !== false) { $count = count($resArray); for ($i = 0; $i < $count; $i++) { $array = $resArray[$i]; $conn = new Connection($array['TripleID']); $conn = $conn->delete(); } } else { return database_error(); } //update the related URLs $params = array(); $params[0] = $this->nodeid; $res3 = $DB->delete($HUB_SQL->DATAMODEL_NODE_DELETE_URLNODE, $params); if (!$res3) { return database_error(); } // Take this opportunity to delete any URLs if they are no longer connected to a node // Probably should do this in a more organized way! $params = array(); $res4Array = $DB->select($HUB_SQL->DATAMODEL_NODE_DELETE_URLS_CLEAN, $params); if ($res4Array !== false) { $count = count($res4Array); for ($i = 0; $i < $count; $i++) { $array = $res4Array[$i]; $url = new URL($array['URLID']); $url = $url->delete(); } } // Delete any associated challenge node if this node is a Map // and any associated map Connections if ($role->name == "Map" && $challengenode != "") { $challengenode->delete(); $count = count($deleteconnections); for ($i = 0; $i < $count; $i++) { $nextcon = $deleteconnections[$i]; // Need to bypass check. // If you own the map you can delete it and its connections need to be deleted. $conxml = format_object('xml', $nextcon); $innerparams = array(); $innerparams[0] = $nextcon->connid; $res5 = $DB->delete($HUB_SQL->DATAMODEL_CONNECTION_DELETE, $innerparams); if ($res5) { auditConnection($USER->userid, $nextcon->connid, "", $nextcon->from->nodeid, $nextcon->to->nodeid, $nextcon->linktype->linktypeid, $nextcon->fromrole->roleid, $nextcon->torole->roleid, $CFG->actionDelete, $conxml); } } } } else { return database_error(); } //remove old thumbnail if ($this->thumb != null && $this->thumb != "" && substr($this->thumb, 0, 7) == 'uploads') { unlink($HUB_FLM->createUploadsDirPath($this->thumb)); } return new Result("deleted", "true"); }
$nodeCheck[$node->nodeid] = $node; } if (!array_key_exists($node->users[0]->userid, $userHashtable)) { $globaluser = clone $node->users[0]; $globaluser->procount = 0; $globaluser->concount = 0; $globaluser->ideacount = 0; $globaluser->debatecount = 0; $globaluser->mapcount = 1; $userHashtable[$node->users[0]->userid] = $globaluser; } else { $globaluser = $userHashtable[$node->users[0]->userid]; $globaluser->debatecount = $globaluser->debatecount + 1; $userHashtable[$node->users[0]->userid] = $globaluser; } $view = getView($node->nodeid); $cons = $view->connections; $countcons = count($cons); $localusers = array(); $debateowner = clone $node->users[0]; $debateowner->procount = 0; $debateowner->concount = 0; $debateowner->ideacount = 0; $debateowner->debatecount = 0; $debateowner->mapcount = 1; $localusers[$node->users[0]->userid] = $debateowner; if (!array_key_exists($node->users[0]->userid, $userCheck)) { $userCheck[$node->users[0]->userid] = $node->users[0]; } for ($j = 0; $j < $countcons; $j++) { $viewcon = $cons[$j];
function getAction($id, $params = array()) { $action = \cf\query2array(' SELECT * FROM cf_admin_action WHERE id=:id', array('id' => $id)); $action['params'] = array(); $action['params_query'] = ''; if ($action['params_id']) { $action['params'] = \cf\query2arrays(' SELECT name, type_id AS type, title, default_val AS value, mandatory, max_length, min_length, fmt, default_val, tree_id, list_id FROM cf_admin_action_param WHERE params_id=:id ORDER BY sort_order', array('id' => $action['params_id'])); $action['params_query'] = \cf\query2var('SELECT query FROM cf_admin_action_params WHERE id=:id', array('id' => $action['params_id'])); if (!empty($params) && $action['params_query']) { $values = \cf\query2array($action['params_query'], $params); for ($i = 0; $i < count($action['params']); ++$i) { if (array_key_exists($action['params'][$i]['name'], $values)) { $action['params'][$i]['value'] = $values[$action['params'][$i]['name']]; if ($action['params'][$i]['type'] == 'File') { $action['params'][$i]['is_image'] = @getimagesize($_SERVER['DOCUMENT_ROOT'] . '/' . $action['params'][$i]['value']) != false; } } } } for ($i = 0; $i < count($action['params']); ++$i) { $p = $action['params'][$i]; $action['params'][$i]['options'] = explode(';', $p['fmt']); $action['params'][$i]['dict_value'] = false; if ($p['tree_id'] || $p['list_id']) { $v = getView($p['tree_id'] ? $p['tree_id'] : $p['list_id']); $action['params'][$i]['view'] = $v; $action['params'][$i]['dict_value'] = \cf\query2var('SELECT ' . $v['name_field'] . ' FROM ' . (preg_match('/^\\w+$/', $v['query']) ? $v['query'] : '(' . $v['query'] . ') t') . ' WHERE ' . $v['primary_key_field'] . '=:id', array('id' => $p['value'])); } } } return $action; }