• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP plugin_is_active函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中plugin_is_active函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_is_active函数的具体用法?PHP plugin_is_active怎么用?PHP plugin_is_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plugin_is_active函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setUp

 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();
 }
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:10,代码来源:CommentingPlugin.php


示例2: testMetsAlto

 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();
 }
开发者ID:Daniel-KM,项目名称:ArchiveFolder,代码行数:11,代码来源:BuilderTest.php


示例3: get_child_collections

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();
}
开发者ID:AdrienneSerra,项目名称:Digitalsc,代码行数:12,代码来源:custom.php


示例4: _installPluginOrSkip

 /**
  * 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.");
     }
 }
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:18,代码来源:SolrSearch_Case_Default.php


示例5: __construct

 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);
 }
开发者ID:Daniel-KM,项目名称:ArchiveFolder,代码行数:13,代码来源:Abstract.php


示例6: testMappings

 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)));
     }
 }
开发者ID:Daniel-KM,项目名称:OaiPmhStaticRepository,代码行数:48,代码来源:MappingTest.php


示例7: setUp

 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);
         }
     }
 }
开发者ID:sgbalogh,项目名称:peddler_clone5,代码行数:18,代码来源:ContributionPlugin.php


示例8: nl_getNeatlineFeaturesWkt

/**
 * 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;
}
开发者ID:HCDigitalScholarship,项目名称:scattergoodjournals,代码行数:25,代码来源:Coverage.php


示例9: _getForm

 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;
 }
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:21,代码来源:SettingsController.php


示例10: linkToOwnerProfile

 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;
 }
开发者ID:Daniel-KM,项目名称:UserProfiles,代码行数:39,代码来源:LinkToOwnerProfile.php


示例11: ProcessPost

 /**
  * 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));
     }
 }
开发者ID:Daniel-KM,项目名称:MetsExport,代码行数:27,代码来源:ConfigForm.php


示例12: _skipIfNotPlugin

 /**
  * 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();
     }
 }
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:11,代码来源:Neatline_Case_Default.php


示例13: _getElementOptions

 /**
  * 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;
 }
开发者ID:biblibre,项目名称:omeka-plugin-BulkMetadataEditor,代码行数:39,代码来源:Main.php


示例14: _usePreTiled

 /**
  * 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);
     }
 }
开发者ID:pabalexa,项目名称:UniversalViewer4Omeka,代码行数:54,代码来源:ImageController.php


示例15: _getElementSlug

 /**
  *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));
 }
开发者ID:Daniel-KM,项目名称:MetsExport,代码行数:16,代码来源:MetsExporter.php


示例16: _processUserProfile

 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;
 }
开发者ID:sgbalogh,项目名称:peddler_clone5,代码行数:20,代码来源:ContributionController.php


示例17: head

<?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');
                ?>
开发者ID:kalbers,项目名称:religions-in-mn,代码行数:31,代码来源:index.php


示例18: iiifInfo

 /**
  * 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;
 }
开发者ID:pabalexa,项目名称:UniversalViewer4Omeka,代码行数:97,代码来源:IiifInfo.php


示例19: hookDefineAcl

 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'));
 }
开发者ID:Daniel-KM,项目名称:UserProfiles,代码行数:21,代码来源:UserProfilesPlugin.php


示例20: metadata



<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>
开发者ID:srerickson,项目名称:harlem-theme,代码行数:29,代码来源:show.php



注:本文中的plugin_is_active函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP plugin_is_installed函数代码示例发布时间:2022-05-15
下一篇:
PHP plugin_hook函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap