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


PHP link_to_remote函数代码示例

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


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

示例1: pager_navigation_remote

function pager_navigation_remote($pager, $uri, $options = array())
{
    $navigation = '';
    $options = _parse_attributes($options);
    if (!isset($options['update'])) {
        return null;
    }
    $update = $options['update'];
    $loading = isset($options['loading']) ? $options['loading'] : '';
    $complete = isset($options['complete']) ? $options['complete'] : '';
    if ($pager->haveToPaginate()) {
        $uri .= (preg_match('/\\?/', $uri) ? '&' : '?') . 'page=';
        $navigation .= link_to_remote(image_tag('/images/icons/first.png', array('align' => 'absmiddle', 'alt' => __('primero'), 'title' => __('primero'))), array('update' => $update, 'url' => $uri . '1', 'loading' => $loading, 'complete' => $complete));
        $navigation .= link_to_remote(image_tag('/images/icons/previous.png', array('align' => 'absmiddle', 'alt' => __('previo'), 'title' => __('previo'))), array('update' => $update, 'url' => $uri . $pager->getPreviousPage(), 'loading' => $loading, 'complete' => $complete));
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            if ($page == $pager->getPage()) {
                $links[] = $page;
            } else {
                $links[] = link_to_remote($page, array('update' => $update, 'url' => $uri . $page, 'loading' => $loading, 'complete' => $complete));
            }
        }
        $navigation .= join('  ', $links);
        $navigation .= link_to_remote(image_tag('/images/icons/next.png', array('align' => 'absmiddle', 'alt' => __('siguiente'), 'title' => __('siguiente'))), array('update' => $update, 'url' => $uri . $pager->getNextPage(), 'loading' => $loading, 'complete' => $complete));
        $navigation .= link_to_remote(image_tag('/images/icons/last.png', array('align' => 'absmiddle', 'alt' => __('último'), 'title' => __('último'))), array('update' => $update, 'url' => $uri . $pager->getLastPage(), 'loading' => $loading, 'complete' => $complete));
    }
    return $navigation;
}
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:29,代码来源:MisObjetosHelper.php

示例2: link_to_remote_pane

function link_to_remote_pane($text, $url, $update = 'feedback', $html_options = '')
{
  return link_to_remote($text, array(
      'url'     => $url, 
      'update'  => $update,
      'loading' => "Element.addClassName(document.getElementsByTagName('html')[0], 'waiting');",
      'success' => "Element.removeClassName(document.getElementsByTagName('html')[0], 'waiting');",
    ), $html_options);
}
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:9,代码来源:ControlPanelHelper.php

示例3: link_to_publish

function link_to_publish($event)
{
    if ($event->getPublished()) {
        $publish = "Published";
    } else {
        $publish = "Publish";
    }
    return link_to_remote($publish, array('url' => 'event/publish?id=' . $event->getId(), 'update' => array('success' => 'publish'), 'loading' => "Element.show('published_indicator')", 'complete' => "Element.hide('published_indicator');" . visual_effect('highlight', 'publish_button')));
}
开发者ID:soon0009,项目名称:EMS,代码行数:9,代码来源:EventHelper.php

示例4: link_to_add_new_comment

function link_to_add_new_comment($name, $record, $comment = null)
{
    use_helper('Javascript');
    $params = array();
    $params['update'] = $comment && $comment->getId() ? 'add_new_comment_form_holder_' . $comment->getId() : 'add_new_comment_form_holder';
    $params['url'] = '@cscomments_comments_add';
    $comment_id = $comment ? $comment->getId() : null;
    $params['with'] = "'comment_id=" . $comment_id . "&model=" . get_class($record) . "&record_id=" . $record->getId() . "&return_uri=" . urlencode(sfContext::getInstance()->getRequest()->getUri()) . "'";
    return link_to_remote($name, $params);
}
开发者ID:bshaffer,项目名称:Symplist,代码行数:10,代码来源:CommentHelper.php

示例5: link_to_user_interested

