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


PHP entity::get_display_name方法代码示例

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


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

示例1: entity

 /**
  * Automatically called each time the form loads.
  * 
  * Checks the show_form variable to determine if the deletion page should be shown.
  * Displays each entity that will be deleted with the site, in the format
  * <h4>Type</h4> <ul> <li> Entity <a href = "Preview of entity"> Preview </a> </li> </ul>
  *
  * Contains javascript to display a confirmation window after delete is submitted.
  **/
 function show_form()
 {
     if ($this->show_form) {
         $site = new entity($this->get_value('id'));
         $action_word = 'Deleting';
         if ('Deleted' == $site->get_value('state')) {
             $action_word = 'Expunging';
         }
         echo $action_word . " a site will delete all entities it owns. For " . $site->get_value('name') . " this includes:<br>";
         $borrowing_array = $this->get_borrowing_list();
         foreach ($borrowing_array as $type_id => $entities) {
             $type_entity = new entity($type_id);
             $type_name = $type_entity->get_value('plural_name') ? $type_entity->get_value('plural_name') : $type_entity->get_value('name');
             $temp_string = "\n<h4>" . $type_name . "</h4>\n<ul>";
             foreach (array_keys($entities) as $entity_id) {
                 $link_address = '<a href="?site_id=' . $site->id() . '&amp;type_id=' . $type_id . '&amp;id=' . $entity_id . '&amp;cur_module=Preview" target="_blank">Preview</a> (id: ' . $entity_id . ')';
                 $entity_object = new entity($entity_id);
                 $entity_name = $entity_object->get_display_name();
                 $temp_string .= "\n<li>" . $entity_name . " " . $link_address . "</li>";
             }
             $temp_string .= "\n</ul>";
             echo $temp_string;
         }
         parent::show_form();
         echo "<script>";
         echo "\n\$(document).ready(function(){";
         echo "\n\$('form#disco_form').submit(function(event){";
         echo "\nif(window.confirm('" . $action_word . " this site will delete all entities listed. Are you sure you want to proceed?')){";
         echo "\n}";
         echo "\nelse{";
         echo "\nevent.preventDefault();";
         echo "\ncancelDisableSubmit();";
         echo "\n}";
         echo "\n});";
         echo "\n});";
         /*
         echo "\ndocument.getElementById('disco_form')[0].onsubmit=function() {return displayWarning(this)}";
         echo "\nfunction displayWarning(item)\n{\n\na = window.confirm('Deleting this site will delete all entities listed. Are you sure you want to proceed?')\nif(a!=true)\n{\nreturn false\n}\n}";
         */
         echo "\n</script>";
     } else {
         echo $this->no_show_form();
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:53,代码来源:site.php


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