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


PHP url::render方法代码示例

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


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

示例1: renderUI

 function renderUI($prefix = false)
 {
     $out = '';
     $out .= sprintf('<input type="text" value="%s" name="%s", size="64">', $this->getHtmlSafe(), $this->getName());
     require_once ROOT . '/class/url.class.php';
     $url = new url();
     $url->set('class', 'file');
     $url->set('mode', 'field');
     $url->set('field', $this->getName());
     $out .= ' <a class="action_button" href="' . $url->render('browser.php') . '" target="_blank" onClick="popup(\'' . $url->render('browser.php') . '\');return false">' . translate('browse_button') . '</a>';
     if ($filesystem = $this->getFilesystem()) {
         $out .= '<div>';
         $out .= '<img src="' . $filesystem->getIcon(50) . '"/> ';
         $out .= '</div>';
     }
     return $out;
 }
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:17,代码来源:field.file.class.php

示例2: render

 function render()
 {
     $out = '';
     if ($this->node->getChildren(true)) {
         foreach ($this->node->getChildren(true) as $child) {
             $content = $child->getContent();
             $content->load();
             $url = new url();
             $url->set('node_id', $child->getId());
             $out .= '<a href="' . $url->render() . '">' . $content->getTitle() . '</a> <br/>';
         }
         return $out;
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:16,代码来源:menu.child.class.php

示例3: render

 function render()
 {
     $out = '';
     if ($siblings = $this->node->getSibling(true)) {
         foreach ($siblings as $child) {
             $content = $child->getContent();
             if ($content->isUsedIn('navigation')) {
                 $content->load();
                 $url = new url();
                 $url->set('node_id', $child->getId());
                 $out .= '<a href="' . $url->render() . '">' . $content->getTitle() . '</a> <br/>';
             }
         }
         return $out;
     } else {
         return false;
     }
 }
开发者ID:philippejadin,项目名称:thinkedit,代码行数:18,代码来源:menu.sibling.class.php

示例4: getMainMenu

 function getMainMenu()
 {
     $out = '';
     global $thinkedit;
     $node = $thinkedit->newNode();
     $node->loadRootNode();
     if ($node->getChildren()) {
         foreach ($node->getChildren() as $child) {
             $content = $child->getContent();
             $content->load();
             $url = new url();
             $url->set('node_id', $child->getId());
             $out[] = '<a href="' . $url->render() . '">' . $content->getTitle() . '</a>';
         }
         return $out;
     } else {
         return false;
     }
 }
开发者ID:philippejadin,项目名称:thinkedit,代码行数:19,代码来源:menu.class.php

示例5: render

 function render()
 {
     $out = '';
     $url = new url();
     $url->keepAll();
     $out .= sprintf('<form action="%s" method="post">', $url->render());
     if (is_array($this->record->field)) {
         foreach ($this->record->field as $field) {
             $out .= '<div class="input">';
             $out .= $field->getHelp();
             $out .= ' : ';
             $out .= '<br/>';
             $out .= $field->renderUI();
             $out .= '</div>';
         }
     } else {
         trigger_error('form::render() no fields found in the record, cannot render form');
     }
     $out .= sprintf('<input type="submit" value="%s" name="save"> ', translate('save_button'));
     $out .= sprintf('<input type="submit" value="%s" name="cancel">', translate('cancel_button'));
     $out .= '</form>';
     return $out;
 }
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:23,代码来源:form.class.php

示例6: foreach

    foreach ($allowed_items as $allowed_item) {
        if ($allowed_item['class'] == 'record') {
            $table = $thinkedit->newTable($allowed_item['type']);
            $item['title'] = $table->getTitle();
            $url = new url();
            $url->set('mode', 'new_node');
            $url->set('node_id', $current_node->getId());
            $url->addObject($table);
            $item['action'] = $url->render('edit.php');
            $out['allowed_items'][] = $item;
        }
    }
}
/******************** Global paste ****************************/
/*
$url = new url();
$url->set('source_node', $current_node->getId());
$url->set('action', 'cut');
$out['clipboard']['cut_link'] = $url->render('clipboard.php');
*/
if ($session->get('clipboard_source_node')) {
    $url = new url();
    $url->set('target_node', $current_node->getId());
    $url->set('action', 'paste');
    $out['clipboard']['paste_link'] = $url->render('clipboard.php');
}
debug($out, 'OUT');
// include template :
include 'header.template.php';
include 'structure.template.php';
include 'footer.template.php';
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:structure.php

示例7: foreach

}
$relations = $relation->getRelations($source);
if ($relations) {
    foreach ($relations as $relation_object) {
        $relation_object->load();
        $item['title'] = te_short($relation_object->getTitle(), 50);
        $item['icon'] = $relation_object->getIcon();
        $url->set('action', 'unrelate');
        $url->addObject($relation_object, 'target_');
        $item['remove_url'] = $url->render();
        $out['relation']['data'][] = $item;
    }
}
$url = new url();
$url->set('mode', 'relation');
$out['browse_url'] = $url->render('browser.php');
debug($out, 'OUT');
debug($relations);
$out['title'] = 'Relations';
// include template file
include 'relation.template.php';
die;
//$debug=true;
// check/validate if we have enough input
// check module name
// todo : need validation (from config file)!
if (!$_REQUEST['module']) {
    error(translate('please_choose_a_module'));
}
$module = $_REQUEST['module'];
$out['module'] = $module;
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:relation.php