function link_to_user_interested($user, $question)
{
    if ($user->isAuthenticated()) {
        $interested = InterestPeer::retrieveByPk($question->getId(), $user->getSubscriberId());
        if ($interested) {
            // already interested
            return __('interested!');
        } else {
            // didn't declare interest yet
            return link_to_remote(__('interested?'), array('url' => 'user/interested?id=' . $question->getId(), 'update' => array('success' => 'block_' . $question->getId()), 'loading' => "Element.show('indicator')", 'complete' => "Element.hide('indicator');" . visual_effect('pulsate', 'mark_' . $question->getId())));
        }
    } else {
        return link_to_login(__('interested?'));
    }
}
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:15,代码来源:UserHelper.php

示例6: link_to_report_answer

function link_to_report_answer($answer, $user)
{
    use_helper('Javascript');
    $text = '[' . __('report to moderator') . ']';
    if ($user->isAuthenticated()) {
        $has_already_reported_answer = ReportAnswerPeer::retrieveByPk($answer->getId(), $user->getSubscriberId());
        if ($has_already_reported_answer) {
            // already spam for this user
            return '[' . __('reported as spam') . ']';
        } else {
            return link_to_remote($text, array('url' => '@user_report_answer?id=' . $answer->getId(), 'update' => array('success' => 'report_answer_' . $answer->getId()), 'loading' => "Element.show('indicator')", 'complete' => "Element.hide('indicator');" . visual_effect('highlight', 'report_answer_' . $answer->getId())));
        }
    } else {
        return link_to_login($text);
    }
}
开发者ID:emacsattic,项目名称:symfony,代码行数:16,代码来源:AnswerHelper.php

示例7: depp_voter

/**
 * Return the HTML code for an unordered list showing opinions that can be voted
 * If the user has already voted, then a message appears
 * 
 * @param  BaseObject  $object   Propel object instance to vote
 * @param  string      $domid    unique css identifier for the block (div) containing the voter tool
 * @param  string      $message  a message string to be displayed in the voting-message block
 * @param  array       $options  Array of HTML options to apply on the HTML list
 * @return string
 **/
function depp_voter($object, $domid = 'depp-voter-block', $message = '', $options = array())
{
    if (is_null($object)) {
        sfLogger::getInstance()->debug('A NULL object cannot be voted');
        return '';
    }
    $user_id = deppPropelActAsVotableBehaviorToolkit::getUserId();
    // anonymous votes
    if ((is_null($user_id) || $user_id == '') && !$object->allowsAnonymousVoting()) {
        return __('Anonymous voting is not allowed') . ", " . __('please') . " " . link_to('login', '/login');
    }
    try {
        $voting_range = $object->getVotingRange();
        $options = _parse_attributes($options);
        if (!isset($options['id'])) {
            $options = array_merge($options, array('id' => 'voting-items'));
        }
        if ($object instanceof sfOutputEscaperObjectDecorator) {
            $object_class = get_class($object->getRawValue());
        } else {
            $object_class = get_class($object);
        }
        $object_id = $object->getReferenceKey();
        $token = deppPropelActAsVotableBehaviorToolkit::addTokenToSession($object_class, $object_id);
        // already voted
        if ($object->hasBeenVotedByUser($user_id)) {
            $message .= " " . link_to_remote(__('Take your vote back'), array('url' => sprintf('deppVoting/unvote?domid=%s&token=%s', $domid, $token), 'update' => $domid, 'script' => true, 'complete' => visual_effect('appear', $domid) . visual_effect('highlight', $domid)));
        }
        $list_content = '';
        for ($i = -1 * $voting_range; $i <= $voting_range; $i++) {
            if ($i == 0 && !$object->allowsNeutralPosition()) {
                continue;
            }
            $text = sprintf("[%d]", $i);
            $label = sprintf(__('Vote %d!'), $i);
            if ($object->hasBeenVotedByUser($user_id) && $object->getUserVoting($user_id) == $i) {
                $list_content .= content_tag('li', $text);
            } else {
                $list_content .= '  <li>' . link_to_remote($text, array('url' => sprintf('deppVoting/vote?domid=%s&token=%s&voting=%d', $domid, $token, $i), 'update' => $domid, 'script' => true, 'complete' => visual_effect('appear', $domid) . visual_effect('highlight', $domid)), array('title' => $label)) . '</li>';
            }
        }
        $results = get_component('deppVoting', 'votingDetails', array('object' => $object));
        return content_tag('ul', $list_content, $options) . content_tag('div', $message, array('id' => 'voting-message')) . content_tag('div', $results, array('id' => 'voting-results'));
    } catch (Exception $e) {
        sfLogger::getInstance()->err('Exception catched from sf_rater helper: ' . $e->getMessage());
    }
}
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:57,代码来源:deppVotingHelper.php

