コード例 #1
0
 public function testMetsAlto()
 {
     if (!plugin_is_active('OcrElementSet')) {
         $this->markTestSkipped(__('This test requires OcrElementSet.'));
     }
     $uri = TEST_FILES_DIR . DIRECTORY_SEPARATOR . 'Folder_Test_Mets_Alto';
     $parameters = array('add_relations' => true, 'ocr_fill_text' => true, 'ocr_fill_data' => true, 'ocr_fill_process' => true);
     $this->_expectedXml = $this->_expectedBaseDir . DIRECTORY_SEPARATOR . 'FolderTest_Mets_Alto.xml';
     $this->_prepareFolderTest($uri, $parameters);
     $this->_checkFolder();
 }
コード例 #2
0
ファイル: custom.php プロジェクト: AdrienneSerra/Digitalsc
function get_child_collections($collectionId)
{
    if (plugin_is_active('CollectionTree')) {
        $treeChildren = get_db()->getTable('CollectionTree')->getChildCollections($collectionId);
        $childCollections = array();
        foreach ($treeChildren as $treeChild) {
            $childCollections[] = get_record_by_id('collection', $treeChild['id']);
        }
        return $childCollections;
    }
    return array();
}
コード例 #3
0
 /**
  * Install the passed plugin. If the installation fails, skip the test.
  *
  * @param string $pluginName The plugin name.
  */
 protected function _installPluginOrSkip($pluginName)
 {
     // Break if plugin is already installed. (Necessary to prevent errors
     // caused by trying to re-activate the Exhibit Builder ACL.)
     if (plugin_is_active($pluginName)) {
         return;
     }
     try {
         $this->helper->setUp($pluginName);
     } catch (Exception $e) {
         $this->markTestSkipped("Plugin {$pluginName} can't be installed.");
     }
 }
コード例 #4
0
ファイル: Abstract.php プロジェクト: Daniel-KM/ArchiveFolder
 public function __construct($uri, $parameters)
 {
     // Set the default value.
     if (plugin_is_active('DublinCoreExtended')) {
         $this->_parametersFormat['use_dcterms'] = true;
     }
     $this->_uri = $uri;
     $this->_parameters = $parameters;
     if ($this->_parametersFormat['use_dcterms']) {
         $this->_loadDcmiElements();
     }
     $this->_managePaths = new ArchiveFolder_Tool_ManagePaths($this->_uri, $this->_parameters);
 }
