本文整理汇总了PHP中carl_make_link函数的典型用法代码示例。如果您正苦于以下问题:PHP carl_make_link函数的具体用法?PHP carl_make_link怎么用?PHP carl_make_link使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了carl_make_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_editable
/**
* Present an interface to edit / create content
*/
function run_editable()
{
$inline_edit =& get_reason_inline_editing($this->page_id);
$active = $inline_edit->active_for_module($this);
$class = $active ? 'editable editing' : 'editable';
echo '<div id="pageContent" class="' . $class . '">' . "\n";
if ($active) {
$form = new Disco();
$form->strip_tags_from_user_input = true;
$form->allowable_HTML_tags = REASON_DEFAULT_ALLOWED_TAGS;
$form->actions = array('save' => 'Save', 'save_and_finish' => 'Save and Finish Editing');
$form->add_element('editable_content', html_editor_name($this->site_id), html_editor_params($this->site_id, $this->get_html_editor_user_id()));
$form->set_display_name('editable_content', ' ');
$form->set_value('editable_content', $this->content);
$form->add_callback(array(&$this, 'process_editable'), 'process');
$form->add_callback(array(&$this, 'where_to_editable'), 'where_to');
$form->run();
} else {
$url = carl_make_link($inline_edit->get_activation_params($this));
if (!carl_empty_html($this->content)) {
$link = '<p><a href="' . $url . '" class="editThis">Edit Content</a></p>';
$pre = '<div class="editRegion">';
$post = '</div>';
$output = $pre . $this->content . $link . $post;
} else {
$link = '<p><a href="' . $url . '" class="editThis">Create Content</a></p>';
$pre = '<div class="editRegion">';
$post = '</div>';
$output = $pre . $link . $post;
}
echo $output;
}
echo '</div>' . "\n";
}
示例2: display_entity
function display_entity()
{
$this->start_table();
$id = $this->_entity->id();
// Full Size Image
$full_name = reason_get_image_filename($id);
$local_full_image_path = PHOTOSTOCK . $full_name;
if (file_exists($local_full_image_path)) {
$this->show_item_default('Full Image', '<img src="' . WEB_PHOTOSTOCK . $full_name . '" alt="Full Size Image" />');
}
// Thumbnail Image
$tn_name = reason_get_image_filename($id, 'thumbnail');
$local_tn_image_path = PHOTOSTOCK . $tn_name;
if (file_exists($local_tn_image_path)) {
$this->show_item_default('Thumbnail Image', '<img src="' . WEB_PHOTOSTOCK . $tn_name . '" alt="Thumbnail Image" />');
}
// Original Image if we are in the owner site
$owner = $this->_entity->get_owner();
if (!empty($owner) && $owner->id() == $this->admin_page->site_id) {
$original_name = reason_get_image_filename($id, 'original');
$local_original_image_path = PHOTOSTOCK . $original_name;
if (file_exists($local_original_image_path)) {
$this->show_item_default('Hi-Res Image', '<a href="' . WEB_PHOTOSTOCK . $original_name . '">View original image </a>');
}
}
$this->show_item_default('Custom sizes', '<a href="' . carl_make_link(array('cur_module' => 'ImageSizer')) . '">Get this image at a custom size</a>');
// Everything Else
$this->show_all_values($this->_entity->get_values());
$this->end_table();
}
示例3: get_size_selector_html
/**
* Returns the html markup used to display the size selector elements.
*
* @param $media_work
* @param $initial_height the initial height the media work is displayed at
* @return string html
*/
public function get_size_selector_html($media_work, $initial_height)
{
$small_url = carl_make_link(array('displayer_height' => MEDIA_WORK_SMALL_HEIGHT));
$medium_url = carl_make_link(array('displayer_height' => MEDIA_WORK_MEDIUM_HEIGHT));
$large_url = carl_make_link(array('displayer_height' => MEDIA_WORK_LARGE_HEIGHT));
if (MEDIA_WORK_SMALL_HEIGHT == $initial_height || strtolower($initial_height) == 'small') {
$small_link = '<strong><a>Small <em>(' . MEDIA_WORK_SMALL_HEIGHT . 'p)</em></a></strong>' . "\n";
} else {
$small_link = '<a href="' . $small_url . '" >Small <em>(' . MEDIA_WORK_SMALL_HEIGHT . 'p)</em></a>' . "\n";
}
if (MEDIA_WORK_MEDIUM_HEIGHT == $initial_height || strtolower($initial_height) == 'medium') {
$medium_link = '<strong><a>Medium <em>(' . MEDIA_WORK_MEDIUM_HEIGHT . 'p)</em></a></strong>' . "\n";
} else {
$medium_link = '<a href="' . $medium_url . '" >Medium <em>(' . MEDIA_WORK_MEDIUM_HEIGHT . 'p)</em></a>' . "\n";
}
if (MEDIA_WORK_LARGE_HEIGHT == $initial_height || strtolower($initial_height) == 'large') {
$large_link = '<strong><a>Large <em>(' . MEDIA_WORK_LARGE_HEIGHT . 'p)</em></a></strong>' . "\n";
} else {
$large_link = '<a href="' . $large_url . '" >Large <em>(' . MEDIA_WORK_LARGE_HEIGHT . 'p)</em></a>' . "\n";
}
$html = '';
$html .= '<div class="size_links">' . "\n";
$html .= '<h4>Video Size:</h4>' . "\n";
$html .= '<ul>' . "\n";
$html .= '<li data-size="' . MEDIA_WORK_SMALL_HEIGHT . '" data-link="' . $small_url . '" class="small_link"><span class="buttonSize">' . $small_link . '</span></li>' . "\n";
$html .= '<li data-size="' . MEDIA_WORK_MEDIUM_HEIGHT . '" data-link="' . $medium_url . '" class="medium_link"><span class="buttonSize">' . $medium_link . '</span></li>' . "\n";
$html .= '<li data-size="' . MEDIA_WORK_LARGE_HEIGHT . '" data-link="' . $large_url . '" class="large_link"><span class="buttonSize">' . $large_link . '</span></li>' . "\n";
$html .= '</ul>' . "\n";
$html .= '</div>' . "\n";
return $html;
}
示例4: run_editable
function run_editable()
{
// Show a small disco inline editing form if it is activated, display the title
// and an activation button if not.
$inline_edit =& get_reason_inline_editing($this->page_id);
$active = $inline_edit->active_for_module($this);
$class = $active ? 'editable editing' : 'editable';
echo '<div class="' . $class . '">' . "\n";
if ($inline_edit->active_for_module($this)) {
$form = new Disco();
$form->strip_tags_from_user_input = true;
$form->allowable_HTML_tags = '';
$form->add_element('page_title', 'text');
$form->set_value('page_title', $this->parent->title);
$form->add_required('page_title');
$form->add_callback(array(&$this, 'process_editable'), 'process');
$form->add_callback(array(&$this, 'where_to_editable'), 'where_to');
$form->run();
} else {
$url = carl_make_link($inline_edit->get_activation_params($this));
$link = '<p><a href="' . $url . '" class="editThis">Edit Page Title</a></p>' . "\n";
$pre = '<div class="editRegion">' . "\n";
$post = '</div>' . "\n";
$output = $pre . $this->get_formatted_page_title() . $link . $post;
echo $output;
}
echo '</div>' . "\n";
}
示例5: step_pre_show_form
function step_pre_show_form()
{
echo '<h2>Create a Publication</h2>';
if (!empty($this->site_publication_names_by_id)) {
$pub_string = count($this->site_publication_names_by_id) == 1 ? 'publication' : 'publications';
$link = carl_make_link(array('active_screen' => 2));
echo '<p>...Or <a href="' . $link . '">attach news items to existing ' . $pub_string . '</a></p>';
}
}
示例6: on_every_time
function on_every_time()
{
$this->change_element_type('event_date', 'solidtext');
$this->set_value('event_date', prettify_mysql_datetime($this->request_array['date']));
if ($this->show_date_change_link == true) {
$link = carl_make_link(array('date' => '', 'slot_id' => ''));
$this->add_comments('event_date', '<a href="' . $link . '">Register for a different date</a>');
}
}
示例7: get_cache_status
function get_cache_status()
{
$rpc = $this->get_reason_page_cache();
if ($rpc->page_cache_exists() && !$rpc->page_cache_is_empty()) {
$link = carl_make_link(array('kill_cache' => 1));
return 'Cached. (<a href="' . $link . '">delete cache</a>)';
} else {
return 'Not cached.';
}
}
示例8: run
function run()
{
$master_admin_link = carl_construct_link(array('site_id' => id_of('master_admin')));
$link[] = '<a href="' . $master_admin_link . '">Return to master admin</a>';
if ($this->authenticate() && $this->table_admin->get_table_row_action()) {
$url2 = carl_make_link($this->table_admin->get_menu_links_base_with_filters());
$link[] = '<a href="' . $url2 . '">Show allowable relationships list</a>';
}
echo implode(' | ', $link);
if (!$this->authenticate()) {
echo '<h3>You do not have the proper privileges to use this module</h3>';
} else {
$this->table_admin->run();
}
}
示例9: show_memory
function show_memory()
{
if ($this->helper->get_type_id() && $this->helper->get_search_term()) {
$excluded = $this->helper->get_excluded();
$excluded_string = !empty($excluded) ? implode(",", $excluded) : false;
echo '<div id="excluded" style="float:right; border:1px solid #000; padding: 10px;">';
echo '<h4>Excluded IDs</h4>';
if ($excluded_string) {
echo '<p>' . $excluded_string . '</p>';
$clear_link = carl_make_link(array('clear_exclude' => "true"));
echo '<p><a href="' . $clear_link . '">Clear excluded ids</a></p>';
} else {
echo '<p>No ids currently excluded for this type and set of fields.</p>';
}
echo '</div>';
}
}
示例10: step_init
function step_init()
{
$this->site_id = $this->helper->get_site_id();
if (!$this->site_id) {
$this->redirect_to_screen(1);
}
$this->user_id = $this->helper->get_user_id();
$this->site_name = $this->helper->get_site_name();
$this->new_publication_link = carl_make_link(array('active_screen' => "3"));
$this->site_publication_names_by_id = $this->helper->get_site_publication_names_by_id();
$this->unattached_issue_names_by_id = $this->helper->get_unattached_issue_names_by_id();
if (empty($this->site_publication_names_by_id)) {
$this->redirect_to_screen("3");
}
if (empty($this->unattached_issue_names_by_id)) {
$this->redirect_to_screen("2");
}
}
示例11: on_every_time
function on_every_time()
{
if ($this->disabled_for_maintenance()) {
echo '<p>Posting is temporarily disabled because the website is in maintenance mode. Please try again later.</p>';
$this->show_form = false;
return false;
}
if ($this->hold_posts_for_review) {
$this->actions['Submit'] = 'Submit Post (Moderated)';
}
// nwhite make a nice link that only clears add item and return text that identifies publication type
$pub_type = ($pt = $this->publication->get_value('publication_type')) ? strtolower($pt) : 'publication';
$link = carl_make_link(array('add_item' => ''));
$this->change_element_type('dont_post', 'comment', array('text' => '<a href="' . $link . '">Return to ' . $pub_type . ' without posting</a>'));
if (!empty($this->user_netID)) {
$this->set_value('author', $this->user_netID);
}
$this->do_wysiwygs();
$this->do_categories();
$this->do_issues();
$this->do_sections();
$this->set_order($this->get_order_array());
}
示例12: no_show_form
/**
* Account type is not set - we force selection of a valid account type.
*/
function no_show_form()
{
$options = $this->social_helper()->get_available_integrators();
if (!empty($options)) {
echo '<div class="socialAccountTypeSelector">';
echo '<p>Which social account would you like to create?</p>';
echo '<ul>';
foreach ($options as $k => $v) {
$link = carl_make_link(array('account_type' => $k));
$image = '';
if ($integrator = $this->social_helper()->get_integrator($k, 'SocialAccountPlatform')) {
if (method_exists($integrator, 'get_platform_icon')) {
$image = '<img src="' . htmlspecialchars($integrator->get_platform_icon()) . '" alt="' . htmlspecialchars($v) . ' icon" height="25" width="25" /> ';
}
}
echo '<li><a href="' . $link . '">' . $image . $v . '</a></li>';
}
echo '</ul>';
echo '</div>';
} else {
echo '<p>This installation of Reason CMS does not have any social account options enabled.</p>';
}
}
示例13: _add_file_preview
/**
* Adds a preview of the media work to the form.
*/
function _add_file_preview()
{
if ($this->manager->get_value('transcoding_status') == 'ready') {
$entity = new entity($this->manager->get_value('id'));
$embed_markup = '';
$this->displayer_chrome->set_media_height('small');
$this->displayer_chrome->set_google_analytics(false);
$embed_markup .= $this->displayer_chrome->get_html_markup();
if ($this->manager->get_value('av_type') == 'Video') {
$image_picker_url = carl_make_link(array('cur_module' => 'ZencoderMediaImagePicker'));
$image_picker_link = '<br/><a href="' . $image_picker_url . '"><strong>Choose a thumbnail for this video</strong></a>';
$embed_markup .= $image_picker_link;
}
if (!empty($embed_markup)) {
$this->manager->add_element('file_preview', 'commentWithLabel', array('text' => $embed_markup));
$this->manager->set_display_name('file_preview', 'Preview');
}
}
}
示例14: get_display_value_name
function get_display_value_name($value, &$item, $summary_mode)
{
if ($summary_mode) {
$item_name = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
$link_to_item = carl_make_link(array('item_id' => $item->id()));
return '<a href="' . $link_to_item . '">' . $item_name . '</a>';
} else {
return $value;
}
}
示例15: run
function run()
{
$form = $this->get_form();
// thor_core needs the XML from the form entities thor_content field, and the table name the data is stored in
$xml = $form->get_value('thor_content');
$table_name = 'form_' . $form->id();
$thor_core = new ThorCore($xml, $table_name);
$thor_values = $thor_core->get_rows();
// Loop through the database information to gather the poll results
$pretty_values = array();
if ($thor_values != "") {
foreach ($thor_values as $t_v) {
foreach ($t_v as $key => $value) {
if ($key != "id" && $key != "submitted_by" && $key != "submitter_ip" && $key != "date_created" && $key != "date_modified") {
$pretty_values[] = $value;
}
}
}
}
// Get the total number of results and then find the total results for each option
$responses = array_count_values($pretty_values);
$accumulator = array();
foreach ($responses as $response) {
$accumulator[] = $response;
}
// Get the label for each option
$name = array();
foreach ($responses as $key => $value) {
$name[] = $key;
}
// Calculate the total and get the percentage for each option
$total = 0;
$per = array();
foreach ($accumulator as $key => $value) {
$total += $value;
}
if ($total > 0) {
for ($i = 0; $i <= count($accumulator) - 1; $i++) {
$per[$i] = round($accumulator[$i] / $total * 100) . "%";
}
}
if (!$this->show_results()) {
echo '<p><a href="' . carl_make_link(array('show_results' => 1, 'submission_key' => '')) . '">Show Results</a></p>';
} else {
echo '<p><a href="' . carl_make_link(array('show_results' => 0, 'submission_key' => '')) . '">Hide Results</a></p>';
}
if ($this->show_results()) {
if ($this->sidebar) {
echo '<div id="interactive" class="graph">';
} else {
echo '<div id="graph1" class="graph">';
}
for ($i = 0; $i <= count($accumulator) - 1; $i++) {
echo '<table width="300px" border="solid" cellpadding="5px">
<tr>
<td width="50px">' . reason_htmlspecialchars($per[$i]) . ' </td><td> ' . reason_htmlspecialchars($name[$i]) . '</td>
</tr>
</table>';
}
echo '</div>';
if ($this->sidebar) {
echo '<div id="hover"></div>';
}
echo '<div id="responses"><p><strong>Total responses: ' . $total . '</strong></p></div>';
}
$datas = array();
$lbls = array();
for ($i = 0; $i <= count($accumulator) - 1; $i++) {
$datas[$i] = $accumulator[$i];
$lbls[$i] = $name[$i];
}
// Transfer the labels and totals for each option to polls.js
echo '<script type="text/javascript">' . "\n";
echo 'var data = new Array();' . "\n";
echo 'var lbl = new Array();' . "\n";
echo 'var color = new Array();' . "\n";
for ($i = 0; $i <= count($datas) - 1; $i++) {
$color = isset($this->params['custom_colors'][$i]) ? $this->params['custom_colors'][$i] : "#" . dechex(rand(0, 10000000));
echo 'color[' . $i . '] = "' . addslashes(htmlspecialchars($color)) . '" ;' . "\n";
echo 'data[' . $i . '] =' . addslashes(htmlspecialchars($datas[$i])) . ';' . "\n";
echo 'lbl[' . $i . '] = "' . addslashes(htmlspecialchars($lbls[$i])) . '" ;' . "\n";
}
echo '</script>' . "\n";
}