示例8: sf_rater

/**
 * Return the HTML code for a unordered list showing rating stars
 * 
 * @param  BaseObject  $object  Propel object instance
 * @param  array       $options        Array of HTML options to apply on the HTML list
 * @throws sfPropelActAsRatableException
 * @return string
 **/
function sf_rater($object, $options = array())
{
    if (is_null($object)) {
        sfLogger::getInstance()->debug('A NULL object cannot be rated');
    }
    if (!isset($options['star-width'])) {
        $star_width = sfConfig::get('app_rating_star_width', 25);
    } else {
        $star_width = $options['star-width'];
        unset($options['star-width']);
    }
    try {
        $max_rating = $object->getMaxRating();
        $actual_rating = $object->getRating();
        $bar_width = $actual_rating * $star_width;
        $options = _parse_attributes($options);
        if (!isset($options['class'])) {
            $options = array_merge($options, array('class' => 'star-rating'));
        }
        if (!isset($options['style']) or !preg_match('/width:/i', $options['style'])) {
            $full_bar_width = $max_rating * $star_width;
            $options = array_merge($options, array('style' => 'width:' . $full_bar_width . 'px'));
        }
        if ($object instanceof sfOutputEscaperObjectDecorator) {
            $object_class = get_class($object->getRawValue());
        } else {
            $object_class = get_class($object);
        }
        $object_id = $object->getReferenceKey();
        $token = sfPropelActAsRatableBehaviorToolkit::addTokenToSession($object_class, $object_id);
        $msg_domid = sprintf('rating_message_%s', $token);
        $bar_domid = sprintf('current_rating_%s', $token);
        $list_content = '  <li class="current-rating" id="' . $bar_domid . '" style="width:' . $bar_width . 'px;">';
        $list_content .= sprintf(__('Currently rated %d star(s) on %d'), $object->getRating(), $max_rating);
        $list_content .= '  </li>';
        for ($i = 1; $i <= $max_rating; $i++) {
            $label = sprintf(__('Rate it %d stars'), $i);
            $list_content .= '  <li>' . link_to_remote($label, array('url' => sprintf('sfRating/rate?token=%s&rating=%d&star_width=%d', $token, $i, $star_width), 'update' => $msg_domid, 'script' => true, 'complete' => visual_effect('appear', $msg_domid) . visual_effect('highlight', $msg_domid)), array('class' => 'r' . $i . 'stars', 'title' => $label)) . '</li>';
        }
        return content_tag('ul', $list_content, $options) . content_tag('div', null, array('id' => $msg_domid));
    } catch (Exception $e) {
        sfLogger::getInstance()->err('Exception catched from sf_rater helper: ' . $e->getMessage());
    }
}
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:52,代码来源:sfRatingHelper.php

示例9: list_people

function list_people($object, $method, $type, $obj_type, $outside = false)
{
    $list = "";
    $people = call_user_func(array($object, $method));
    $list .= "<ul>\n";
    foreach ($people as $person) {
        if (strtolower($person->getPersonType()->getName()) == strtolower($type)) {
            $list .= "<li>\n";
            $list .= $person->getName();
            $list .= "&nbsp;" . $person->getEmail();
            $list .= "&nbsp;" . $person->getPhone();
            if (!$outside) {
                $list .= "&nbsp;" . link_to_remote(image_tag('delete', array('alt' => 'delete')), array('url' => $obj_type . '/deletePerson?id=' . $person->getId(), 'update' => array('success' => $obj_type . '_' . myTools::stripText($type))));
            }
            $list .= "</li>\n";
        }
    }
    $list .= "</ul>\n";
    return $list;
}
开发者ID:soon0009,项目名称:EMS,代码行数:20,代码来源:PeopleHelper.php

