diff --git a/app/Book.php b/app/Book.php
index d0faa19..0f3323d 100755
--- a/app/Book.php
+++ b/app/Book.php
@@ -17,7 +17,7 @@ class Book extends Model
public function project()
{
- return $this->belongsTo('App\Project', 'project_id', 'id');
+ return $this->belongsTo('App\Models\Project', 'project_id', 'id');
}
// public function shelf()
diff --git a/app/Collection.php b/app/Collection.php
deleted file mode 100644
index f2c55f1..0000000
--- a/app/Collection.php
+++ /dev/null
@@ -1,14 +0,0 @@
-belongsToMany(\App\Dataset::class, 'link_documents_collections', 'collection_id', 'document_id');
- }
-}
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 7a69be0..9360d3a 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Auth;
-use App\User;
+use App\Models\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php
index f6139a3..86c5c04 100755
--- a/app/Http/Controllers/BookController.php
+++ b/app/Http/Controllers/BookController.php
@@ -4,7 +4,7 @@ namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Book;
-use App\Project;
+use App\Models\Project;
use App\Shelf;
use App\Http\Requests\BookRequest;
use Illuminate\Http\Request;
diff --git a/app/Http/Controllers/BorrowController.php b/app/Http/Controllers/BorrowController.php
index e0d3ed7..3d126fe 100644
--- a/app/Http/Controllers/BorrowController.php
+++ b/app/Http/Controllers/BorrowController.php
@@ -5,14 +5,12 @@ use App\Http\Controllers\Controller;
use App\Book;
use App\Person;
use App\Transaction;
-use App\Project;
+use App\Models\Project;
use App\Http\Requests\PeminjamanRequest;
use Illuminate\Http\Request;
class BorrowController extends Controller
{
-
-
public function __construct()
{
$this->middleware('auth');
diff --git a/app/Http/Controllers/Frontend/HomeController.php b/app/Http/Controllers/Frontend/HomeController.php
index f9f6132..43323c4 100644
--- a/app/Http/Controllers/Frontend/HomeController.php
+++ b/app/Http/Controllers/Frontend/HomeController.php
@@ -17,6 +17,10 @@ class HomeController extends Controller
{
//$this->middleware('auth');
}
+ public function test(): View
+ {
+ return view('welcome');
+ }
/**
* Show the application dashboard.
@@ -43,7 +47,6 @@ class HomeController extends Controller
// }
return view('frontend.home.index');
- // return view('welcome');
}
/**
diff --git a/app/Http/Controllers/Frontend/PagesController.php b/app/Http/Controllers/Frontend/PagesController.php
index fe3375f..c7e2102 100644
--- a/app/Http/Controllers/Frontend/PagesController.php
+++ b/app/Http/Controllers/Frontend/PagesController.php
@@ -2,8 +2,7 @@
namespace App\Http\Controllers\Frontend;
use App\Http\Controllers\Controller;
-use App\Dataset;
-use Illuminate\Http\Request;
+use App\Models\Dataset;
use Illuminate\View\View;
class PagesController extends Controller
diff --git a/app/Http/Controllers/Frontend/SearchController.php b/app/Http/Controllers/Frontend/SearchController.php
index bad74a2..e6d5c0b 100644
--- a/app/Http/Controllers/Frontend/SearchController.php
+++ b/app/Http/Controllers/Frontend/SearchController.php
@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Frontend;
use App\Book;
-use App\Dataset;
+use App\Models\Dataset;
use App\Http\Controllers\Controller;
use App\Library\Search\Navigation;
use App\Library\Util\SolrSearchSearcher;
diff --git a/app/Http/Controllers/Frontend/SitelinkController.php b/app/Http/Controllers/Frontend/SitelinkController.php
index f4251e9..cf504cf 100644
--- a/app/Http/Controllers/Frontend/SitelinkController.php
+++ b/app/Http/Controllers/Frontend/SitelinkController.php
@@ -1,8 +1,8 @@
with(['years' => $this->years, 'documents' => $this->ids]);
}
- public function list($year)
+ public function listDocs($year)
{
$this->index();
if (preg_match('/^\d{4}$/', $year) > 0) {
@@ -34,7 +34,7 @@ class SitelinkController extends Controller
$select = Dataset::with('titles', 'authors')
->where('server_state', 'LIKE', "%" . $serverState . "%");
- $from = (int)$year;
+ $from = (int) $year;
$until = $year + 1;
$select
->whereYear('server_date_published', '>=', $from)
diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php
index b1deb3a..3a168d1 100644
--- a/app/Http/Controllers/Oai/RequestController.php
+++ b/app/Http/Controllers/Oai/RequestController.php
@@ -3,9 +3,8 @@ namespace App\Http\Controllers\Oai;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
-use App\Dataset;
+use App\Models\Dataset;
use Illuminate\Support\Facades\Log;
-use App\Book;
class RequestController extends Controller
{
@@ -15,7 +14,7 @@ class RequestController extends Controller
*
* @var array
*/
- private $_deliveringDocumentStates = array('published', 'deleted'); // maybe deleted documents too
+ private $deliveringDocumentStates = array('published', 'deleted'); // maybe deleted documents too
const SET_SPEC_PATTERN = '[A-Za-z0-9\-_\.!~\*\'\(\)]+';
@@ -31,7 +30,7 @@ class RequestController extends Controller
*
* @var \DomDocument Defaults to null.
*/
- protected $_xslt = null;
+ protected $xslt = null;
/**
* Holds the xslt processor.
@@ -47,9 +46,9 @@ class RequestController extends Controller
*/
private function loadStyleSheet($stylesheet)
{
- $this->_xslt = new \DomDocument;
- $this->_xslt->load($stylesheet);
- $this->_proc->importStyleSheet($this->_xslt);
+ $this->xslt = new \DomDocument;
+ $this->xslt->load($stylesheet);
+ $this->_proc->importStyleSheet($this->xslt);
if (isset($_SERVER['HTTP_HOST'])) {
$this->_proc->setParameter('', 'host', $_SERVER['HTTP_HOST']);
}
@@ -91,22 +90,22 @@ class RequestController extends Controller
if (isset($oaiRequest['verb'])) {
$this->_proc->setParameter('', 'oai_verb', $oaiRequest['verb']);
if ($oaiRequest['verb'] == 'Identify') {
- $this->_handleIdentify();
+ $this->handleIdentify();
} elseif ($oaiRequest['verb'] == 'ListMetadataFormats') {
- $this->_handleListMetadataFormats();
+ $this->handleListMetadataFormats();
} elseif ($oaiRequest['verb'] == 'ListRecords') {
- $this->_handleListRecords($oaiRequest);
+ $this->handleListRecords($oaiRequest);
} elseif ($oaiRequest['verb'] == 'ListIdentifiers') {
- $this->_handleListIdentifiers($oaiRequest);
+ $this->handleListIdentifiers($oaiRequest);
} elseif ($oaiRequest['verb'] == 'ListSets') {
- $this->_handleListSets($oaiRequest);
+ $this->handleListSets($oaiRequest);
} else {
- $this->_handleIllegalVerb();
+ $this->handleIllegalVerb();
}
} else {
$oaiRequest['verb'] = 'Identify';
$this->_proc->setParameter('', 'oai_verb', $oaiRequest['verb']);
- $this->doc = $this->_handleIdentify();
+ $this->doc = $this->handleIdentify();
}
//$xml = $this->_xml->saveXML();
@@ -123,7 +122,7 @@ class RequestController extends Controller
*
* @return void
*/
- private function _handleIdentify()
+ private function handleIdentify()
{
$email = "repository@geologie.ac.at";
$repositoryName = "Data Research Repository";
@@ -149,7 +148,7 @@ class RequestController extends Controller
* @param array &$oaiRequest Contains full request information
* @return void
*/
- private function _handleListMetadataFormats()
+ private function handleListMetadataFormats()
{
$this->_xml->appendChild($this->_xml->createElement('Documents'));
}
@@ -160,10 +159,10 @@ class RequestController extends Controller
* @param array &$oaiRequest Contains full request information
* @return void
*/
- private function _handleListRecords($oaiRequest)
+ private function handleListRecords($oaiRequest)
{
$maxRecords = 20;//$this->_configuration->getMaxListRecords();
- $this->_handlingOfLists($oaiRequest, $maxRecords);
+ $this->handlingOfLists($oaiRequest, $maxRecords);
}
/**
@@ -172,10 +171,10 @@ class RequestController extends Controller
* @param array &$oaiRequest Contains full request information
* @return void
*/
- private function _handleListIdentifiers(array &$oaiRequest)
+ private function handleListIdentifiers(array &$oaiRequest)
{
$maxIdentifier = 20;//$this->_configuration->getMaxListIdentifiers();
- $this->_handlingOfLists($oaiRequest, $maxIdentifier);
+ $this->handlingOfLists($oaiRequest, $maxIdentifier);
}
/**
@@ -184,7 +183,7 @@ class RequestController extends Controller
* @param array &$oaiRequest Contains full request information
* @return void
*/
- private function _handleListSets()
+ private function handleListSets()
{
$repIdentifier = "rdr.gba.ac.at";
$this->_proc->setParameter('', 'repIdentifier', $repIdentifier);
@@ -216,7 +215,7 @@ class RequestController extends Controller
}
- private function _handleIllegalVerb()
+ private function handleIllegalVerb()
{
$this->_proc->setParameter('', 'oai_error_code', 'badVerb');
$this->_proc->setParameter('', 'oai_error_message', 'The verb provided in the request is illegal.');
@@ -231,7 +230,7 @@ class RequestController extends Controller
*
* @return void
*/
- private function _handlingOfLists(array &$oaiRequest, $maxRecords)
+ private function handlingOfLists(array &$oaiRequest, $maxRecords)
{
if (true === empty($maxRecords)) {
$maxRecords = 100;
@@ -255,7 +254,7 @@ class RequestController extends Controller
// no resumptionToken is given
$finder = Dataset::query();
// add server state restrictions
- $finder->whereIn('server_state', $this->_deliveringDocumentStates);
+ $finder->whereIn('server_state', $this->deliveringDocumentStates);
if (array_key_exists('set', $oaiRequest)) {
$setarray = explode(':', $oaiRequest['set']);
if ($setarray[0] == 'doc-type') {
@@ -283,7 +282,7 @@ class RequestController extends Controller
//$node = $this->_xml->createElement('Rdr_Dataset');
$domNode = $this->getDatasetXmlDomNode($dataset);
// add frontdoor url
- $this->_addLandingPageAttribute($domNode, $dataset->id);
+ $this->addLandingPageAttribute($domNode, $dataset->id);
// add access rights to element
//$this->_addAccessRights($domNode, $dataset);
@@ -301,8 +300,8 @@ class RequestController extends Controller
//$node->appendChild($child);
//$type = $dataset->type;
- $this->_addSpecInformation($node, 'doc-type:' . $dataset->type);
- //$this->_addSpecInformation($node, 'bibliography:' . 'false');
+ $this->addSpecInformation($node, 'doc-type:' . $dataset->type);
+ //$this->addSpecInformation($node, 'bibliography:' . 'false');
$this->_xml->documentElement->appendChild($node);
}
@@ -314,7 +313,7 @@ class RequestController extends Controller
* @param string $docid Id of the dataset
* @return void
*/
- private function _addLandingPageAttribute(\DOMNode $document, $dataid)
+ private function addLandingPageAttribute(\DOMNode $document, $dataid)
{
$url = route('frontend.dataset.show', $dataid);
@@ -324,7 +323,7 @@ class RequestController extends Controller
$document->appendChild($attr);
}
- private function _addSpecInformation(\DOMNode $document, $information)
+ private function addSpecInformation(\DOMNode $document, $information)
{
$setSpecAttribute = $this->_xml->createAttribute('Value');
$setSpecAttributeValue = $this->_xml->createTextNode($information);
@@ -338,7 +337,7 @@ class RequestController extends Controller
private function getDatasetXmlDomNode($dataset)
{
- if (!in_array($dataset->server_state, $this->_deliveringDocumentStates)) {
+ if (!in_array($dataset->server_state, $this->deliveringDocumentStates)) {
$message = 'Trying to get a document in server state "' . $dataset->server_state . '"';
//Zend_Registry::get('Zend_Log')->err($message);
Log::error("server state: $message");
@@ -349,7 +348,7 @@ class RequestController extends Controller
$xmlModel = new \App\Library\Xml\XmlModel();
$xmlModel->setModel($dataset);
$xmlModel->excludeEmptyFields();
- $xmlModel->setXmlCache(new \App\XmlCache());
+ $xmlModel->setXmlCache(new \App\Models\XmlCache());
return $xmlModel->getDomDocument()->getElementsByTagName('Rdr_Dataset')->item(0);
}
@@ -362,7 +361,7 @@ class RequestController extends Controller
$setSpecPattern = self::SET_SPEC_PATTERN;
$sets = array();
- $finder = new \App\DatasetFinder();
+ $finder = new \App\Models\DatasetFinder();
$finder->setServerState('published');
foreach ($finder->groupedTypesPlusCount() as $doctype => $row) {
if (0 == preg_match("/^$setSpecPattern$/", $doctype)) {
@@ -383,14 +382,22 @@ class RequestController extends Controller
private function handleIdentifyOld()
{
//$earliestDateFromDb = Opus_Document::getEarliestPublicationDate();
- //$earliestDateFromDb = Dataset::select('server_date_created')->orderBy('server_date_created', 'desc')->first()->toDateTimeString();
+ // $earliestDateFromDb = Dataset::select('server_date_created')
+ // ->orderBy('server_date_created', 'desc')
+ // ->first()->toDateTimeString();
$earliestDateFromDb = Dataset::earliestPublicationDate();
- $sxe = new \SimpleXMLElement('');
+ $sxe = new \SimpleXMLElement(
+ ''
+ );
+
$sxe->addAttribute('xmlns', 'http://www.openarchives.org/OAI/2.0/');
$sxe->addAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
$sxe->addAttribute('xmlns:mml', 'http://www.w3.org/1998/Math/MathML');
- $sxe->addAttribute('xsi:schemaLocation', 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd');
+ $sxe->addAttribute(
+ 'xsi:schemaLocation',
+ 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd'
+ );
$sxe->addChild('responseDate', date("Y-m-d\TH:i:s\Z"));
$uri = explode('?', $_SERVER['REQUEST_URI'], 2);
@@ -411,7 +418,7 @@ class RequestController extends Controller
//$oaiIdentifier->addAttribute('xmlns', 'http://www.openarchives.org/OAI/2.0/oai-identifier');
//$oaiIdentifier->addAttribute('xsi:schemaLocation', 'http://www.openarchives.org/OAI/2.0/oai-identifier');
//$oaiIdentifier->addChild('scheme', 'oai');
-
+
return $sxe;
}
}
diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php
index 676f1da..3886f56 100644
--- a/app/Http/Controllers/Publish/IndexController.php
+++ b/app/Http/Controllers/Publish/IndexController.php
@@ -2,12 +2,12 @@
//https://www.5balloons.info/multi-page-step-form-in-laravel-with-validation/
namespace App\Http\Controllers\Publish;
-use App\Dataset;
+use App\Models\Dataset;
use App\Http\Controllers\Controller;
-use App\License;
+use App\Models\License;
use App\Models\File;
-use App\Person;
-use App\Project;
+use App\Models\Person;
+use App\Models\Project;
use App\Models\Title;
use App\Rules\RdrFiletypes;
use App\Rules\RdrFilesize;
diff --git a/app/Http/Controllers/Settings/Access/UserController.php b/app/Http/Controllers/Settings/Access/UserController.php
index 5286599..3fb8e10 100644
--- a/app/Http/Controllers/Settings/Access/UserController.php
+++ b/app/Http/Controllers/Settings/Access/UserController.php
@@ -3,7 +3,7 @@ namespace App\Http\Controllers\Settings\Access;
use App\Http\Controllers\Controller;
use App\Models\Role;
-use App\User;
+use App\Models\User;
use Illuminate\Http\Request;
class UserController extends Controller
diff --git a/app/Http/Controllers/Settings/CategoryController.php b/app/Http/Controllers/Settings/CategoryController.php
index 72fd41b..84c20f0 100644
--- a/app/Http/Controllers/Settings/CategoryController.php
+++ b/app/Http/Controllers/Settings/CategoryController.php
@@ -3,7 +3,7 @@ namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
use App\Http\Requests\ProjectRequest;
-use App\Project;
+use App\Models\Project;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
diff --git a/app/Http/Controllers/Settings/CollectionController.php b/app/Http/Controllers/Settings/CollectionController.php
index 58ba4a8..f842fa0 100644
--- a/app/Http/Controllers/Settings/CollectionController.php
+++ b/app/Http/Controllers/Settings/CollectionController.php
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Settings;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
-use App\Collection;
+use App\Models\Collection;
class CollectionController extends Controller
{
diff --git a/app/Http/Controllers/Settings/DatasetController.php b/app/Http/Controllers/Settings/DatasetController.php
index 48622ba..0361f25 100644
--- a/app/Http/Controllers/Settings/DatasetController.php
+++ b/app/Http/Controllers/Settings/DatasetController.php
@@ -2,9 +2,9 @@
namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
-use App\Dataset;
-use App\Project;
-use App\License;
+use App\Models\Dataset;
+use App\Models\Project;
+use App\Models\License;
use App\Models\Title;
use App\Http\Requests\DocumentRequest;
use Illuminate\View\View;
@@ -33,9 +33,6 @@ class DatasetController extends Controller
} else {
$state = "published";
}
-
-
-
$data = $request->all();
if ($searchType == "simple") {
diff --git a/app/Http/Controllers/Settings/LicenseController.php b/app/Http/Controllers/Settings/LicenseController.php
index d845081..501a81b 100644
--- a/app/Http/Controllers/Settings/LicenseController.php
+++ b/app/Http/Controllers/Settings/LicenseController.php
@@ -2,8 +2,8 @@
namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
-use App\License;
-use App\Language;
+use App\Models\License;
+use App\Models\Language;
use App\Http\Requests\LicenseRequest;
use Illuminate\Http\Request;
use Illuminate\View\View;
diff --git a/app/Http/Controllers/Settings/PersonController.php b/app/Http/Controllers/Settings/PersonController.php
index 639e602..cda1dce 100644
--- a/app/Http/Controllers/Settings/PersonController.php
+++ b/app/Http/Controllers/Settings/PersonController.php
@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
-use App\Person;
+use App\Models\Person;
use App\Http\Requests\PersonRequest;
use Illuminate\Http\Request;
use Illuminate\View\View;
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index e841445..8343d90 100755
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -56,6 +56,7 @@ class Kernel extends HttpKernel
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+ 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
// 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
// 'perm' => \App\Http\Middleware\PermissionMiddleware::class,
diff --git a/app/Library/Xml/Conf.php b/app/Library/Xml/Conf.php
index 3e873bb..af2241d 100644
--- a/app/Library/Xml/Conf.php
+++ b/app/Library/Xml/Conf.php
@@ -1,8 +1,7 @@
array(
'model' => Title::class,
'options' => array('type' => 'main'),
@@ -25,13 +28,13 @@ trait DatasetExtension
'fetch' => 'eager'
),
'Licence' => array(
- 'model' => 'App\License',
+ 'model' => License::class,
'through' => 'link_documents_licences',
'relation' => 'licenses',
'fetch' => 'eager'
),
'PersonAuthor' => array(
- 'model' => 'App\Person',
+ 'model' => Person::class,
'through' => 'link_documents_persons',
'pivot' => array('role' => 'author'),
//'sort_order' => array('sort_order' => 'ASC'), // <-- We need a sorted authors list.
@@ -40,7 +43,7 @@ trait DatasetExtension
'fetch' => 'eager'
),
'PersonContributor' => array(
- 'model' => 'App\Person',
+ 'model' => Person::class,
'through' => 'link_documents_persons',
'pivot' => array('role' => 'contributor'),
// 'sort_order' => array('sort_order' => 'ASC'), // <-- We need a sorted authors list.
@@ -49,15 +52,15 @@ trait DatasetExtension
'fetch' => 'eager'
),
'File' => array(
- 'model' => 'App\Models\File',
+ 'model' => File::class,
'relation' => 'files',
'fetch' => 'eager'
),
);
- protected $_internalFields = array();
+ protected $internalFields = array();
- protected $_fields = array();
+ protected $fields = array();
protected function _initFields()
{
@@ -90,7 +93,7 @@ trait DatasetExtension
$this->addField($field);
}
- foreach (array_keys($this->_externalFields) as $fieldname) {
+ foreach (array_keys($this->externalFields) as $fieldname) {
$field = new Field($fieldname);
$field->setMultiplicity('*');
$this->addField($field);
@@ -112,21 +115,21 @@ trait DatasetExtension
/**
* Get a list of all fields attached to the model. Filters all fieldnames
- * that are defined to be inetrnal in $_internalFields.
+ * that are defined to be inetrnal in $internalFields.
*
- * @see Opus_Model_Abstract::_internalFields
+ * @see Opus_Model_Abstract::internalFields
* @return array List of fields
*/
public function describe()
{
- return array_diff(array_keys($this->_fields), $this->_internalFields);
+ return array_diff(array_keys($this->fields), $this->internalFields);
}
public function addField(Field $field)
{
$fieldname = $field->getName();
- if (isset($fieldname, $this->_externalFields[$fieldname])) {
- $options = $this->_externalFields[$fieldname];
+ if (isset($fieldname, $this->externalFields[$fieldname])) {
+ $options = $this->externalFields[$fieldname];
// set ValueModelClass if a through option is given
if (isset($options['model'])) {
@@ -139,7 +142,7 @@ trait DatasetExtension
//}
}
- $this->_fields[$field->getName()] = $field;
+ $this->fields[$field->getName()] = $field;
$field->setOwningModelClass(get_class($this));
return $this;
}
@@ -157,8 +160,8 @@ trait DatasetExtension
*/
protected function _getField($name)
{
- if (isset($this->_fields[$name])) {
- return $this->_fields[$name];
+ if (isset($this->fields[$name])) {
+ return $this->fields[$name];
} else {
return null;
}
@@ -167,11 +170,11 @@ trait DatasetExtension
public function fetchValues()
{
$this->_initFields();
- foreach ($this->_fields as $fieldname => $field) {
- if (isset($this->_externalFields[$fieldname]) === true) {
+ foreach ($this->fields as $fieldname => $field) {
+ if (isset($this->externalFields[$fieldname]) === true) {
$fetchmode = 'lazy';
- if (isset($this->_externalFields[$fieldname]['fetch']) === true) {
- $fetchmode = $this->_externalFields[$fieldname]['fetch'];
+ if (isset($this->externalFields[$fieldname]['fetch']) === true) {
+ $fetchmode = $this->externalFields[$fieldname]['fetch'];
}
if ($fetchmode === 'lazy') {
@@ -210,7 +213,7 @@ trait DatasetExtension
protected function _loadExternal($fieldname)
{
- $field = $this->_fields[$fieldname];
+ $field = $this->fields[$fieldname];
$modelclass = $field->getLinkModelClass();
if (!isset($modelclass)) {
@@ -223,8 +226,8 @@ trait DatasetExtension
$select = $tableclass->query();//->where("document_id", $this->id);;
// If any declared constraints, add them to query
- if (isset($this->_externalFields[$fieldname]['options'])) {
- $options = $this->_externalFields[$fieldname]['options'];
+ if (isset($this->externalFields[$fieldname]['options'])) {
+ $options = $this->externalFields[$fieldname]['options'];
foreach ($options as $column => $value) {
$select = $select->where($column, $value);
}
@@ -236,17 +239,17 @@ trait DatasetExtension
$datasetId = $this->id;
$rows = array();
- if (isset($this->_externalFields[$fieldname]['through'])) {
- $relation = $this->_externalFields[$fieldname]['relation'];
+ if (isset($this->externalFields[$fieldname]['through'])) {
+ $relation = $this->externalFields[$fieldname]['relation'];
//$rows = $select->datasets
////->orderBy('name')
//->get();
//$licenses = $select->with('datasets')->get();
//$rows = $supplier->datasets;
$rows = $this->{$relation};
- //if (isset($this->_externalFields[$fieldname]['pivot']))
+ //if (isset($this->externalFields[$fieldname]['pivot']))
//{
- // $pivArray = $this->_externalFields[$fieldname]['pivot'];
+ // $pivArray = $this->externalFields[$fieldname]['pivot'];
// $rows = $rows->wherePivot('role', $pivArray['role']);
//}
} else {
diff --git a/app/Library/Xml/Strategy.php b/app/Library/Xml/Strategy.php
index 5d1078e..e244afd 100644
--- a/app/Library/Xml/Strategy.php
+++ b/app/Library/Xml/Strategy.php
@@ -1,7 +1,7 @@
_strategy = new Strategy();// Opus_Model_Xml_Version1;
- $this->_config = new Conf();
- $this->_strategy->setup($this->_config);
+ $this->strategy = new Strategy();// Opus_Model_Xml_Version1;
+ $this->config = new Conf();
+ $this->strategy->setup($this->config);
}
/**
@@ -59,8 +59,8 @@ class XmlModel
*/
public function setStrategy(Strategy $strategy)
{
- $this->_strategy = $strategy;
- $this->_strategy->setup($this->_config);
+ $this->strategy = $strategy;
+ $this->strategy->setup($this->config);
return $this;
}
@@ -73,7 +73,7 @@ class XmlModel
*/
public function setXmlCache(XmlCache $cache)
{
- $this->_cache = $cache;
+ $this->cache = $cache;
return $this;
}
@@ -84,19 +84,19 @@ class XmlModel
*/
public function getXmlCache()
{
- return $this->_cache;
+ return $this->cache;
}
/**
* Set the Model for XML generation.
*
- * @param \App\Dataset $model Model to serialize.
+ * @param \App\Models\Dataset $model Model to serialize.
*
* @return XmlModel Fluent interface.
*/
public function setModel($model)
{
- $this->_config->model = $model;
+ $this->config->model = $model;
return $this;
}
@@ -107,7 +107,7 @@ class XmlModel
*/
public function excludeEmptyFields()
{
- $this->_config->excludeEmpty = true;
+ $this->config->excludeEmpty = true;
return $this;
}
@@ -119,7 +119,7 @@ class XmlModel
*/
public function getDomDocument()
{
- $dataset = $this->_config->model;
+ $dataset = $this->config->model;
$domDocument = $this->getDomDocumentFromXmlCache();
if (!is_null($domDocument)) {
@@ -127,19 +127,19 @@ class XmlModel
}
//create xml:
- $domDocument = $this->_strategy->getDomDocument();
+ $domDocument = $this->strategy->getDomDocument();
//if caching is not desired, return domDocument
- if (is_null($this->_cache)) {
+ if (is_null($this->cache)) {
return $domDocument;
} else {
//create cache relation
- $this->_cache->fill(array(
+ $this->cache->fill(array(
'document_id' => $dataset->id,
- 'xml_version' => (int)$this->_strategy->getVersion(),
+ 'xml_version' => (int)$this->strategy->getVersion(),
'server_date_modified' => $dataset->server_date_modified,
'xml_data' => $domDocument->saveXML()
));
- $this->_cache->save();
+ $this->cache->save();
Log::debug(__METHOD__ . ' cache refreshed for ' . get_class($dataset) . '#' . $dataset->id);
return $domDocument;
@@ -155,15 +155,15 @@ class XmlModel
*/
private function getDomDocumentFromXmlCache()
{
- $dataset = $this->_config->model;
- if (null === $this->_cache) {
+ $dataset = $this->config->model;
+ if (null === $this->cache) {
//$logger->debug(__METHOD__ . ' skipping cache for ' . get_class($model));
Log::debug(__METHOD__ . ' skipping cache for ' . get_class($dataset));
return null;
}
- //$cached = $this->_cache->hasValidEntry(
+ //$cached = $this->cache->hasValidEntry(
// $dataset->id,
- // (int) $this->_strategy->getVersion(),
+ // (int) $this->strategy->getVersion(),
// $dataset->server_date_modified
//);
diff --git a/app/Models/Collection.php b/app/Models/Collection.php
new file mode 100644
index 0000000..60edaec
--- /dev/null
+++ b/app/Models/Collection.php
@@ -0,0 +1,15 @@
+belongsToMany(Dataset::class, 'link_documents_collections', 'collection_id', 'document_id');
+ }
+}
diff --git a/app/Dataset.php b/app/Models/Dataset.php
similarity index 79%
rename from app/Dataset.php
rename to app/Models/Dataset.php
index da58f34..42dbb47 100644
--- a/app/Dataset.php
+++ b/app/Models/Dataset.php
@@ -1,10 +1,15 @@
belongsTo(\App\Project::class, 'project_id', 'id');
+ return $this->belongsTo(Project::class, 'project_id', 'id');
}
public function collections()
{
return $this
- ->belongsToMany(\App\Collection::class, 'link_documents_collections', 'document_id', 'collection_id');
+ ->belongsToMany(Collection::class, 'link_documents_collections', 'document_id', 'collection_id');
}
#region [person table]
@@ -62,7 +67,7 @@ class Dataset extends Model
//return all persons attached to this film
public function persons()
{
- return $this->belongsToMany(\App\Person::class, 'link_documents_persons', 'document_id', 'person_id')
+ return $this->belongsToMany(Person::class, 'link_documents_persons', 'document_id', 'person_id')
->withPivot('role');
}
@@ -74,18 +79,18 @@ class Dataset extends Model
public function authors()
{
return $this
- ->belongsToMany(\App\Person::class, 'link_documents_persons', 'document_id', 'person_id')
+ ->belongsToMany(Person::class, 'link_documents_persons', 'document_id', 'person_id')
->wherePivot('role', 'author');
}
/**
* Add author to dataset
*
- * @param \App\User $user user to add
+ * @param Person $user user to add
*
* @return void
*/
- public function addAuthor(\App\User $user): void
+ public function addAuthor(Person $user): void
{
$this->persons()->save($user, ['role' => 'author']);
}
@@ -98,7 +103,7 @@ class Dataset extends Model
public function contributors()
{
return $this
- ->belongsToMany(\App\Person::class, 'link_documents_persons', 'document_id', 'person_id')
+ ->belongsToMany(Person::class, 'link_documents_persons', 'document_id', 'person_id')
->wherePivot('role', 'contributor');
}
@@ -143,7 +148,7 @@ class Dataset extends Model
public function licenses()
{
- return $this->belongsToMany(\App\License::class, 'link_documents_licences', 'document_id', 'licence_id');
+ return $this->belongsToMany(License::class, 'link_documents_licences', 'document_id', 'licence_id');
}
public function files()
@@ -154,11 +159,11 @@ class Dataset extends Model
/**
* Get the xml-cache record associated with the dataset.
*
- * @return \App\XmlCache
+ * @return \App\Models\XmlCache
*/
public function xmlCache()
{
- return $this->hasOne(\App\XmlCache::class, 'document_id', 'id');
+ return $this->hasOne(XmlCache::class, 'document_id', 'id');
}
public function scopeOrderByType($query)
diff --git a/app/DatasetFinder.php b/app/Models/DatasetFinder.php
similarity index 75%
rename from app/DatasetFinder.php
rename to app/Models/DatasetFinder.php
index 9d67c57..ebc24fc 100644
--- a/app/DatasetFinder.php
+++ b/app/Models/DatasetFinder.php
@@ -1,7 +1,7 @@
_db = $table->getAdapter();
- // $this->_select = $this->_db->select()->from(array('d' => 'documents'));
+ // $this->select = $this->_db->select()->from(array('d' => 'documents'));
- $this->_select = Dataset::query(); //>select('name', 'email as user_email')
+ $this->select = Dataset::query(); //>select('name', 'email as user_email')
}
/**
@@ -39,8 +39,8 @@ class DatasetFinder
*/
public function setServerStateInList($serverStateArray)
{
- $this->_select->whereIn('server_state', $serverStateArray);
- //$this->_select->where('server_state IN (?)', $serverStateArray);
+ $this->select->whereIn('server_state', $serverStateArray);
+ //$this->select->where('server_state IN (?)', $serverStateArray);
return $this;
}
@@ -52,7 +52,7 @@ class DatasetFinder
*/
public function setType($type)
{
- $this->_select->where('type', $type);
+ $this->select->where('type', $type);
return $this;
}
@@ -64,8 +64,8 @@ class DatasetFinder
*/
public function setServerState($serverState)
{
- //$this->_select->where('server_state', '=', $serverState);
- $this->_select->where('server_state', 'LIKE', "%".$serverState."%");
+ //$this->select->where('server_state', '=', $serverState);
+ $this->select->where('server_state', 'LIKE', "%".$serverState."%");
return $this;
}
@@ -76,8 +76,8 @@ class DatasetFinder
*/
public function groupedTypesPlusCount()
{
- //$this->_select->reset('columns');
- $test = $this->_select
+ //$this->select->reset('columns');
+ $test = $this->select
//->select("type") // "count(DISTINCT id)");
->selectRaw('type, count(DISTINCT id) as count')
->groupBy('type')
@@ -93,7 +93,7 @@ class DatasetFinder
*/
public function count()
{
- $this->_select->count();
+ $this->select->count();
}
/**
@@ -107,6 +107,6 @@ class DatasetFinder
public function ids()
{
//return array_unique($this->_db->fetchCol($this->getSelectIds()));
- return $this->_select->pluck('id')->toArray();
+ return $this->select->pluck('id')->toArray();
}
}
diff --git a/app/Models/File.php b/app/Models/File.php
index 08e4f97..50f6f4b 100644
--- a/app/Models/File.php
+++ b/app/Models/File.php
@@ -2,7 +2,7 @@
namespace App\Models;
-use App\Dataset;
+use App\Models\Dataset;
use App\Models\HashValue;
use Illuminate\Database\Eloquent\Model;
diff --git a/app/Language.php b/app/Models/Language.php
similarity index 89%
rename from app/Language.php
rename to app/Models/Language.php
index f514fc4..59eebff 100644
--- a/app/Language.php
+++ b/app/Models/Language.php
@@ -1,5 +1,5 @@
belongsToMany(\App\Dataset::class, 'link_documents_licences', 'licence_id', 'document_id');
+ return $this->belongsToMany(Dataset::class, 'link_documents_licences', 'licence_id', 'document_id');
}
}
diff --git a/app/Models/Page.php b/app/Models/Page.php
index 1530581..6869eab 100644
--- a/app/Models/Page.php
+++ b/app/Models/Page.php
@@ -3,7 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
-use App\User;
+use App\Models\User;
use App\Models\ModelTrait;
class Page extends Model
@@ -62,7 +62,8 @@ class Page extends Model
*/
public function getViewButtonAttribute()
{
- return '
+ return '
';
}
diff --git a/app/Person.php b/app/Models/Person.php
similarity index 66%
rename from app/Person.php
rename to app/Models/Person.php
index 6d318fc..2334805 100644
--- a/app/Person.php
+++ b/app/Models/Person.php
@@ -1,6 +1,7 @@
belongsToMany(\App\Dataset::class, 'link_documents_persons', 'person_id', 'document_id')
- ->withPivot('role');
+ return $this->belongsToMany(Dataset::class, 'link_documents_persons', 'person_id', 'document_id')
+ ->withPivot('role');
}
-
// public function scopeNotLimit($query)
// {
// return $query->where('borrow', '<', 3);
// }
+
/**
* Get the user's full name.
- *
+ * see https://laravel.com/docs/5.6/eloquent-serialization
* @return string
*/
- public function getFullName()
+ public function getFullNameAttribute()
{
return $this->first_name . " " . $this->last_name;
}
diff --git a/app/Project.php b/app/Models/Project.php
similarity index 83%
rename from app/Project.php
rename to app/Models/Project.php
index 13870f6..bfaefa6 100644
--- a/app/Project.php
+++ b/app/Models/Project.php
@@ -1,7 +1,8 @@
hasMany(\App\Dataset::class, 'project_id', 'id');
+ return $this->hasMany(Dataset::class, 'project_id', 'id');
}
// public function books()
diff --git a/app/Models/Title.php b/app/Models/Title.php
index 8c44271..f031637 100644
--- a/app/Models/Title.php
+++ b/app/Models/Title.php
@@ -4,6 +4,7 @@ namespace App\Models;
//use App\Library\Xml\DatasetExtension;
use Illuminate\Database\Eloquent\Model;
+use App\Models\Dataset;
class Title extends Model
{
@@ -16,6 +17,6 @@ class Title extends Model
public function dataset()
{
- return $this->belongsTo(\App\Dataset::class, 'document_id', 'id');
+ return $this->belongsTo(Dataset::class, 'document_id', 'id');
}
}
diff --git a/app/User.php b/app/Models/User.php
old mode 100755
new mode 100644
similarity index 99%
rename from app/User.php
rename to app/Models/User.php
index 59193a7..64a2aef
--- a/app/User.php
+++ b/app/Models/User.php
@@ -1,5 +1,5 @@
belongsTo(\App\Dataset::class, 'document_id', 'id');
+ return $this->belongsTo(Dataset::class, 'document_id', 'id');
}
/**
diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php
index df4ac72..42bf1ce 100755
--- a/app/Services/Registrar.php
+++ b/app/Services/Registrar.php
@@ -1,7 +1,7 @@
[
'users' => [
'driver' => 'eloquent',
- 'model' => App\User::class,
+ 'model' => App\Models\User::class,
],
// 'users' => [
diff --git a/config/entrust.php b/config/entrust.php
index b3f44d7..98b4e15 100644
--- a/config/entrust.php
+++ b/config/entrust.php
@@ -51,7 +51,7 @@ return [
| Update the User if it is in a different namespace.
|
*/
- 'user' => 'App\User',
+ 'user' => 'App\Models\User',
/*
|--------------------------------------------------------------------------
diff --git a/config/services.php b/config/services.php
index 40c1507..62ac69e 100755
--- a/config/services.php
+++ b/config/services.php
@@ -30,7 +30,7 @@ return [
],
'stripe' => [
- 'model' => 'App\User',
+ 'model' => 'App\Models\User',
'secret' => '',
],
diff --git a/public/js/app.js b/public/js/app.js
index c6460ed..6e89ee3 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -1 +1 @@
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=55)}([function(e,t,n){"use strict";var r=n(32),i=n(61),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function s(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===o.call(e)}function c(e,t){if(null!==e&&void 0!==e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(o)}),e.exports=u}).call(t,n(17))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f1)for(var n=1;n0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports={}},function(e,t,n){var r=n(44),i=n(26);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(25)("keys"),i=n(15);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(11),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(10)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(5).f,i=n(3),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(8)},function(e,t,n){var r=n(2),i=n(11),o=n(10),a=n(28),s=n(5).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";(function(t){var r=n(1),i=n(124),o=/^\)\]\}',?\n/,a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={adapter:("undefined"!=typeof XMLHttpRequest?u=n(49):void 0!==t&&(u=n(49)),u),transformRequest:[function(e,t){return i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(e){}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){c.headers[e]={}}),r.forEach(["post","put","patch"],function(e){c.headers[e]=r.merge(a)}),e.exports=c}).call(t,n(17))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;rdocument.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(3),i=n(7),o=n(100)(!1),a=n(24)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(44),i=n(26).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r0&&t-1 in e)}C.fn=C.prototype={jquery:"3.3.1",constructor:C,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=C.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return C.each(this,e)},map:function(e){return this.pushStack(C.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+R+")"+R+"*"),V=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),W=new RegExp(M),z=new RegExp("^"+I+"$"),X={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){d()},ie=ye(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{D.apply(E=N.call(w.childNodes),w.childNodes),E[w.childNodes.length].nodeType}catch(e){D={apply:E.length?function(e,t){j.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,s,c,l,f,h,g,y=t&&t.ownerDocument,_=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return r;if(!i&&((t?t.ownerDocument||t:w)!==p&&d(t),t=t||p,v)){if(11!==_&&(f=Y.exec(e)))if(o=f[1]){if(9===_){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&b(t,c)&&c.id===o)return r.push(c),r}else{if(f[2])return D.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!m||!m.test(e))){if(1!==_)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){for((l=t.getAttribute("id"))?l=l.replace(te,ne):t.setAttribute("id",l=x),s=(h=a(e)).length;s--;)h[s]="#"+l+" "+ge(h[s]);g=h.join(","),y=Q.test(e)&&ve(t.parentNode)||t}if(g)try{return D.apply(r,y.querySelectorAll(g)),r}catch(e){}finally{l===x&&t.removeAttribute("id")}}}return u(e.replace(H,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function ue(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function le(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},d=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,v=!o(p),w!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=G.test(p.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],m=[],(n.qsa=G.test(p.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+R+"*(?:value|"+L+")"),e.querySelectorAll("[id~="+x+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||m.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+R+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=G.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",M)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=G.test(h.compareDocumentPosition),b=t||G.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:l?P(l,e)-P(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===p?-1:t===p?1:i?-1:o?1:l?P(l,e)-P(l,t):0;if(i===o)return le(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?le(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},p):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&d(e),t=t.replace(V,"='$1']"),n.matchesSelector&&v&&!S[t+" "]&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&d(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&O.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):void 0;return void 0!==o?o:n.attributes||!v?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(A),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return l=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&k(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,p,h,v=o!==a?"nextSibling":"previousSibling",m=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!u&&!s,b=!1;if(m){if(o){for(;v;){for(d=t;d=d[v];)if(s?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;h=v="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(b=(p=(c=(l=(f=(d=m)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===_&&c[1])&&c[2],d=p&&m.childNodes[p];d=++p&&d&&d[v]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){l[e]=[_,p,b];break}}else if(y&&(b=p=(c=(l=(f=(d=t)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===_&&c[1]),!1===b)for(;(d=++p&&d&&d[v]||(b=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++b||(y&&((l=(f=d[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[_,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=P(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(H,"$1"));return r[x]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return z.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return J.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xe(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,c=null!=t;s-1&&(o[c]=!(a[c]=f))}}else g=xe(g===a?g.splice(h,g.length):g),i?i(null,a,g,u):D.apply(a,g)})}function _e(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,l=ye(function(e){return e===t},s,!0),f=ye(function(e){return P(t,e)>-1},s,!0),d=[function(e,n,r){var i=!a&&(r||n!==c)||((t=n).nodeType?l(e,n,r):f(e,n,r));return t=null,i}];u1&&be(d),u>1&&ge(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(H,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,l){var f,h,m,g=0,y="0",b=o&&[],x=[],w=c,C=o||i&&r.find.TAG("*",l),k=_+=null==w?1:Math.random()||.1,T=C.length;for(l&&(c=a===p||a||l);y!==T&&null!=(f=C[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument===p||(d(f),s=!v);m=e[h++];)if(m(f,a||p,s)){u.push(f);break}l&&(_=k)}n&&((f=!m&&f)&&g--,o&&b.push(f))}if(g+=y,n&&y!==g){for(h=0;m=t[h++];)m(b,x,a,s);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=$.call(u));x=xe(x)}D.apply(u,x),l&&!o&&x.length>0&&g+t.length>1&&oe.uniqueSort(u)}return l&&(_=k,c=w),b};return n?se(o):o}(o,i))).selector=e}return s},u=oe.select=function(e,t,n,i){var o,u,c,l,f,d="function"==typeof e&&e,p=!i&&a(e=d.selector||e);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===t.nodeType&&v&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(Z,ee),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=X.needsContext.test(e)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((f=r.find[l])&&(i=f(c.matches[0].replace(Z,ee),Q.test(u[0].type)&&ve(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ge(u)))return D.apply(n,i),n;break}}return(d||s(e,p))(i,t,!v,n,!t||Q.test(e)&&ve(t.parentNode)||t),n},n.sortStable=x.split("").sort(A).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ce("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ce("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||ce(L,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(n);C.find=S,C.expr=S.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=S.uniqueSort,C.text=S.getText,C.isXMLDoc=S.isXML,C.contains=S.contains,C.escapeSelector=S.escape;var A=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&C(e).is(n))break;r.push(e)}return r},O=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},E=C.expr.match.needsContext;function $(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var j=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return y(t)?C.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?C.grep(e,function(e){return e===t!==n}):"string"!=typeof t?C.grep(e,function(e){return f.call(t,e)>-1!==n}):C.filter(t,e,n)}C.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?C.find.matchesSelector(r,e)?[r]:[]:C.find.matches(e,C.grep(t,function(e){return 1===e.nodeType}))},C.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(C(e).filter(function(){for(t=0;t1?C.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&E.test(e)?C(e):e||[],!1).length}});var N,P=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||N,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:P.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),j.test(r[1])&&C.isPlainObject(t))for(r in t)y(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=a.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this)}).prototype=C.fn,N=C(a);var L=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&C.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?f.call(C(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),C.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return O((e.parentNode||{}).firstChild,e)},children:function(e){return O(e.firstChild)},contents:function(e){return $(e,"iframe")?e.contentDocument:($(e,"template")&&(e=e.content||e),C.merge([],e.childNodes))}},function(e,t){C.fn[e]=function(n,r){var i=C.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=C.filter(r,i)),this.length>1&&(R[e]||C.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var F=/[^\x20\t\r\n\f]+/g;function M(e){return e}function q(e){throw e}function H(e,t,n,r){var i;try{e&&y(i=e.promise)?i.call(e).done(t).fail(n):e&&y(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}C.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return C.each(e.match(F)||[],function(e,n){t[n]=!0}),t}(e):C.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?C.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},C.extend({Deferred:function(e){var t=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return C.Deferred(function(n){C.each(t,function(t,r){var i=y(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function a(e,t,r,i){return function(){var s=this,u=arguments,c=function(){var n,c;if(!(e=o&&(r!==q&&(s=void 0,u=[n]),t.rejectWith(s,u))}};e?l():(C.Deferred.getStackHook&&(l.stackTrace=C.Deferred.getStackHook()),n.setTimeout(l))}}return C.Deferred(function(n){t[0][3].add(a(0,n,y(i)?i:M,n.notifyWith)),t[1][3].add(a(0,n,y(e)?e:M)),t[2][3].add(a(0,n,y(r)?r:q))}).promise()},promise:function(e){return null!=e?C.extend(e,i):i}},o={};return C.each(t,function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add(function(){r=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=u.call(arguments),o=C.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?u.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(H(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||y(i[n]&&i[n].then)))return o.then();for(;n--;)H(i[n],a(n),o.reject);return o.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&B.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},C.readyException=function(e){n.setTimeout(function(){throw e})};var U=C.Deferred();function V(){a.removeEventListener("DOMContentLoaded",V),n.removeEventListener("load",V),C.ready()}C.fn.ready=function(e){return U.then(e).catch(function(e){C.readyException(e)}),this},C.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==e&&--C.readyWait>0||U.resolveWith(a,[C]))}}),C.ready.then=U.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?n.setTimeout(C.ready):(a.addEventListener("DOMContentLoaded",V),n.addEventListener("load",V));var W=function(e,t,n,r,i,o,a){var s=0,u=e.length,c=null==n;if("object"===_(n))for(s in i=!0,n)W(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,y(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(C(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),C.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,C.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=C.queue(e,t),r=n.length,i=n.shift(),o=C._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){C.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:C.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),C.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ve={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&$(e,t)?C.merge([e],n):n}function ge(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(c=C.contains(o.ownerDocument,o),a=me(f.appendChild(o),"script"),c&&ge(a),n)for(l=0;o=a[l++];)he.test(o.type||"")&&n.push(o);return f}ye=a.createDocumentFragment().appendChild(a.createElement("div")),(be=a.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),ye.appendChild(be),g.checkClone=ye.cloneNode(!0).cloneNode(!0).lastChild.checked,ye.innerHTML="",g.noCloneChecked=!!ye.cloneNode(!0).lastChild.defaultValue;var _e=a.documentElement,Ce=/^key/,ke=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Ae(){return!1}function Oe(){try{return a.activeElement}catch(e){}}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ae;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return C().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=C.guid++)),e.each(function(){C.event.add(this,t,i,r,n)})}C.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,p,h,v,m=Q.get(e);if(m)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&C.find.matchesSelector(_e,i),n.guid||(n.guid=C.guid++),(u=m.events)||(u=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==C&&C.event.triggered!==t.type?C.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(F)||[""]).length;c--;)p=v=(s=Te.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p&&(f=C.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=C.event.special[p]||{},l=C.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&C.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||((d=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),C.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,c,l,f,d,p,h,v,m=Q.hasData(e)&&Q.get(e);if(m&&(u=m.events)){for(c=(t=(t||"").match(F)||[""]).length;c--;)if(p=v=(s=Te.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p){for(f=C.event.special[p]||{},d=u[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)l=d[o],!i&&v!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(e,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||C.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)C.event.remove(e,p+t[c],n,r,!0);C.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=C.event.fix(e),u=new Array(arguments.length),c=(Q.get(this,"events")||{})[s.type]||[],l=C.event.special[s.type]||{};for(u[0]=s,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:C.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,je=/
\ No newline at end of file
diff --git a/resources/lang/en/doctypes.php b/resources/lang/en/doctypes.php
index 2dde9d4..ab472db 100644
--- a/resources/lang/en/doctypes.php
+++ b/resources/lang/en/doctypes.php
@@ -4,7 +4,7 @@ return [
/*
|--------------------------------------------------------------------------
- | Pagination Language Lines
+ | Doctypes Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
diff --git a/resources/views/settings/person/edit.blade.php b/resources/views/settings/person/edit.blade.php
index e9dd652..885b807 100644
--- a/resources/views/settings/person/edit.blade.php
+++ b/resources/views/settings/person/edit.blade.php
@@ -3,7 +3,7 @@
@section('content')
diff --git a/routes/api.php b/routes/api.php
index 55f7341..b478d7b 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -2,6 +2,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
+use App\Models\Person;
/*
|--------------------------------------------------------------------------
@@ -18,4 +19,45 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
-Route::get('/oai', 'Oai\RequestController@identify');
\ No newline at end of file
+Route::get('/oai', 'Oai\RequestController@identify');
+
+Route::get('/api/persons', function () {
+ $request = request();
+ $query = Person::query();//->with('group');
+ // handle sort option
+ //if (request()->has('sort')) {
+ if (null !== ($request->input('sort'))) {
+ // handle multisort
+ $sorts = explode(',', request()->sort);
+ foreach ($sorts as $sort) {
+ list($sortCol, $sortDir) = explode('|', $sort);
+ $query = $query->orderBy($sortCol, $sortDir);
+ }
+ } else {
+ $query = $query->orderBy('id', 'asc');
+ }
+ if ($request->exists('filter')) {
+ $query->where(function ($q) use ($request) {
+ $value = "%{$request->filter}%";
+ $q->where('name', 'like', $value)
+ // ->orWhere('nickname', 'like', $value)
+ ->orWhere('email', 'like', $value);
+ });
+ }
+ $perPage = request()->has('per_page') ? (int) request()->per_page : null;
+ // $pagination = $query->with('address')->paginate($perPage);
+ $pagination = $query->paginate($perPage);
+ $pagination->appends([
+ 'sort' => request()->sort,
+ 'filter' => request()->filter,
+ 'per_page' => request()->per_page
+ ]);
+ // The headers 'Access-Control-Allow-Origin' and 'Access-Control-Allow-Methods'
+ // are to allow you to call this from any domain (see CORS for more info).
+ // This is for local testing only. You should not do this in production server,
+ // unless you know what it means.
+ return response()
+ ->json($pagination)
+ ->header('Access-Control-Allow-Origin', '*')
+ ->header('Access-Control-Allow-Methods', 'GET');
+});
diff --git a/routes/web.php b/routes/web.php
index ca7ffb5..543ecc0 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Route;
Route::get('/oai', ['as' => 'oai', 'uses' => 'Oai\RequestController@index']);
+//=================================================publish dataasets================================================
Route::group(
[
'namespace' => 'Publish',
@@ -197,6 +198,9 @@ Route::group(['middleware' => ['permission:settings']], function () {
*/
Route::group(['namespace' => 'Frontend', 'as' => 'frontend.'], function () {
// includeRouteFiles(__DIR__.'/Frontend/');
+ Route::get('/test', [
+ 'as' => 'home.index', 'uses' => 'HomeController@test',
+ ]);
Route::get('/', [
'as' => 'home.index', 'uses' => 'HomeController@index',
]);
@@ -217,7 +221,7 @@ Route::group(['namespace' => 'Frontend', 'as' => 'frontend.'], function () {
Route::get('sitelinks', [
'as' => 'sitelinks.index', 'uses' => 'SitelinkController@index',
]);
- Route::get('sitelinks/list/{year}', 'SitelinkController@list')->name('sitelinks.list');
+ Route::get('sitelinks/list/{year}', 'SitelinkController@listDocs')->name('sitelinks.list');
Route::get('/dataset', [
'as' => 'datasets', 'uses' => 'PagesController@datasets',