Author: fortim
Date: 2008-12-05 13:57:53 -0800 (Fri, 05 Dec 2008)
New Revision: 1662

Modified:
   trunk/qubit/apps/qubit/lib/oai.class.php
Log:
Added Set attribution function

Modified: trunk/qubit/apps/qubit/lib/oai.class.php
===================================================================
--- trunk/qubit/apps/qubit/lib/oai.class.php    2008-12-05 21:53:44 UTC (rev 
1661)
+++ trunk/qubit/apps/qubit/lib/oai.class.php    2008-12-05 21:57:53 UTC (rev 
1662)
@@ -1,8 +1,12 @@
 <?php
 class oai {
-  public static function getDate()
+  public static function getDate($date = '')
   {
-    return gmdate('Y-m-d\TH:i:s\Z');
+    if ($date == '')
+    {
+      return gmdate('Y-m-d\TH:i:s\Z');
+    }
+    return gmdate('Y-m-d\TH:i:s\Z', strtotime($date));
   }
 
   public static function getMetadataPrefixes()
@@ -13,4 +17,28 @@
                       array('prefix'=>'MODS', 'ns'=>'http://MODS', 
'schema'=>'http://modsSchema'));
     return $prefixes;
   }
+
+  public static function getCollectionArray()
+  {
+    $collections = QubitInformationObject::getCollections();
+    $collectionTable = array();
+
+    foreach ($collections as $collection)
+    {
+      $collectionTable[]= array('setSpec'=>$collection->getId(), 'lft' => 
$collection->getLft(), 'rgt' => $collection->getRgt());
+    }
+    return $collectionTable;
+  }
+
+  public static function getSetSpec($left, $collectionTable)
+  {
+    foreach ($collectionTable as $collection)
+    {
+      if ($collection['lft'] <= $left AND $collection['rgt'] > $left)
+      {
+        return $collection['setSpec'];
+      }
+    }
+    return 'None';
+  }
 }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to