示例10: link_to_remote

                ?>
							<p id="row_<?php 
                echo $locate->getId();
                ?>
" style="display:none;">.
								<?php 
                echo link_to_remote(__('detail'), array('url' => 'location/show?id=' . $locate->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'green', 'style' => 'font-size:10px;'));
                ?>
								<?php 
                if ($can_edit) {
                    echo link_to_remote(__('edit'), array('url' => 'location/edit?id=' . $locate->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'blue', 'style' => 'font-size:10px;'));
                }
                ?>
								<?php 
                if ($can_remove) {
                    echo link_to_remote(__('delete'), array('url' => 'location/delete?id=' . $locate->getId(), 'confirm' => __('Are you sure?'), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'red', 'style' => 'font-size:10px;'));
                }
                ?>
							</p>
						</td>
                        <td><?php 
                echo $locate->getCampus() ? $locate->getCampus() : '-';
                ?>
</td>
                        <!--td><?php 
                #echo $locate->getDepartmentId()? $locate->getDepartment()->toString() : '-' ;
                ?>
</td-->
                        <td><?php 
                echo $locate->getCapacity() ? $locate->getCapacity() : '-';
                ?>
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listSuccess.php

示例11: foreach

    $i = 0;
    foreach ($pager->getResults() as $accal_activity) {
        ?>
					<tr class="list<?php 
        ++$i;
        if ($i % 2 == 0) {
            echo ' even';
        }
        ?>
">
						<td><?php 
        echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
        ?>
</td>
						<td class='first'><?php 
        echo $accal_activity->getAcademicCalendar() ? link_to_remote($accal_activity->getAcademicCalendar()->toString(), array('url' => 'accal_activity/showByEmployee?id=' . $accal_activity->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-';
        ?>
</td>
                        <td><?php 
        echo $accal_activity->getStart() ? $accal_activity->getStart('d-m-Y') . '&nbsp;&nbsp;s/d&nbsp;&nbsp;' . $accal_activity->getEnd('d-m-Y') : 'n/a';
        ?>
</td>
						<td><?php 
        echo $accal_activity->getActivityLength() ? $accal_activity->getActivityLength() : '-';
        ?>
&nbsp;&nbsp;Hari</td>
						<td><?php 
        echo $accal_activity->getActivityTypeId() ? $accal_activity->getActivityType()->toString() : '-';
        ?>
</td>
                        <td><?php 
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listByEmployeeSuccess.php

示例12: number_format

            $tleave = number_format($levels[$employee_leave->getAcademicCalendarId() . '#' . $employee_detail->getEmployeeLevelId()]);
        } elseif (array_key_exists($employee_leave->getAcademicCalendarId(), $accals)) {
            echo number_format($accals[$employee_leave->getAcademicCalendarId()]);
            $tleave = number_format($accals[$employee_leave->getAcademicCalendarId()]);
        } else {
            echo '-';
            $tleave = number_format(0);
        }
        ?>
&nbsp;<?php 
        echo __('Day');
        ?>
                                                    </td>
                                                    <td align="center" style="text-align:  center;">
                                                            <?php 
        echo link_to_remote($employee_leave->getTotalLength() . '&nbsp;Hari', array('url' => 'employee_leave_recapt/listLeave?employee_id=' . $employee_leave->getEmployeeId() . '&academic_calendar_id=' . $employee_leave->getAcademicCalendarId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white'));
        ?>
 
                                                    </td>
                                                    <td align="center" style="text-align:  center; font-weight: bold;">
                                                        <?php 
        if ($tleave > 0) {
            echo number_format($tleave - $employee_leave->getTotalLength());
        } else {
            echo number_format(0);
        }
        ?>
&nbsp;<?php 
        echo __('Day');
        ?>
                                                    </td>
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listSuccess.php

示例13: link_to_remote

							</p>
						</td>
						<td><?php 
        echo $subject->getName();
        ?>
</td>
						<td><?php 
        echo $subject->getCredit();
        ?>
</td>
						<td><?php 
        echo $subject->getSubjectGroup() ? link_to_remote($subject->getSubjectGroup()->toString(), array('url' => 'subject_group/show?id=' . $subject->getSubjectGroupId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-';
        ?>
</td>
						<td><?php 
        echo $subject->getDepartment() ? link_to_remote($subject->getDepartment()->toString(), array('url' => 'department/show?id=' . $subject->getDepartmentId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-';
        ?>
</td>
					</tr>
				<?php 
    }
    ?>
			<?php 
}
?>
			</tbody>
		</table>
		<?php 
if ($pager->getNbResults() > 1) {
    echo include_partial('global/pager', array('position' => 'bottom', 'pager' => $pager, 'module' => 'Subject'));
}
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listSuccess.php

示例14: array

</label></td>
                    	<td width="2%" style="text-align:center; vertical-align:middle;" class='first'>:</td>
			<td style="vertical-align:middle;" class='first'>
				<p style="font-weight: bold;" class="detail">
				<?php 
$counselings = CounselingPeer::retrieveByPK($counseling->getId());
$tutors = array();
foreach ($counselings->getCounselingTutors() as $cr) {
    $c = new Criteria();
    $c->add(EmployeeDetailPeer::EMPLOYEE_ID, $cr->getEmployeeId());
    $employee_detail = EmployeeDetailPeer::doSelectOne($c);
    $tutors[] = $cr->getEmployee() ? '&middot; ' . $cr->getEmployee()->getName() . ' - ' . $employee_detail->getContactDetail() : '-';
}
echo join("<br>", $tutors);
?>
				</p>
			</td>
                </tr>

		<tr>
			<td style="vertical-align:middle; text-align: left;" colspan='6' class='first'>
				<div class="ja-typo-box box-rounded orange box-flash"><b>Harap Diperhatikan..!!</b><br>Untuk Nilai yang salah anda dapat langsung menghubungi Wali Kelas Terkait lewat No. Telepon / Contact diatas atau bisa menggunakan Fasilitas Komunikasi Kekolah dengan link berikut <b><?php 
echo link_to_remote('Contact', array('url' => 'student_email/create', 'update' => 'content', 'script' => 'true', 'before' => "this.blur(); showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white'));
?>
</b>. Dengan menyertakan bukti printout Nilai yang dirasa salah.</div>
			</td>
		</tr>			
	</tbody>
</table>
       
开发者ID:taryono,项目名称:school,代码行数:29,代码来源:getDetailSuccess.php

示例15: elseif

        } elseif ($employee_detail->getGroups() == StaffType::GROUP_FOUND) {
            echo __('Pengurus');
        } elseif ($employee_detail->getGroups() == StaffType::GROUP_ORG) {
            echo __('Pembina');
        } elseif ($employee_detail->getGroups() == StaffType::GROUP_MISC) {
            echo __('Misc');
        } else {
            echo '-';
        }
    } else {
        echo '-';
    }
    ?>
                                                    </td>
                                                    <td style="text-align:center; vertical-align: middle;"><?php 
    echo link_to_remote(image_tag('hapus.png', 'title=Hapus'), array('url' => 'employee_report/deleteTemp?id=' . $temp->getId() . '&academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId() . '&time=' . $time . '&time2=' . $time2 . '&tgl_cetak=' . $tgl_cetak . '&month_id1=' . $month1->getId() . '&month_id2=' . $month2->getId() . '&tgl_absen1=' . $tgl_absen1 . '&tgl_absen2=' . $tgl_absen2 . '&thn1=' . $thn1 . '&thn2=' . $thn2, 'confirm' => __('Are you sure?'), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"));
    ?>
</td> 
                                                </tr>
                                            <?php 
}
?>
                                        </tbody>
                                    </table>
                                </td></tr>
                        </table>  
                    </td>
                </tr>
            </table>
        </td></tr>
</table>
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:previewAbsenceSuccess.php


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