From 81260056727f06453d00ec1fe9464b2c486b008e Mon Sep 17 00:00:00 2001 From: Martin Dahl Date: Fri, 21 Dec 2012 16:27:23 +0100 Subject: [PATCH] Todo --- ting.client.inc | 5 ++++- ting.entities.inc | 5 +++++ ting.module | 8 +++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ting.client.inc b/ting.client.inc index c351a70..990cf56 100644 --- a/ting.client.inc +++ b/ting.client.inc @@ -270,8 +270,11 @@ function ting_execute_cache($request) { if (!isset($calls)) { $calls = array(); } - $calls[] = $request->getRequest()->getParameters(); + $params = $request->getRequest()->getParameters(); + $start_time = microtime(TRUE); $reply = ting_execute($request); + $params['time'] = microtime(TRUE) - $start_time; + $calls[] = $params; // Cache any sub-objects (mostly true for collections). if (isset($reply->objects)) { diff --git a/ting.entities.inc b/ting.entities.inc index aacf1b7..5c679d7 100644 --- a/ting.entities.inc +++ b/ting.entities.inc @@ -49,6 +49,7 @@ class TingEntity extends DingEntity { public $isPartOf = DingEntityBase::NULL; public $extent = DingEntityBase::NULL; public $classification = DingEntityBase::NULL; + public $publisher = DingEntityBase::NULL; public function getExtent() { return !empty($this->reply->record['dcterms:extent'][''][0]) ? $this->reply->record['dcterms:extent'][''][0] : FALSE; @@ -135,6 +136,10 @@ class TingEntity extends DingEntity { return !empty($this->reply->record) ? $this->reply->record : false; } + public function getPublisher() { + return !empty($this->reply->record['dc:publisher'][''][0]) ? $this->reply->record['dc:publisher'][''][0] : FALSE; + } + function getRelations() { // If relations are not set; do another request to get relations if( !isset($this->reply->relationsData) ) { diff --git a/ting.module b/ting.module index 2aadba2..53051e6 100644 --- a/ting.module +++ b/ting.module @@ -520,14 +520,14 @@ function ting_ding_entity_buttons($type, $entity) { */ function ting_page_alter(&$page) { $calls = &drupal_static('ting_execute_cache'); - if (sizeof($calls) > 1) { + if (sizeof($calls) > 5) { $calls_str = array(); foreach ($calls as $call) { $calls_str[] = print_r($calls, TRUE); } watchdog('ting', 'Warning, ting_execute called @x times:
"@queries"', array('@x' => sizeof($calls), '@queries' => join('" "', $calls_str)), WATCHDOG_WARNING); if (function_exists('dpm') && user_access('access devel information')) { - drupal_set_message(t('Warning, ting_execute called @x times.', array('@x' => sizeof($calls))), 'error'); + //drupal_set_message(t('Warning, ting_execute called @x times.', array('@x' => sizeof($calls))), 'error'); dpm($calls, 'ting_execute queries:'); } } @@ -554,7 +554,9 @@ function ting_collection_page_view($object) { * Page title callback. */ function ting_page_title($object) { - return check_plain($object->title); + // check_plain is handled later on. + return $object->title; + // return check_plain($object->title); } /**