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


PHP assemble_url函数代码示例

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


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

示例1: smarty_function_object_visibility

/**
 * Show object visibility if it's private
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_object_visibility($params, &$smarty)
{
    static $ids = array();
    $object = array_var($params, 'object');
    if (!instance_of($object, 'ProjectObject')) {
        return new InvalidParamError('object', $object, '$object is not valid instance of ProjectObject class', true);
    }
    // if
    if ($object->getVisibility() > VISIBILITY_PRIVATE) {
        return '';
    }
    // if
    $user = array_var($params, 'user');
    if (!instance_of($user, 'User')) {
        return new InvalidParamError('user', $user, '$user is expected to be an instance of User class', true);
    }
    // if
    if (!$user->canSeePrivate()) {
        return '';
    }
    // if
    $id = array_var($params, 'id');
    if (empty($id)) {
        do {
            $id = 'object_visibility_' . make_string(40);
        } while (in_array($id, $ids));
    }
    // if
    $ids[] = $id;
    return open_html_tag('a', array('href' => assemble_url('project_object_visibility', array('project_id' => $object->getProjectId(), 'object_id' => $object->getId())), 'title' => lang('Private :type', array('type' => Inflector::humanize($object->getType()))), 'class' => 'object_visibility', 'id' => $id)) . '<img src="' . get_image_url('private.gif') . '" alt="" /></a><script type="text/javascript">App.widgets.ObjectVisibility.init("' . $id . '");</script>';
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:38,代码来源:function.object_visibility.php

示例2: __construct

 /**
  * Construct company invoices controller
  *
  * @param Request $request
  * @return CompanyInvoicesController
  */
 function __construct($request)
 {
     parent::__construct($request);
     if (!Invoice::canAccessCompanyInvoices($this->logged_user, $this->active_company)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $this->wireframe->current_menu_item = 'invoicing';
     $this->wireframe->page_actions = array();
     $this->wireframe->addBreadCrumb(lang('Invoices'), assemble_url('people_company_invoices', array('company_id' => $this->active_company->getId())));
     $invoice_id = $this->request->getId('invoice_id');
     if ($invoice_id) {
         $this->active_invoice = Invoices::findById($invoice_id);
     }
     // if
     if (instance_of($this->active_invoice, 'Invoice')) {
         if ($this->active_invoice->getCompanyId() != $this->active_company->getId()) {
             $this->httpError(HTTP_ERR_CONFLICT);
         }
         // if
         $this->wireframe->addBreadCrumb($this->active_invoice->getName(), $this->active_invoice->getCompanyViewUrl());
     } else {
         $this->active_invoice = new Invoice();
     }
     // if
     $this->smarty->assign(array('active_invoice' => $this->active_invoice, 'page_tab' => 'invoices'));
     js_assign('invoicing_precision', INVOICE_PRECISION);
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:CompanyInvoicesController.class.php

示例3: incoming_mail_handle_on_build_menu

/**
 * Build menu
 *
 * @param Menu $menu
 * @param User $user
 * @return array
 */
function incoming_mail_handle_on_build_menu(&$menu, &$user)
{
    if (($user->isAdministrator() || $user->getSystemPermission('can_use_incoming_mail_frontend')) && ($count_pending = IncomingMails::countPending()) > 0) {
        $menu->addToGroup(array(new MenuItem('incoming_mail', lang('Inbox'), assemble_url('incoming_mail'), get_image_url('icon_menu.gif', INCOMING_MAIL_MODULE), $count_pending)), 'main');
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:14,代码来源:on_build_menu.php

示例4: invoicing_handle_on_time_report_footer_options

/**
 * on_time_report_footer_options event handler implementation
 *
 * @param TimeReport $report
 * @param array $options
 * @param Project $project
 * @param User $user
 * @return null
 */
function invoicing_handle_on_time_report_footer_options(&$report, &$options, &$project, &$user)
{
    if (Invoice::canAdd($user)) {
        $options[] = array('url' => instance_of($project, 'Project') ? assemble_url('invoices_add', array('time_report_id' => $report->getId(), 'project_id' => $project->getId())) : assemble_url('invoices_add', array('time_report_id' => $report->getId())), 'text' => lang('New Invoice'), 'icon' => get_image_url('create-invoice.gif', INVOICING_MODULE));
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:16,代码来源:on_time_report_footer_options.php

示例5: documents_handle_on_build_menu

/**
 * Build menu
 *
 * @param Menu $menu
 * @param User $user
 * @return array
 */
function documents_handle_on_build_menu(&$menu, &$user)
{
    if ($user->isAdministrator() || $user->getSystemPermission('can_use_documents')) {
        $menu->addToGroup(array(new MenuItem('documents', lang('Docs'), assemble_url('documents'), get_image_url('icon.gif', DOCUMENTS_MODULE))), 'main');
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:14,代码来源:on_build_menu.php

示例6: resources_handle_on_dashboard_important_section

/**
 * Handle on_dashboard_important_section event
 *
 * @param NamedList $items
 * @param User $user
 * @return null
 */
function resources_handle_on_dashboard_important_section(&$items, &$user)
{
    if ($reminders_count = Reminders::countActiveByUser($user)) {
        $items->add('reminders', array('label' => $reminders_count > 1 ? lang('<strong>:count</strong>&nbsp;reminders', array('count' => $reminders_count)) : lang('<strong>:count</strong>&nbsp;reminder', array('count' => $reminders_count)), 'class' => 'reminders', 'icon' => get_image_url('important.gif'), 'url' => assemble_url('reminders')));
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:14,代码来源:on_dashboard_important_section.php

示例7: smarty_function_object_owner

/**
 * Render object assignees list
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_object_owner($params, &$smarty)
{
    $object = array_var($params, 'object');
    if (!instance_of($object, 'ProjectObject')) {
        return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
    }
    // if
    $users_table = TABLE_PREFIX . 'users';
    $assignments_table = TABLE_PREFIX . 'assignments';
    $rows = db_execute_all("SELECT {$assignments_table}.is_owner AS is_assignment_owner, {$users_table}.id AS user_id, {$users_table}.company_id, {$users_table}.first_name, {$users_table}.last_name, {$users_table}.email FROM {$users_table}, {$assignments_table} WHERE {$users_table}.id = {$assignments_table}.user_id AND {$assignments_table}.object_id = ? and {$assignments_table}.is_owner='1' ORDER BY {$assignments_table}.is_owner DESC", $object->getId());
    if (is_foreachable($rows)) {
        $owner = null;
        foreach ($rows as $row) {
            if (empty($row['first_name']) && empty($row['last_name'])) {
                $user_link = '<a href="' . assemble_url('people_company', array('company_id' => $row['company_id'])) . '#user' . $row['user_id'] . '">' . clean($row['email']) . '</a>';
            } else {
                $user_link = '<a href="' . assemble_url('people_company', array('company_id' => $row['company_id'])) . '#user' . $row['user_id'] . '">' . clean($row['first_name']) . '</a>';
            }
            // if
            $owner .= $user_link . '&nbsp;';
        }
        // foreach
    }
    // if
    if (empty($owner)) {
        $owner = '--';
    }
    // if
    return $owner;
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:37,代码来源:function.object_owner.php

示例8: project_exporter_handle_on_project_options

/**
 * Handle on project options event
 *
 * @param NamedList $options
 * @param Project $project
 * @param User $user
 * @return null
 */
function project_exporter_handle_on_project_options(&$options, $project, $user)
{
    if ($user->isAdministrator() || $user->isProjectLeader($project) || $user->isProjectManager()) {
        $options->add('export_project', array('url' => assemble_url('project_exporter', array('project_id' => $project->getId())), 'text' => lang('Export Project')));
    }
    //
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:15,代码来源:on_project_options.php

示例9: __construct

 /**
  * Contruct time report controller
  *
  * @param Request $request
  * @return ProjectTimeReportsController
  */
 function __construct($request)
 {
     parent::__construct($request);
     if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('use_time_reports')) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $this->wireframe->addBreadCrumb(lang('Reports'), timetracking_module_reports_url($this->active_project));
     $report_id = $this->request->getId('report_id');
     if ($report_id) {
         $this->active_report = TimeReports::findById($report_id);
     }
     // if
     if (instance_of($this->active_report, 'TimeReport')) {
         $this->wireframe->addBreadCrumb($this->active_report->getName(), $this->active_report->getUrl());
     } else {
         $this->active_report = new TimeReport();
     }
     // if
     $this->wireframe->page_actions = array();
     if (TimeReport::canAdd($this->logged_user)) {
         $this->wireframe->addPageAction(lang('New Report'), assemble_url('global_time_report_add', array('project_id' => $this->active_project->getId())));
     }
     // if
     $this->smarty->assign('active_report', $this->active_report);
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:32,代码来源:ProjectTimeReportsController.class.php

示例10: smarty_function_object_departments

/**
 * Render object assignees list
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_object_departments($params, &$smarty)
{
    $resp = '--';
    $object = array_var($params, 'object');
    if (!instance_of($object, 'ProjectObject')) {
        return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
    }
    // if
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
    mysql_select_db(DB_NAME, $link);
    $query = "select a.category_name, a.id from \n\t\t\t healingcrystals_project_milestone_categories a \n\t\t\t inner join healingcrystals_project_object_categories b on b.category_id=a.id \n\t\t\t inner join healingcrystals_project_objects c on c.id=b.object_id where \n\t\t\t c.id='" . $object->getId() . "' order by a.category_name";
    $result = mysql_query($query, $link);
    if (mysql_num_rows($result)) {
        $resp = '';
        while ($info = mysql_fetch_assoc($result)) {
            if (instance_of($object, 'Milestone')) {
                $resp .= '<a href="' . assemble_url('project_milestones', array('project_id' => $object->getProjectId())) . '&category_id=' . $info['id'] . '">' . $info['category_name'] . '</a>, ';
            } elseif (instance_of($object, 'Ticket')) {
                $resp .= '<a href="' . assemble_url('project_tickets', array('project_id' => $object->getProjectId())) . '&department_id=' . $info['id'] . '">' . $info['category_name'] . '</a>, ';
            } elseif (instance_of($object, 'Page')) {
                $resp .= '<a href="' . assemble_url('project_pages', array('project_id' => $object->getProjectId())) . '&category_id=' . $info['id'] . '">' . $info['category_name'] . '</a>, ';
            } else {
                $resp .= $info['category_name'] . ', ';
            }
        }
        $resp = substr($resp, 0, -2);
    }
    mysql_close($link);
    return $resp;
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:37,代码来源:function.object_departments.php

示例11: index

 /**
  * Settings form
  * 
  * @param void
  * @return null
  */
 function index()
 {
     js_assign('test_svn_url', assemble_url('admin_source_test_svn'));
     $source_data = $this->request->post('source');
     if (!is_foreachable($source_data)) {
         $source_data = array('svn_path' => ConfigOptions::getValue('source_svn_path'), 'svn_config_dir' => ConfigOptions::getValue('source_svn_config_dir'), 'source_svn_use_output_redirect' => ConfigOptions::getValue('source_svn_use_output_redirect'), 'source_svn_trust_server_cert' => ConfigOptions::getValue('source_svn_trust_server_cert'));
     }
     // if
     if ($this->request->isSubmitted()) {
         $svn_path = array_var($source_data, 'svn_path', null);
         $svn_path = $svn_path ? with_slash($svn_path) : null;
         ConfigOptions::setValue('source_svn_path', $svn_path);
         $svn_config_dir = array_var($source_data, 'svn_config_dir') == '' ? null : array_var($source_data, 'svn_config_dir');
         ConfigOptions::setValue('source_svn_config_dir', $svn_config_dir);
         $svn_use_output_redirection = array_var($source_data, 'source_svn_use_output_redirect') == "1";
         ConfigOptions::setValue('source_svn_use_output_redirect', $svn_use_output_redirection);
         $svn_trust_server_certificate = array_var($source_data, 'source_svn_trust_server_cert') == "1";
         ConfigOptions::setValue('source_svn_trust_server_cert', $svn_trust_server_certificate);
         flash_success("Source settings successfully saved");
         $this->redirectTo('admin_source');
     }
     // if
     if (!RepositoryEngine::executableExists()) {
         $this->wireframe->addPageMessage(lang("SVN executable not found. You won't be able to use this module"), 'error');
     }
     // if
     $this->smarty->assign(array('source_data' => $source_data));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:SourceAdminController.class.php

示例12: smarty_function_object_subscriptions

/**
 * Render object subscribers
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_object_subscriptions($params, &$smarty)
{
    $object = array_var($params, 'object');
    if (!instance_of($object, 'ProjectObject')) {
        return new InvalidParamError('object', $object, '$object is expected to be an instance of ProjectObject class', true);
    }
    // if
    js_assign('max_subscribers_count', MAX_SUBSCRIBERS_COUNT);
    require_once SYSTEM_MODULE_PATH . '/helpers/function.user_link.php';
    $subscribers = $object->getSubscribers();
    if (count($subscribers) > MAX_SUBSCRIBERS_COUNT) {
        $smarty->assign(array('_object_subscriptions_list_subscribers' => false, '_object_subscriptions_object' => $object, '_object_subscriptions_subscribers_count' => count($subscribers), '_object_subscription_brief' => array_var($params, 'brief', false), '_object_subscriptions_popup_url' => assemble_url('object_subscribers_widget', array('object_id' => $object->getId()))));
    } else {
        $links = null;
        if (is_foreachable($subscribers)) {
            $links = array();
            foreach ($subscribers as $subscriber) {
                $links[] = smarty_function_user_link(array('user' => $subscriber), $smarty);
            }
            // foreach
        }
        // if
        $smarty->assign(array('_object_subscriptions_list_subscribers' => true, '_object_subscriptions' => $subscribers, '_object_subscriptions_object' => $object, '_object_subscription_links' => $links, '_object_subscription_brief' => array_var($params, 'brief', false), '_object_subscriptions_popup_url' => assemble_url('object_subscribers_widget', array('object_id' => $object->getId()))));
    }
    // if
    return $smarty->fetch(get_template_path('_object_subscriptions', 'subscriptions', RESOURCES_MODULE));
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:function.object_subscriptions.php

示例13: invoicing_handle_on_company_options

/**
 * Handle on_company_options event
 *
 * @param Company $company
 * @param NamedList $options
 * @param User $logged_user
 * @return null
 */
function invoicing_handle_on_company_options(&$company, &$options, &$logged_user)
{
    if (Invoice::canAccessCompanyInvoices($logged_user, $company)) {
        $options->add('invoices', array('text' => lang('Invoices'), 'url' => assemble_url('people_company_invoices', array('company_id' => $company->getId())), 'icon' => get_image_url('company-invoices.gif', INVOICING_MODULE)));
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:15,代码来源:on_company_options.php

示例14: smarty_function_object_user_star

/**
 * Render star for a given user page
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_object_user_star($params, &$smarty)
{
    static $ids = array();
    $starred_user_id = array_var($params, 'starred_user_id');
    $starred_page_type = array_var($params, 'starred_page_type');
    $starred_by_user_id = array_var($params, 'starred_by_user_id');
    $project_id = array_var($params, 'project_id');
    $id = array_var($params, 'id');
    if (empty($id)) {
        do {
            $id = 'object_star_' . make_string(40);
        } while (in_array($id, $ids));
    }
    // if
    $ids[] = $id;
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
    mysql_select_db(DB_NAME, $link);
    $query = "select * from healingcrystals_starred_user_pages where starred_by_user_id='" . $starred_by_user_id . "' and starred_user_id='" . $starred_user_id . "' and starred_page_type='" . $starred_page_type . "'";
    $result = mysql_query($query);
    $is_starred = false;
    if (mysql_num_rows($result)) {
        $is_starred = true;
    }
    mysql_close($link);
    if ($is_starred) {
        $params = array('id' => $id, 'href' => assemble_url('unstar_user_' . $starred_page_type . '_page', array('project_id' => $project_id, 'user_id' => $starred_by_user_id)) . '&starred_user_id=' . $starred_user_id, 'title' => lang('Unstar this object'), 'class' => 'object_star');
        $result = open_html_tag('a', $params) . '<img src="' . get_image_url('icons/star-small.gif') . '" alt="" /></a>';
    } else {
        $params = array('id' => $id, 'href' => assemble_url('star_user_' . $starred_page_type . '_page', array('project_id' => $project_id, 'user_id' => $starred_by_user_id)) . '&starred_user_id=' . $starred_user_id, 'title' => lang('Star this object'), 'class' => 'object_star');
        $result = open_html_tag('a', $params) . '<img src="' . get_image_url('icons/unstar-small.gif') . '" alt="" /></a>';
    }
    // if
    return $result . "\n<script type=\"text/javascript\">App.layout.init_star_unstar_link('" . $id . "')</script>";
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:41,代码来源:function.object_user_star.php

示例15: system_handle_on_build_menu

function system_handle_on_build_menu(&$menu, &$user, &$project = null)
{
    //EOF:task_1260
    // ---------------------------------------------------
    //  Tools
    // ---------------------------------------------------
    //BOF:task_1260
    /*if (is_null($project)){
      	$my_tickets_menu = new MenuItem('today', lang('My Tickets'), assemble_url('user_today_page'), get_image_url('navigation/today.png'));
      } else {
      	$my_tickets_menu = new MenuItem('today', lang('My Tickets'), assemble_url('project_user_today_page', array('project_id' => $project->getId(), 'user_id' => $user->getId())), get_image_url('navigation/today.png'));
      }*/
    //EOF:task_1260
    $menu->addToGroup(array(new MenuItem('tasks', lang('My Tasks'), assemble_url('goto_user_task_page', array('project_id' => TASK_LIST_PROJECT_ID)) . '&selected_user_id=' . $user->getId(), get_image_url('navigation/today.png')), new MenuItem('calendar', lang('Calendar'), Calendar::getDashboardCalendarUrl(), get_image_url('navigation/calendar.gif')), new MenuItem('projects', lang('Projects'), assemble_url('projects'), get_image_url('navigation/projects.gif')), new MenuItem('people', lang('People'), assemble_url('people'), get_image_url('navigation/people.gif'))), 'main');
    // ---------------------------------------------------
    //  Folders
    // ---------------------------------------------------
    $folders = array(new MenuItem('search', lang('Search'), assemble_url('quick_search'), get_image_url('navigation/search.gif')), new MenuItem('starred_folder', lang('Starred'), assemble_url('starred'), get_image_url('navigation/starred.gif')));
    if ($user->isAdministrator() || $user->getSystemPermission('manage_trash')) {
        $folders[] = new MenuItem('trash', lang('Trash'), assemble_url('trash'), get_image_url('navigation/trash.gif'));
    }
    // if
    $folders[] = new MenuItem('quick_add', lang('Quick Add'), assemble_url('homepage'), get_image_url('navigation/quick_add.gif'), null, '+');
    $menu->addToGroup($folders, 'folders');
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:25,代码来源:on_build_menu.php


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