コード例 #5
0
 public function testMappings()
 {
     $notReady = array();
     foreach ($this->_metadataFilesByFolder as $folder => $metadataFiles) {
         foreach ($metadataFiles as $metadataFile) {
             $prefix = key($metadataFile);
             $metadataFile = reset($metadataFile);
             $uri = TEST_FILES_DIR . DIRECTORY_SEPARATOR . $folder;
             $filepath = TEST_FILES_DIR . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $metadataFile;
             $expectedPath = TEST_FILES_DIR . DIRECTORY_SEPARATOR . 'Results' . DIRECTORY_SEPARATOR . 'Mappings' . DIRECTORY_SEPARATOR . basename($filepath) . '.json';
             if ($prefix == 'omeka' || $prefix == 'mag') {
                 $notReady[] = basename($expectedPath);
                 continue;
             }
             if (!file_exists($expectedPath)) {
                 $notReady[] = basename($expectedPath);
                 continue;
             }
             if ($prefix == 'mets' && !plugin_is_active('OcrElementSet')) {
                 $notReady[] = basename($expectedPath);
                 // $this->markTestSkipped(
                 //    __('This test requires OcrElementSet.')
                 // );
                 continue;
             }
             $expected = file_get_contents($expectedPath);
             $expected = trim($expected);
             $this->assertTrue(strlen($expected) > 0, __('Result for file "%s" (prefix "%s") is not readable.', basename($filepath), $prefix));
             $mapping = $this->_mappings[$prefix]['class'];
             $mapping = new $mapping($uri, array());
             $result = $mapping->isMetadataFile($filepath);
             $this->assertTrue($result, __('The file "%s" is not recognized as format "%s".', basename($filepath), $prefix));
             if (version_compare(phpversion(), '5.4.0', '<')) {
                 $this->markTestSkipped(__('This test requires php 5.4.0 or higher.'));
             }
             $result = $mapping->listDocuments($filepath);
             $result = json_encode($result, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
             // Remove local paths before comparaison.
             $jsonUri = trim(json_encode($uri, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), '"');
             $expected = str_replace($jsonUri, '::ExampleBasePath::', $expected);
             $result = str_replace($jsonUri, '::ExampleBasePath::', $result);
             $this->assertEquals($expected, $result, __('The list of documents for file "%s" (prefix "%s") is not correct.', basename($filepath), $prefix));
         }
     }
     if ($notReady) {
         $this->markTestIncomplete(__('Some file for the mapping test are not ready: "%s".', implode('", "', $notReady)));
     }
 }
コード例 #6
0
 public function setUp()
 {
     parent::setUp();
     if (plugin_is_active('UserProfiles')) {
         $this->_hooks[] = 'user_profiles_user_page';
     }
     if (!is_admin_theme()) {
         //dig up all the elements being used, and add their ElementForm hook
         $elementsTable = $this->_db->getTable('Element');
         $select = $elementsTable->getSelect();
         $select->join(array('contribution_type_elements' => $this->_db->ContributionTypeElement), 'element_id = elements.id', array());
         $elements = $elementsTable->fetchObjects($select);
         foreach ($elements as $element) {
             add_filter(array('ElementForm', 'Item', $element->set_name, $element->name), array($this, 'elementFormFilter'), 2);
             add_filter(array('ElementInput', 'Item', $element->set_name, $element->name), array($this, 'elementInputFilter'), 2);
         }
     }
 }
コード例 #7
0
/**
 * Return record coverage data from the NeatlineFeatures plugin.
 *
 * @param $record NeatlineRecord The record to get the feature for.
 * @return string|null
 */
function nl_getNeatlineFeaturesWkt($record)
{
    // Halt if Features is not present.
    if (!plugin_is_active('NeatlineFeatures')) {
        return;
    }
    $db = get_db();
    // Get raw coverage.
    $result = $db->fetchOne("SELECT geo FROM `{$db->prefix}neatline_features`\n        WHERE is_map=1 AND item_id=?;", $record->item_id);
    if ($result) {
        // If KML, convert to WKT.
        if (strpos($result, '<kml') !== false) {
            $result = nl_extractWkt(trim($result));
        } else {
            $result = 'GEOMETRYCOLLECTION(' . implode(',', explode('|', $result)) . ')';
        }
    }
    return $result;
}
コード例 #8
0
 private function _getForm()
 {
     $form = new Omeka_Form_Admin(array('type' => 'contribution_settings'));
     $form->addElementToEditGroup('text', 'contribution_page_path', array('label' => __('Contribution Slug'), 'description' => __('Relative path from the Omeka root to the desired location for the contribution form. If left blank, the default path will be named &#8220;contribution.&#8221;'), 'filters' => array(array('StringTrim', '/\\\\s'))));
     $form->addElementToEditGroup('text', 'contribution_email_sender', array('label' => __('Contribution Confirmation Email'), 'description' => __('An email message will be sent to each contributor from this address confirming that they submitted a contribution to this website. Leave blank if you do not want an email sent.'), 'validators' => array('EmailAddress')));
     $form->addElementToEditGroup('textarea', 'contribution_email_recipients', array('label' => __('New Contribution Notification Emails'), 'description' => __('An email message will be sent to each address here whenever a new item is contributed. Leave blank if you do not want anyone to be alerted of contributions by email.'), 'attribs' => array('rows' => '5')));
     $form->addElementToEditGroup('textarea', 'contribution_consent_text', array('label' => __('Text of Terms of Service'), 'description' => __('The text of the legal disclaimer to which contributors will agree.'), 'attribs' => array('class' => 'html-editor', 'rows' => '15')));
     $form->addElementToEditGroup('checkbox', 'contribution_simple', array('label' => __("Use 'Simple' Options"), 'description' => __("This will require an email address from contributors, and create a guest user from that information. If those users want to use the account, they will have to request a new password for the account. If you want to collect additional information about contributors, you cannot use the simple option. See <a href='http://omeka.org/codex/Plugins/Contribution_2.0'>documentation</a> for details. ")), array('checked' => (bool) get_option('contribution_simple') ? 'checked' : ''));
     $form->addElementToEditGroup('textarea', 'contribution_email', array('label' => __("Email text to send to contributors"), 'description' => __("Email text to send to contributors when they submit an item. A link to their contribution will be appended. If using the 'Simple' option, we recommend that you notify contributors that a guest user account has been created for them, and what they gain by confirming their account."), 'attribs' => array('class' => 'html-editor', 'rows' => '15')));
     $collections = get_db()->getTable('Collection')->findPairsForSelectForm();
     $collections = array('' => __('Do not put contributions in any collection')) + $collections;
     $form->addElementToEditGroup('select', 'contribution_collection_id', array('label' => __('Contribution Collection'), 'description' => __('The collection to which contributions will be added. Changes here will only affect new contributions.'), 'multiOptions' => $collections));
     $types = get_db()->getTable('ContributionType')->findPairsForSelectForm();
     $types = array('' => __('No default type')) + $types;
     $form->addElementToEditGroup('select', 'contribution_default_type', array('label' => __('Default Contribution Type'), 'description' => __('The type that will be chosen for contributors by default.'), 'multiOptions' => $types));
     if (plugin_is_active('UserProfiles')) {
         $profileTypes = $this->_helper->db->getTable('UserProfilesType')->findPairsForSelectForm();
         $form->addElementToEditGroup('select', 'contribution_user_profile_type', array('label' => __('Choose a profile type for contributors'), 'description' => __('Configure the profile type under User Profiles'), 'multiOptions' => array('' => __("None")) + $profileTypes));
     }
     return $form;
 }
コード例 #9
0
 public function linkToOwnerProfile($args)
 {
     if (isset($args['owner'])) {
         $owner = $args['owner'];
     }
     if (!isset($args['owner']) && isset($args['item'])) {
         $item = $args['item'];
         $owner = $item->getOwner();
     }
     if (!isset($args['type'])) {
         //get the first type
         $types = get_db()->getTable('UserProfilesType')->findBy(array(), 1);
         if (!isset($types[0])) {
             return '';
         }
         $type = $types[0];
     }
     if (isset($args['text'])) {
         $text = $args['text'];
     } else {
         $text = '';
     }
     $html = "";
     if ($owner) {
         $html .= "<div id='user-profiles-link-to-owner'>";
         $html .= "{$text} <a href='" . url('user-profiles/profiles/user/id/' . $owner->id . '/type/' . $type->id) . "'>{$owner->name}</a>";
         $html .= "</div>";
     }
     //hack to enforce compatibility with Contribution's anonymous contribution option
     if (plugin_is_active('Contribution')) {
         if (!empty($item)) {
             $contributedItem = get_db()->getTable('ContributionContributedItem')->findByItem($item);
         }
         if (isset($contributedItem) && $contributedItem->anonymous) {
             return;
         }
     }
     return $html;
 }
コード例 #10
0
ファイル: ConfigForm.php プロジェクト: Daniel-KM/MetsExport
 /**
  * Process the data from the form and save changes to options
  *
  *@return void
  */
 public static function ProcessPost()
 {
     if (!empty($_REQUEST['derivImages'])) {
         set_option('mets_includeDeriv', 'true');
     } else {
         set_option('mets_includeDeriv', 'false');
     }
     if (plugin_is_active('HistoryLog')) {
         if (!empty($_REQUEST['includeLogs'])) {
             set_option('mets_includeLogs', 'true');
         } else {
             set_option('mets_includeLogs', 'false');
         }
     }
     if (isset($_REQUEST['admElements'])) {
         $options = array();
         foreach ($_REQUEST['admElements'] as $elementName) {
             $options[$elementName] = $_REQUEST['adm_type_' . str_replace(' ', '', $elementName)];
         }
         set_option('mets_admElements', serialize($options));
     }
 }
コード例 #11
0
 /**
  * Get a pre tiled image.
  *
  * @todo Prebuild tiles directly with the IIIF standard (same type of url).
  *
  * @internal Because the position of the requested region may be anything
  * (it depends of the client), until four images may be needed to build the
  * resulting image. It's always quicker to reassemble them rather than
  * extracting the part from the full image, specially with big ones.
  * Nevertheless, OpenSeaDragon tries to ask 0-based tiles, so only this case
  * is managed currently.
  * @todo For non standard requests, the tiled images may be used to rebuild
  * a fullsize image that is larger the Omeka derivatives. In that case,
  * multiple tiles should be joined.
  *
  * @todo If OpenLayersZoom uses an IIPImage server, it simpler to link it
  * directly to Universal Viewer.
  *
  * @param File $file
  * @param array $transform
  * @return array|null Associative array with the file path, the derivative
  * type, the width and the height. Null if none.
  */
 protected function _usePreTiled($file, $transform)
 {
     // Some requirements to get tiles.
     if (!in_array($transform['region']['feature'], array('regionByPx', 'full')) || !in_array($transform['size']['feature'], array('sizeByW', 'sizeByH', 'sizeByWh', 'sizeByWhListed', 'full'))) {
         return;
     }
     // Check if the file is pretiled with the OpenLayersZoom.
     if (plugin_is_active('OpenLayersZoom') && $this->view->openLayersZoom()->isZoomed($file)) {
         // Get the level and position x and y of the tile.
         $data = $this->_getLevelAndPosition($file, $transform['source'], $transform['region'], $transform['size']);
         if (is_null($data)) {
             return;
         }
         // Determine the tile group.
         $tileGroup = $this->_getTileGroup(array('width' => $transform['source']['width'], 'height' => $transform['source']['height']), $data);
         if (is_null($tileGroup)) {
             return;
         }
         // Set the image path.
         $olz = new OpenLayersZoom_Creator();
         $dirWeb = $olz->getZDataWeb($file);
         $dirpath = $olz->useIIPImageServer() ? $dirWeb : $olz->getZDataDir($file);
         $path = sprintf('/TileGroup%d/%d-%d-%d.jpg', $tileGroup, $data['level'], $data['x'], $data['y']);
         // The imageUrl is used when there is no transformation.
         $imageUrl = $dirWeb . $path;
         $imagePath = $dirpath . $path;
         $derivativeType = 'zoom_tiles';
         list($tileWidth, $tileHeight) = array_values($this->_getWidthAndHeight($imagePath));
         return array('fileurl' => $imageUrl, 'filepath' => $imagePath, 'derivativeType' => $derivativeType, 'mime_type' => 'image/jpeg', 'width' => $tileWidth, 'height' => $tileHeight);
     }
 }
コード例 #12
0
 protected function _processUserProfile($post, $user)
 {
     $profileTypeId = get_option('contribution_user_profile_type');
     if ($profileTypeId && plugin_is_active('UserProfiles')) {
         $profile = $this->_helper->db->getTable('UserProfilesProfile')->findByUserIdAndTypeId($user->id, $profileTypeId);
         if (!$profile) {
             $profile = new UserProfilesProfile();
             $profile->setOwner($user);
             $profile->type_id = $profileTypeId;
             $profile->public = 0;
             $profile->setRelationData(array('subject_id' => $user->id, 'user_id' => $user->id));
         }
         $profile->setPostData($post);
         $this->_profile = $profile;
         if (!$profile->save(false)) {
             return false;
         }
     }
     return true;
 }
コード例 #13
0
ファイル: MetsExporter.php プロジェクト: Daniel-KM/MetsExport
 /**
  *Retrieve the slug for a given metadata element name
  *
  *@param string $elementName The name of the metadata element
  * currently being exported
  *@return string $slug The standard shortened form of the 
  *metadata element name, or "unknown"
  */
 private function _getElementSlug($elementName, $elementSetName = '')
 {
     if ($elementSetName == "UCLDC Schema" && plugin_is_active('NuxeoLink')) {
         require_once dirname(dirname(dirname(__FILE__))) . '/NuxeoLink/helpers/APIfunctions.php';
         return NuxeoOmekaSession::GetElementSlug($elementName);
     }
     return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $elementName));
 }