示例8: url

        $url = new url();
        $url->keep('path');
        $url->set('file_to_delete', $child->getPath());
        $url->set('action', 'delete');
        $file['delete_url'] = $url->render();
        $out['files'][] = $file;
    }
}
// handle add folder
// handle remove folder
// handle sync with folder
// define action buttons urls
$url = new url();
$url->keep('path');
$url->set('action', 'add_folder');
$out['add_folder_url'] = $url->render();
$url = new url();
$url->keep('path');
$url->set('action', 'upload_file');
$out['upload_file_url'] = $url->render();
// add breadcrumb
$url = new url();
$out['breadcrumb'][1]['title'] = translate('filemanager_title');
$out['breadcrumb'][1]['url'] = $url->render();
debug($out, 'OUT');
//print_a($out);
// include template :
include 'header.template.php';
include 'file_manager.template.php';
//include('list.template.php');
include 'footer.template.php';
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:file_manager.php

示例9: url

        $url->set('source_node', $node_item->getId());
        $url->set('action', 'cut');
        $node_info['clipboard']['cut_link'] = $url->render('clipboard.php');
        $url = new url();
        $url->set('source_node', $node_item->getId());
        $url->set('action', 'copy');
        $node_info['clipboard']['copy_link'] = $url->render('clipboard.php');
        $url = new url();
        $url->set('target_node', $node_item->getId());
        $url->set('action', 'paste');
        $node_info['clipboard']['paste_link'] = $url->render('clipboard.php');
        /******* locales links ****/
        if ($content->isMultilingual()) {
            $locales = $thinkedit->configuration->getLocaleList();
            foreach ($locales as $locale) {
                $url = new url();
                $url->set('node_id', $node_item->getId());
                $content->setLocale($locale);
                $url->addObject($content);
                $url->set('mode', 'edit_node');
                $node_info['locale'][$locale]['edit_url'] = $url->render('edit.php');
                $node_info['locale'][$locale]['locale'] = $locale;
            }
        }
        /******* append this node info to out nodes list ****/
        $out['nodes'][] = $node_info;
        $i++;
    }
}
require 'node.template.php';
//print_r ($out);
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:node.php

示例10: url

<?php

require_once '../class/url.class.php';
require_once '../class/record.class.php';
require_once '../thinkedit.init.php';
$url = new url();
$url->setParam('id', 7);
$url->setParam('action', 'move');
$url->setParam('locale', 'en');
$url->unSetParam('id');
echo '<pre>';
echo $url->render();
// try it with ./url.test.php?test_class=record&test_type=article&test_id=5
// and with url.test.php?test_class=record&test_type=article
echo $url->getParam('test');
$record = new record('article');
$record->set('id', 5);
$url->addObject($record, 'my_');
echo '<hr>';
echo $url->render();
$object = $url->getObject('test_');
$object->load();
echo '<hr>';
print_r($object);
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:24,代码来源:url.test.php

