/** * Constructor */ public function __construct() { // Override some defaults: $this->searchClassId = 'WorldCat'; // Call standard record controller initialization: parent::__construct(); }
/** * Constructor * * @param \Zend\Config\Config $config VuFind configuration */ public function __construct(\Zend\Config\Config $config) { // Call standard record controller initialization: parent::__construct(); // Load default tab setting: $this->fallbackDefaultTab = isset($config->Site->defaultRecordTab) ? $config->Site->defaultRecordTab : 'Holdings'; }
/** * Display a particular tab. * * @param string $tab Name of tab to display * @param bool $ajax Are we in AJAX mode? * * @return mixed */ protected function showTab($tab, $ajax = false) { $result = parent::showTab($tab, $ajax); if (!$ajax && $result instanceof \Zend\View\Model\ViewModel) { $result->setTemplate('collection/view'); } return $result; }
/** * Constructor */ public function __construct() { // Override some defaults: $this->searchClassId = 'Primo'; $this->fallbackDefaultTab = 'Description'; // Call standard record controller initialization: parent::__construct(); }
/** * @ignore */ public function __get($attr) { if ($attr == 'name') { return $this->name(); } else { return parent::__get($attr); } }
/** * Constructor */ public function __construct() { throw new \Exception('Pazpar2 record view not supported.'); // Override some defaults: $this->searchClassId = 'Pazpar2'; // Call standard record controller initialization: parent::__construct(); }
/** * Constructor */ public function __construct() { // Override some defaults: $this->accessPermission = 'access.EITModule'; $this->searchClassId = 'EIT'; $this->defaultTab = 'Description'; // Call standard record controller initialization: parent::__construct(); }
/** * pretizeno o mazani front cache */ public function resetCache() { try { // relevant cache je treba mazat bez ohledu na isCacheON() (viz parent::resetCache()), protoze se tim maze i relevantni front cache $this->resetRelevantCache(); LBoxCacheManagerFront::getInstance()->cleanByRecordType(get_class($this), $this->getClassVar("frontCacheForceCleanForAllXTUsers")); return parent::resetCache(); } catch (Exception $e) { throw $e; } }
/** * moves child before me * @param AbstractRecord $$sibling - child to remove * @throws Exception */ public function moveSiblingBefore(AbstractRecord $sibling) { try { $this->load(); $sibling->load(); $this->clearCache(); $tableName = $this->getClassVar("tableName"); $className = get_class($this); $treeColNames = $this->getClassVar("treeColNames"); $lftColName = $treeColNames[0]; $rgtColName = $treeColNames[1]; $pidColName = $treeColNames[2]; $bidColName = $treeColNames[3]; $idColName = $this->getIdColName(); if (!$sibling instanceof $className) { throw new LBoxException("Cannot manipulate records relations between records of another types in '{$className}' type!"); } if (!($isTree = $this->isTree())) { throw new LBoxException("Table '{$tableName}' seems not to be tree!"); } if (!$sibling->{$idColName} == $this->params[$idColName]) { throw new LBoxException("You are trying to move me before me!"); } $quotesColumnName = $this->getQueryBuilder()->getQuotesColumnName(); $lftColNameSlashed = reset($quotesColumnName) . $lftColName . end($quotesColumnName); $rgtColNameSlashed = reset($quotesColumnName) . $rgtColName . end($quotesColumnName); $pidColNameSlashed = reset($quotesColumnName) . $pidColName . end($quotesColumnName); $bidColNameSlashed = reset($quotesColumnName) . $bidColName . end($quotesColumnName); // set sibling as parent's child if is not if ($sibling->{$pidColName} != $this->get($pidColName)) { $this->getParent()->addChild($sibling); $this->setSynchronized(false); $this->load(); } $myId = $this->get($this->getIdColName()); $myLft = $this->get($lftColName); $myRgt = $this->get($rgtColName); $myBid = $this->get($bidColName); $myWeight = $myRgt - $myLft + 1; $maxRgt = $this->getMaxTreeRgt(); $chLft = $sibling->{$lftColName}; $chRgt = $sibling->{$rgtColName}; $chWeight = $chRgt - $chLft + 1; $weightDiff = $chWeight - $myWeight; $diff = $chLft - $myLft; if ($chRgt == $myLft - 1) { return; } // cut sibling from tree /*$sqls[] = "UPDATE $tableName SET $lftColName = $lftColName + $maxRgt, $rgtColName = $rgtColName + $maxRgt WHERE $lftColName > ($chLft-1) AND $rgtColName < ($chRgt+1) ";*/ $i = count((array) $sqls); $wheres[$i] = new QueryBuilderWhere(); $wheres[$i]->addConditionColumn($lftColName, $chLft - 1, 2); $wheres[$i]->addConditionColumn($rgtColName, $chRgt + 1, -2); $sqls[$i] = $this->getQueryBuilder()->getUpdate($tableName, array($lftColName => "<<{$lftColNameSlashed} + {$maxRgt}>>", $rgtColName => "<<{$rgtColNameSlashed} + {$maxRgt}>>"), $wheres[$i]); // make space for sibling /*$sqls[] = "UPDATE $tableName SET $lftColName = $lftColName + $chWeight, $rgtColName = $rgtColName + $chWeight WHERE $lftColName > ($myLft-1) AND $rgtColName < $chLft ";*/ $i = count((array) $sqls); $wheres[$i] = new QueryBuilderWhere(); $wheres[$i]->addConditionColumn($lftColName, $myLft - 1, 2); $wheres[$i]->addConditionColumn($rgtColName, $chLft, -2); $sqls[$i] = $this->getQueryBuilder()->getUpdate($tableName, array($lftColName => "<<{$lftColNameSlashed} + {$chWeight}>>", $rgtColName => "<<{$rgtColNameSlashed} + {$chWeight}>>"), $wheres[$i]); // move sibling before /*$sqls[] = "UPDATE $tableName SET $lftColName = $lftColName - ($diff+$maxRgt), $rgtColName = $rgtColName - ($diff+$maxRgt), $bidColName = $myBid, WHERE $lftColName > ($chLft+$maxRgt-1) AND $rgtColName < ($chRgt+$maxRgt+1) ";*/ $i = count((array) $sqls); $wheres[$i] = new QueryBuilderWhere(); $wheres[$i]->addConditionColumn($lftColName, $chLft + $maxRgt - 1, 2); $wheres[$i]->addConditionColumn($rgtColName, $chRgt + $maxRgt + 1, -2); $sqls[$i] = $this->getQueryBuilder()->getUpdate($tableName, array($lftColName => "<<{$lftColNameSlashed} - " . ($diff + $maxRgt) . ">>", $rgtColName => "<<{$rgtColNameSlashed} - " . ($diff + $maxRgt) . ">>", $bidColName => $myBid), $wheres[$i]); foreach ($sqls as $sql) { // var_dump(__CLASS__ ."::". __LINE__ .": ". $sql); $this->getDb()->initiateQuery($sql); } $this->setSynchronized(false); $sibling->setSynchronized(false); $this->clearCache(); $this->load(); $sibling->load(); } catch (Exception $e) { throw $e; } }