当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_sets::load方法代码示例

本文整理汇总了PHP中ca_sets::load方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_sets::load方法的具体用法?PHP ca_sets::load怎么用?PHP ca_sets::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca_sets的用法示例。


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

示例1: Index

 public function Index()
 {
     $va_participate_ids = array();
     $t_participate = new ca_sets();
     # --- participate set - set name assigned in eastend.conf - plugin conf file
     $t_participate->load(array('set_code' => $this->opo_plugin_config->get('participate_set_name')));
     # Enforce access control on set
     if (sizeof($this->opa_access_values) == 0 || sizeof($this->opa_access_values) && in_array($t_participate->get("access"), $this->opa_access_values)) {
         $this->view->setVar('participate_set_id', $t_participate->get("set_id"));
         $va_participate_ids = array_keys(is_array($va_tmp = $t_participate->getItemRowIDs(array('checkAccess' => $this->opa_access_values, 'shuffle' => 1))) ? $va_tmp : array());
         // These are the entity ids in the set
     }
     # --- loop through featured ids and grab the object's image
     $t_object = new ca_objects();
     $va_participate_images = array();
     foreach ($va_participate_ids as $vn_participate_object_id) {
         $va_tmp = array();
         $t_object->load($vn_participate_object_id);
         $va_tmp["object_id"] = $vn_participate_object_id;
         $va_image = $t_object->getPrimaryRepresentation(array("mediumlarge"));
         # --- don't show records with status ars/vaga don't show image
         if ($t_object->get("ca_objects.object_status") != 348) {
             if ($t_object->get("ca_objects.object_status") == 349) {
                 $va_tmp["vaga_class"] = "vagaDisclaimer";
             }
             $va_tmp["image"] = $va_image["tags"]["mediumlarge"];
             $va_tmp["caption"] = $t_object->get("ca_objects.caption");
             $va_tmp["title"] = $t_object->getLabelForDisplay();
         }
         $va_participate_images[$vn_participate_object_id] = $va_tmp;
     }
     $this->view->setVar("participate_images", $va_participate_images);
     $this->render('participate_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:34,代码来源:ParticipateController.php

示例2: __call

 /**
  *
  */
 public function __call($ps_function, $pa_args)
 {
     AssetLoadManager::register("carousel");
     $va_access_values = caGetUserAccessValues($this->request);
     $this->view->setVar('access_values', $va_access_values);
     #
     # --- if there is a set configured to show on the front page, load it now
     #
     $va_featured_ids = array();
     if ($vs_set_code = $this->config->get("front_page_set_code")) {
         $t_set = new ca_sets();
         $t_set->load(array('set_code' => $vs_set_code));
         # Enforce access control on set
         if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
             $this->view->setVar('featured_set_id', $t_set->get("set_id"));
             $this->view->setVar('featured_set', $t_set);
             $va_featured_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
             $this->view->setVar('featured_set_item_ids', $va_featured_ids);
             $this->view->setVar('featured_set_items_as_search_result', caMakeSearchResult('ca_objects', $va_featured_ids));
         }
     }
     #
     # --- no configured set/items in set so grab random objects with media
     #
     if (sizeof($va_featured_ids) == 0) {
         $t_object = new ca_objects();
         $va_featured_ids = array_keys($t_object->getRandomItems(10, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1)));
         $this->view->setVar('featured_set_item_ids', $va_featured_ids);
         $this->view->setVar('featured_set_items_as_search_result', caMakeSearchResult('ca_objects', $va_featured_ids));
     }
     $this->view->setVar('config', $this->config);
     $o_result_context = new ResultContext($this->request, 'ca_objects', 'front');
     $this->view->setVar('result_context', $o_result_context);
     $o_result_context->setAsLastFind();
     //
     // Try to load selected page if it exists in Front/, otherwise load default Front/front_page_html.php
     //
     $ps_function = preg_replace("![^A-Za-z0-9_\\-]+!", "", $ps_function);
     $vs_path = "Front/{$ps_function}_html.php";
     if (file_exists(__CA_THEME_DIR__ . "/views/{$vs_path}")) {
         $this->render($vs_path);
     } else {
         $this->render("Front/front_page_html.php");
     }
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:48,代码来源:FrontController.php

示例3: Index

 function Index()
 {
     // Remove any browse criteria previously set
     $this->opo_browse->removeAllCriteria();
     parent::Index(true);
     JavascriptLoadManager::register('imageScroller');
     JavascriptLoadManager::register('browsable');
     JavascriptLoadManager::register('tabUI');
     $t_object = new ca_objects();
     $t_featured = new ca_sets();
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $va_access_values = array();
     } else {
         $va_access_values = caGetUserAccessValues($this->request);
     }
     # --- featured items set - set name assigned in app.conf
     $featured_sets = $this->request->config->get('featured_sets');
     $len = count($featured_sets);
     if ($len > 3) {
         $len = 3;
     }
     for ($i = 0; $i < $len; $i++) {
         $t_featured->load(array('set_code' => $featured_sets[$i]));
         $set_id = $t_featured->getPrimaryKey();
         $set_title = $t_featured->getLabelForDisplay();
         $set_desc = $t_featured->getAttributeFromSets('description', array(0 => $set_id));
         $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
         // These are the object ids in the set
         if (is_array($va_featured_ids) && sizeof($va_featured_ids) > 0) {
             $t_object = new ca_objects($va_featured_ids[0]);
             $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'medium', 'mediumlarge', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values));
             $featured_set_id_array[$i] = array('featured_set_code' => $featured_sets[$i], 'featured_content_id' => $va_featured_ids[0], 'featured_content_small' => $va_rep["tags"]["small"], 'featured_content_label' => $set_title, 'featured_content_description' => $set_desc[$set_id][0], 'featured_set_id' => $set_id);
         }
     }
     $this->view->setVar('featured_set_id_array', $featured_set_id_array);
     # --- user favorites get the highest ranked objects to display
     $va_user_favorites_items = $t_object->getHighestRated(true, 12, $va_access_values);
     if (sizeof($va_user_favorites_items) > 0) {
         if (is_array($va_user_favorites_items) && sizeof($va_user_favorites_items) > 0) {
             $t_object = new ca_objects($va_user_favorites_items[0]);
             $va_rep = $t_object->getPrimaryRepresentation(array('thumbnail', 'small', 'preview', 'widepreview'), null, array('return_with_access' => $va_access_values));
             $this->view->setVar('user_favorites_id', $va_user_favorites_items[0]);
             $this->view->setVar('user_favorites_thumb', $va_rep["tags"]["thumbnail"]);
             $this->view->setVar('user_favorites_small', $va_rep["tags"]["small"]);
             $this->view->setVar('user_favorites_preview', $va_rep["tags"]["preview"]);
             $this->view->setVar('user_favorites_widepreview', $va_rep["tags"]["widepreview"]);
         }
     } else {
         $this->view->setVar('user_favorites_is_random', 1);
         # if no ranks set, choose a random object
         $va_random_items = $t_object->getRandomItems(1, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
         $va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
         $va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('small', 'thumbnail', 'preview', 'medium', 'widepreview'), array("checkAccess" => $va_access_values));
         foreach ($va_random_items as $vn_object_id => $va_object_info) {
             $va_object_info['title'] = $va_labels[$vn_object_id];
             $va_object_info['media'] = $va_media[$vn_object_id];
             $va_random_items[$vn_object_id] = $va_object_info;
         }
         $this->view->setVar('random_objects', $va_random_items);
         if (is_array($va_random_items) && sizeof($va_random_items) > 0) {
             $va_object_info = array_shift($va_random_items);
             $this->view->setVar('user_favorites_id', $va_object_info['object_id']);
             $this->view->setVar('user_favorites_thumb', $va_media[$va_object_info['object_id']]["tags"]["thumbnail"]);
             $this->view->setVar('user_favorites_small', $va_media[$va_object_info['object_id']]["tags"]["small"]);
             $this->view->setVar('user_favorites_preview', $va_media[$va_object_info['object_id']]["tags"]["preview"]);
             $this->view->setVar('user_favorites_widepreview', $va_media[$va_object_info['object_id']]["tags"]["widepreview"]);
             $this->view->setVar('user_favorites_medium', $va_media[$va_object_info['object_id']]["tags"]["medium"]);
         }
     }
     #---- new 'recently added'
     $t_set = new ca_sets();
     $ra_set_code = $this->request->config->get('recently_added_set_id');
     $t_set->load(array('set_code' => $ra_set_code));
     $set_id = $t_set->getPrimaryKey();
     $ra_items = caExtractValuesByUserLocale($t_set->getItems(array('thumbnailVersions' => array('thumbnail', 'preview'), "checkAccess" => 1)));
     $va_recently_added = array();
     foreach ($ra_items as $va_item_info) {
         $vn_r_object_id = $va_item_info['object_id'];
         $t_object->load($vn_r_object_id);
         $va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
         $va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"];
     }
     # --- get the 12 most recently added objects to display
     /*$va_recently_added_ids = $t_object->getRecentlyAddedItems(15, array('checkAccess' => $va_access_values, 'hasRepresentations' => 1));
     			if(is_array($va_recently_added_ids) && sizeof($va_recently_added_ids) > 0){
     			$va_recently_added = array();
     			foreach($va_recently_added_ids as $va_item_info){
     				$vn_r_object_id = $va_item_info['object_id'];
     				$t_object->load($vn_r_object_id);
     				$va_reps = $t_object->getPrimaryRepresentation(array('thumbnail', 'preview'), null, array('return_with_access' => $va_access_values));
     				$va_recently_added[$vn_r_object_id] = $va_reps["tags"]["preview"];
     			}
     		}*/
     $this->view->setVar('recently_added', $va_recently_added);
     $this->render('Splash/splash_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:96,代码来源:SplashController.php

示例4: caEditorInspector

/**
 * Generates standard-format inspector panels for editors
 *
 * @param View $po_view Inspector view object
 * @param array $pa_options Optional array of options. Supported options are:
 *		backText = a string to use as the "back" button text; default is "Results"
 *
 * @return string HTML implementing the inspector
 */
function caEditorInspector($po_view, $pa_options = null)
{
    require_once __CA_MODELS_DIR__ . '/ca_sets.php';
    require_once __CA_MODELS_DIR__ . '/ca_data_exporters.php';
    $t_item = $po_view->getVar('t_item');
    $vs_table_name = $t_item->tableName();
    if (($vs_priv_table_name = $vs_table_name) == 'ca_list_items') {
        $vs_priv_table_name = 'ca_lists';
    }
    $vn_item_id = $t_item->getPrimaryKey();
    $o_result_context = $po_view->getVar('result_context');
    $t_ui = $po_view->getVar('t_ui');
    $t_type = method_exists($t_item, "getTypeInstance") ? $t_item->getTypeInstance() : null;
    $vs_type_name = method_exists($t_item, "getTypeName") ? $t_item->getTypeName() : '';
    if (!$vs_type_name) {
        $vs_type_name = $t_item->getProperty('NAME_SINGULAR');
    }
    $va_reps = $po_view->getVar('representations');
    $o_dm = Datamodel::load();
    if ($t_item->isHierarchical()) {
        $va_ancestors = $po_view->getVar('ancestors');
        $vn_parent_id = $t_item->get($t_item->getProperty('HIERARCHY_PARENT_ID_FLD'));
    } else {
        $va_ancestors = array();
        $vn_parent_id = null;
    }
    // action extra to preserve currently open screen across next/previous links
    $vs_screen_extra = $po_view->getVar('screen') ? '/' . $po_view->getVar('screen') : '';
    if ($vs_type_name == "list item") {
        $vs_style = "style='height:auto;'";
    }
    if ($vn_item_id | $po_view->request->getAction() === 'Delete') {
        $vs_buf = '<h3 class="nextPrevious" ' . $vs_style . '>' . caEditorFindResultNavigation($po_view->request, $t_item, $o_result_context, $pa_options) . "</h3>\n";
    }
    $vs_color = null;
    if ($t_type) {
        $vs_color = trim($t_type->get('color'));
    }
    if (!$vs_color && $t_ui) {
        $vs_color = trim($t_ui->get('color'));
    }
    if (!$vs_color) {
        $vs_color = "FFFFFF";
    }
    $vs_buf .= "<h4><div id='caColorbox' style='border: 6px solid #{$vs_color};'>\n";
    $vs_icon = null;
    if ($t_type) {
        $vs_icon = $t_type->getMediaTag('icon', 'icon');
    }
    if (!$vs_icon && $t_ui) {
        $vs_icon = $t_ui->getMediaTag('icon', 'icon');
    }
    if ($vs_icon) {
        $vs_buf .= "<div id='inspectoricon' style='border-right: 6px solid #{$vs_color}; border-bottom: 6px solid #{$vs_color}; -moz-border-radius-bottomright: 8px; -webkit-border-bottom-right-radius: 8px;'>\n{$vs_icon}</div>\n";
    }
    if ($po_view->request->getAction() === 'Delete' && $po_view->request->getParameter('confirm', pInteger)) {
        $vs_buf .= "<strong>" . _t("Deleted %1", $vs_type_name) . "</strong>\n";
        $vs_buf .= "<br style='clear: both;'/></div></h4>\n";
    } else {
        if ($vn_item_id) {
            if (!$po_view->request->config->get("{$vs_priv_table_name}_inspector_disable_headline")) {
                if ($po_view->request->user->canDoAction("can_edit_" . $vs_priv_table_name) && sizeof($t_item->getTypeList()) > 1) {
                    $vs_buf .= "<strong>" . _t("Editing %1", $vs_type_name) . ": </strong>\n";
                } else {
                    $vs_buf .= "<strong>" . _t("Viewing %1", $vs_type_name) . ": </strong>\n";
                }
            }
            if ($t_item->hasField('is_deaccessioned') && $t_item->get('is_deaccessioned') && $t_item->get('deaccession_date', array('getDirectDate' => true)) <= caDateToHistoricTimestamp(_t('now'))) {
                // If currently deaccessioned then display deaccession message
                $vs_buf .= "<br/><div class='inspectorDeaccessioned'>" . _t('Deaccessioned %1', $t_item->get('deaccession_date')) . "</div>\n";
                if ($vs_deaccession_notes = $t_item->get('deaccession_notes')) {
                    TooltipManager::add(".inspectorDeaccessioned", $vs_deaccession_notes);
                }
            } else {
                if ($po_view->request->user->canDoAction('can_see_current_location_in_inspector_ca_objects')) {
                    if ($t_ui && method_exists($t_item, "getObjectHistory") && (is_array($va_placements = $t_ui->getPlacementsForBundle('ca_objects_history')) && sizeof($va_placements) > 0)) {
                        //
                        // Output current "location" of object in life cycle. Configuration is taken from a ca_objects_history bundle configured for the current editor
                        //
                        $va_placement = array_shift($va_placements);
                        $va_bundle_settings = $va_placement['settings'];
                        if (is_array($va_history = $t_item->getObjectHistory($va_bundle_settings, array('limit' => 1, 'currentOnly' => true))) && sizeof($va_history) > 0) {
                            $va_current_location = array_shift(array_shift($va_history));
                            if (!($vs_inspector_current_location_label = $po_view->request->config->get("ca_objects_inspector_current_location_label"))) {
                                $vs_inspector_current_location_label = _t('Current');
                            }
                            if ($va_current_location['display']) {
                                $vs_buf .= "<div class='inspectorCurrentLocation'><strong>" . $vs_inspector_current_location_label . ':</strong><br/>' . $va_current_location['display'] . "</div>";
                            }
                        }
                    } elseif (method_exists($t_item, "getLastLocationForDisplay")) {
//.........这里部分代码省略.........
开发者ID:kai-iak,项目名称:providence,代码行数:101,代码来源:displayHelpers.php

示例5: caGetUserAccessValues

<?php

require_once __CA_MODELS_DIR__ . "/ca_sets.php";
include_once __CA_LIB_DIR__ . "/ca/Search/OccurrenceSearch.php";
include_once __CA_MODELS_DIR__ . "/ca_occurrences.php";
$va_access_values = caGetUserAccessValues($this->request);
if ($vs_set_code = $this->request->config->get("featured_art_set")) {
    AssetLoadManager::register("carousel");
    $t_set = new ca_sets();
    $t_set->load(array('set_code' => $vs_set_code));
    # Enforce access control on set
    if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
        $va_item_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 0))) ? $va_tmp : array());
    }
    if (is_array($va_item_ids) && sizeof($va_item_ids)) {
        $t_object = new ca_objects();
        $va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("slideshowsmall"), array('checkAccess' => caGetUserAccessValues($this->request)));
    }
}
?>
<div class="container">
	<div class="row collection">
		<div class="col-sm-6">	
			<div class="advSearch">
				<h1>Search Collection</h1>
				{{{form}}}

					<div class="advancedSearchField">
						Title:<br/>
						{{{ca_objects.preferred_labels.name%width=220px}}}
					</div>
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:ca_objects_advanced_search_artworks_html.php

示例6: saveBundlesForScreen

 /**
  * Saves all bundles on the specified screen in the database by extracting 
  * required data from the supplied request
  * $pm_screen can be a screen tag (eg. "Screen5") or a screen_id (eg. 5)
  *
  * Calls processBundlesBeforeBaseModelSave() method in subclass right before invoking insert() or update() on
  * the BaseModel, if the method is defined. Passes the following parameters to processBundlesBeforeBaseModelSave():
  *		array $pa_bundles An array of bundles to be saved
  *		string $ps_form_prefix The form prefix
  *		RequestHTTP $po_request The current request
  *		array $pa_options Optional array of parameters; expected to be the same as that passed to saveBundlesForScreen()
  *
  * The processBundlesBeforeBaseModelSave() is useful for those odd cases where you need to do some processing before the basic
  * database record defined by the model (eg. intrinsic fields and hierarchy coding) is inserted or updated. You usually don't need 
  * to use it.
  *
  * @param mixed $pm_screen
  * @param RequestHTTP $ps_request
  * @param array $pa_options Options are:
  *		dryRun = Go through the motions of saving but don't actually write information to the database
  *		batch = Process save in "batch" mode. Specifically this means honoring batch mode settings (add, replace, remove), skipping bundles that are not supported in batch mode and ignoring updates
  *		existingRepresentationMap = an array of representation_ids key'ed on file path. If set saveBundlesForScreen() use link the specified representation to the row it is saving rather than processing the uploaded file. saveBundlesForScreen() will build the map as it goes, adding newly uploaded files. If you want it to process a file in a batch situation where it should be processed the first time and linked subsequently then pass an empty array here. saveBundlesForScreen() will use the empty array to build the map.
  */
 public function saveBundlesForScreen($pm_screen, $po_request, &$pa_options)
 {
     $vb_we_set_transaction = false;
     $vs_form_prefix = caGetOption('formName', $pa_options, $po_request->getParameter('_formName', pString));
     $vb_dryrun = caGetOption('dryRun', $pa_options, false);
     $vb_batch = caGetOption('batch', $pa_options, false);
     if (!$this->inTransaction()) {
         $this->setTransaction(new Transaction($this->getDb()));
         $vb_we_set_transaction = true;
     } else {
         if ($vb_dryrun) {
             $this->postError(799, _t('Cannot do dry run save when in transaction. Try again without setting a transaction.'), "BundlableLabelableBaseModelWithAttributes->saveBundlesForScreen()");
             return false;
         }
     }
     $vb_read_only_because_deaccessioned = $this->hasField('is_deaccessioned') && (bool) $this->getAppConfig()->get('deaccession_dont_allow_editing') && (bool) $this->get('is_deaccessioned');
     BaseModel::setChangeLogUnitID();
     // get items on screen
     $t_ui = caGetOption('ui_instance', $pa_options, ca_editor_uis::loadDefaultUI($this->tableName(), $po_request, $this->getTypeID()));
     $va_bundle_lists = $this->getBundleListsForScreen($pm_screen, $po_request, $t_ui, $pa_options);
     //
     // Filter bundles to save if deaccessioned - only allow editing of the ca_objects_deaccession bundle
     //
     if ($vb_read_only_because_deaccessioned) {
         foreach ($va_bundle_lists['bundles'] as $vn_i => $va_bundle) {
             if ($va_bundle['bundle_name'] !== 'ca_objects_deaccession') {
                 unset($va_bundle_lists['bundles'][$vn_i]);
             }
         }
         foreach ($va_bundle_lists['fields_by_type'] as $vs_type => $va_bundles) {
             foreach ($va_bundles as $vs_id => $vs_bundle_name) {
                 if ($vs_bundle_name !== 'ca_objects_deaccession') {
                     unset($va_bundle_lists['fields_by_type'][$vs_type][$vs_id]);
                 }
             }
         }
     }
     $va_bundles = $va_bundle_lists['bundles'];
     $va_fields_by_type = $va_bundle_lists['fields_by_type'];
     // save intrinsic fields
     if (is_array($va_fields_by_type['intrinsic'])) {
         $vs_idno_field = $this->getProperty('ID_NUMBERING_ID_FIELD');
         foreach ($va_fields_by_type['intrinsic'] as $vs_placement_code => $vs_f) {
             if ($vb_batch) {
                 $vs_batch_mode = $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}_batch_mode", pString);
                 if ($vs_batch_mode == '_disabled_') {
                     continue;
                 }
             }
             if (isset($_FILES["{$vs_placement_code}{$vs_form_prefix}{$vs_f}"]) && $_FILES["{$vs_placement_code}{$vs_form_prefix}{$vs_f}"]) {
                 // media field
                 $this->set($vs_f, $_FILES["{$vs_placement_code}{$vs_form_prefix}{$vs_f}"]['tmp_name'], array('original_filename' => $_FILES["{$vs_placement_code}{$vs_form_prefix}{$vs_f}"]['name']));
             } else {
                 switch ($vs_f) {
                     case 'access':
                         if ((bool) $this->getAppConfig()->get($this->tableName() . '_allow_access_inheritance') && $this->hasField('access_inherit_from_parent')) {
                             $this->set('access_inherit_from_parent', $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}access_inherit_from_parent", pInteger));
                         }
                         if (!(bool) $this->getAppConfig()->get($this->tableName() . '_allow_access_inheritance') || !$this->hasField('access_inherit_from_parent') || !(bool) $this->get('access_inherit_from_parent')) {
                             $this->set('access', $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}access", pString));
                         }
                         break;
                     case $vs_idno_field:
                         if ($this->opo_idno_plugin_instance) {
                             $this->opo_idno_plugin_instance->setDb($this->getDb());
                             $this->set($vs_f, $vs_tmp = $this->opo_idno_plugin_instance->htmlFormValue($vs_idno_field));
                         } else {
                             $this->set($vs_f, $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}{$vs_f}", pString));
                         }
                         break;
                     default:
                         // Look for fully qualified intrinsic
                         if (!strlen($vs_v = $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}{$vs_f}", pString))) {
                             // fall back to simple field name intrinsic spec - still used for "mandatory" fields such as type_id and parent_id
                             $vs_v = $po_request->getParameter("{$vs_f}", pString);
                         }
                         $this->set($vs_f, $vs_v);
//.........这里部分代码省略.........
开发者ID:idiscussforum,项目名称:providence,代码行数:101,代码来源:BundlableLabelableBaseModelWithAttributes.php

示例7: _t

print _t("Add item to lightbox");
?>
</H1>
<?php 
if ($va_errors["general"]) {
    print "<div class='alert alert-danger'>" . $va_errors["general"] . "</div>";
}
?>
	<form id="AddItemForm" action="#" class="form-horizontal" role="form">
<?php 
if (is_array($va_write_sets) && sizeof($va_write_sets)) {
    $t_write_set = new ca_sets();
    print "<div class='form-group'><div class='col-sm-offset-4 col-sm-7'><select name='set_id' class='form-control'>";
    print "<option value=''>" . _t("Select a lightbox") . "</option>\n";
    foreach ($va_write_sets as $va_write_set) {
        $t_write_set->load($va_write_set["set_id"]);
        print "<option value='" . $va_write_set["set_id"] . "'>" . $t_write_set->getLabelForDisplay() . "</option>\n";
    }
    print "</select>\n";
    print "</div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
    print "<div class='form-group'><div class='col-sm-offset-4 col-sm-7'><H3>" . _t("OR Create a New Lightbox") . "</H3></div></div><!-- end form-group -->\n";
}
print "<div class='form-group'><label for='name' class='col-sm-4 control-label'>" . _t("Name") . "</label><div class='col-sm-7'><input type='text' name='name' placeholder='Your lightbox' class='form-control'></div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
#print $t_set->htmlFormElement("access","<div class='form-group'><label for='access' class='col-sm-4 control-label'>"._t("Display Option")."</label><div class='col-sm-7' class='form-control'>^ELEMENT</div><!-- end col-sm-7 --></div><!-- end form-group -->\n", array("classname" => "form-control"));
print "<div class='form-group'><label for='description' class='col-sm-4 control-label'>" . _t("Description") . "</label><div class='col-sm-7'><textarea name='description' class='form-control' rows='3'></textarea></div><!-- end col-sm-7 --></div><!-- end form-group -->\n";
?>
		<div class="form-group">
			<div class="col-sm-offset-4 col-sm-7">
				<button type="submit" class="btn btn-default">Save</button>
			</div><!-- end col-sm-7 -->
		</div><!-- end form-group -->
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:form_add_set_item_html.php

示例8: foreach

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * @package CollectiveAccess
 * @subpackage Core
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License version 3
 *
 * ----------------------------------------------------------------------
 */
$qr_res = $this->getVar('featured_set_items_as_search_result');
$t_featured = new ca_sets();
$t_featured->load(array('set_code' => 'featuredSet'));
$va_set_items = $t_featured->getItems();
?>

<div id="featuredSlideshow">

	<div class='blockTitle'>Featured Items</div>
	<div class='blockFeatured scrollBlock' >
		<div class='scrollingDiv'><div class='scrollingDivContent'>
<?php 
foreach ($va_set_items as $va_set_id => $va_set_item_a) {
    foreach ($va_set_item_a as $va_set_item_id => $va_set_item) {
        $va_object_id = $va_set_item['row_id'];
        $t_object = new ca_objects($va_object_id);
        $va_image_width = $t_object->get('ca_object_representations.media.mediumlarge.width');
        print "<div class='featuredObject' style='width:{$va_image_width}px;'>";
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:featured_items_html.php

示例9: getFeaturedArtistSlideshow

 public function getFeaturedArtistSlideshow()
 {
     $va_featured_ids = array();
     $t_featured = new ca_sets();
     # --- featured artists set - set name assigned in eastend.conf - plugin conf file
     $t_featured->load(array('set_code' => $this->opo_plugin_config->get('featured_artists_set_name')));
     # Enforce access control on set
     if (sizeof($this->opa_access_values) == 0 || sizeof($this->opa_access_values) && in_array($t_featured->get("access"), $this->opa_access_values)) {
         $this->view->setVar('featured_set_id', $t_featured->get("set_id"));
         $va_featured_ids = array_keys(is_array($va_tmp = $t_featured->getItemRowIDs(array('checkAccess' => $this->opa_access_values, 'shuffle' => 1))) ? $va_tmp : array());
         // These are the entity ids in the set
     }
     if (!is_array($va_featured_ids) || sizeof($va_featured_ids) == 0) {
         # put random entities in the features variable
         $o_db = new Db();
         $q_entities = $o_db->query("SELECT e.entity_id from ca_entities e WHERE e.access IN (" . implode($this->opa_access_values, ", ") . ") ORDER BY RAND() LIMIT 10");
         if ($q_entities->numRows() > 0) {
             while ($q_entities->nextRow()) {
                 $va_featured_ids[] = $q_entities->get("entity_id");
             }
         }
     }
     # --- loop through featured ids and grab the entity's name, portrait, lifespan -lifespans_date, indexing_notes (brief description abouthow they relate to the east end)
     $t_entity = new ca_entities();
     $t_object = new ca_objects();
     $va_featured_artists = array();
     foreach ($va_featured_ids as $vn_featured_entity_id) {
         $va_tmp = array();
         $t_entity->load($vn_featured_entity_id);
         $va_tmp["entity_id"] = $vn_featured_entity_id;
         $va_tmp["lifespan"] = $t_entity->get("lifespans_date");
         $va_tmp["indexing_notes"] = $t_entity->get("indexing_notes");
         $va_tmp["name"] = $t_entity->getLabelForDisplay();
         $va_objects = $t_entity->get("ca_objects", array("returnAsArray" => 1, 'checkAccess' => $this->opa_access_values, 'restrict_to_relationship_types' => array('portrait')));
         $va_object = array_shift($va_objects);
         $t_object->load($va_object["object_id"]);
         $va_portrait = $t_object->getPrimaryRepresentation(array("abSlideShow"));
         # --- don't show records with status ars/vaga don't show image
         if ($t_object->get("ca_objects.object_status") != 348) {
             if ($t_object->get("ca_objects.object_status") == 349) {
                 $va_tmp["vaga_class"] = "vagaDisclaimer";
             }
             $va_tmp["image"] = $va_portrait["tags"]["abSlideShow"];
             $va_tmp["caption"] = $t_object->get("ca_objects.caption");
         }
         $va_featured_artists[$vn_featured_entity_id] = $va_tmp;
     }
     $this->view->setVar("featured_artists", $va_featured_artists);
     $this->render('featured_artists_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:50,代码来源:ArtistBrowserController.php

示例10: floor

<!-- BEGIN List of sets -->
<div id="scrollableContainer">
	<a class="prevPage setTileScrollControl"><img src='<?php 
print $this->request->getThemeUrlPath();
?>
/graphics/browse_arrow_large_gr_lt.gif' width='20' height='31' border='0'></a>
	<!-- root element for scrollable --> 
	<div class="scrollable">     
		<!-- root element for the items --> 
		<div class="items"> 
<?php 
$t_set = new ca_sets();
$vn_i = 0;
foreach ($va_set_list as $va_set) {
    $vn_set_id = $va_set['set_id'];
    if ($t_set->load($vn_set_id)) {
        $va_item = $va_set_display_items[$vn_set_id][array_shift(array_keys($va_set_display_items[$vn_set_id]))];
        $vn_item_width = $va_item['representation_width'];
        $vn_item_height = $va_item['representation_height'];
        if ($vn_i == 0) {
            print "<div>";
        }
        ?>
				<div class='setTile'>
					<div class='setTileImage set<?php 
        print $va_set['set_id'];
        ?>
'>
						<div style='margin-top: <?php 
        print floor((160 - $vn_item_height) / 2);
        ?>
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:features_landing_html.php

示例11: _initView

 /**
  * Initializes editor view with core set of values, loads model with record to be edited and selects user interface to use.
  *
  * @param $pa_options Array of options. Supported options are:
  *		ui = The ui_id or editor_code value for the user interface to use. If omitted the default user interface is used.
  */
 protected function _initView($pa_options = null)
 {
     // load required javascript
     AssetLoadManager::register('bundleableEditor');
     AssetLoadManager::register('imageScroller');
     AssetLoadManager::register('datePickerUI');
     $vn_set_id = $this->request->getParameter('set_id', pInteger);
     $t_set = new ca_sets();
     if (!$vn_set_id || !$t_set->load($vn_set_id)) {
         // Bad set id
         return array(null, null, null, null);
     }
     // Does user have access to set?
     if (!$t_set->haveAccessToSet($this->request->getUserID(), __CA_SET_READ_ACCESS__)) {
         return array(null, null, null, null);
     }
     $t_subject = $this->opo_datamodel->getInstanceByTableNum($t_set->get('table_num'));
     $t_ui = new ca_editor_uis();
     if (!isset($pa_options['ui']) && !$pa_options['ui']) {
         $t_ui->load($this->request->user->getPreference("batch_" . $t_subject->tableName() . "_editor_ui"));
     }
     if (!$t_ui->getPrimaryKey() && isset($pa_options['ui']['__all__']) && $pa_options['ui']['__all__']) {
         if (is_numeric($pa_options['ui']['__all__'])) {
             $t_ui->load((int) $pa_options['ui']['__all__']);
         }
         if (!$t_ui->getPrimaryKey()) {
             $t_ui->load(array('editor_code' => $pa_options['ui']['__all__']));
         }
     }
     if (!$t_ui->getPrimaryKey()) {
         $t_ui = ca_editor_uis::loadDefaultUI($t_subject->tableName(), $this->request, $t_subject->getTypeID());
     }
     $this->view->setVar('set_id', $vn_set_id);
     $this->view->setVar('t_set', $t_set);
     $this->view->setVar('t_subject', $t_subject);
     $vn_item_count = $t_set->getItemCount(array('user_id' => $this->request->getUserID()));
     $vs_item_name = $vn_item_count == 1 ? $t_subject->getProperty("NAME_SINGULAR") : $t_subject->getProperty("NAME_PLURAL");
     MetaTagManager::setWindowTitle(_t("Batch editing %1 %2 with set %3", $vn_item_count, $vs_item_name, $t_set->getLabelForDisplay(true)));
     return array($vn_set_id, $t_set, $t_subject, $t_ui);
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:46,代码来源:EditorController.php

示例12: caGetFrontConfig

 * http://www.CollectiveAccess.org
 *
 * @package CollectiveAccess
 * @subpackage Core
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License version 3
 *
 * ----------------------------------------------------------------------
 */
?>
<div class="row">
<?php 
$va_access_values = $this->getVar("access_values");
$o_config = caGetFrontConfig();
# --- grab the set that has the featured
$t_set = new ca_sets();
$t_set->load(array('set_code' => $o_config->get("front_page_exhibit_set_code")));
$t_exhibition = new ca_occurrences();
if (sizeof($va_access_values) == 0 || sizeof($va_access_values) && in_array($t_set->get("access"), $va_access_values)) {
    $va_exhibition_ids = array_keys(is_array($va_tmp = $t_set->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
    $t_exhibition->load($va_exhibition_ids[0]);
}
# --- check to see if there is an image set configured
if ($this->getVar("featured_set_id")) {
    $qr_res = $this->getVar('featured_set_items_as_search_result');
    if ($qr_res && $qr_res->numHits()) {
        while ($qr_res->nextHit()) {
            if ($vs_media = $qr_res->getWithTemplate('^ca_object_representations.media.front', array("checkAccess" => $va_access_values))) {
                print "<div class='col-sm-12'><div class='frontSlide'>" . $vs_media . "</div></div>";
                break;
            }
        }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:front_page_html.php

示例13: foreach

			<div class="unit">
				<div class="heading"><?php 
    print _t("STAFF PICKS");
    ?>
</div>
				<div class="divide"><!-- empty --></div>
<?php 
    foreach ($va_staff_picks_sets as $vn_set_id => $va_set_info) {
        ?>
				<div class="heading"><?php 
        print $va_set_info["name"];
        ?>
:</div>
				<ul class="crossList">
<?php 
        $t_set->load($vn_set_id);
        $va_set_items = caExtractValuesByUserLocale($t_set->getItems());
        foreach ($va_set_items as $vn_item_id => $va_item_info) {
            if ($va_item_info["access"] == 1) {
                print "<li>" . caNavLink($this->request, $va_item_info["name"], '', 'Detail', 'Collection', 'Show', array('collection_id' => $va_item_info["row_id"])) . "</li>";
            }
        }
        ?>
				</ul>
				<div class="divide"><!-- empty --></div>
<?php 
    }
    ?>
			</div>
<?php 
}
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:right_col_html.php

示例14: array

 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
JavascriptLoadManager::register("cycle");
$t_object = new ca_objects();
$t_featured = new ca_sets();
$featured_set = $t_featured->load(array('set_code' => 'splash'));
$carousel_ids = $t_featured->getItemRowIDs(array('shuffle' => true));
$qr_set = ca_objects::createResultSet(array_keys($carousel_ids));
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("mediumlarge"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
$va_access_values = caGetUserAccessValues($this->request);
?>
	<div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;">
		<a href="#" onclick="caUIBrowsePanel.hideBrowsePanel()" class="browseSelectPanelButton"></a>
		<div id="splashBrowsePanelContent">
		
		</div>
	</div>
	<script type="text/javascript">
		var caUIBrowsePanel = caUI.initBrowsePanel({ facetUrl: '<?php 
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:splash_html.php

示例15: shareSet

 public function shareSet()
 {
     $pn_set_id = $this->request->getParameter('set_id', pInteger);
     $t_set = new ca_sets();
     if (!$t_set->haveAccessToSet($this->request->getUserID(), __CA_SET_EDIT_ACCESS__, $pn_set_id)) {
         $this->notification->addNotification(_t("You cannot share this set"), "message");
     } else {
         $t_set->load($pn_set_id);
         $vs_form_prefix = 'shareSetForm_';
         $va_users_to_set = array();
         foreach ($_REQUEST as $vs_key => $vs_val) {
             if (preg_match("!^{$vs_form_prefix}id(.*)\$!", $vs_key, $va_matches)) {
                 $vn_user_id = (int) $this->request->getParameter($vs_form_prefix . 'id' . $va_matches[1], pInteger);
                 $vn_access = $this->request->getParameter($vs_form_prefix . 'access_' . $va_matches[1], pInteger);
                 if ($vn_access > 0) {
                     $va_users_to_set[$vn_user_id] = $vn_access;
                 }
             }
         }
         $t_set->setUsers($va_users_to_set);
         if ($t_set->numErrors()) {
             $this->notification->addNotification(_t("There were errors while sharing: %1", join("; ", $t_set->getErrors())), "message");
         } else {
             $vn_c = sizeof($va_users_to_set);
             $this->notification->addNotification($vn_c == 1 ? _t("Shared set with %1 user", $vn_c) : _t("Shared set with %1 users", $vn_c), "message");
         }
     }
     $this->index();
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:29,代码来源:SetsController.php


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