示例11: intval

    $i++;
}
// -----------------------------
//handle pagination
// -----------------------------
if ($record_count > 25) {
    // find number of pages
    $number_of_pages = intval($record_count / 25) + 1;
    for ($i = 0; $i < $number_of_pages; $i++) {
        $out['pagination'][$i]['title'] = $i + 1;
        $url = new url();
        $url->keep('class');
        $url->keep('type');
        $url->keep('sort');
        $url->set('page', $i);
        $out['pagination'][$i]['url'] = $url->render();
        $url = new url();
        if ($url->get('page') == $i) {
            $out['pagination'][$i]['current'] = true;
        }
    }
    //echo $number_of_pages;
    // create pages array
}
/*
echo '<pre>';
print_r($out['pagination']);
*/
// -----------------------------
//handle global actions
// -----------------------------
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:list.php

示例12: url

<!-- Cover -->
<?php 
if (isset($sidebar_image)) {
    ?>
<div id="cover">
<img src="<?php 
    echo $sidebar_image->getThumbnail(array('w' => 170));
    ?>
"/>

<?php 
    // fabrication lien vers ecard
    $url = new url();
    $url->set('image', $sidebar_image->getPath());
    $url->set('template', '/ecards/' . te_get_section_name($node) . '.png');
    $ecard_url = $url->render(ROOT_URL . '/plugin/ecards/');
    ?>

<a onclick="popup(this.href, 'ecard');  return false;" target="_blank" class="<?php 
    echo te_get_section_name($node);
    ?>
_sub" href="<?php 
    echo $ecard_url;
    ?>
">
<img src="<?php 
    echo te_design();
    ?>
/sources/fleche.gif">
Envoyer cette image en carte postale
</a>
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:sidebar.php

示例13: renderAsIcons

 function renderAsIcons()
 {
     $out = '';
     if (isset($this->pager)) {
         $out .= $this->pager->render();
     }
     // $out.='<table border="1">';
     /*
     if (is_array($this->column))
     {
     		foreach ($this->column as $id=>$column)
     		{
     				$out.='<th>' . $column['title'] .'</th>';
     		}
     }
     else
     {
     		trigger_error('datagrid::render() no column defined');
     }
     
     if (is_array($this->local_action))
     {
     		$out.='<th>' . translate('datagrid_action_header') .'</th>';
     }
     */
     if (is_array($this->data)) {
         $i = 0;
         foreach ($this->data as $data) {
             $i++;
             if ($i >= count($this->data)) {
                 $out .= '<table class="icon_table" style="float: none">';
             } else {
                 $out .= '<table class="icon_table" style="float: left">';
             }
             $out .= '<tr>';
             $out .= '<td>';
             $out .= '<img src="decoration/types/folder.png">';
             $out .= '</td>';
             $out .= '</tr>';
             $out .= '<tr>';
             $out .= '<td>';
             $out .= substr($data['title'], 0, 32);
             $out .= '<br/>';
             // add local action buttons
             if (is_array($this->local_action)) {
                 //$out .= '<td>';
                 foreach ($this->local_action as $action) {
                     require_once ROOT . '/class/url.class.php';
                     $url = new url();
                     // find the primary columns to pass to the url
                     foreach ($this->column as $id => $column) {
                         if ($column['primary']) {
                             $url->setParam($id, $data[$id]);
                         }
                     }
                     $url->setFilename($action['url']);
                     $out .= '<a href="' . $url->render() . '">' . $action['title'] . '</a> ';
                 }
             }
             $out .= '</td>';
             $out .= '</tr>';
             $out .= '</table>';
             foreach ($this->column as $id => $column) {
                 // $out.='<td>' . substr($data[$id], 0, 32) .'</td>';
             }
         }
     } else {
         translate('empty_datagrid');
     }
     // add local action buttons
     if (is_array($this->global_action)) {
         foreach ($this->global_action as $action) {
             require_once ROOT . '/class/url.class.php';
             $url = new url();
             $url->setFilename($action['url']);
             require_once ROOT . '/class/button.class.php';
             $button = new button($action['title'], $url->render());
             $out .= $button->render();
         }
     }
     return $out;
 }
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:82,代码来源:grid.class.php

示例14: te_admin_toolbox

function te_admin_toolbox()
{
    global $te_admin_toolbox_written;
    if (!isset($te_admin_toolbox_written)) {
        $te_admin_toolbox_written = true;
        global $thinkedit;
        if ($thinkedit->user->isAdmin()) {
            $out = '';
            // add jquery code
            $out = te_jquery();
            // todo move style sheet somewhere, but this one is common to all designs, and designs author can do what they want with it
            // done, file is in /edit/toolbar.css
            $out .= '<link type="text/css" href="' . ROOT_URL . '/edit/ressource/css/toolbar.css" rel="stylesheet" media="screen"/>';
            $out .= '<div class="te_tools">';
            $out .= '<div class="te_toolbar">';
            $out .= '<div class="te_toolbar_logo">';
            $out .= '<b>ThinkEDIT</b>';
            // todo add version number automagically
            $out .= '</div>';
            // logout
            $url = $thinkedit->newUrl();
            $out .= '<a href="' . ROOT_URL . '/edit/logout.php" class="te_toolbar_button">' . translate('logout') . '</a>';
            // refresh page link
            $url = new url();
            $url->keep('node_id');
            $url->set('refresh', 1);
            $out .= '<a href="' . $url->render() . '" class="te_toolbar_button">' . translate('refresh_page') . '</a>';
            // refresh site link
            $url = new url();
            $url->keep('node_id');
            $url->set('clear_cache', 1);
            $out .= '<a href="' . $url->render() . '" class="te_toolbar_button">' . translate('refresh_site') . '</a>';
            // edit page link
            $url = new url();
            $url->keep('node_id');
            $out .= '<a href="' . $url->render('./edit/structure.php') . '" target="_blank" class="te_toolbar_button">' . translate('edit') . '</a>';
            // show hide profiling
            $out .= '<a class="te_toolbar_button" onclick="$(\'.te_profiling\').toggle()">' . translate('toggle_profiling') . '</a>';
            // show hide errors
            if (isset($thinkedit->errors)) {
                $out .= '<a class="te_toolbar_button te_toolbar_error_button" onclick="$(\'.te_error_log\').toggle()">' . translate('toggle_errors') . '</a>';
            }
            $out .= '</div>';
            // end of toolbar
            $out .= '<div class="te_profiling te_console" style="display: none">';
            $out .= 'Total Queries : ' . $thinkedit->db->getTotalQueries();
            $out .= '<br/>';
            $out .= 'Total time : ' . $thinkedit->timer->render();
            global $db_debug;
            if (isset($db_debug)) {
                if (!$thinkedit->isInProduction()) {
                    foreach ($db_debug as $sql) {
                        $out .= "<li>{$sql}</li>";
                    }
                } else {
                    $out .= "<li>SQL not shown in production mode</li>";
                }
            }
            $out .= '</div>';
            // end of profiling
            // include error log
            $out .= te_error_log();
            $out .= '</div>';
            // end of tools
            return $out;
        } else {
            return false;
        }
    }
}
开发者ID:philippejadin,项目名称:thinkedit,代码行数:70,代码来源:template.lib.php

示例15: url

$url = new url();
$url->set('node_id', $current_node->getId());
//$url->addObject($current_node, 'current_');
$out['structure_breadcrumb'][$i]['url'] = $url->render();
/************************ Allowed items ************************/
$allowed_items = $current_node->getAllowedItems();
if (is_array($allowed_items)) {
    foreach ($allowed_items as $allowed_item) {
        if ($allowed_item['class'] == 'record') {
            $table = $thinkedit->newTable($allowed_item['type']);
            $item['title'] = $table->getTitle();
            $url = new url();
            $url->set('mode', 'new_node');
            $url->set('node_id', $current_node->getId());
            $url->addObject($table);
            $item['action'] = $url->render('edit.php');
            $out['allowed_items'][] = $item;
        }
    }
}
/*
// first allow anything :

$config_tool = $thinkedit->newConfig();
$tables = $config_tool->getTableList();

// generating the table list from the config array
foreach($tables as $table_id)
{
		$table = $thinkedit->newTable($table_id);
		$item['title'] = $table->getTitle();
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:structure.php


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