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


PHP ca_list_items::get方法代码示例

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


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

示例1: info

 public function info($pa_parameters)
 {
     parent::info($pa_parameters);
     if ($t_item = $this->view->getVar('t_item')) {
         if (!($vn_tour_id = $t_item->get('tour_id'))) {
             $t_parent = new ca_list_items($this->request->getParameter('parent_id', pInteger));
             $vn_tour_id = $t_parent->get('tour_id');
         }
     }
     $t_tour = new ca_tours($vn_tour_id);
     $this->view->setVar('t_tour', $t_tour);
     return $this->render('widget_tour_stop_info_html.php', true);
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:13,代码来源:TourStopEditorController.php

示例2: getDisplaysAsXML

 public function getDisplaysAsXML()
 {
     $t_display = new ca_bundle_displays();
     /** @var Datamodel $o_dm */
     $o_dm = Datamodel::load();
     $this->opt_locale = new ca_locales();
     $va_displays = $t_display->getBundleDisplays();
     $vs_buf = "<displays>\n";
     foreach ($va_displays as $vn_i => $va_display_by_locale) {
         $va_locales = array_keys($va_display_by_locale);
         $va_info = $va_display_by_locale[$va_locales[0]];
         if (!$t_display->load($va_info['display_id'])) {
             continue;
         }
         $vs_buf .= "\t<display code='" . ($va_info['display_code'] && preg_match('!^[A-Za-z0-9_]+$!', $va_info['display_code']) ? $va_info['display_code'] : 'display_' . $va_info['display_id']) . "' type='" . $o_dm->getTableName($va_info['table_num']) . "' system='" . $t_display->get('is_system') . "'>\n";
         $vs_buf .= "\t\t<labels>\n";
         foreach ($va_display_by_locale as $vn_locale_id => $va_display_info) {
             if (strlen($this->opt_locale->localeIDToCode($vn_locale_id)) > 0) {
                 $vs_buf .= "\t\t\t<label locale='" . $this->opt_locale->localeIDToCode($vn_locale_id) . "'><name>" . caEscapeForXML($va_display_info['name']) . "</name></label>\n";
             }
         }
         $vs_buf .= "\t\t</labels>\n";
         $va_settings = $t_display->getSettings();
         if (sizeof($va_settings) > 0) {
             $vs_buf .= "\t\t<settings>\n";
             foreach ($va_settings as $vs_setting => $vm_val) {
                 if (is_array($vm_val)) {
                     foreach ($vm_val as $vn_i => $vn_val) {
                         $vs_buf .= "\t\t\t<setting name='{$vs_setting}'><![CDATA[" . $vn_val . "]]></setting>\n";
                     }
                 } else {
                     $vs_buf .= "\t\t\t<setting name='{$vs_setting}'><![CDATA[" . $vm_val . "]]></setting>\n";
                 }
             }
             $vs_buf .= "\t\t</settings>\n";
         }
         // User and group access
         $va_users = $t_display->getUsers();
         if (sizeof($va_users) > 0) {
             $vs_buf .= "\t\t<userAccess>\n";
             foreach ($va_users as $va_user_info) {
                 $vs_buf .= "\t\t\t<permission user='" . $va_user_info["user_name"] . "' access='" . $this->_convertUserGroupAccessToString(intval($va_user_info['access'])) . "'/>\n";
             }
             $vs_buf .= "\t\t</userAccess>\n";
         }
         $va_groups = $t_display->getUserGroups();
         if (sizeof($va_groups) > 0) {
             $vs_buf .= "\t\t<groupAccess>\n";
             foreach ($va_groups as $va_group_info) {
                 $vs_buf .= "\t\t\t<permission group='" . $va_group_info["code"] . "' access='" . $this->_convertUserGroupAccessToString(intval($va_group_info['access'])) . "'/>\n";
             }
             $vs_buf .= "\t\t</groupAccess>\n";
         }
         $va_placements = $t_display->getPlacements();
         $vs_buf .= "<bundlePlacements>\n";
         foreach ($va_placements as $vn_placement_id => $va_placement_info) {
             $vs_buf .= "\t\t<placement code='" . preg_replace("![^A-Za-z0-9_]+!", "_", $va_placement_info['bundle_name']) . "'><bundle>" . $va_placement_info['bundle_name'] . "</bundle>\n";
             $va_settings = caUnserializeForDatabase($va_placement_info['settings']);
             if (is_array($va_settings)) {
                 $vs_buf .= "<settings>\n";
                 foreach ($va_settings as $vs_setting => $vm_value) {
                     switch ($vs_setting) {
                         case 'label':
                             if (is_array($vm_value)) {
                                 foreach ($vm_value as $vn_locale_id => $vm_locale_specific_value) {
                                     if (preg_match("/^[a-z]{2,3}\\_[A-Z]{2,3}\$/", $vn_locale_id)) {
                                         // locale code
                                         $vs_locale_code = $vn_locale_id;
                                     } else {
                                         if (!($vs_locale_code = $this->opt_locale->localeIDToCode($vn_locale_id))) {
                                             $vs_locale_code = 'en_US';
                                         }
                                     }
                                     $vs_buf .= "<setting name='label' locale='" . $vs_locale_code . "'>" . caEscapeForXML($vm_locale_specific_value) . "</setting>\n";
                                 }
                             }
                             break;
                         case 'restrict_to_relationship_types':
                             if (is_array($vm_value)) {
                                 foreach ($vm_value as $vn_val) {
                                     $t_rel_type = new ca_relationship_types($vn_val);
                                     if ($t_rel_type->getPrimaryKey()) {
                                         $vs_value = $t_rel_type->get('type_code');
                                         $vs_buf .= "\t\t\t\t<setting name='{$vs_setting}'><![CDATA[" . $vs_value . "]]></setting>\n";
                                     }
                                 }
                             }
                             break;
                         case 'restrict_to_types':
                             if (is_array($vm_value)) {
                                 foreach ($vm_value as $vn_val) {
                                     $t_item = new ca_list_items($vn_val);
                                     if ($t_item->getPrimaryKey()) {
                                         $vs_value = $t_item->get('idno');
                                         $vs_buf .= "\t\t\t\t<setting name='{$vs_setting}'><![CDATA[" . $vs_value . "]]></setting>\n";
                                     }
                                 }
                             }
                             break;
                         default:
//.........这里部分代码省略.........
开发者ID:idiscussforum,项目名称:providence,代码行数:101,代码来源:ConfigurationExporter.php

示例3: parseValue

 /**
  * @param mixed $ps_value
  * @param array $pa_element_info
  * @param array $pa_options Options are:
  *		alwaysTreatValueAsIdno = Always try to convert $ps_value to a list idno value, even if it is numeric
  *
  * @return array
  */
 public function parseValue($ps_value, $pa_element_info, $pa_options = null)
 {
     $vb_treat_value_as_idno = caGetOption('alwaysTreatValueAsIdno', $pa_options, false);
     $vb_require_value = is_null($pa_element_info['settings']['requireValue']) ? true : (bool) $pa_element_info['settings']['requireValue'];
     if ($vb_treat_value_as_idno || preg_match('![^\\d]+!', $ps_value)) {
         // try to convert idno to item_id
         if ($vn_id = ca_lists::getItemID($pa_element_info['list_id'], $ps_value)) {
             $ps_value = $vn_id;
         }
     }
     if (!$vb_require_value && !(int) $ps_value) {
         return array('value_longtext1' => null, 'item_id' => null);
     }
     if (strlen($ps_value) && !is_numeric($ps_value)) {
         $this->postError(1970, _t('Item_id %2 is not valid for element %1', $pa_element_info["element_code"], $ps_value), 'ListAttributeValue->parseValue()');
         return false;
     }
     $t_item = new ca_list_items((int) $ps_value);
     if (!$t_item->getPrimaryKey()) {
         if ($ps_value) {
             $this->postError(1970, _t('%1 is not a valid list item_id for %2 [%3]', $ps_value, $pa_element_info['displayLabel'], $pa_element_info['element_code']), 'ListAttributeValue->parseValue()');
         } else {
             //$this->postError(1970, _t('Value %1 [%2] cannot be blank', $pa_element_info['displayLabel'], $pa_element_info['element_code']), 'ListAttributeValue->parseValue()');
             return null;
         }
         return false;
     }
     if ((int) $t_item->get('list_id') != (int) $pa_element_info['list_id']) {
         $this->postError(1970, _t('Item is not in the correct list for element %1. List id is %2 but should be %3', $pa_element_info["element_code"], $t_item->get('list_id'), $pa_element_info['list_id']), 'ListAttributeValue->parseValue()');
         return false;
     }
     return array('value_longtext1' => $ps_value, 'item_id' => (int) $ps_value);
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:41,代码来源:ListAttributeValue.php

示例4: caNavUrl

                $va_resp['subList'] .= "<li><a href='#' onClick='\$(\"#tocSubList" . $vn_i . "\").toggle(); return false;'>+ " . $va_item['name_plural'] . "</a></li>\n";
                $va_resp['subList'] .= "<ul class='tocSubSubMenu' id='tocSubList" . $vn_i . "'>";
                foreach ($va_list_sub_sub_items as $vn_sub_i => $va_subitem) {
                    #$va_resp['subList'] .= "<li>".caNavLink($this->request, $va_subitem['name_plural'], '', '', 'Browse', 'Objects', array('facet' => 'term_facet', 'id' => $vn_sub_i))."</li>\n";
                    $va_resp['subList'] .= "<li>" . caNavLink($this->request, $va_subitem['name_plural'], '', '', 'MultiSearch', 'Index', array('search' => 'ca_list_items.item_id:' . $vn_sub_i)) . "</li>\n";
                }
                $va_resp['subList'] .= "</ul>";
            } else {
                #$va_resp['subList'] .= "<li>".caNavLink($this->request, $va_item['name_plural'], '', '', 'Browse', 'Objects', array('facet' => 'term_facet', 'id' => $vn_i))."</li>\n";
                $va_resp['subList'] .= "<li>" . caNavLink($this->request, $va_item['name_plural'], '', '', 'MultiSearch', 'Index', array('search' => 'ca_list_items.item_id:' . $vn_i)) . "</li>\n";
            }
        }
    }
    require_once __CA_MODELS_DIR__ . "/ca_list_items.php";
    $t_list_item = new ca_list_items($vn_item_id);
    $va_resp['selectedTitle'] = $t_list_item->get('ca_list_items.preferred_labels.name_plural');
    $va_resp['selectedDescription'] = $t_list_item->get('ca_list_items.preferred_labels.description') . "<br/><br>" . caNavLink($this->request, _t('View'), '', '', 'MultiSearch', 'Index', array('search' => 'ca_list_items.item_id:' . $vn_item_id));
    print json_encode($va_resp);
    return;
}
?>

<script type="text/javascript">
	function caFrontLoadSubList(item_id) {
		jQuery.getJSON('<?php 
print caNavUrl($this->request, '*', '*', '*');
?>
', {item_id: item_id}, function(data) {
			console.log("data", data);
			jQuery("#tocTopTitle").html(data['selectedTitle']);
			
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:30,代码来源:toc_functions_html.php

示例5: caLightboxSetDetailItemOld

/**
 * Returns the info for each set item
 * 
 * options: "write_access" = false
 * 
 */
function caLightboxSetDetailItemOld($po_request, $va_set_item = array(), $pa_options = array())
{
    $t_set_item = new ca_set_items($va_set_item["item_id"]);
    if (!$t_set_item->get("item_id")) {
        return false;
    }
    $vb_write_access = false;
    if ($pa_options["write_access"]) {
        $vb_write_access = true;
    }
    $t_list_items = new ca_list_items($va_set_item["type_id"]);
    $vs_placeholder = getPlaceholder($t_list_items->get("idno"), "placeholder_media_icon");
    $vs_caption = "";
    $o_config = caGetSetsConfig();
    $vs_caption_template = $o_config->get("caption_template");
    if ($vs_caption_template) {
        $t_object = new ca_objects($va_set_item["row_id"]);
        $vs_caption = $t_object->getWithTemplate($vs_caption_template);
    } else {
        $vs_caption = $va_set_item["set_item_label"];
    }
    $vs_set_item_display = "";
    $vs_set_item_display .= "<div class='lbItem'><div class='lbItemContent'>\n";
    #$vs_set_item_display .= "<div class='lbItem' onmouseover='jQuery(\"#lbExpandedInfo".$t_set_item->get("item_id")."\").show();'  onmouseout='jQuery(\"#lbExpandedInfo".$t_set_item->get("item_id")."\").hide();'><div class='lbItemContent'>\n";
    if ($va_set_item["representation_tag_medium"]) {
        $vs_set_item_display .= caDetailLink($po_request, "<div class='lbItemImg'>" . $va_set_item["representation_tag_medium"] . "</div>", '', 'ca_objects', $va_set_item["row_id"]);
    } else {
        $vs_set_item_display .= caDetailLink($po_request, "<div class='lbItemImg lbSetImgPlaceholder'>" . $vs_placeholder . "</div>", '', 'ca_objects', $va_set_item["row_id"]);
    }
    $vs_set_item_display .= "<div id='comment" . $t_set_item->get("item_id") . "' class='lbSetItemComment'><!-- load comments here --></div>\n";
    $vs_set_item_display .= "<div class='caption'>" . $vs_caption . "</div>\n";
    $vs_set_item_display .= "</div><!-- end lbItemContent -->\n";
    $vs_set_item_display .= "<div class='lbExpandedInfo' id='lbExpandedInfo" . $t_set_item->get("item_id") . "'>\n<hr>\n";
    if ($vb_write_access) {
        $vs_set_item_display .= "<div class='pull-right'><a href='#' class='lbItemDeleteButton' id='lbItemDelete" . $t_set_item->get("item_id") . "' title='" . _t("Remove") . "'><span class='glyphicon glyphicon-trash'></span></a></div>\n";
    }
    $vs_set_item_display .= "<div>" . caDetailLink($po_request, "<span class='glyphicon glyphicon-file'></span>", '', 'ca_objects', $va_set_item["row_id"], "", array("title" => _t("View Item Detail"))) . "\n";
    if ($va_set_item["representation_id"]) {
        $vs_set_item_display .= "&nbsp;<a href='#' title='" . _t("Enlarge Image") . "' onclick='caMediaPanel.showPanel(\"" . caNavUrl($po_request, '', 'Detail', 'GetRepresentationInfo', array('object_id' => $t_set_item->get("row_id"), 'representation_id' => $va_set_item["representation_id"], 'overlay' => 1)) . "\"); return false;' ><span class='glyphicon glyphicon-zoom-in'></span></a>\n";
    }
    $vs_set_item_display .= "&nbsp;&nbsp;<a href='#' title='" . _t("Comments") . "' onclick='jQuery(\"#comment" . $t_set_item->get("item_id") . "\").load(\"" . caNavUrl($po_request, '', 'Sets', 'AjaxListComments', array('item_id' => $t_set_item->get("item_id"), 'tablename' => 'ca_set_items', 'set_id' => $t_set_item->get("set_id"))) . "\", function(){jQuery(\"#comment" . $t_set_item->get("item_id") . "\").show();}); return false;'><span class='glyphicon glyphicon-comment'></span> <small>" . $t_set_item->getNumComments() . "</small></a></div>\n";
    $vs_set_item_display .= "</div><!-- end lbExpandedInfo --></div><!-- end lbItem -->\n";
    return $vs_set_item_display;
}
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:50,代码来源:themeHelpers.php

示例6: getItemInfoForImport

 /**
  * Get a record summary that is easier to parse when importing to another system
  */
 private function getItemInfoForImport()
 {
     if (!($t_instance = $this->_getTableInstance($this->ops_table, $this->opn_id))) {
         return false;
     }
     $o_dm = Datamodel::load();
     $t_list = new ca_lists();
     $t_locales = new ca_locales();
     //
     // Options
     //
     if (!($vs_delimiter = $this->opo_request->getParameter('delimiter', pString))) {
         $vs_delimiter = "; ";
     }
     if (!($vs_flatten = $this->opo_request->getParameter('flatten', pString))) {
         $vs_flatten = null;
     }
     $va_flatten = preg_split("![ ]*[;]+[ ]*!", $vs_flatten);
     $va_flatten = array_flip($va_flatten);
     $va_locales = $t_locales->getLocaleList(array("available_for_cataloguing_only" => true));
     $va_return = array();
     // allow user-defined template to be passed; allows flexible formatting of returned "display" value
     if (!($vs_template = $this->opo_request->getParameter('template', pString))) {
         $vs_template = '';
     }
     if ($vs_template) {
         $va_return['display'] = caProcessTemplateForIDs($vs_template, $this->ops_table, array($this->opn_id));
     }
     // "intrinsic" fields
     foreach ($t_instance->getFieldsArray() as $vs_field_name => $va_field_info) {
         $vs_list = null;
         if (!is_null($vs_val = $t_instance->get($vs_field_name))) {
             if (preg_match("/^hier\\_/", $vs_field_name)) {
                 continue;
             }
             if (preg_match("/\\_sort\$/", $vs_field_name)) {
                 continue;
             }
             if ($vs_field_name == $t_instance->primaryKey()) {
                 continue;
             }
             if (isset($va_field_info["LIST_CODE"])) {
                 // typical example: type_id
                 $va_item = $t_list->getItemFromListByItemID($va_field_info["LIST_CODE"], $vs_val);
                 if ($t_item = new ca_list_items($va_item["item_id"])) {
                     $vs_val = $t_item->get('idno');
                 }
             }
             $va_return['intrinsic'][$vs_field_name] = $vs_val;
         }
     }
     // preferred labels
     $va_labels = $t_instance->get($this->ops_table . ".preferred_labels", array("returnAllLocales" => true));
     $va_labels = end($va_labels);
     $vs_display_field_name = $t_instance->getLabelDisplayField();
     if (is_array($va_labels)) {
         foreach ($va_labels as $vn_locale_id => $va_labels_by_locale) {
             foreach ($va_labels_by_locale as $va_tmp) {
                 $va_label = array();
                 $va_label['locale'] = $va_locales[$vn_locale_id]["code"];
                 // add only UI fields to return
                 foreach (array_merge($t_instance->getLabelUIFields(), array('type_id')) as $vs_label_fld) {
                     $va_label[$vs_label_fld] = $va_tmp[$vs_label_fld];
                 }
                 $va_label[$vs_label_fld] = $va_tmp[$vs_label_fld];
                 $va_label['label'] = $va_tmp[$vs_display_field_name];
                 $va_return["preferred_labels"][$va_label['locale']] = $va_label;
             }
         }
         if (isset($va_flatten['locales'])) {
             $va_return["preferred_labels"] = array_pop(caExtractValuesByUserLocale(array($va_return["preferred_labels"])));
         }
     }
     // nonpreferred labels
     $va_labels = $t_instance->get($this->ops_table . ".nonpreferred_labels", array("returnAllLocales" => true));
     $va_labels = end($va_labels);
     if (is_array($va_labels)) {
         foreach ($va_labels as $vn_locale_id => $va_labels_by_locale) {
             foreach ($va_labels_by_locale as $va_tmp) {
                 $va_label = array();
                 $va_label['locale'] = $va_locales[$vn_locale_id]["code"];
                 // add only UI fields to return
                 foreach (array_merge($t_instance->getLabelUIFields(), array('type_id')) as $vs_label_fld) {
                     $va_label[$vs_label_fld] = $va_tmp[$vs_label_fld];
                 }
                 $va_return["nonpreferred_labels"][$va_label['locale']] = $va_label;
             }
         }
         if (isset($va_flatten['locales'])) {
             $va_return["nonpreferred_labels"] = array_pop(caExtractValuesByUserLocale(array($va_return["nonpreferred_labels"])));
         }
     }
     // attributes
     $va_codes = $t_instance->getApplicableElementCodes();
     foreach ($va_codes as $vs_code) {
         if ($va_vals = $t_instance->get($this->ops_table . "." . $vs_code, array("convertCodesToDisplayText" => false, "returnAllLocales" => true))) {
             $va_vals_as_text = end($t_instance->get($this->ops_table . "." . $vs_code, array("convertCodesToDisplayText" => true, "returnAllLocales" => true)));
//.........这里部分代码省略.........
开发者ID:guaykuru,项目名称:pawtucket,代码行数:101,代码来源:ItemService.php

示例7: indexRow

    /**
     * Indexes single row in a table; this is the public call when one needs to index content.
     * indexRow() will analyze the dependencies of the row being indexed and automatically
     * apply the indexing of the row to all dependent rows in other tables.  (Note that while I call this
     * a "public" call in fact you shouldn't need to call this directly. BaseModel.php does this for you
     * during insert() and update().)
     *
     * For example, if you are indexing a row in table 'entities', then indexRow()
     * will automatically apply the indexing not just to the entities record, but also
     * to all objects, place_names, occurrences, lots, etc. that reference the entity.
     * The dependencies are configured in the search_indices.conf configuration file.
     *
     * "subject" tablenum/row_id refer to the row **to which the indexing is being applied**. This may be the row being indexed
     * or it may be a dependent row. The "content" tablenum/fieldnum/row_id parameters define the specific row and field being indexed.
     * This is always the actual row being indexed. $pm_content is the content to be indexed and $pa_options is an optional associative
     * array of indexing options passed through from the search_indices.conf (no options are defined yet - but will be soon)
     */
    public function indexRow($pn_subject_tablenum, $pn_subject_row_id, $pa_field_data, $pb_reindex_mode = false, $pa_exclusion_list = null, $pa_changed_fields = null, $pa_old_values = null, $pa_options = null)
    {
        if (!$pb_reindex_mode && is_array($pa_changed_fields) && !sizeof($pa_changed_fields)) {
            return;
        }
        // don't bother indexing if there are no changed fields
        $vs_subject_tablename = $this->opo_datamodel->getTableName($pn_subject_tablenum);
        $t_subject = $this->getTableInstance($vs_subject_tablename, true);
        // Prevent endless recursive reindexing
        if (is_array($pa_exclusion_list[$pn_subject_tablenum]) && isset($pa_exclusion_list[$pn_subject_tablenum][$pn_subject_row_id])) {
            return;
        }
        $vb_reindex_children = false;
        $vs_subject_pk = $t_subject->primaryKey();
        if (!is_array($pa_changed_fields)) {
            $pa_changed_fields = array();
        }
        foreach ($pa_changed_fields as $vs_k => $vb_bool) {
            if (!isset($pa_field_data[$vs_k])) {
                $pa_field_data[$vs_k] = null;
            }
        }
        $vb_can_do_incremental_indexing = $this->opo_engine->can('incremental_reindexing') ? true : false;
        // can the engine do incremental indexing? Or do we need to reindex the entire row every time?
        foreach ($this->opo_search_config->get('search_indexing_replacements') as $vs_to_replace => $vs_replacement) {
            foreach ($pa_field_data as $vs_k => &$vs_value) {
                if ($vs_replacement == "nothing") {
                    $vs_replacement = "";
                }
                $vs_value = str_replace($vs_to_replace, $vs_replacement, $vs_value);
            }
        }
        if (!$pa_exclusion_list) {
            $pa_exclusion_list = array();
        }
        $pa_exclusion_list[$pn_subject_tablenum][$pn_subject_row_id] = true;
        //
        // index fields in subject table itself
        //
        $va_fields_to_index = $this->getFieldsToIndex($pn_subject_tablenum);
        if (is_array($va_fields_to_index)) {
            foreach ($va_fields_to_index as $vs_k => $va_data) {
                if (preg_match('!^ca_attribute_(.*)$!', $vs_k, $va_matches)) {
                    if (!is_numeric($va_matches[1])) {
                        if ($vn_x = $this->_getElementID($va_matches[1])) {
                            $va_matches[1] = $vn_x;
                        } else {
                            unset($va_fields_to_index[$vs_k]);
                            continue;
                        }
                    }
                    unset($va_fields_to_index[$vs_k]);
                    if ($va_data['DONT_INDEX']) {
                        // remove attribute from indexing list
                        unset($va_fields_to_index['_ca_attribute_' . $va_matches[1]]);
                    } else {
                        $va_fields_to_index['_ca_attribute_' . $va_matches[1]] = $va_data;
                    }
                }
            }
        }
        //
        // If location in hierarchy has changed we need to reindex this record and all of its children
        //
        if ($t_subject->isHierarchical() && isset($pa_changed_fields['parent_id']) && $pa_changed_fields['parent_id'] && method_exists($t_subject, "makeSearchResult")) {
            $pb_reindex_mode = true;
            $vb_reindex_children = true;
        }
        $vb_started_indexing = false;
        if (is_array($va_fields_to_index)) {
            $this->opo_engine->startRowIndexing($pn_subject_tablenum, $pn_subject_row_id);
            $vb_started_indexing = true;
            foreach ($va_fields_to_index as $vs_field => $va_data) {
                if (substr($vs_field, 0, 14) === '_ca_attribute_') {
                    //
                    // Is attribute
                    //
                    $vs_v = $pa_field_data[$vs_field];
                    if (!preg_match('!^_ca_attribute_(.*)$!', $vs_field, $va_matches)) {
                        continue;
                    }
                    if ($vb_can_do_incremental_indexing && !$pb_reindex_mode && (!isset($pa_changed_fields[$vs_field]) || !$pa_changed_fields[$vs_field])) {
                        continue;
//.........这里部分代码省略.........
开发者ID:guaykuru,项目名称:pawtucket,代码行数:101,代码来源:SearchIndexer.php

示例8: array

    $vn_featured_member_set_id = $t_featured_member->get("set_id");
    $va_featured_member_ids = array_keys(is_array($va_tmp = $t_featured_member->getItemRowIDs(array('checkAccess' => $va_access_values, 'shuffle' => 1))) ? $va_tmp : array());
    // These are the entity ids in the set
}
$t_entity = new ca_entities($va_featured_member_ids[0]);
$vn_featured_member_id = $va_featured_member_ids[0];
$vs_featured_member_image = $t_entity->get("mem_inst_image", array("version" => "frontpage", "return" => "tag"));
$vs_featured_member_name = $t_entity->getLabelForDisplay();
# --- canned browses
$va_browse_codes = $this->request->config->get('hp_category_browse_codes');
$t_list_item = new ca_list_items();
$va_browses = array();
if (is_array($va_browse_codes) && sizeof($va_browse_codes)) {
    foreach ($va_browse_codes as $vs_item_code) {
        $t_list_item->load(array('idno' => $vs_item_code));
        $va_browses[$t_list_item->get("item_id")] = array("idno" => $vs_item_code, "name" => $t_list_item->getLabelForDisplay());
    }
}
if ($this->getVar("featured_set_id")) {
    $t_featured_set = new ca_sets($this->getVar("featured_set_id"));
    ?>
		<div id="contentcontainer">
			<div id="objectcontainerHP">
				<div class="homeIntro">Navigate through some of the collections of Nova Scotia's community museums to learn about the province's past, and share your own stories and information about what is important to you.</div><!-- end home intro -->
				<div id="objectslidesContainerHP">
<?php 
    # --- featured objects
    foreach ($va_item_media as $vn_object_id => $va_media) {
        if ($va_media['urls']['frontpage']) {
            $vs_image_tag = $va_media["tags"]["frontpage"];
            $t_title_object = new ca_objects($vn_object_id);
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:splash_html.php

示例9: getUIsAsDOM

 public function getUIsAsDOM()
 {
     $t_list = new ca_lists();
     $vo_uis = $this->opo_dom->createElement("userInterfaces");
     $qr_uis = $this->opo_db->query("SELECT * FROM ca_editor_uis ORDER BY ui_id");
     while ($qr_uis->nextRow()) {
         $vo_ui = $this->opo_dom->createElement("userInterface");
         $vs_type = $this->opo_dm->getTableName($qr_uis->get("editor_type"));
         if (strlen($vs_code = $qr_uis->get("editor_code")) > 0) {
             $vo_ui->setAttribute("code", $this->makeIDNO($vs_code));
         } else {
             $vo_ui->setAttribute("code", "standard_{$vs_type}_ui");
         }
         $vo_ui->setAttribute("type", $vs_type);
         $vo_labels = $this->opo_dom->createElement("labels");
         $qr_ui_labels = $this->opo_db->query("SELECT * FROM ca_editor_ui_labels WHERE ui_id=?", $qr_uis->get("ui_id"));
         if ($qr_ui_labels->numRows() > 0) {
             while ($qr_ui_labels->nextRow()) {
                 if ($vs_locale = $this->opt_locale->localeIDToCode($qr_ui_labels->get("locale_id"))) {
                     $vo_label = $this->opo_dom->createElement("label");
                     $vo_label->setAttribute("locale", $vs_locale);
                     $vo_label->appendChild($this->opo_dom->createElement("name", caEscapeForXML($qr_ui_labels->get("name"))));
                     $vo_labels->appendChild($vo_label);
                 }
             }
         } else {
             $vo_label = $this->opo_dom->createElement("label");
             $vo_label->setAttribute("locale", "en_US");
             $vo_label->appendChild($this->opo_dom->createElement("name", caEscapeForXML($vs_code)));
             $vo_labels->appendChild($vo_label);
         }
         $vo_ui->appendChild($vo_labels);
         $vo_screens = $this->opo_dom->createElement("screens");
         $qr_screens = $this->opo_db->query("SELECT * FROM ca_editor_ui_screens WHERE parent_id IS NOT NULL AND ui_id=? ORDER BY screen_id", $qr_uis->get("ui_id"));
         while ($qr_screens->nextRow()) {
             $t_screen = new ca_editor_ui_screens($qr_screens->get("screen_id"));
             $vo_screen = $this->opo_dom->createElement("screen");
             if ($vs_idno = $qr_screens->get("idno")) {
                 $vo_screen->setAttribute("idno", $this->makeIDNO($vs_idno));
             }
             $vo_screen->setAttribute("default", $qr_screens->get("is_default"));
             $vo_labels = $this->opo_dom->createElement("labels");
             $qr_screen_labels = $this->opo_db->query("SELECT * FROM ca_editor_ui_screen_labels WHERE screen_id=?", $qr_screens->get("screen_id"));
             if ($qr_ui_labels->numRows() > 0) {
                 while ($qr_screen_labels->nextRow()) {
                     if ($vs_locale = $this->opt_locale->localeIDToCode($qr_screen_labels->get("locale_id"))) {
                         $vo_label = $this->opo_dom->createElement("label");
                         $vo_label->setAttribute("locale", $vs_locale);
                         $vo_label->appendChild($this->opo_dom->createElement("name", caEscapeForXML($qr_screen_labels->get("name"))));
                         if (strlen(trim($qr_screen_labels->get("description"))) > 0) {
                             $vo_label->appendChild($this->opo_dom->createElement("description", caEscapeForXML($qr_screen_labels->get("description"))));
                         }
                         $vo_labels->appendChild($vo_label);
                     }
                 }
             } else {
                 $vo_label = $this->opo_dom->createElement("label");
                 $vo_label->setAttribute("locale", "en_US");
                 $vo_label->appendChild($this->opo_dom->createElement("name", caEscapeForXML($vs_code)));
                 $vo_labels->appendChild($vo_label);
             }
             $vo_screen->appendChild($vo_labels);
             if (is_array($t_screen->getTypeRestrictions()) && sizeof($t_screen->getTypeRestrictions()) > 0) {
                 $vo_type_restrictions = $this->opo_dom->createElement("typeRestrictions");
                 foreach ($t_screen->getTypeRestrictions() as $va_restriction) {
                     $vo_type_restriction = $this->opo_dom->createElement("restriction");
                     $t_instance = $this->opo_dm->getInstanceByTableNum($va_restriction["table_num"]);
                     $vs_type_code = $t_instance->getTypeListCode();
                     $va_item = $t_list->getItemFromListByItemID($vs_type_code, $va_restriction["type_id"]);
                     $vo_type_restriction->setAttribute("type", $va_item["idno"]);
                     $vo_type_restrictions->appendChild($vo_type_restriction);
                 }
                 $vo_screen->appendChild($vo_type_restrictions);
             }
             $vo_placements = $this->opo_dom->createElement("bundlePlacements");
             $va_placements = $t_screen->getPlacementsInScreen();
             if (is_array($va_placements)) {
                 foreach ($va_placements as $va_placement) {
                     $vo_placement = $this->opo_dom->createElement("placement");
                     $vo_placements->appendChild($vo_placement);
                     $vo_placement->setAttribute("code", $this->makeIDNO($va_placement["placement_code"]));
                     $vo_placement->appendChild($this->opo_dom->createElement("bundle", caEscapeForXML($va_placement["bundle"])));
                     if (is_array($va_placement["settings"])) {
                         $vo_settings = $this->opo_dom->createElement("settings");
                         foreach ($va_placement["settings"] as $vs_setting => $va_values) {
                             if (is_null($va_values)) {
                                 continue;
                             }
                             if (!is_array($va_values)) {
                                 $va_values = array($va_values);
                             }
                             // account for legacy settings
                             if ($vs_setting == "restrict_to_type") {
                                 $vs_setting = "restrict_to_types";
                             }
                             foreach ($va_values as $vs_key => $vs_value) {
                                 switch ($vs_setting) {
                                     case 'restrict_to_types':
                                         $t_item = new ca_list_items($vs_value);
                                         if ($t_item->getPrimaryKey()) {
//.........这里部分代码省略.........
开发者ID:guaykuru,项目名称:pawtucket,代码行数:101,代码来源:ConfigurationExporter.php

示例10: caGetListItemIdno

function caGetListItemIdno($pn_item_id)
{
    global $g_list_item_idno_cache;
    if (isset($g_list_item_idno_cache[$pn_item_id])) {
        return $g_list_item_idno_cache[$pn_item_id];
    }
    $t_item = new ca_list_items($pn_item_id);
    return $g_list_item_idno_cache[$pn_item_id] = $t_item->get('idno');
}
开发者ID:ffarago,项目名称:pawtucket2,代码行数:9,代码来源:listHelpers.php

示例11: getDisplayValue

 /**
  * When returning text will return plural value of list item unless useSingular option is set to true, in which case singular version of list item label will be used.
  *
  * @param array Optional array of options. Support options are:
  * 			list_id = if set then the numeric item_id value is translated into label text in the current locale. If not set then the numeric item_id is returned.
  *			useSingular = If list_id is set then by default the returned text is the plural label. Setting this option to true will force use of the singular label. [Default is false]
  *			showHierarchy = If true then hierarchical parents of list item will be returned and hierarchical options described below will be used to control the output [Default is false]
  *			returnIdno = If true list item idno is returned rather than preferred label [Default is false]
  *			idsOnly = Return numeric item_id only [Default is false]
  *			alwaysReturnItemID = Synonym for idsOnly [Default is false]
  *			output = what value for the list to return. Valid values are text [display text], idno [identifier; same as returnIdno option], value [numeric item_id; same as idsOnly option]. [Default is value]
  *
  *			HIERARCHICAL OPTIONS:
  *				direction - For hierarchy specifications (eg. ca_objects.hierarchy) this determines the order in which the hierarchy is returned. ASC will return the hierarchy root first while DESC will return it with the lowest node first. Default is ASC.
  *				top - For hierarchy specifications (eg. ca_objects.hierarchy) this option, if set, will limit the returned hierarchy to the first X nodes from the root down. Default is to not limit.
  *				bottom - For hierarchy specifications (eg. ca_objects.hierarchy) this option, if set, will limit the returned hierarchy to the first X nodes from the lowest node up. Default is to not limit.
  * 				hierarchicalDelimiter - Text to place between items in a hierarchy for a hierarchical specification (eg. ca_objects.hierarchy) when returning as a string
  *				removeFirstItems - If set to a non-zero value, the specified number of items at the top of the hierarchy will be omitted. For example, if set to 2, the root and first child of the hierarchy will be omitted. Default is zero (don't delete anything).
  *				transaction = the transaction to execute database actions within. [Default is null]
  * @return string The value
  */
 public function getDisplayValue($pa_options = null)
 {
     if (isset($pa_options['output'])) {
         switch (strtolower($pa_options['output'])) {
             case 'idno':
                 $pa_options['returnIdno'] = true;
                 break;
             case 'text':
                 $pa_options['returnIdno'] = false;
                 $pa_options['idsOnly'] = false;
                 break;
             default:
                 $pa_options['idsOnly'] = true;
                 break;
         }
     }
     if ($vb_return_idno = isset($pa_options['returnIdno']) && (bool) $pa_options['returnIdno']) {
         return caGetListItemIdno($this->opn_item_id);
     }
     if (is_null($vb_ids_only = isset($pa_options['idsOnly']) ? (bool) $pa_options['idsOnly'] : null)) {
         $vb_ids_only = isset($pa_options['alwaysReturnItemID']) ? (bool) $pa_options['alwaysReturnItemID'] : false;
     }
     if ($vb_ids_only) {
         return (int) $this->opn_item_id;
     }
     $vn_list_id = is_array($pa_options) && isset($pa_options['list_id']) ? (int) $pa_options['list_id'] : null;
     if ($vn_list_id > 0) {
         $t_list = new ca_lists();
         if ($o_trans = isset($pa_options['transaction']) ? $pa_options['transaction'] : null) {
             $t_list->setTransaction($o_trans);
         }
         $t_item = new ca_list_items();
         if ($pa_options['showHierarchy'] || $vb_return_idno) {
             if ($o_trans) {
                 $t_item->setTransaction($o_trans);
             }
         }
         $vs_get_spec = isset($pa_options['useSingular']) && $pa_options['useSingular'] ? 'preferred_labels.name_singular' : 'preferred_labels.name_plural';
         // do we need to get the hierarchy?
         if ($pa_options['showHierarchy']) {
             $t_item->load((int) $this->opn_item_id);
             return $t_item->get('ca_list_items.hierarchy.' . $vs_get_spec, array_merge(array('removeFirstItems' => 1, 'delimiter' => ' ➔ ', $pa_options)));
         }
         return $t_list->getItemFromListForDisplayByItemID($vn_list_id, $this->opn_item_id, isset($pa_options['useSingular']) && $pa_options['useSingular'] ? false : true);
     }
     return $this->ops_text_value;
 }
开发者ID:samrahman,项目名称:providence,代码行数:68,代码来源:ListAttributeValue.php

示例12: getTags

 /**
  * Returns COinS tags for inclusion in page
  *
  * @param SearchResult_or_BundleableLabelableBaseModelWithAttributes_subclass $pm_instance_or_result
  * @param string $ps_output_type
  * @param array $pa_options
  */
 public static function getTags($pm_instance_or_result, $ps_output_type = null, $pa_options = null)
 {
     $va_config = COinS::_getConfig($vs_table_name = $pm_instance_or_result->tableName(), $ps_output_type);
     $va_urls = array();
     if (is_subclass_of($pm_instance_or_result, 'BaseModel')) {
         $qr_res = $pm_instance_or_result->makeSearchResult($pm_instance_or_result->tableName(), array($pm_instance_or_result->getPrimaryKey()));
     } else {
         $qr_res = $pm_instance_or_result;
     }
     $o_dm = Datamodel::load();
     $t_instance = $o_dm->getInstanceByTableName($vs_table_name, true);
     $vs_type_fld_name = $t_instance->getTypeFieldName();
     $t_item = new ca_list_items();
     while ($qr_res->nextHit()) {
         $vs_type_name = null;
         if ($vn_type_id = $qr_res->get($vs_type_fld_name)) {
             if ($t_item->load($vn_type_id)) {
                 $vs_type_name = $t_item->get('idno');
             }
         }
         $va_mappings = isset($va_config[$vs_type_name]) ? $va_config[$vs_type_name] : $va_config['__default__'];
         $va_people_mappings = $va_mappings['People'];
         unset($va_mappings['People']);
         $va_item = $va_people = array();
         foreach ($va_mappings as $vs_key => $va_mapping) {
             if (!is_array($va_mapping)) {
                 $vs_static = (string) $va_mapping;
             } else {
                 $vs_static = $va_mapping['value'];
                 $vs_bundle = $va_mapping['bundle'];
                 $va_options = $va_mapping['options'];
             }
             if ($vs_bundle) {
                 $va_item[$vs_key] = $qr_res->get($vs_bundle, $va_options);
             } else {
                 $va_item[$vs_key] = $vs_static;
             }
         }
         if (is_array($va_people_mappings)) {
             foreach ($va_people_mappings as $vn_person_type => $va_mapping) {
                 if (!is_array($va_mapping)) {
                     $vs_static = (string) $va_mapping;
                 } else {
                     $vs_static = $va_mapping['value'];
                     $vs_forename_bundle = $va_mapping['forename'];
                     $vs_surname_bundle = $va_mapping['surname'];
                     $va_options = $va_mapping['options'];
                 }
                 $vs_forename = $qr_res->get($vs_forename_bundle, $va_options);
                 $vs_surname = $qr_res->get($vs_surname_bundle, $va_options);
                 if ($vs_forename || $vs_surname) {
                     $va_people[] = array('DocRelationship' => $vn_person_type, 'FirstName' => $vs_forename, 'LastName' => $vs_surname);
                 }
             }
         }
         $va_urls[] = $vs_url = COinS::_CreateOpenURL($va_item, $va_people);
         $va_tags[] = "<span class='Z3988' title='{$vs_url}'></span>";
     }
     $vb_return_urls = isset($pa_options['returnUrls']) && $pa_options['returnUrls'];
     if (isset($pa_options['returnAsArray']) && $pa_options['returnAsArray']) {
         return $vb_return_urls ? $va_urls : $va_tags;
     } else {
         $vs_delimiter = isset($pa_options['delimiter']) ? $pa_options['delimiter'] : "\n";
         return join($vs_delimiter, $vb_return_urls ? $va_urls : $va_tags);
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:73,代码来源:COinS.php

示例13: array

        }
        print "<br/>";
    }
    print "</H5>";
}
?>
		<HR/>
<?php 
$va_classification_links = array();
$t_list_item = new ca_list_items();
$va_decorative_types = $t_object->get("ca_objects.decorative_types", array("returnAsArray" => true));
if (sizeof($va_decorative_types)) {
    foreach ($va_decorative_types as $va_decorative_type) {
        $vn_decorative_type = $va_decorative_type["decorative_types"];
        $t_list_item->load($vn_decorative_type);
        if (trim($t_list_item->get("ca_list_item_labels.name_singular"))) {
            $va_classification_links[] = caNavLink($this->request, $t_list_item->get("ca_list_item_labels.name_singular"), "", "", "Browse", "Objects", array("facet" => "decorative_types_facet", "id" => $vn_decorative_type));
        }
    }
    if (sizeof($va_classification_links)) {
        print "<H6>Classification</H6>";
        print join(", ", $va_classification_links);
    }
}
$va_documentation_types = $t_object->get("ca_objects.documentation_types", array("returnAsArray" => true));
if (sizeof($va_documentation_types)) {
    foreach ($va_documentation_types as $va_documentation_type) {
        $vn_documentation_type = $va_documentation_type["documentation_types"];
        $t_list_item->load($vn_documentation_type);
        if (trim($t_list_item->get("ca_list_item_labels.name_singular"))) {
            $va_classification_links[] = caNavLink($this->request, $t_list_item->get("ca_list_item_labels.name_singular"), "", "", "Browse", "Objects", array("facet" => "documentation_types_facet", "id" => $vn_documentation_type));
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:set_item_info_html.php

示例14: caGetListItemIdno

function caGetListItemIdno($pn_item_id, $pa_options = null)
{
    global $g_list_item_idno_cache;
    if (isset($g_list_item_idno_cache[$pn_item_id])) {
        return $g_list_item_idno_cache[$pn_item_id];
    }
    $t_item = new ca_list_items();
    if ($o_trans = caGetOption('transaction', $pa_options, null)) {
        $t_item->setTransaction($o_trans);
    }
    $t_item->load($pn_item_id);
    return $g_list_item_idno_cache[$pn_item_id] = $t_item->get('idno');
}
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:13,代码来源:listHelpers.php

示例15: caGetListItemIdno

/**
 * Fetch idno for item with specified item_id in list
 *
 * @param int $pn_item_id item_id to get idno for
 * @return string idno of list item or null if no matching item was found
 */
function caGetListItemIdno($pn_item_id)
{
    $t_item = new ca_list_items($pn_item_id);
    return $t_item->get('idno');
}
开发者ID:guaykuru,项目名称:pawtucket,代码行数:11,代码来源:listHelpers.php


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