本文整理汇总了PHP中caEditorLink函数的典型用法代码示例。如果您正苦于以下问题:PHP caEditorLink函数的具体用法?PHP caEditorLink怎么用?PHP caEditorLink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caEditorLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: caCreateBatchMediaImportResultsReport
function caCreateBatchMediaImportResultsReport($po_request, $pa_general, $pa_notices, $pa_errors)
{
$vs_buf = '';
if (is_array($pa_errors) && sizeof($pa_errors)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Errors occurred') . ':</div><ul>';
foreach ($pa_errors as $vs_f => $va_error) {
$vs_buf .= "<li><em>[{$vs_f}]:</em> " . $va_error['message'] . "</li>";
}
$vs_buf .= "</ul>";
}
if (is_array($pa_notices) && sizeof($pa_notices)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Processed') . ':</div><ol>';
foreach ($pa_notices as $vn_id => $va_notice) {
switch ($va_notice['status']) {
case 'SUCCESS':
$vs_buf .= "<li><em>" . caEditorLink($po_request, $va_notice['label'], '', $pa_general['table'], $vn_id) . "</em> (" . $va_notice['idno'] . "): " . $va_notice['status'] . "</li>";
break;
case 'SKIPPED':
case 'MATCHED':
case 'RELATED':
$vs_buf .= "<li><em>" . $va_notice['label'] . "</em>: " . $va_notice['message'] . "</li>";
break;
default:
$vs_buf .= "<li><em>" . $va_notice['label'] . "</em> (" . $va_notice['idno'] . "): " . $va_notice['status'] . "</li>";
break;
}
}
$vs_buf .= "</ol>";
}
if ($pa_general['set_id']) {
$vs_buf .= caNavButton($po_request, __CA_NAV_BUTTON_BATCH_EDIT__, _t('Batch edit'), 'batch', 'Editor', 'Edit', array('set_id' => $pa_general['set_id']), array(), array('icon_position' => __CA_NAV_BUTTON_ICON_POS_LEFT__, 'use_class' => 'list-button', 'no_background' => true, 'dont_show_content' => true)) . ' ' . _t('Batch edit set <em>%1</em> containing imported media', caNavLink($po_request, $pa_general['setName'], '', 'batch', 'Editor', 'Edit', array('set_id' => $pa_general['set_id'])));
}
print "<script type='text/javascript'>";
print "jQuery('#batchProcessingMediaPreview').hide();";
print "jQuery('#batchProcessingReport').html('" . addslashes($vs_buf) . "').fadeIn(300);";
print "jQuery('#batchProcessingMore').fadeIn(300);";
print "</script>";
caFlushOutput();
}
示例2: caCreateBatchEditorResultsReport
function caCreateBatchEditorResultsReport($po_request, $pa_general, $pa_notices, $pa_errors)
{
$vs_buf = '';
if (is_array($pa_errors) && sizeof($pa_errors)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Errors occurred') . ':</div><ul>';
foreach ($pa_errors as $vn_id => $va_error) {
$va_error_list = array();
foreach ($va_error['errors'] as $o_error) {
$va_error_list[] = $o_error->getErrorDescription();
}
$vs_buf .= "<li><em>" . caEditorLink($po_request, $va_error['label'], '', $pa_general['table'], $vn_id) . "</em> (" . $va_error['idno'] . "): " . join("; ", $va_error_list) . "</li>";
}
$vs_buf .= "</ul>";
$vs_buf .= '<div class="batchProcessingReportSectionWarning">' . (sizeof($pa_errors) == 1 ? _t('Note: <strong>NO</strong> batch changes were saved due to the error.') : _t('Note: <strong>NO</strong> batch changes were saved due to %1 errors.', sizeof($pa_errors))) . "</div>";
}
if (is_array($pa_notices) && sizeof($pa_notices)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Processed successfully') . ':</div><ol>';
foreach ($pa_notices as $vn_id => $va_notice) {
$vs_buf .= "<li><em>" . caEditorLink($po_request, preg_replace("![\r\n\t]+!", " ", $va_notice['label']), '', $pa_general['table'], $vn_id) . "</em> (" . $va_notice['idno'] . "): " . $va_notice['status'] . "</li>";
}
$vs_buf .= "</ol>";
}
print "<script type='text/javascript'>";
print "jQuery('#batchProcessingReport').html('" . addslashes($vs_buf) . "').fadeIn(300);";
print "jQuery('#batchProcessingMore').fadeIn(300);";
print "</script>";
caFlushOutput();
}
示例3: foreach
?>
<div class="dashboardWidgetContentContainer">
<?php
if (sizeof($va_watched_items) > 0) {
print '<div class="dashboardWidgetScrollMedium"><ul>';
?>
<form id="watchedItemsForm"><input type="hidden" name="mode" value="list">
<?php
foreach ($va_watched_items as $va_item) {
$vs_idno = "";
if ($va_item["idno"]) {
$vs_idno = "[" . $va_item["idno"] . "] ";
}
print "<li><input type='checkbox' name='watch_id[]' value='" . $va_item["watch_id"] . "'> ";
if ($va_item["primary_key"]) {
print "<span style='font-size:12px; font-weight:bold;'>" . caEditorLink($po_request, $vs_idno . $va_item["displayName"], '', $va_item["table_name"], $va_item["row_id"]) . "</span>";
print "<br/> <a href='#' id='moreWatchItem" . $va_item["watch_id"] . "' onclick='jQuery(\"#moreWatchItem" . $va_item["watch_id"] . "\").hide(); jQuery(\"#watchItem" . $va_item["watch_id"] . "\").slideDown(250); return false;'>" . _t("Recent Changes") . " ›</a>";
print "<div style='display:none; margin-right:5px;' id='watchItem" . $va_item["watch_id"] . "'>";
print $va_item["change_log"];
print "<a href='#' id='hideWatchItem" . $va_item["watch_id"] . "' style='padding-left:10px;' onclick='jQuery(\"#watchItem" . $va_item["watch_id"] . "\").slideUp(250); jQuery(\"#moreWatchItem" . $va_item["watch_id"] . "\").show(); return false;'>" . _t('Hide') . " ›</a>";
print "</div>";
} else {
print _t("Item was deleted - row_id: %1; table number: %2", $va_item["row_id"], $va_item["table_num"]);
}
print "</li>";
}
print '</ul></div>';
?>
<div style="padding-top:10px; text-align:center; padding-right:20px;">
<a href='#' onclick='jQuery("#watchedItemsForm").attr("action", "<?php
print caNavUrl($po_request, 'manage', 'WatchedItems', 'Delete');
示例4: caUpdateBatchMetadataImportResultsReport
function caUpdateBatchMetadataImportResultsReport($po_request, $pa_general, $pa_errors, $pb_done = false)
{
$vs_buf = '';
if (is_array($pa_errors) && sizeof($pa_errors)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Errors during import') . ':</div><ul>';
foreach ($pa_errors as $vn_i => $vs_error_message) {
$vs_buf .= "<li>{$vs_error_message}</li>";
}
$vs_buf .= "</ul>";
}
if (is_array($pa_notices) && sizeof($pa_notices)) {
$vs_buf .= '<div class="batchProcessingReportSectionHead">' . _t('Processed') . ':</div><ol>';
foreach ($pa_notices as $vn_id => $va_notice) {
switch ($va_notice['status']) {
case 'SUCCESS':
$vs_buf .= "<li><em>" . caEditorLink($po_request, $va_notice['label'], '', $pa_general['table'], $vn_id) . "</em> (" . $va_notice['idno'] . "): " . $va_notice['status'] . "</li>";
break;
case 'SKIPPED':
case 'MATCHED':
$vs_buf .= "<li><em>" . $va_notice['label'] . "</em>: " . $va_notice['message'] . "</li>";
break;
default:
$vs_buf .= "<li><em>" . $va_notice['label'] . "</em> (" . $va_notice['idno'] . "): " . $va_notice['status'] . "</li>";
break;
}
}
$vs_buf .= "</ol>";
}
print "<script type='text/javascript'>";
print "jQuery('#batchProcessingReport').html('" . addslashes($vs_buf) . "').show();";
if ($pb_done) {
print "jQuery('#batchProcessingMore').fadeIn(300);";
}
print "</script>";
caFlushOutput();
}
示例5: caCreateLinksFromText
/**
* Creates links to the appropriate editor (in Providence) or detail page (in Pawtucket) from supplied text and ids.
* Used in SearchResult::get() and BundlableLabelableBaseModelWithAttributes::get() to automatically generate links when fetching
* information from related tables.
*
* @param array $pa_text An array of strings to create links for
* @param string $ps_table_name The name of the table/record to which the links refer
* @param array $pa_row_ids Array of row_ids to link to. Values must correspond by index with those in $pa_text
* @param string $ps_class Optional CSS class to apply to links
* @param array $pa_options Supported options are:
* requireLinkTags = if set then links are only added when explicitly defined with <l> tags. Default is to make the entire text a link in the absence of <l> tags.
*
* @return array A list of HTML links
*/
function caCreateLinksFromText($pa_text, $ps_table_name, $pa_row_ids, $ps_class = null, $ps_target = null, $pa_options = null)
{
if (!in_array(__CA_APP_TYPE__, array('PROVIDENCE', 'PAWTUCKET'))) {
return $pa_text;
}
if (__CA_APP_TYPE__ == 'PAWTUCKET') {
$o_config = Configuration::load();
}
$vb_can_handle_target = false;
if ($ps_target) {
$o_app_plugin_manager = new ApplicationPluginManager();
$vb_can_handle_target = $o_app_plugin_manager->hookCanHandleGetAsLinkTarget(array('target' => $ps_target));
}
// Parse template
$o_dom = new DOMDocument('1.0', 'utf-8');
$o_dom->preserveWhiteSpace = true;
libxml_use_internal_errors(true);
// don't reported mangled HTML errors
$o_dm = Datamodel::load();
$va_links = $va_type_ids = array();
if ($t_instance = $o_dm->getInstanceByTableName($ps_table_name)) {
$va_type_ids = $t_instance->getFieldValuesForIDs($pa_row_ids, array('type_id'));
//if (caUseIdentifiersInUrls()) {
// $pa_row_ids = array_values($t_instance->getFieldValuesForIDs($pa_row_ids, array($t_instance->getProperty('ID_NUMBERING_ID_FIELD'))));
//}
}
global $g_request;
if (!$g_request) {
return $pa_text;
}
foreach ($pa_text as $vn_i => $vs_text) {
$vs_text = preg_replace("!([A-Za-z0-9]+)='([^']*)'!", "\$1=\"\$2\"", $vs_text);
// DomDcoument converts single quotes around attributes to double quotes so we do the same to the template
$vs_text = preg_replace("![ ]+/>!", "/>", $vs_text);
// DomDocument removes spaces before the end of self-closing tags so we do the same here to the template
$o_dom->loadHTML('<?xml encoding="utf-8">' . $vs_text);
// Needs XML declaration to force it to consider the text as UTF-8. Please don't ask why. No one knows.
libxml_clear_errors();
$va_l_tags = array();
$o_links = $o_dom->getElementsByTagName("l");
// l=link
foreach ($o_links as $o_link) {
if (!$o_link) {
continue;
}
$vs_html = $o_dom->saveXML($o_link);
$vs_content = preg_replace("!^<[^\\>]+>!", "", $vs_html);
$vs_content = preg_replace("!<[^\\>]+>\$!", "", $vs_content);
$va_l_tags[] = array('directive' => html_entity_decode($vs_html), 'content' => $vs_content);
}
if (sizeof($va_l_tags)) {
$vs_content = $vs_text;
foreach ($va_l_tags as $va_l) {
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $va_l['content'], 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$vs_link_text = $va_params['tag'];
} else {
switch (__CA_APP_TYPE__) {
case 'PROVIDENCE':
$vs_link_text = caEditorLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i]);
break;
case 'PAWTUCKET':
$vs_link_text = caDetailLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i], array(), array(), array('type_id' => $va_type_ids[$pa_row_ids[$vn_i]]));
break;
}
}
if ($vs_link_text) {
$vs_content = str_replace($va_l['directive'], $vs_link_text, $vs_content);
} else {
$vs_content = str_replace($va_l['directive'], $va_l['content'], $vs_content);
}
}
$va_links[] = $vs_content;
} else {
if (isset($pa_options['requireLinkTags']) && $pa_options['requireLinkTags']) {
$va_links[] = $vs_text;
continue;
}
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $vs_text, 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$va_links[] = $va_params['tag'];
} else {
switch (__CA_APP_TYPE__) {
case 'PROVIDENCE':
//.........这里部分代码省略.........
示例6: caCreateLinksFromText
/**
* Creates links to the appropriate editor (in Providence) or detail page (in Pawtucket) from supplied text and ids.
* Used in SearchResult::get() and BundlableLabelableBaseModelWithAttributes::get() to automatically generate links when fetching
* information from related tables.
*
* @param array $pa_text An array of strings to create links for
* @param string $ps_table_name The name of the table/record to which the links refer
* @param array $pa_row_ids Array of row_ids to link to. Values must correspond by index with those in $pa_text
* @param string $ps_class Optional CSS class to apply to links
* @param string $ps_target
* @param array $pa_options Supported options are:
* requireLinkTags = if set then links are only added when explicitly defined with <l> tags. Default is to make the entire text a link in the absence of <l> tags.
* addRelParameter =
*
* @return array A list of HTML links
*/
function caCreateLinksFromText($pa_text, $ps_table_name, $pa_row_ids, $ps_class = null, $ps_target = null, $pa_options = null)
{
if (!in_array(__CA_APP_TYPE__, array('PROVIDENCE', 'PAWTUCKET'))) {
return $pa_text;
}
if (__CA_APP_TYPE__ == 'PAWTUCKET') {
$o_config = Configuration::load();
}
$pb_add_rel = caGetOption('addRelParameter', $pa_options, false);
$vb_can_handle_target = false;
if ($ps_target) {
$o_app_plugin_manager = new ApplicationPluginManager();
$vb_can_handle_target = $o_app_plugin_manager->hookCanHandleGetAsLinkTarget(array('target' => $ps_target));
}
// Parse template
$o_dom = new DOMDocument('1.0', 'utf-8');
$o_dom->preserveWhiteSpace = true;
libxml_use_internal_errors(true);
// don't reported mangled HTML errors
$va_links = array();
global $g_request;
if (!$g_request) {
return $pa_text;
}
foreach ($pa_text as $vn_i => $vs_text) {
$vs_text = preg_replace("!([A-Za-z0-9]+)='([^']*)'!", "\$1=\"\$2\"", $vs_text);
// DomDcoument converts single quotes around attributes to double quotes so we do the same to the template
$vs_text = preg_replace("![ ]+/>!", "/>", $vs_text);
$vs_text = preg_replace("![\r\n]+!", "", $vs_text);
// DomDocument removes newlines so we do the same here to the template
$o_dom->loadHTML('<?xml encoding="utf-8">' . mb_convert_encoding($vs_text, 'HTML-ENTITIES', 'UTF-8'));
// Needs XML declaration to force it to consider the text as UTF-8. Please don't ask why. No one knows.
$o_dom->encoding = 'utf-8';
libxml_clear_errors();
$va_l_tags = array();
$o_links = $o_dom->getElementsByTagName("l");
// l=link
foreach ($o_links as $o_link) {
if (!$o_link) {
continue;
}
$vs_html = $o_dom->saveXML($o_link);
$vs_content = preg_replace("!^<[^\\>]+>!", "", $vs_html);
$vs_content = preg_replace("!<[^\\>]+>\$!", "", $vs_content);
$va_l_tags[] = array('directive' => html_entity_decode($vs_html), 'content' => $vs_content);
//html_entity_decode
}
if (sizeof($va_l_tags)) {
$vs_content = html_entity_decode($vs_text);
$vs_content = preg_replace_callback("/(&#[0-9]+;)/", function ($m) {
return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES");
}, $vs_content);
foreach ($va_l_tags as $va_l) {
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $va_l['content'], 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$vs_link_text = $va_params['tag'];
} else {
switch (__CA_APP_TYPE__) {
case 'PROVIDENCE':
$vs_link_text = caEditorLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i], $pb_add_rel ? array('rel' => true) : array());
break;
case 'PAWTUCKET':
$vs_link_text = caDetailLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i]);
break;
}
}
if ($vs_link_text) {
$vs_content = str_replace($va_l['directive'], $vs_link_text, $vs_content);
} else {
$vs_content = str_replace($va_l['directive'], $va_l['content'], $vs_content);
}
}
$va_links[] = $vs_content;
} else {
if (isset($pa_options['requireLinkTags']) && $pa_options['requireLinkTags']) {
$va_links[] = $vs_text;
continue;
}
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $vs_text, 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$va_links[] = $va_params['tag'];
} else {
//.........这里部分代码省略.........
示例7: caCreateLinksFromText
/**
* Creates links to the appropriate editor (in Providence) or detail page (in Pawtucket) from supplied text and ids.
* Used in SearchResult::get() and BundlableLabelableBaseModelWithAttributes::get() to automatically generate links when fetching
* information from related tables.
*
* @param array $pa_text An array of strings to create links for
* @param string $ps_table_name The name of the table/record to which the links refer
* @param array $pa_row_ids Array of row_ids to link to. Values must correspond by index with those in $pa_text
* @param string $ps_class Optional CSS class to apply to links
* @param string $ps_target
* @param array $pa_options Supported options are:
* requireLinkTags = if set then links are only added when explicitly defined with <l> tags. Default is to make the entire text a link in the absence of <l> tags.
* addRelParameter =
*
* @return array A list of HTML links
*/
function caCreateLinksFromText($pa_text, $ps_table_name, $pa_row_ids, $ps_class = null, $ps_target = null, $pa_options = null)
{
if (!in_array(__CA_APP_TYPE__, array('PROVIDENCE', 'PAWTUCKET'))) {
return $pa_text;
}
if (__CA_APP_TYPE__ == 'PAWTUCKET') {
$o_config = Configuration::load();
}
$pb_add_rel = caGetOption('addRelParameter', $pa_options, false);
$vb_can_handle_target = false;
if ($ps_target) {
$o_app_plugin_manager = new ApplicationPluginManager();
$vb_can_handle_target = $o_app_plugin_manager->hookCanHandleGetAsLinkTarget(array('target' => $ps_target));
}
// Parse template
$o_doc = str_get_dom($ps_template);
$va_links = array();
global $g_request;
if (!$g_request) {
return $pa_text;
}
foreach ($pa_text as $vn_i => $vs_text) {
$vs_text = preg_replace("!([A-Za-z0-9]+)='([^']*)'!", "\$1=\"\$2\"", $vs_text);
$va_l_tags = array();
$o_links = $o_doc('l');
foreach ($o_links as $o_link) {
if (!$o_link) {
continue;
}
$vs_html = $o_link->html();
$vs_content = preg_replace("!^<[^\\>]+>!", "", $vs_html);
$vs_content = preg_replace("!<[^\\>]+>\$!", "", $vs_content);
$va_l_tags[] = array('directive' => html_entity_decode($vs_html), 'content' => $vs_content);
//html_entity_decode
}
if (sizeof($va_l_tags)) {
$vs_content = html_entity_decode($vs_text);
$vs_content = preg_replace_callback("/(&#[0-9]+;)/", function ($m) {
return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES");
}, $vs_content);
foreach ($va_l_tags as $va_l) {
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $va_l['content'], 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$vs_link_text = $va_params['tag'];
} else {
switch (__CA_APP_TYPE__) {
case 'PROVIDENCE':
$vs_link_text = caEditorLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i], $pb_add_rel ? array('rel' => true) : array());
break;
case 'PAWTUCKET':
$vs_link_text = caDetailLink($g_request, $va_l['content'], $ps_class, $ps_table_name, $pa_row_ids[$vn_i]);
break;
}
}
if ($vs_link_text) {
$vs_content = str_replace($va_l['directive'], $vs_link_text, $vs_content);
} else {
$vs_content = str_replace($va_l['directive'], $va_l['content'], $vs_content);
}
}
$va_links[] = $vs_content;
} else {
if (isset($pa_options['requireLinkTags']) && $pa_options['requireLinkTags']) {
$va_links[] = $vs_text;
continue;
}
if ($vb_can_handle_target) {
$va_params = array('request' => $g_request, 'content' => $vs_text, 'table' => $ps_table_name, 'id' => $pa_row_ids[$vn_i], 'classname' => $ps_class, 'target' => $ps_target, 'additionalParameters' => null, 'options' => null);
$va_params = $o_app_plugin_manager->hookGetAsLink($va_params);
$va_links[] = $va_params['tag'];
} else {
switch (__CA_APP_TYPE__) {
case 'PROVIDENCE':
$va_links[] = ($vs_link = caEditorLink($g_request, $vs_text, $ps_class, $ps_table_name, $pa_row_ids[$vn_i])) ? $vs_link : $vs_text;
break;
case 'PAWTUCKET':
$va_links[] = ($vs_link = caDetailLink($g_request, $vs_text, $ps_class, $ps_table_name, $pa_row_ids[$vn_i])) ? $vs_link : $vs_text;
break;
default:
$va_links[] = $vs_text;
break;
}
}
//.........这里部分代码省略.........
示例8: while
while ($vn_item_count < $vn_items_per_page && $vo_result->nextHit()) {
$vn_lot_id = $vo_result->get('lot_id');
$i == 2 ? $i = 0 : "";
?>
<tr <?php
print $i == 1 ? "class='odd'" : "";
?>
>
<td style="width:10px">
<input type='checkbox' name='add_to_set_ids' value='<?php
print (int) $vn_lot_id;
?>
' class="addItemToSetControl" />
</td>
<?php
print "<td style='width:5%;'>" . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), '', 'ca_object_lots', $vn_lot_id, array()) . "</td>";
foreach ($va_display_list as $vn_placement_id => $va_info) {
print "<td>" . $t_display->getDisplayValue($vo_result, $vn_placement_id, array_merge(array('request' => $this->request), is_array($va_info['settings']) ? $va_info['settings'] : array())) . "</td>";
}
?>
</tr>
<?php
$i++;
$vn_item_count++;
}
?>
</tbody>
<?php
if (is_array($va_bottom_line = $this->getVar('bottom_line'))) {
?>
示例9: print
$vn_padding_top = 0;
$vn_padding_top_bottom = (180 - $va_media_info["HEIGHT"]) / 2;
if (sizeof($va_tmp) == 0) {
$vs_background_image = 'background-image:url("' . $vs_background_image . '"); background-position: 55px 65px; background-repeat: no-repeat; background-size: 64px 64px; opacity: .3;';
}
print "<td align='center' valign='top' style='padding:2px 2px 2px 2px;'><div class='objectThumbnailsImageContainer' style='padding: " . $vn_padding_top_bottom . "px 0px " . $vn_padding_top_bottom . "px 0px; {$vs_background_image}'>";
?>
<input type='checkbox' name='add_to_set_ids' value='<?php
print (int) $vn_object_id;
?>
' class="addItemToSetControl addItemToSetControlInThumbnails" />
<?php
print caEditorLink($this->request, array_shift($va_tmp), '', 'ca_objects', $vn_object_id, array(), array('onmouseover' => 'jQuery(".qlButtonContainerThumbnail").css("display", "none"); jQuery("#ql_' . $vn_object_id . '").css("display", "block");', 'onmouseout' => 'jQuery(".qlButtonContainerThumbnail").css("display", "none");'));
print "<div class='qlButtonContainerThumbnail' id='ql_" . $vn_object_id . "' onmouseover='jQuery(\"#ql_" . $vn_object_id . "\").css(\"display\", \"block\");'><a class='qlButton' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, 'find', 'SearchObjects', 'QuickLook', array('object_id' => $vn_object_id)) . "\"); return false;' >Quick Look</a></div>";
print "</div><div class='thumbCaption' " . $vs_caption;
print "<br/>" . caEditorLink($this->request, $vs_idno, '', 'ca_objects', $vn_object_id, array()) . "\n";
print "</div></td>";
$vn_col++;
if ($vn_col == $vn_display_cols) {
print "</tr>";
$vn_col = 0;
}
$vn_item_count++;
}
if ($vn_col > 0) {
while ($vn_col < $vn_display_cols) {
print "<td><!-- empty --></td>";
$vn_col++;
}
print "</tr>";
}
示例10: print
$vn_padding_top = 0;
$vn_padding_top_bottom = (250 - $va_media_info["HEIGHT"]) / 2;
print "<div class='objectFullImageContainer' style='padding: " . $vn_padding_top_bottom . "px 0px " . $vn_padding_top_bottom . "px 0px;'>";
?>
<input type='checkbox' name='add_to_set_ids' value='<?php
print (int) $vn_object_id;
?>
' class="addItemToSetControl addItemToSetControlInThumbnails" />
<?php
$va_tmp = $vo_result->getMediaTags('ca_object_representations.media', 'small');
print caEditorLink($this->request, array_shift($va_tmp), '', 'ca_objects', $vn_object_id, array(), array('onmouseover' => 'jQuery(".qlButtonContainerFull").css("display", "none"); jQuery("#ql_' . $vn_object_id . '").css("display", "block");', 'onmouseout' => 'jQuery(".qlButtonContainerFull").css("display", "none");'));
print "<div class='qlButtonContainerFull' id='ql_" . $vn_object_id . "' onmouseover='jQuery(\"#ql_" . $vn_object_id . "\").css(\"display\", \"block\");'><a class='qlButton' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, 'find', 'SearchObjects', 'QuickLook', array('object_id' => $vn_object_id)) . "\"); return false;' >" . _t("Quick Look") . "</a></div>";
print "</div>";
print "<div class='objectFullText'>";
$va_labels = $vo_result->getDisplayLabels($this->request);
print "<div class='objectFullTextTitle'>" . caEditorLink($this->request, implode("<br/>", $va_labels), '', 'ca_objects', $vn_object_id, array()) . "</div>";
// Output configured fields in display
foreach ($va_display_list as $vn_placement_id => $va_info) {
if (in_array($va_info['bundle_name'], array('ca_objects.preferred_labels', 'ca_object_labels.name'))) {
continue;
}
// skip preferred labels because we always output them above
if ($vs_display_text = $t_display->getDisplayValue($vo_result, $vn_placement_id, array_merge(array('request' => $this->request), is_array($va_info['settings']) ? $va_info['settings'] : array()))) {
print "<div class='objectFullTextTextBlock'><span class='formLabel'>" . $va_info['display'] . "</span>: " . $vs_display_text . "</div>\n";
}
}
//print "<div class='objectFullTextTextBlock'>".caNavLink($this->request, ($vs_action == "Edit" ? _t("Edit") : _t("View"))." ›", 'button', 'editor/objects', 'ObjectEditor', $vs_action, array('object_id' => $vn_object_id))."</div>";
print "</div><!-- END objectFullText -->";
$vn_item_count++;
if ($vn_item_count < $vn_items_per_page) {
print "<br/><div class='divide'><!-- empty --></div>";
示例11: foreach
<tr <?php
print $i == 1 ? "class='odd'" : "";
?>
>
<td style="width:10px">
<?php
if ($t_rel = $o_dm->getInstanceByTableNum($vo_result->get('table_num'), true)) {
print ' (<i>' . $t_rel->getProperty('NAME_SINGULAR') . '</i>)';
}
?>
</td>
<?php
foreach ($va_display_list as $vn_placement_id => $va_display_item) {
print "<td>" . $t_display->getDisplayValue($vo_result, $vn_placement_id) . "</td>";
}
print "<td style='width:5%;'>" . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), 'editIcon', 'ca_relationship_types', $vn_type_id, array()) . "</td>";
print " <a href='#' onclick='caOpenBrowserWith(" . $vn_type_id . ");'>" . caNavIcon($this->request, __CA_NAV_BUTTON_GO__, array('title' => _t('View in hierarchy'))) . "</a>";
print "</td>";
?>
</tr>
<?php
$i++;
$vn_item_count++;
}
?>
</tbody></table>
</form><!--end caFindResultsForm -->
</div><!--end scrollingResults -->
<?php
TooltipManager::add('.editIcon', _t("Edit"));
示例12: trim
}
if ($vs_template) {
print '<li class="quickSearchList">' . $o_res->getWithTemplate($vs_template) . "</li>\n";
} else {
$vs_idno_display = trim($o_res->get($va_info['displayidno']));
if ($vb_show_labels) {
$vs_label = $o_res->get($vs_table . '.preferred_labels');
} else {
$vs_label = $vs_idno_display;
$vs_idno_display = '';
}
$vs_type_display = '';
if (($vn_type_id = trim($o_res->get($vs_table . '.type_id'))) && $va_type_list[$vn_type_id]) {
$vs_type_display = ' [' . $va_type_list[$vn_type_id]['name_singular'] . ']';
}
print '<li class="quickSearchList">' . caEditorLink($this->request, $vs_label, null, $vs_table, $o_res->get($va_info['primary_key'])) . " " . ($vs_idno_display ? "({$vs_idno_display})" : "") . " {$vs_type_display}</li>\n";
}
}
?>
</ul>
<div class="quickSearchResultHide"><a href='#' id='hide<?php
print $vs_table;
?>
' onclick='jQuery("#<?php
print $vs_table;
?>
_results").slideUp(250); jQuery("#show<?php
print $vs_table;
?>
").slideDown(1); jQuery("#hide<?php
print $vs_table;
示例13: print
?>
<tr <?php
print $i == 1 ? "class='odd'" : "";
?>
>
<td style="width:10px">
<input type='checkbox' name='add_to_set_ids' value='<?php
print (int) $vn_item_id;
?>
' class="addItemToSetControl" />
</td>
<?php
foreach ($va_display_list as $vn_placement_id => $va_display_item) {
print "<td>" . $t_display->getDisplayValue($vo_result, $vn_placement_id) . "</td>";
}
print "<td class='editDelete'>" . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), 'list-button', 'ca_list_items', $vn_item_id, array());
print " <a href='#' class='list-button' onclick='caOpenBrowserWith({$vn_item_id});'>" . caNavIcon($this->request, __CA_NAV_BUTTON_GO__, array('title' => _t('View in hierarchy'))) . "</a>";
print "</td>";
?>
</tr>
<?php
$i++;
$vn_item_count++;
}
?>
</tbody>
<?php
if (is_array($va_bottom_line = $this->getVar('bottom_line'))) {
?>
<tfoot>
示例14: Index
//.........这里部分代码省略.........
$this->view->setVar('num_pages', $vn_num_pages = ceil($vn_num_hits / $vn_items_per_page));
if ($vn_page_num > $vn_num_pages) {
$vn_page_num = 1;
}
if ($pa_options['output_format']) {
$vo_result = $this->opo_browse->getResults(array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction));
} else {
$vo_result = $this->opo_browse->getResults(array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction, 'start' => ($vn_page_num - 1) * $vn_items_per_page, 'limit' => $vn_items_per_page));
}
// Only prefetch what we need
$vo_result->setOption('prefetch', $vn_items_per_page);
if ($vo_result) {
if ($vb_criteria_have_changed || $vb_sort_has_changed) {
// Put the results id list into the results context - we used this for previous/next navigation
$this->opo_result_context->setResultList($vo_result->getPrimaryKeyValues());
$this->opo_result_context->setParameter('availableVisualizationChecked', 0);
}
$vo_result->seek(0);
}
//
// Set up view for display of results
//
$this->view->setVar('page', $vn_page_num);
$this->view->setVar('result', $vo_result);
$this->view->setVar('views', $this->opa_views);
// pass view list to view for rendering
$this->view->setVar('current_view', $vs_view);
$this->view->setVar('sorts', $this->opa_sorts);
// pass sort list to view for rendering
$this->view->setVar('current_sort', $vs_sort);
$this->view->setVar('current_sort_direction', $vs_sort_direction);
$this->view->setVar('items_per_page', $this->opa_items_per_page);
$this->view->setVar('current_items_per_page', $vn_items_per_page);
$this->view->setVar('t_subject', $t_model);
$this->view->setVar('mode_name', _t('browse'));
$this->view->setVar('mode', 'browse');
$this->view->setVar('mode_type_singular', $this->browseName('singular'));
$this->view->setVar('mode_type_plural', $this->browseName('plural'));
$this->view->setVar('access_values', $va_access_values);
$t_display = $this->view->getVar('t_display');
$va_display_list = $this->view->getVar('display_list');
if ($vs_view == 'editable') {
$va_initial_data = array();
$va_row_headers = array();
$vn_item_count = 0;
if ($vo_result) {
$vs_pk = $vo_result->primaryKey();
while ($vn_item_count < 100 && $vo_result->nextHit()) {
$va_result = array('item_id' => $vn_id = $vo_result->get($vs_pk));
foreach ($va_display_list as $vn_placement_id => $va_bundle_info) {
$va_result[str_replace(".", "-", $va_bundle_info['bundle_name'])] = $t_display->getDisplayValue($vo_result, $vn_placement_id, array('request' => $this->request));
}
$va_initial_data[] = $va_result;
$vn_item_count++;
$va_row_headers[] = $vn_item_count . " " . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), 'caResultsEditorEditLink', $this->ops_tablename, $vn_id);
}
}
$this->view->setVar('initialData', $va_initial_data);
$this->view->setVar('rowHeaders', $va_row_headers);
}
//
// Bottom line
//
$va_bottom_line = array();
$vb_bottom_line_is_set = false;
foreach ($va_display_list as $vn_placement_id => $va_placement) {
if (isset($va_placement['settings']['bottom_line']) && $va_placement['settings']['bottom_line']) {
$va_bottom_line[$vn_placement_id] = caProcessBottomLineTemplate($this->request, $va_placement, $vo_result, array('pageStart' => ($vn_page_num - 1) * $vn_items_per_page, 'pageEnd' => ($vn_page_num - 1) * $vn_items_per_page + $vn_items_per_page));
$vb_bottom_line_is_set = true;
} else {
$va_bottom_line[$vn_placement_id] = '';
}
}
$this->view->setVar('bottom_line', $vb_bottom_line_is_set ? $va_bottom_line : null);
switch ($pa_options['output_format']) {
# ------------------------------------
case 'LABELS':
$this->_genLabels($vo_result, $this->request->getParameter("label_form", pString), _t('Browse'), _t('Browse'));
break;
# ------------------------------------
# ------------------------------------
case 'EXPORT':
$this->_genExport($vo_result, $this->request->getParameter("export_format", pString), _t('Browse'), _t('Browse'));
break;
# ------------------------------------
# ------------------------------------
case 'HTML':
default:
// generate type menu and type value list
if (method_exists($t_model, "getTypeList")) {
$this->view->setVar('type_list', $t_model->getTypeList());
}
$this->opo_result_context->setAsLastFind();
$this->opo_result_context->saveContext();
if (!$pb_dont_render_view) {
$this->render('Browse/browse_controls_html.php');
}
break;
}
}
示例15: jQuery
<th class="{sorter: false} list-header-nosort"><input type='checkbox' name='record' value='' id='watchItemSelectAllControl' class='watchItemControl' onchange="jQuery('.watchItemControl').attr('checked', jQuery('#watchItemSelectAllControl').attr('checked'));"/></th>
</tr>
</thead>
<tbody>
<?php
foreach ($va_watched_items as $va_item) {
$vs_idno = "";
if ($va_item["idno"]) {
$vs_idno = "[" . $va_item["idno"] . "] ";
}
?>
<tr>
<td>
<?php
if ($va_item["primary_key"]) {
print caEditorLink($this->request, $vs_idno . $va_item["displayName"], '', $va_item["table_name"], $va_item["row_id"]) . " " . "<a href='#' style='font-weight:bold; margin-left:5px; color:#555; text-decoration:none;' id='changeLogLink" . $va_item["watch_id"] . "' onclick='jQuery(\"#changeLogLink" . $va_item["watch_id"] . "\").hide(); jQuery(\"#changeLogHide" . $va_item["watch_id"] . "\").show(); jQuery(\"#changeLog" . $va_item["watch_id"] . "\").slideDown(250); return false;'>" . _t("Recent Changes") . " ›</a><a href='#' style='display:none; font-weight:bold; margin-left:5px; text-decoration:none;' id='changeLogHide" . $va_item["watch_id"] . "' onclick='jQuery(\"#changeLogHide" . $va_item["watch_id"] . "\").hide(); jQuery(\"#changeLogLink" . $va_item["watch_id"] . "\").show(); jQuery(\"#changeLog" . $va_item["watch_id"] . "\").slideUp(250); return false;'>" . _t("Hide Recent Changes") . " ›</a>";
} else {
print "item was deleted. Row id: " . $va_item["row_id"] . " table_num: " . $va_item["table_num"];
}
?>
</td>
<td style="white-space:nowrap; width:75px;">
<?php
print $va_item["item_type"];
?>
</td>
<td style="width:15px;">
<input type="checkbox" class="watchItemControl" name="watch_id[]" value="<?php
print $va_item["watch_id"];
?>
">