コード例 #14
0
 /**
  * Get the IIIF info for the specified record.
  *
  * @todo Replace all data by standard classes.
  *
  * @param Record|integer|null $record
  * @param boolean $asJson Return manifest as object or as a json string.
  * @return Object|string|null. The object or the json string corresponding
  * to the manifest.
  */
 public function iiifInfo($record = null, $asJson = true)
 {
     if (is_null($record)) {
         $record = get_current_record('file');
     } elseif (is_numeric($record)) {
         $record = get_record_by_id('File', (int) $record);
     }
     if (empty($record)) {
         return null;
     }
     if (get_class($record) != 'File') {
         return null;
     }
     $file = $record;
     if (strpos($file->mime_type, 'image/') === 0) {
         $sizes = array();
         $availableTypes = array('thumbnail', 'fullsize', 'original');
         foreach ($availableTypes as $imageType) {
             $imageSize = $this->_getImageSize($file, $imageType);
             $size = array();
             $size['width'] = $imageSize['width'];
             $size['height'] = $imageSize['height'];
             $size = (object) $size;
             $sizes[] = $size;
         }
         $imageType = 'original';
         $imageSize = $this->_getImageSize($file, $imageType);
         list($width, $height) = array_values($imageSize);
         $imageUrl = absolute_url(array('id' => $file->id), 'universalviewer_image');
         $tiles = array();
         if (plugin_is_active('OpenLayersZoom') && $this->view->openLayersZoom()->isZoomed($file)) {
             $tile = $this->_iiifTile($file);
             if ($tile) {
                 $tiles[] = $tile;
             }
         }
         $profile = array();
         $profile[] = 'http://iiif.io/api/image/2/level2.json';
         // According to specifications, the profile details should be omitted,
         // because only default formats, qualities and supports are supported
         // currently.
         /*
         $profileDetails = array();
         $profileDetails['format'] = array('jpg');
         $profileDetails['qualities'] = array('default');
         $profileDetails['supports'] = array('sizeByWhListed');
         $profileDetails = (object) $profileDetails;
         $profile[] = $profileDetails;
         */
         // Exemple of service, useless currently.
         /*
         $service = array();
         $service['@context'] = 'http://iiif.io/api/annex/service/physdim/1/context.json';
         $service['profile'] = 'http://iiif.io/api/annex/service/physdim';
         $service['physicalScale'] = 0.0025;
         $service['physicalUnits'] = 'in';
         $service = (object) $service;
         */
         $info = array();
         $info['@context'] = 'http://iiif.io/api/image/2/context.json';
         $info['@id'] = $imageUrl;
         $info['protocol'] = 'http://iiif.io/api/image';
         $info['width'] = $width;
         $info['height'] = $height;
         $info['sizes'] = $sizes;
         if ($tiles) {
             $info['tiles'] = $tiles;
         }
         $info['profile'] = $profile;
         // Useless currently.
         // $info['service'] = $service;
         $info = (object) $info;
     } else {
         $info = array();
         $info['@context'] = array('http://iiif.io/api/presentation/2/context.json', 'http://wellcomelibrary.org/ld/ixif/0/context.json');
         $fileUrl = absolute_url(array('id' => $file->id), 'universalviewer_media');
         $info['@id'] = $fileUrl;
         // See MediaController::contextAction()
         $info['protocol'] = 'http://wellcomelibrary.org/ld/ixif';
         $info = (object) $info;
     }
     if ($asJson) {
         return version_compare(phpversion(), '5.4.0', '<') ? json_encode($info) : json_encode($info, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     }
     // Return as array
     return $info;
 }
コード例 #15
0
ファイル: index.php プロジェクト: kalbers/religions-in-mn
<?php

echo head(array('bodyclass' => 'home'));
?>



<?php 
if (plugin_is_active('ExhibitBuilder')) {
    ?>
<!-- Featured Exhibit -->
<?php 
    $featuredExhibits = get_records('Exhibit', array('featured' => true));
    if ($featuredExhibits) {
        ?>
<div class="slider-pro" id="featured-exhibit">
    <div class="sp-slides">
        <?php 
        foreach ($featuredExhibits as $featuredExhibit) {
            ?>

            <div class="sp-slide">
                    <?php 
            $file = $featuredExhibit->getFile();
            ?>
                <?php 
            if ($file) {
                ?>
                    <?php 
                $exhibitImage = metadata($file, 'fullsize_uri');
                ?>
コード例 #16
0
ファイル: show.php プロジェクト: srerickson/harlem-theme

<div id="title-row">
  <div class="title">
    <h2><?php 
echo metadata('item', array('Dublin Core', 'Title'));
?>
</h2>

    <span class="collection">
      <!-- Collections: use CollectionTree or fallback to default -->
      <?php 
if (metadata('item', 'Collection Name')) {
    ?>
        <?php 
    if (plugin_is_active('CollectionTree')) {
        ?>
          <?php 
        $collection = get_collection_for_item($item);
        $collectionTree = get_db()->getTable('CollectionTree')->getCollectionTree($collection->id);
        echo get_view()->partial('collections/collection-tree-list.php', array('collection_tree' => $collectionTree));
        ?>
        <?php 
    } else {
        ?>
          <div class="element-set">
            <div id="collection" class="element">
              <h3><?php 
        echo __('from');
        ?>
</h3>
コード例 #17
0
 public function hookDefineAcl($args)
 {
     $acl = $args['acl'];
     $acl->addResource('UserProfiles_Type');
     $acl->addResource('UserProfiles_Profile');
     //null as 1st param in allow includes not logged in, so manage roles here
     $roles = array('super', 'admin', 'contributor', 'researcher');
     if (plugin_is_active('GuestUser')) {
         $roles[] = 'guest';
     }
     $acl->allow(null, 'UserProfiles_Profile', array('edit', 'delete'), new Omeka_Acl_Assert_Ownership());
     $acl->allow(null, 'UserProfiles_Profile', array('user'));
     $acl->allow($roles, 'UserProfiles_Profile', array('add', 'editSelf', 'delete-confirm', 'showSelfNotPublic', 'deleteSelf'));
     $acl->allow(array('admin', 'super', 'researcher'), 'UserProfiles_Profile', array('showNotPublic'));
     $acl->allow(array('admin', 'super'), 'UserProfiles_Profile', array('deleteAll'));
     $acl->deny(null, 'UserProfiles_Type');
     $acl->allow(array('super', 'admin'), 'UserProfiles_Type');
     //let all logged in people see the types available, but hide non-public ones from searches
     //since public/private is managed by Omeka_Db_Select_PublicPermission, this keeps them out of the navigation
     $acl->allow($roles, 'UserProfiles_Type', array('showNotPublic'));
 }
コード例 #18
0
<?php

/**
 * @version $Id$
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @copyright Center for History and New Media, 2010
 * @package Contribution
 */
queue_js_file('contribution-public-form');
$contributionPath = get_option('contribution_page_path');
if (!$contributionPath) {
    $contributionPath = 'contribution';
}
queue_css_file('form');
//load user profiles js and css if needed
if (get_option('contribution_user_profile_type') && plugin_is_active('UserProfiles')) {
    queue_js_file('admin-globals');
    queue_js_file('tiny_mce', 'javascripts/vendor/tiny_mce');
    queue_js_file('elements');
    queue_css_string("input.add-element {display: block}");
}
$head = array('title' => 'Contribute', 'bodyclass' => 'contribution');
echo head($head);
?>
<script type="text/javascript">
// <![CDATA[
enableContributionAjaxForm(<?php 
echo js_escape(url($contributionPath . '/type-form'));
?>
);
// ]]>
コード例 #19
0
ファイル: pay_form.php プロジェクト: annguyenit/getdeal
                    }
                }
            } else {
                ?>
								<li><?php 
                _e(NO_PAYMENT_METHOD_MSG);
                ?>
</li>
		<?php 
            }
            ?>
							</ul>
						</div>
		<?php 
        }
        if (get_option('pttthemes_captcha') == 'Enable' && file_exists(ABSPATH . 'wp-content/plugins/wp-recaptcha/recaptchalib.php') && plugin_is_active('wp-recaptcha')) {
            echo '<div class="form_row clearfix">';
            $a = get_option("recaptcha_options");
            echo '<label>Word verification</label>';
            $publickey = $a['public_key'];
            // you got this from the signup page
            echo recaptcha_get_html($publickey);
            if ($_REQUEST['emsg'] == 'captch') {
                echo '<span class="message_error2" id="category_span">' . __('Please enter valid text as you see in captcha', 'templatic') . '</span>';
            }
            echo '</div>';
        }
        ?>
 
						<input type="submit" id="submit" value="<?php 
        echo BUY_DEAL_PAY_BUTTON;
コード例 #20
0
 /**
  * Import coverage from Neatline Features, if it's installed, and set the
  * `is_coverage` flag.
  */
 public function compileCoverage()
 {
     // Get parent item.
     $item = $this->getItem();
     // Only try to import coverage values if (a) a parent item is defined
     // and (b) the local coverage value is currently empty (this prevents
     // modified coverages from being overwritten on save).
     if ($item && !$this->coverage) {
         if (plugin_is_active('NeatlineFeatures')) {
             // Try to import a value from Neatline Features.
             $wkt = nl_getNeatlineFeaturesWkt($this);
             if (is_string($wkt)) {
                 $this->coverage = $wkt;
             }
         }
         if (!$this->coverage) {
             // If a coverage wasn't gethered from Features (either because
             // it isn't installed, or there isn't a Features-managed value
             // for the item), just look for a vanilla DC "Coverage" value.
             try {
                 $coverage = metadata($item, array('Dublin Core', 'Coverage'));
                 $this->coverage = nl_extractWkt($coverage);
             } catch (Exception $e) {
             }
         }
     }
     // Track whether the record has a coverage.
     $this->is_coverage = $this->coverage ? 1 : 0;
 }
コード例 #21
0
 /**
  * If the passed plugin is not installed/active, skip the test.
  *
  * @param string $pluginName The plugin name.
  */
 protected function _skipIfNotPlugin($pluginName)
 {
     if (!plugin_is_active($pluginName)) {
         $this->markTestSkipped();
     }
 }
コード例 #22
0
 /**
  * Get an array to be used in html select input containing all elements.
  *
  * @return array $elementOptions Array of options for a dropdown
  * menu containing all elements applicable to records of type Item
  */
 private function _getElementOptions()
 {
     /*
     $options = get_table_options('Element', null, array(
         'record_types' => array('Item', 'All'),
         'sort' => 'alphaBySet')
     );
     unset($options['']);
     return $options;
     */
     $db = get_db();
     $sql = "\n        SELECT es.name AS element_set_name, e.id AS element_id,\n        e.name AS element_name, it.name AS item_type_name\n        FROM {$db->ElementSet} es\n        JOIN {$db->Element} e ON es.id = e.element_set_id\n        LEFT JOIN {$db->ItemTypesElements} ite ON e.id = ite.element_id\n        LEFT JOIN {$db->ItemType} it ON ite.item_type_id = it.id\n        WHERE es.record_type IS NULL OR es.record_type = 'Item'\n        ORDER BY es.name, it.name, e.name";
     $elements = $db->fetchAll($sql);
     $options = array();
     //        $options = array('' => __('Select Below'));
     foreach ($elements as $element) {
         $element_id = $element['element_id'];
         // Do not allow modification of elements linked to authorities
         if (plugin_is_active('ElementTypes')) {
             $element_types_by_id = Zend_Registry::get('element_types_by_id');
             if (array_key_exists($element_id, $element_types_by_id)) {
                 $element_type = $element_types_by_id[$element_id];
                 if ($element_type->element_type == 'koha-authority') {
                     continue;
                 }
             }
         }
         $optGroup = $element['item_type_name'] ? __('Item Type') . ': ' . __($element['item_type_name']) : __($element['element_set_name']);
         $value = __($element['element_name']);
         $options[$optGroup][$element_id] = $value;
     }
     return $options;
 }
コード例 #23
0
<?php

if (empty($options['limiters'])) {
    ?>
    <?php 
    if (plugin_is_active('SolrSearch')) {
        if (isset($_GET['q'])) {
            $filters['query'] = $_GET['q'];
        }
        $options['show_advanced'] = false;
    }
    ?>
    <?php 
    echo $this->form('search-form', $options['form_attributes']);
    ?>
        <div class="form-group">
            <?php 
    echo $this->formLabel($options['form_attributes']['id'] . '-query', __('Search'), array('class' => 'sr-only'));
    ?>
            <?php 
    echo $this->formText('query', $filters['query'], array('id' => $options['form_attributes']['id'] . '-query', 'placeholder' => __('Search'), 'class' => 'form-control'));
    ?>
        </div>
        <div class="btn-group">
            <button type="submit" class="btn btn-primary">Go</button>

            <?php 
    if ($options['show_advanced']) {
        ?>
                <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                    <span class="caret"></span>
コード例 #24
0
function mh_contributor($item, $fallback = "The Community of Gardens Team")
{
    if (plugin_is_active('Contribution') && plugin_is_active('Guest User')) {
        $contribItem = get_db()->getTable('ContributionContributedItem')->findByItem($item);
        if ($contribItem->anonymous) {
            $name = "Anonymous";
        } else {
            $name = $contribItem->Contributor->name;
        }
    }
    return '<span class="story-meta byline">Contributed by: ' . ($name ? $name : $fallback) . '</span>';
}
コード例 #25
0
                           <button type="button" class="remove_search" style="display:none;">-</button>
                       </div>
                   <?php 
     }
     ?>
               <?php 
 }
 ?>
               <?php 
 if (!array_key_exists($facet_name, $ordered_applied_facets)) {
     ?>
                   <div style="display: inline">
                       <?php 
     $form_element = "no empty form element";
     $form_element = $this->formText($free_facet_name, "", array("class" => "facet-search-value", "style" => "margin-bottom:0; width:50%; min-width: 85px;"));
     if (plugin_is_active('SimpleVocab')) {
         $simpleVocabTerm = get_db()->getTable('SimpleVocabTerm')->findByElementId(str_replace("_s", "", $facet_name));
         if ($simpleVocabTerm) {
             $terms = explode("\n", $simpleVocabTerm->terms);
             foreach ($terms as $key => $term) {
                 $terms[$key] = '"' . $term . '"';
             }
             $selectTerms = array('' => '-') + array_combine($terms, $terms);
             $form_element = $this->formSelect($free_facet_name, "", array("class" => "facet-search-value", 'style' => 'margin-bottom:0; width:50%; min-width: 85px; font-size:1.2em;'), $selectTerms);
         }
     }
     echo $form_element;
     ?>
                       <button type="button" class="remove_search" style="display:none;">-</button>
                   </div>
               <?php 
コード例 #26
0
ファイル: IiifManifest.php プロジェクト: kyfr59/cg35
 /**
  * Create an IIIF image object from an Omeka file.
  *
  * @param File $file
  * @param integer $index Used to set the standard name of the image.
  * @param string $canvasUrl Used to set the value for "on".
  * @param integer $width If not set, will be calculated.
  * @param integer $height If not set, will be calculated.
  * @return Standard object|null
  */
 protected function _iiifImage($file, $index, $canvasUrl, $width = null, $height = null)
 {
     if (empty($file)) {
         return;
     }
     if (empty($width) || empty($height)) {
         $imagePath = $this->_getImagePath($file, 'original');
         list($width, $height) = $this->_getWidthAndHeight($imagePath);
     }
     $image = array();
     $image['@id'] = $this->_baseUrl . '/annotation/p' . sprintf('%04d', $index) . '-image';
     $image['@type'] = 'oa:Annotation';
     $image['motivation'] = "sc:painting";
     // There is only one image (parallel is not managed currently).
     $imageResource = array();
     if (plugin_is_active('OpenLayersZoom') && $this->view->openLayersZoom()->isZoomed($file)) {
         $imagePath = $this->_getImagePath($file, 'fullsize');
         list($widthFullsize, $heightFullsize) = $this->_getWidthAndHeight($imagePath);
         $imageUrl = absolute_url(array('id' => $file->id, 'region' => 'full', 'size' => $width . ',' . $height, 'rotation' => 0, 'quality' => 'default', 'format' => 'jpg'), 'universalviewer_image_url');
         $imageResource['@id'] = $imageUrl;
         $imageResource['@type'] = 'dctypes:Image';
         $imageResource['format'] = $file->mime_type;
         $imageResource['width'] = $widthFullsize;
         $imageResource['height'] = $heightFullsize;
         $imageResourceService = array();
         $imageResourceService['@context'] = 'http://iiif.io/api/image/2/context.json';
         $imageUrl = absolute_url(array('id' => $file->id), 'universalviewer_image');
         $imageResourceService['@id'] = $imageUrl;
         $imageResourceService['profile'] = 'http://iiif.io/api/image/2/level2.json';
         $imageResourceService['width'] = $width;
         $imageResourceService['height'] = $height;
         $tile = $this->_iiifTile($file);
         if ($tile) {
             $tiles = array();
             $tiles[] = $tile;
             $imageResourceService['tiles'] = $tiles;
         }
         $imageResourceService = (object) $imageResourceService;
         $imageResource['service'] = $imageResourceService;
         $imageResource = (object) $imageResource;
     } else {
         $imageResource['@id'] = $file->getWebPath('original');
         $imageResource['@type'] = 'dctypes:Image';
         $imageResource['format'] = $file->mime_type;
         $imageResource['width'] = $width;
         $imageResource['height'] = $height;
         $imageResourceService = array();
         $imageResourceService['@context'] = 'http://iiif.io/api/image/2/context.json';
         $imageUrl = absolute_url(array('id' => $file->id), 'universalviewer_image');
         $imageResourceService['@id'] = $imageUrl;
         $imageResourceService['profile'] = 'http://iiif.io/api/image/2/level2.json';
         $imageResourceService = (object) $imageResourceService;
         $imageResource['service'] = $imageResourceService;
         $imageResource = (object) $imageResource;
     }
     $image['resource'] = $imageResource;
     $image['on'] = $canvasUrl;
     $image = (object) $image;
     return $image;
 }
コード例 #27
0
        echo $featuredCollectionHTML;
    } else {
        //put the heading after the image so it can float right of the image
        $imageStart = strpos($featuredCollectionHTML, '<a href');
        $imageEnd = strpos($featuredCollectionHTML, '</div>');
        $featuredCollectionHTML = '<div class="collection record">' . substr($featuredCollectionHTML, $imageStart, $imageEnd - $imageStart) . substr($featuredCollectionHTML, $headingStart, $imageStart - $headingStart) . '</div>';
        echo $featuredCollectionHTML;
    }
    ?>
</div><!-- end featured collection -->
<?php 
}
?>

<?php 
if (get_theme_option('Display Featured Exhibit') !== '0' && plugin_is_active('ExhibitBuilder') && function_exists('exhibit_builder_display_random_featured_exhibit')) {
    ?>
<!-- Featured Exhibit -->
<?php 
    echo exhibit_builder_display_random_featured_exhibit();
}
?>

<?php 
$recentItems = get_theme_option('Homepage Recent Items');
if ($recentItems === null || $recentItems === '') {
    $recentItems = 3;
} else {
    $recentItems = (int) $recentItems;
}
if ($recentItems) {
コード例 #28
0
ファイル: functions.php プロジェクト: TheRojam/raindrops
}
/**
 * plugin API
 *
 *
 *
 *
 *
 */
if (!function_exists("plugin_is_active")) {
    function plugin_is_active($plugin_path)
    {
        $return_var = in_array($plugin_path, get_option('active_plugins'));
        return $return_var;
    }
    if (plugin_is_active('tmn-quickpost/tmn-quickpost.php')) {
        global $base_info;
        foreach ($base_info['root'] as $key => $val) {
            $wp_cockneyreplace['%' . $key . '%'] = $val;
        }
        function raindrops_import_post_meta()
        {
            global $post, $base_info;
            $r = get_post_meta($post->ID, 'template', true);
            foreach ($base_info['root'] as $key => $val) {
                $r = str_replace('%' . $key . '%', $val, $r);
            }
            if (class_exists('trans')) {
                $n = new trans($r);
                return $n->text2html();
            } else {
コード例 #29
0
ファイル: widgets.php プロジェクト: annguyenit/getdeal
    function form($instance)
    {
        //widgetform in backend
        $instance = wp_parse_args((array) $instance, array('opt_subscrib' => '', 'id' => ''));
        $id = strip_tags($instance['id']);
        $opt_subscrib = strip_tags($instance['opt_subscrib']);
        if ($opt_subscrib == 'mailchimp') {
            $mchecked = 'checked';
        } else {
            if ($opt_subscrib == 'constant_contact') {
                $cchecked = 'checked';
            } else {
                $dchecked = 'checked';
            }
        }
        ?>
 <?php 
        if (function_exists(mailchimpSF_signup_form) && plugin_is_active('mailchimp')) {
            ?>
<input type="radio" name="<?php 
            echo $this->get_field_name('opt_subscrib');
            ?>
" value="<?php 
            _e('mailchimp', 'templatic');
            ?>
" <?php 
            echo $mchecked;
            ?>
>&nbsp;<?php 
            _e('Mail Chimp', 'templatic');
            ?>
<br /> <?php 
        }
        if (function_exists(gConstantcontact) && plugin_is_active('constant-contact')) {
            ?>
<input type="radio" name="<?php 
            echo $this->get_field_name('opt_subscrib');
            ?>
" value="<?php 
            _e('constant_contact', 'templatic');
            ?>
" <?php 
            echo $cchecked;
            ?>
>&nbsp;<?php 
            _e('Constant Contact', 'templatic');
            ?>
<br /><?php 
        }
        ?>
<input type="radio" name="<?php 
        echo $this->get_field_name('opt_subscrib');
        ?>
" value="<?php 
        _e('default', 'templatic');
        ?>
" <?php 
        echo $dchecked;
        ?>
>&nbsp;<?php 
        _e('Default', 'templatic');
        ?>
<br /><br />
<p><?php 
        _e('<strong>If you select default option then enter ID.</strong>', 'templatic');
        ?>
</p>
 <p><label for="<?php 
        echo $this->get_field_id('id');
        ?>
"><?php 
        _e('Feedburner ID (ex :- templatic):', 'templatic');
        ?>
 <input class="widefat" id="<?php 
        echo $this->get_field_id('id');
        ?>
" name="<?php 
        echo $this->get_field_name('id');
        ?>
" type="text" value="<?php 
        echo attribute_escape($id);
        ?>
" /></label></p>

<?php 
    }
コード例 #30
-1
 public function setUp()
 {
     if (plugin_is_active('SimplePages')) {
         $this->_filters[] = 'api_extend_simple_pages';
     }
     if (plugin_is_active('ExhibitBuilder')) {
         $this->_filters[] = 'api_extend_exhibit_pages';
     }
     parent::setUp();
 }