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

PHP prettify_string函数代码示例

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

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



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

示例1: _add_field_lock_elements

 function _add_field_lock_elements(&$disco, &$entity)
 {
     $cm = $this->_load_content_manager();
     $locks = $entity->get_locks();
     $shown_fields = array();
     $hidden_fields = array();
     $values = array();
     foreach ($locks->get_lockable_fields() as $field) {
         $label = prettify_string($field);
         if ($cm->is_element($field)) {
             $el = $cm->get_element($field);
             if (!empty($el->display_name) && $el->display_name != ' ' && $el->display_name != ' ') {
                 $label = $el->display_name;
             }
         }
         if (!$cm->is_element($field) || $cm->element_is_hidden($field)) {
             $hidden_fields[$field] = '<span class="hiddenInContentManager">' . $label . '</span>';
         } else {
             $shown_fields[$field] = $label;
         }
         if ($entity->field_has_lock($field)) {
             $values[] = $field;
         }
     }
     $fields = $shown_fields + $hidden_fields;
     if (!empty($fields)) {
         $disco->add_element('lock_all_fields', 'checkbox');
         if ($entity->has_all_fields_lock()) {
             $disco->set_value('lock_all_fields', true);
         }
     }
     $disco->add_element('lock_specific_fields', 'checkboxgroup_no_sort', array('options' => $fields));
     $disco->set_value('lock_specific_fields', $values);
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:34,代码来源:manage_locks.php


示例2: thor_build_display_values

	function thor_build_display_values()
	{
		$form = new entity($this->form_id);
		$form->get_values();
		if ($form->get_value('type') != id_of('form'))
		{
			trigger_error('the thor viewer was passed an invalid id ('.$form_id.') - it must be passed the ID of a reason form entity');
		}
		else
		{
			$form_xml_obj = new XMLParser($form->get_value('thor_content'));
			$form_xml_obj->Parse();
			$display_values = array();
			foreach ($form_xml_obj->document->tagChildren as $k=>$v)
			{
				$tagname = is_object($v) ? $v->tagName : '';
				if (method_exists($this, '_build_display_'.$tagname))
				{
					$build_function = '_build_display_'.$tagname;
					$display_values = array_merge($display_values, $this->$build_function($v));
				}
			}
		}
		foreach ($this->extra_fields as $field_name)
		{
			$display_values[$field_name]['label'] = prettify_string($field_name);
			$display_values[$field_name]['type'] = 'text';
		}
		$this->_display_values = (isset($display_values)) ? $display_values : array();
	}
开发者ID:natepixel,项目名称:reason_package,代码行数:30,代码来源:thor_viewer.php


示例3: grab_fields

 /**
  * Grabs Any Search fields from the Viewer and sets up display names properly
  * @param Viewer $viewer The viewer that we are a part of
  * @return void
  */
 function grab_fields($viewer)
 {
     $this->set_form_method('get');
     if (!$this->has_filters()) {
         unset($this->actions['clear']);
     }
     // remove filter if we have no search fields
     $this->add_element('search_exact_id', 'hidden');
     $this->set_value('search_exact_id', true);
     $this->add_element('refresh_lister_state', 'hidden');
     $this->set_value('refresh_lister_state', true);
     if ($viewer) {
         $this->get_db_fields($viewer);
         reset($viewer);
         while (list($field, ) = each($viewer)) {
             $key = 'search_' . $field;
             //add fields in different ways
             if (!empty($this->fields[$field]) && preg_match("/^enum\\((.*)\\)\$/", $this->fields[$field]['db_type'])) {
                 $this->add_enum_element($field);
             } else {
                 $this->add_element($key, 'text', array('size' => 20));
             }
             if (isset($this->page->request[$key]) and $this->page->request[$key]) {
                 $this->set_value($key, $this->page->request[$key]);
             }
             $this->set_display_name($key, prettify_string($field));
         }
     }
     foreach ($this->page->module->viewer->request as $key => $value) {
         if (!$this->is_element($key)) {
             $this->add_element($key, 'hidden');
             $this->set_value($key, $value);
         }
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:40,代码来源:filter.php


示例4: _build_filter_set

 /**
  * Assemble the markup for a particular filter selector
  * @return string
  * @access private
  */
 function _build_filter_set($key)
 {
     $ret = '';
     $other_filter_links = $this->default_links;
     unset($other_filter_links[$key]);
     $combined_other_filter_links = implode('&amp;', $other_filter_links);
     $ret .= '<div class="filters">';
     foreach ($this->filter_types as $filter_name => $filter_type) {
         if (!empty($this->filter_entities[$filter_name])) {
             if ($type_id = id_of($filter_type['type'])) {
                 $type = new entity($type_id);
                 $name = $type->get_value('plural_name');
             } else {
                 $name = prettify_string($filter_name);
             }
             $ret .= '<h4>' . $name . '</h4>' . "\n";
             $ret .= '<ul>';
             if (!empty($this->filters[$key])) {
                 $link = '?';
                 if (!empty($this->search_value)) {
                     $link .= 'search=' . urlencode($this->search_value) . '&amp;';
                 }
                 if (!empty($other_filter_links)) {
                     $link .= $combined_other_filter_links;
                 }
                 $ret .= '<li><a href="' . $link . '">All</a></li>' . "\n";
             }
             foreach ($this->filter_entities[$filter_name] as $entity) {
                 $ret .= '<li>';
                 if (!empty($this->filters[$key]) && $this->filters[$key]['type'] == $filter_name && $this->filters[$key]['id'] == $entity->id()) {
                     $ret .= '<strong>' . $entity->get_value('name') . '</strong>' . "\n";
                 } else {
                     $link = '?';
                     if (!empty($other_filter_links)) {
                         $link .= $combined_other_filter_links . '&amp;';
                     }
                     if (!empty($this->search_value)) {
                         $link .= 'search=' . urlencode($this->search_value) . '&amp;';
                     }
                     $link .= 'filter' . $key . '=' . $filter_name . '-' . $entity->id();
                     if (!empty($this->textonly)) {
                         $link .= '&amp;textonly=1';
                     }
                     $ret .= '<a href="' . $link . '">' . $entity->get_value('name') . '</a>' . "\n";
                 }
                 $ret .= '</li>';
             }
             $ret .= '</ul>';
         }
     }
     $ret .= '</div>' . "\n";
     return $ret;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:58,代码来源:listnav.php


示例5: show_item_thor_content

 function show_item_thor_content($field, $value)
 {
     echo '<tr>';
     $this->_row = $this->_row % 2;
     $this->_row++;
     echo '<td class="listRow' . $this->_row . ' col1" >' . prettify_string($field);
     if ($field != '&nbsp;') {
         echo ':';
     }
     echo '</td>';
     $value = htmlspecialchars($value);
     echo '<td class="listRow' . $this->_row . ' col2">' . (($value or strlen($value) > 0) ? $value : '<em>(No value)</em>') . '</td>';
     echo '</tr>';
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:14,代码来源:form.php


示例6: run_error_checks

 function run_error_checks()
 {
     $name = trim($this->display_name);
     if (empty($name)) {
         $name = $this->name;
     }
     $name = prettify_string($name);
     $username = reason_require_authentication();
     $password = $this->grab_value();
     $dir = new directory_service();
     if (!$dir->authenticate($username, $password)) {
         $this->set_error($name . ':  Please check your password.');
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:14,代码来源:password_verification.php


示例7: run

    function run()
    {
        $type = new entity($this->admin_page->type_id);
        $entity = new entity($this->admin_page->id);
        $user = new entity($this->admin_page->user_id);
        $text = array('root_node' => 'This is a root ' . $type->get_value('name') . ', so you may not delete it.  If you wish to delete this item, please contact the <a href="' . $this->admin_page->make_link(array("cur_module" => "about_reason")) . '">web team</a>.', 'default' => 'You cannot currently delete this item because following items, which 
										are associated with it, must be associated with a ' . $type->get_value('name') . '. If 
										you wish to delete this item, you must first select a different ' . $type->get_value('name') . ' for each of the following items.<br /><br />', id_of('minisite_page') => 'This page has children.  In order to delete it, you must first either:
										<ul>
										<li>delete its children</li>
										<li>Select a different parent page for its children</li>
										</ul>If you wish to delete this item, please select a different parent for the pages listed below.<br /><br />', 'borrowed' => '<p>This item is currently borrowed by one or more sites.  Deleting it might break their sites.  If you still want to delete it, contact the sites\' maintainers to ask if they can stop borrowing the item.</p>', 'locks' => 'This ' . $type->get_value('name') . ' has had a lock applied to it that keeps it from being deleted. A reason administrator may have applied this lock in order to ensure that a site was not inadventently broken. Please contact a Reason administrator if you have any questions about the rationale for placing this lock on this ' . $type->get_value('name') . '.');
        if (!empty($this->borrowed_by)) {
            echo $text['borrowed'];
            echo '<h4>Sites borrowing this item</h4>' . "\n";
            echo '<ul>' . "\n";
            foreach ($this->borrowed_by as $site) {
                echo '<li><a href="' . $site->get_value('base_url') . '">' . $site->get_value('name') . '</a>' . "\n";
                echo '<div>Primary maintainer: ' . $site->get_value('name_cache') . ', <a href="mailto:' . $site->get_value('email_cache') . '" title="send email">' . $site->get_value('email_cache') . '</a></div></li>' . "\n";
            }
            echo '</ul>' . "\n";
        } elseif ($this->is_root_node()) {
            echo $text['root_node'];
        } elseif (!$entity->user_can_edit_field('state', $user)) {
            echo $text['locks'];
        } else {
            if (!empty($text[$this->admin_page->type_id])) {
                echo $text[$this->admin_page->type_id];
            } else {
                echo $text['default'];
            }
            foreach ($this->values as $v) {
                $link = $this->admin_page->make_link(array('cur_module' => 'Preview', 'id' => $v['e_id'], 'type_id' => $v['relationship_a']));
                echo '<a href="' . $link . '" target="' . $v['e_id'] . '">' . $v['e_name'] . '</a><span class="smallText"> (' . prettify_string($v['name']) . ')</span><br />';
            }
        }
    }
开发者ID:hunter2814,项目名称:reason_package,代码行数:37,代码来源:no_delete.php


示例8: load_options

 function load_options($args = array())
 {
     $files = array();
     if (isset($this->directory)) {
         if ($handle = opendir($this->directory)) {
             while ($entry = readdir($handle)) {
                 if (is_file($this->directory . $entry) && (!$this->hide_files_with_initial_period || 0 !== strpos($entry, '.'))) {
                     $show_entry = true;
                     $entry_display = $entry_value = $entry;
                     if (!empty($this->strip_extension)) {
                         $entry_display = $entry_value = substr($entry, 0, strrpos($entry, '.'));
                     }
                     if (!empty($this->prettify_file_name)) {
                         $entry_display = prettify_string(substr($entry, 0, strrpos($entry, '.')));
                     }
                     if (!empty($this->extension)) {
                         if (!preg_match('/' . $this->extension . '$/', $entry)) {
                             $show_entry = false;
                         }
                     }
                     if ($show_entry) {
                         $files[$entry_value] = $entry_display;
                     }
                 }
             }
             ksort($files);
         } else {
             trigger_error('Directory does not appear to be readable (' . $this->directory . ').');
         }
     }
     $this->options += $files;
 }
开发者ID:natepixel,项目名称:reason_package,代码行数:32,代码来源:options.php


示例9: _show_embed_item

 /**
  * Displays an embed field.
  */
 private function _show_embed_item($field, $value)
 {
     echo '<tr id="' . str_replace(' ', '_', $field) . '_Row">';
     $this->previewer->_row = $this->previewer->_row % 2;
     $this->previewer->_row++;
     echo '<td class="listRow' . $this->previewer->_row . ' col1">';
     if ($lock_str = $this->previewer->_get_lock_indication_string($field)) {
         echo $lock_str . '&nbsp;';
     }
     echo prettify_string($field);
     if ($field != '&nbsp;') {
         echo ':';
     }
     echo '</td>';
     echo '<td class="listRow' . $this->previewer->_row . ' col2"><input id="' . $field . 'Element" type="text" readonly="readonly" size="50" value="' . htmlspecialchars($value) . '"></td>';
     echo '</tr>';
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:20,代码来源:media_work_previewer_modifier.php


示例10: get_display_name

 /**
  * Get the display name for a given element or element group
  * @param string $element_name
  * @param boolean $empty_ok
  * @return string
  */
 public function get_display_name($element_name, $empty_ok = true)
 {
     $display_name = prettify_string($element_name);
     //find the real display name, if one exists.
     if ($this->_is_element($element_name)) {
         $element_object = $this->get_element($element_name);
         $element_display_name = trim($element_object->display_name);
         if ($empty_ok || !empty($element_display_name)) {
             $display_name = prettify_string($element_display_name);
         }
     } elseif ($this->_is_element_group($element_name)) {
         $element_group_object = $this->get_element_group($element_name);
         $group_display_name = trim($element_group_object->display_name);
         if ($empty_ok || !empty($group_display_name)) {
             $display_name = prettify_string($group_display_name);
         }
     }
     return $display_name;
 }
开发者ID:natepixel,项目名称:reason_package,代码行数:25,代码来源:disco.php


示例11: strtolower

     $chr1 = strtolower($page_type_name[0]);
     echo '<h2><a name = "' . $chr1 . '">' . strtoupper($chr1) . '</a></h2>';
 }
 echo '<h3><a name="' . $page_type_name . '">' . prettify_string($page_type_name) . '</a></h3>';
 echo '<ul>';
 foreach ($page_type->get_region_names() as $region) {
     $region_info = $page_type->get_region($region);
     $default_region_info = $default_pt->get_region($region);
     // (If the page is not default, then (if a region def differs from the default, then show it))
     // If the page is default, show all region defs.
     if ($page_type_name != 'default' && ($region_info['module_name'] != $default_region_info['module_name'] || $region_info['module_params'] != $default_region_info['module_params']) || $page_type_name == 'default') {
         $xtra = '';
         if (isset($GLOBALS['_reason_deprecated_modules']) && @in_array($region_info['module_name'], $GLOBALS['_reason_deprecated_modules'])) {
             $xtra = ' (deprecated)';
         }
         echo '<li>' . prettify_string($region) . ': ' . (!empty($region_info['module_name']) ? str_replace('_', ' ', "<strong>" . $region_info['module_name']) . "</strong>" . $xtra . "</li>" : "[empty]</li>");
     }
     if (!empty($region_info['module_params'])) {
         echo "Parameters: <ul>";
         foreach ($region_info['module_params'] as $param => $value) {
             if (!empty($value)) {
                 echo "<li>" . $param . ": ";
                 if (is_array($value)) {
                     pray($value);
                 } else {
                     echo $value;
                 }
                 echo "</li>";
             }
         }
         echo "</ul>";
开发者ID:hunter2814,项目名称:reason_package,代码行数:31,代码来源:view_page_type_info.php


示例12: grab

 function grab()
 {
     parent::grab();
     $length = strlen($this->value);
     $length_limits = array('tinytext' => 255, 'text' => 65535, 'mediumtext' => 16777215);
     if (!empty($this->db_type) && array_key_exists($this->db_type, $length_limits)) {
         if ($length > $length_limits[$this->db_type]) {
             $name_to_display = trim($this->display_name);
             if (empty($name_to_display)) {
                 $name_to_display = prettify_string($this->name);
             }
             $this->set_error('There is more text in ' . $name_to_display . ' than can be stored; this field can hold no more than ' . $length_limits[$this->db_type] . ' characters.');
         }
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:15,代码来源:text.php


示例13: mysql_free_result

    mysql_free_result($r);
    echo $info['name'] . ': ' . $row[$info['var']] . '<br /><br />';
}
$multiple_result_queries = array(array('q' => 'SELECT user.name AS username, COUNT(*) AS number_of_entities_last_edited FROM entity AS user, entity AS e WHERE e.last_edited_by = user.id AND e.state = "Live" GROUP BY e.last_edited_by ORDER BY number_of_entities_last_edited DESC LIMIT ' . $num, 'name' => 'Active Users (Top ' . $num . ')'), array('q' => 'SELECT type.name AS type, COUNT(e.name) AS number_of_entities FROM entity AS type LEFT JOIN entity AS e ON e.type = type.id WHERE type.type = 1 AND e.state = "Live" GROUP BY type.id ORDER BY number_of_entities DESC LIMIT ' . $num, 'name' => 'Number of Entities by Type (Top ' . $num . ')'), array('q' => 'SELECT type.name AS type, COUNT(e.name) AS number_of_entities FROM entity AS type LEFT JOIN entity AS e ON e.type = type.id WHERE type.type = 1 AND e.state = "Live" GROUP BY type.id ORDER BY number_of_entities ASC LIMIT ' . $num, 'name' => 'Number of Entities by Type (Bottom ' . $num . ')'), array('q' => 'SELECT e.id,e.name,type.name as type,user.name as last_edited_by,DATE_FORMAT(e.creation_date,"%M %e, %Y %r") as creation_date FROM entity as e, entity as type, entity as user WHERE e.type = type.id AND e.last_edited_by = user.id AND e.state = "Live" ORDER BY e.creation_date DESC LIMIT ' . $num, 'name' => 'Recently Created'), array('q' => 'SELECT e.id,e.name,type.name as type,user.name as last_edited_by,DATE_FORMAT(e.last_modified,"%M %e, %Y %r") as last_modified FROM entity as e, entity as type, entity as user WHERE e.type = type.id AND e.last_edited_by = user.id AND e.state = "Live" ORDER BY e.last_modified DESC LIMIT ' . $num, 'name' => 'Recently Edited'), array('q' => 'SELECT e.id,e.name,type.name as type,user.name as last_edited_by,DATE_FORMAT(e.last_modified,"%M %e, %Y %r") as last_modified FROM entity as e, entity as type, entity as user WHERE e.type = type.id AND e.last_edited_by = user.id AND e.state = "Live" ORDER BY e.last_modified ASC LIMIT ' . $num, 'name' => 'Not Recently Edited'), array('q' => 'SELECT ar.name, e1.name AS type_a, e2.name as type_b, count(*) AS number_of_relationships FROM allowable_relationship AS ar, relationship AS r, entity AS e1, entity AS e2 WHERE r.type = ar.id AND ar.relationship_a = e1.id AND ar.relationship_b = e2.id GROUP BY r.type ORDER BY number_of_relationships DESC LIMIT ' . $num, 'name' => 'Number of Relationships by Type (with ownership)'), array('q' => 'SELECT ar.name, e1.name AS type_a, e2.name as type_b, count(*) AS number_of_relationships FROM allowable_relationship AS ar, relationship AS r, entity AS e1, entity AS e2 WHERE r.type = ar.id AND ar.relationship_a = e1.id AND ar.relationship_b = e2.id AND ar.name != "owns" GROUP BY r.type ORDER BY number_of_relationships DESC LIMIT ' . $num, 'name' => 'Number of Relationships by Type (without ownership)'), array('q' => 'SELECT state, count(*) AS Count FROM entity GROUP BY state ORDER BY Count DESC', 'name' => 'Entities by State'));
reset($multiple_result_queries);
while (list(, $mrq) = each($multiple_result_queries)) {
    $first_row = true;
    echo '<strong>' . $mrq['name'] . '</strong><br /><br />';
    echo '<table border="1" cellpadding="5">';
    $r = db_query($mrq['q'], 'Unable to ' . $mrq['name']);
    while ($row = mysql_fetch_array($r, MYSQL_ASSOC)) {
        if ($first_row) {
            echo '<tr>';
            reset($row);
            while (list($key, ) = each($row)) {
                echo '<th>' . prettify_string($key) . '</th>';
            }
            echo '</tr>';
            $first_row = false;
        }
        echo '<tr>';
        reset($row);
        while (list($key, $val) = each($row)) {
            echo '<td>' . $val . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
    echo '<br />';
}
//	echo '<strong>Session Variables</strong>';
开发者ID:hunter2814,项目名称:reason_package,代码行数:31,代码来源:stats.php


示例14: prettify_array

 /**
  * Recursively prettify all values of an array using prettify_string
  * @author Matt Ryan
  * @date 2006-05-18
  * @param array $array
  * @return array $prettified_array
  */
 function prettify_array($array)
 {
     foreach ($array as $k => $v) {
         if (is_array($v)) {
             $array[$k] = prettify_array($v);
         } else {
             $array[$k] = prettify_string($v);
         }
     }
     return $array;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:18,代码来源:misc.php


示例15: set_name

 /**
  * Sets the unique identifier ( {@link name}) for an instance of this element type.
  * Note that {@link name} needs to be set using this method; it cannot be set using {@link set_class_var()} or {@link init()}.
  * @param string $name The name of this instance of this element type.
  */
 function set_name($name)
 {
     $this->name = $name;
     if (!$this->display_name) {
         $this->display_name = prettify_string($name);
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:12,代码来源:default.php


示例16: run_error_checks

	function run_error_checks()
	{
		foreach($this->forbidden as $field)
		{
			if($this->get_value($field))
			{
				$this->set_error($field,'This field must be left empty for your comment to work');
			}
		}
		$content = $this->get_value('comment_content');
		$content = str_replace('&nbsp;', ' ', $content);
		if (carl_empty_html(trim(tidy($content))))
		{
			$this->set_error('comment_content', 'You must write a comment in order to post a comment!');
		}
				
		$fields_to_tidy = array('comment_content');
		foreach($fields_to_tidy as $field)
		{
			if($this->get_value($field))
			{
				$tidied = trim(tidy($this->get_value($field)));
				if(empty($tidied) && in_array($field,$this->required))
				{
					if(!empty($this->elements[$field]['display_name']))
					{
						$display_name = $this->elements[$field]['display_name'];
					}
					else
					{
						$display_name = prettify_string($field);
					}
					$this->set_error($field,'Please fill in the '.$display_name.' field');
				}
				else 	
				{
					$tidy_errors = tidy_err($this->get_value($field));
					if(!empty($tidy_errors))
					{
						$msg = 'The html in the '.$field.' field is misformed.  Here is what the html checker has to say:<ul>';
						foreach($tidy_errors as $tidy_error)
						{
							$msg .= '<li>'.$tidy_error.'</li>';
						}
						$msg .= '</ul>';
						$this->set_error($field,$msg);
					}
				}
			}
		}
		if (!reason_check_authentication())
		{
			if ($this->is_comment_spam())
			{
				$this->set_error('comment_content', 'Your comment was rejected because it appears to be spam.');
			}
		}
	}
开发者ID:natepixel,项目名称:reason_package,代码行数:58,代码来源:submit_comment.php


示例17: show_root_option_menu

		function show_root_option_menu() // {{{
		{
			$e = new entity($this->page_id);
			$title = $e->get_value('name');
			
			echo '<form name="policy_form" method="get" class="policyForm">' .
					'<select name="policy_id" class="rootMenu">'.
					'<option value="">' . $title . "</option>\n";
			foreach( $this->get_root_nodes() AS $root )
			{
				echo '<option value="'.$root->id().'"';
				if ( $root->id() == $this->request[ 'policy_id' ] ) echo " selected='selected' ";
				echo '>'.prettify_string( $root->get_value( 'name' ) ).'</option>'."\n";
			}
			echo '';
			if ($this->textonly)
				echo '<input type="hidden" name="textonly" value="1"/>';
			if(!empty($this->request['a']))
				echo '<input type="hidden" name="a" value="'.htmlspecialchars($this->request['a']).'" />';
			if(!empty($this->request['audience_id']))
				echo '<input type="hidden" name="audience_id" value="'.htmlspecialchars($this->request['audience_id']).'" />';
			echo '</select><input type="submit" class="rootMenuSubmit" value="Go"></form>';

		}
开发者ID:natepixel,项目名称:reason_package,代码行数:24,代码来源:policy.php


示例18: diff_entities

    function diff_entities($a_id, $b_id, $use_ignore_fields = true)
    {
        $a =& $this->history[$a_id];
        if (!empty($b_id)) {
            $b =& $this->history[$b_id];
        }
        if ($use_ignore_fields) {
            $keys = array_diff(array_keys($a->get_values()), $this->ignore_fields);
        } else {
            $keys = array_keys($a->get_values());
        }
        if (empty($b_id)) {
            $compare_or_comparing = 'Compare';
        } else {
            $compare_or_comparing = 'Comparing';
        }
        $select_form_a = '<form action="?" class="jumpNavigation" name="archive_a_switch" method="get">' . $compare_or_comparing . '
				<select name="archive_a" class="jumpDestination siteMenu" id="archive_a_switch_select">
					';
        $select_form_b = '<form action="?" class="jumpNavigation" name="archive_b_switch" method="get">with
				<select name="archive_b" class="jumpDestination siteMenu" id="archive_b_switch_select">
					<option value="--"' . (empty($b_id) ? ' selected="selected"' : '') . '>--</option>';
        foreach ($this->history as $h) {
            $select_form_a .= '<option value="' . $h->id();
            if ($a->id() == $h->id()) {
                $select_form_a .= '" selected="selected';
            }
            $select_form_a .= '">' . $this->get_archive_name($h->id());
            if (!empty($this->_locks[$h->id()])) {
                $select_form_a .= ' (locked)';
            }
            $select_form_a .= "</option>\n";
            $select_form_b .= '<option value="' . $h->id();
            if (!empty($b_id) and $b->id() == $h->id()) {
                $select_form_b .= '" selected="selected';
            }
            $select_form_b .= '">' . $this->get_archive_name($h->id());
            if (!empty($this->_locks[$h->id()])) {
                $select_form_b .= ' (locked)';
            }
            $select_form_a .= "</option>\n";
        }
        ob_start();
        $this->admin_page->echo_hidden_fields('archive_a');
        $archive_a_fields = ob_get_contents();
        ob_end_clean();
        ob_start();
        $this->admin_page->echo_hidden_fields('archive_b');
        $archive_b_fields = ob_get_contents();
        ob_end_clean();
        $select_form_a .= '</select>' . $archive_a_fields . '<input type="submit" class="jumpNavigationGo" value="go"></form>';
        $select_form_b .= '</select>' . $archive_b_fields . '<input type="submit" class="jumpNavigationGo" value="go"></form>';
        echo '<table border="0" cellspacing="0" cellpadding="4">';
        echo '<tr>';
        echo '<th class="listHead" align="left">Field</th>';
        echo '<th class="listHead">' . $select_form_a . '</th>';
        echo '<th class="listHead">' . $select_form_b . '</th>';
        echo '</tr>';
        $type = new entity($this->admin_page->type_id);
        if (!empty($this->content_transform[$type->get_value('unique_name')])) {
            $transformers = $this->content_transform[$type->get_value('unique_name')];
        }
        foreach ($keys as $key) {
            $diff = false;
            if (!empty($b_id)) {
                if ($a->get_value($key) != $b->get_value($key)) {
                    $diff = true;
                }
            }
            if ($diff) {
                $class = 'highlightRow';
            } else {
                $class = 'listRow1';
            }
            if (!empty($a) && in_array($key, $this->_locks[$a->id()]) || !empty($b) && in_array($key, $this->_locks[$b->id()])) {
                $class .= ' lockedRow';
                $lock_img = '<img class="lockIndicator" src="' . REASON_HTTP_BASE_PATH . 'ui_images/lock_12px.png" alt="locked" width="12" height="12" />';
            } else {
                $lock_img = '';
            }
            echo '<tr>';
            echo '<td class="' . $class . '" valign="top"><strong>' . $lock_img . prettify_string($key) . ':</strong></td>';
            if (!empty($transformers[$key])) {
                $method = $transformers[$key];
                $a_val = $this->{$method}($a->get_value($key));
                if (!empty($b_id)) {
                    $b_val = $this->{$method}($b->get_value($key));
                }
            } else {
                $a_val = $a->get_value($key);
                if (!empty($b_id)) {
                    $b_val = $b->get_value($key);
                }
            }
            echo '<td class="' . $class . '" valign="top"' . (empty($b_id) ? ' colspan="2"' : '') . '>' . $a_val . '</td>';
            if (!empty($b_id)) {
                echo '<td class="' . $class . '" valign="top">' . $b_val . '</td>';
            }
            echo '</tr>';
        }
//.........这里部分代码省略.........
开发者ID:hunter2814,项目名称:reason_package,代码行数:101,代码来源:archive.php


示例19: add_complete

	function add_complete($unique_name,$name,$css = array(),$template_name,$user_id)
	{
		if($this->get_id())
		{
			trigger_error('add_complete method may only be called on a reasonTheme that does not yet have an ID assigned.');
			return false;
		}
		$all_ok = true;
		$output =  '<h4>Adding theme: '.$unique_name.'</h4>';
		$output .= '<ol>';
		if(empty($template_name))
		{
			$template_name = 'default';
		}
		if(empty($name))
		{
			$name = prettify_string($unique_name);
		}
		$template = get_template_by_name($template_name);
		if(empty($template))
		{
			$all_ok = false;
			$template_id = reason_add_template($template_name);
			if(!empty($template_id))
			{
				$template = new entity($template_id);
				$output .= '<li>Template created ('.$template_name.', id '.$template->id().')</li>';
			}
			else
			{
				$output .= '<li>Unable to create template '.$template_name.'. The template file may not be placed correctly.';
				if($this->test_mode)
				{
					$output .= ' Would abort theme addition.';
				}
				else
				{
					$output .= ' Aborting theme addition.';
				}
				$output .= '</li></ol>';
				return array('success'=>false,'report'=>$output);
			}
		}
		else
		{
			$output .= '<li>Template found ('.$template_name.', id '.$template->id().')</li>';
		}
		
		$theme_id = id_of($unique_name);
		if(!$theme_id)
		{
			$all_ok = false;
			$output .= '<li>Theme with unique name '.$unique_name.' needs to be created</li>';
			if(!$this->test_mode)
			{
				$theme_id = $this->create($unique_name,$name,$template->id(),$user_id);
				if(!$theme_id)
				{
					$output .= '<li>Theme '.$name.' unable to be created; aborting theme addition</li></ol>';
					return array('success'=>false,'report'=>$output);
				}
				else
				{
					$output .= '<li>Theme with unique name '.$unique_name.' created</li>';
				}
			}
			else
			{
				$output .= '<li>Would have attempted to create theme entity.</li>';
			}
		}
		else
		{
			$this->set_id($theme_id);
		}
		
		if($this->get_template_id() != $template->id())
		{
			$all_ok = false;
			$output .= '<li>Current theme template id ('.$this->get_template_id().') not the same as specified in update ('.$template->id().').</li>';
			if($this->test_mode)
			{
				$output .= '<li>Would have set theme template to be id '.$template->id().'</li>';
			}
			else
			{
				if($this->attach_template($template->id()))
				{
					$output .= '<li>Attached template id '.$template->id().' to '.$unique_name.'.</li>';
				}
				else
				{
					$output .= '<li>Unable to attach template for some reason. Aborting theme addition.</li>';
					return array('success'=>false,'report'=>$output);
				}
			}
				
		}
		
		$retrieved_css_entities = array();
//.........这里部分代码省略.........
开发者ID:natepixel,项目名称:reason_package,代码行数:101,代码来源:theme.php


示例20: get_table_headers

 function get_table_headers()
 {
     $markup_string = '';
     $markup_string .= '<thead><tr>';
     if ($this->row_labels_exist()) {
         $markup_string .= '<th></th>';
     }
     foreach ($this->column_order as $position => $column) {
         if (!empty($this->columns[$column])) {
             $name = $this->columns[$column];
         } else {
             $name = prettify_string($column);
         }
         $markup_string .= '<th>' . $name . '</th>';
     }
     $markup_string .= '</tr></thead>' . "\n";
     return $markup_string;
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:18,代码来源:element_group.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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