* Rename the method name.
This commit is contained in:
+25
-25
@@ -537,15 +537,15 @@ class doc extends control
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$doc->lib"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->view;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->lib = $lib;
|
||||
$this->view->type = $type;
|
||||
$this->view->version = $version ? $version : $doc->version;
|
||||
$this->view->actions = $this->action->getList('doc', $docID);
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('doc', $docID);
|
||||
$this->view->keTableCSS = $this->doc->extractKETableCSS($doc->content);
|
||||
$this->view->showPageDetails = $this->doc->checkShowPageDetails($doc);
|
||||
$this->view->doc = $doc;
|
||||
$this->view->lib = $lib;
|
||||
$this->view->type = $type;
|
||||
$this->view->version = $version ? $version : $doc->version;
|
||||
$this->view->actions = $this->action->getList('doc', $docID);
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('doc', $docID);
|
||||
$this->view->keTableCSS = $this->doc->extractKETableCSS($doc->content);
|
||||
$this->view->autoloadPage = $this->doc->checkAutoloadPage($doc);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1052,22 +1052,22 @@ class doc extends control
|
||||
$this->view->title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
|
||||
$this->view->position[] = ($type == 'book' or $type == 'custom') ? $this->lang->doc->customAB : $object->name;
|
||||
|
||||
$this->view->docID = $docID;
|
||||
$this->view->doc = $docID ? $doc : '';
|
||||
$this->view->type = $type;
|
||||
$this->view->version = $version;
|
||||
$this->view->object = $object;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->objectType = $type;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : new stdclass();
|
||||
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
|
||||
$this->view->actions = $docID ? $this->action->getList('doc', $docID) : array();
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->preAndNext = $this->doc->getPreAndNextDoc($docID, $libID);
|
||||
$this->view->showPageDetails = $this->doc->checkShowPageDetails($doc);
|
||||
$this->view->docID = $docID;
|
||||
$this->view->doc = $docID ? $doc : '';
|
||||
$this->view->type = $type;
|
||||
$this->view->version = $version;
|
||||
$this->view->object = $object;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->objectType = $type;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->lib = isset($libs[$libID]) ? $libs[$libID] : new stdclass();
|
||||
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
|
||||
$this->view->actions = $docID ? $this->action->getList('doc', $docID) : array();
|
||||
$this->view->users = $this->user->getPairs('noclosed,noletter');
|
||||
$this->view->preAndNext = $this->doc->getPreAndNextDoc($docID, $libID);
|
||||
$this->view->autoloadPage = $this->doc->checkAutoloadPage($doc);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -2653,23 +2653,23 @@ EOT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the url of link type documents needs to be displayed.
|
||||
* Whether the url of link type documents needs to be autoloaded.
|
||||
*
|
||||
* @param object $doc
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkShowPageDetails($doc)
|
||||
public function checkAutoloadPage($doc)
|
||||
{
|
||||
$showPageDetails = true;
|
||||
$autoloadPage = true;
|
||||
if(!empty($doc) and $doc->type == 'url')
|
||||
{
|
||||
$parsedUrl = parse_url($doc->content);
|
||||
$urlPort = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : '';
|
||||
$urlDomain = $parsedUrl['host'] . $urlPort;
|
||||
if($urlDomain == $_SERVER['HTTP_HOST']) $showPageDetails = false;
|
||||
if($urlDomain == $_SERVER['HTTP_HOST']) $autoloadPage = false;
|
||||
}
|
||||
|
||||
return $showPageDetails;
|
||||
return $autoloadPage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ $sessionString .= session_name() . '=' . session_id();
|
||||
</p>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
if($doc->type == 'url' and $showPageDetails)
|
||||
if($doc->type == 'url' and $autoloadPage)
|
||||
{
|
||||
$url = $doc->content;
|
||||
if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url;
|
||||
|
||||
@@ -89,7 +89,7 @@ js::set('docID', $doc->id);
|
||||
<div class="detail no-padding">
|
||||
<div class="detail-content article-content no-margin no-padding">
|
||||
<?php
|
||||
if($doc->type == 'url' and $showPageDetails)
|
||||
if($doc->type == 'url' and $autoloadPage)
|
||||
{
|
||||
$url = $doc->content;
|
||||
if(!preg_match('/^https?:\/\//', $doc->content)) $url = 'http://' . $url;
|
||||
|
||||
Reference in New Issue
Block a user