function input_asset_tag($name, $value, $options = array()) { use_helper('Javascript', 'I18N'); $type = 'all'; if (isset($options['images_only'])) { $type = 'image'; unset($options['images_only']); } $form_name = 'this.previousSibling.previousSibling.form.name'; if (isset($options['form_name'])) { $form_name = '\'' . $options['form_name'] . '\''; unset($options['form_name']); } $html = ''; if (is_file(sfConfig::get('sf_web_dir') . $value)) { $ext = substr($value, strpos($value, '.') - strlen($value) + 1); if (in_array($ext, array('png', 'jpg', 'gif'))) { $image_path = $value; } else { if (!is_file(sfConfig::get('sf_plugins_dir') . '/sfMediaLibraryPlugin/web/images/' . $ext . '.png')) { $ext = 'unknown'; } $image_path = '/sfMediaLibraryPlugin/images/' . $ext; } $html .= link_to_function(image_tag($image_path, array('alt' => 'File', 'height' => '64')), "window.open('{$value}')"); $html .= '<br />'; } $html .= input_tag($name, $value, $options); $html .= ' ' . image_tag('/sfMediaLibraryPlugin/images/folder_open', array('alt' => __('Insert Image'), 'style' => 'cursor: pointer; vertical-align: middle', 'onclick' => 'sfMediaLibrary.openWindow({ form_name: ' . $form_name . ', field_name: \'' . $name . '\', type: \'' . $type . '\', scrollbars: \'yes\' })')); $html .= init_media_library(); return $html; }
public function render() { $metaTitle = $this->metatag != null ? $this->metatag->getMetaTitle() : ''; $metaKeywords = $this->metatag != null ? $this->metatag->getMetaKeywords() : ''; $metaDescription = $this->metatag != null ? $this->metatag->getMetaDescription() : ''; return sprintf($this->skeleton, label_for('meta_title', __('Title:')), input_tag('w3s_meta_title', $metaTitle, 'size=34'), label_for('meta_meta_keywords', __('Keywords:')), textarea_tag('w3s_meta_keywords', $metaKeywords, 'size=31x10'), label_for('meta_meta_description', __('Description:')), textarea_tag('w3s_meta_description', $metaDescription, 'size=31x10'), link_to_function(__('Store metatags'), 'currentTab.save()', 'class="link_button"')); }
public function render() { $result = ''; $page = DbFinder::from('W3sPage')->with('W3sTemplate', 'W3sProject')->leftJoin('W3sGroup')->leftJoin('W3sTemplate')->leftJoin('W3sProject')->findPK($this->idPage); $slots = W3sSlotPeer::getTemplateSlots($page->getW3sGroup()->getTemplateId()); $i = 0; foreach ($slots as $slot) { $idSlot = $slot->getId(); $class = $i / 2 == intval($i / 2) ? "w3s_white_row" : "w3s_blue_row"; switch ($slot->getRepeatedContents()) { case 0: $repeatedColor = 'green'; $repeatedAlt = __('This contents is not repeated through pages'); break; case 1: $repeatedColor = 'orange'; $repeatedAlt = __('This contents is repeated at group level'); break; case 2: $repeatedColor = 'blue'; $repeatedAlt = __('This contents is repeated at site level'); break; } $result .= sprintf($this->rowSkeleton, $this->idLanguage . $idSlot, $class, $idSlot, link_to_function($slot->getSlotName(), 'W3sControlPanel.showRepeatedContentsForm(' . $idSlot . ');', 'onmouseover="W3sControlPanel.highlightSlot(\'' . $slot->getSlotName() . '\', ' . $slot->getRepeatedContents() . ')"'), image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_slot_' . $repeatedColor . '.jpg', 'title=' . $repeatedAlt . ' size=14x14')); $i++; } return sprintf('<div id="w3s_slot_list">%s</div>', $result); }
function link_to_login($name, $uri = null) { use_helper('Javascript'); if ($uri && sfContext::getInstance()->getUser()->isAuthenticated()) { return link_to($name, $uri); } else { return link_to_function($name, visual_effect('blind_down', 'login', array('duration' => 0.5))); } }
/** * Build a Javascript link that tracks a page view. * * Options can include: * * * track_as: an internal URI (required) * * is_route: whether to send the URI through sfRouting * * is_event: track as an event rather than a page view (for those trackers * that support this option) * * @throws sfViewException if "track_as" option is absent * * @param string $name * @param string $internalUri * @param array $options * * @return string */ function google_analytics_link_to_function($name, $function, $options = array()) { sfLoader::loadHelpers(array('Javascript')); $tracker = sfContext::getInstance()->getRequest()->getTracker(); $options = _parse_attributes($options); $trackerOptions = $tracker->extractViewOptions($options); $link = link_to_function($name, $function, $options); $link = _add_onclick_tracking($tracker, $link, $trackerOptions); return $link; }
public function getCollapseSnippet($name, $count) { if (is_null($this->getOption('collapse')) || !$this->getOption('collapse')) { return null; } sfContext::getInstance()->getConfiguration()->loadHelpers(array('Javascript')); $id = $this->generateId($name); $snippet = link_to_function($this->getCollapseText($count), sprintf("document.getElementById('%s').style.display = (document.getElementById('%s').style.display == 'none' ? 'block' : 'none'); this.style.display = 'none';", $id, $id)); $snippet .= javascript_tag(sprintf("document.getElementById('%s').style.display = 'none'", $id)); return $snippet; }
function link_to_app_setting($text, $mid, $isReload = false) { $response = sfContext::getInstance()->getResponse(); $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/prototype'); $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/builder'); $response->addJavascript(sfConfig::get('sf_prototype_web_dir') . '/js/effects'); $response->addJavascript('/opOpenSocialPlugin/js/opensocial-util'); $url = '@application_setting?id=' . $mid; if ($isReload) { $url = $url . '&is_reload=1'; } return link_to_function($text, sprintf("iframeModalBox.open('%s')", url_for($url))); }
public function render($name, $value = null, $attributes = array(), $errors = array()) { $size = isset($attributes['size']) ? $attributes['size'] : (isset($this->attributes['size']) ? $this->attributes['size'] : 10); $letters = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); $text = '<div class="dcFinder">'; $id = $this->generateId($name); $id_left = $id . '_left'; $unassociated_name = 'unassociated_' . $id; $double_list = new sfWidgetFormSelectDoubleList(array('choices' => $this->getOption('choices'))); $double_list->setOptions($this->getOptions()); $custom_handler = $this->getOption('custom_handler'); $widget_serialized = base64_encode(serialize($double_list)); $text .= '<ul class="finder">'; foreach ($letters as $letter) { $text .= '<li>'; $text .= link_to_function($letter, remote_function(array('url' => '@dcWidgetFormSelectDoubleListFinderPropel', 'with' => "'?letter=" . $letter . "&size=" . $size . "&name=" . $unassociated_name . "&values=" . base64_encode(serialize($value)) . ($custom_handler ? "&custom_handler=" . base64_encode(serialize($custom_handler)) : '') . "&widget=" . $widget_serialized . "'", 'before' => "\$('{$id}_indicator').show(); dcFinder.setCurrent('{$id}', this);", 'complete' => "\$('{$id}_indicator').hide();", 'update' => $id_left))); $text .= '</li>'; } $text .= '<li class="current">'; $text .= link_to_function(__('All'), remote_function(array('url' => '@dcWidgetFormSelectDoubleListFinderPropel', 'with' => "'?letter=" . "&size=" . $size . "&values=" . base64_encode(serialize($value)) . ($custom_handler ? "&custom_handler=" . base64_encode(serialize($custom_handler)) : '') . "&name=" . $unassociated_name . "&widget=" . $widget_serialized . "'", 'update' => $id_left, 'before' => "\$('{$id}_indicator').show(); dcFinder.setCurrent('{$id}', this);", 'complete' => "\$('{$id}_indicator').hide();"))); $text .= '</li>'; $text .= '<li style="display: none;" id="' . $id . '_indicator">' . $this->getOption('loader') . '</li>'; $text .= '</ul>'; $this->addOption('template', <<<EOF <div class="%class%"> <div style="float: left"> <div class="double_list_label">%label_unassociated%</div> <div id="{$id_left}">%unassociated%</div> </div> <div style="float: left; margin-top: 2em"> %associate% <br /> %unassociate% </div> <div style="float: left"> <div class="double_list_label">%label_associated%</div> %associated% </div> <br style="clear: both" /> <script type="text/javascript"> sfDoubleList.init(document.getElementById('%id%'), '%class_select%'); </script> </div> EOF ); $text .= parent::render($name, $value, $attributes, $errors); $text .= '</div>'; return $text; }
public function render($name, $value = null, $attributes = array(), $errors = array()) { sfContext::getInstance()->getConfiguration()->loadHelpers('JavascriptBase'); $widget = $this->getRenderer()->render($name, $value, $attributes, $errors); $space = " "; $model = $this->getOption("model"); $widget_id = "#" . $name; $widget_id = str_replace("[", "_", $widget_id); $widget_id = str_replace("]", "", $widget_id); $url = url_for($this->getOption("url")); $ws_url = url_for($this->getOption("ws_url"), true); $type = !$this->getOption('expanded') ? 'select' : ($this->getOption('multiple') ? 'checkbox' : 'radio'); $link = link_to_function($this->getOption("new_label"), "linkToNew('{$model}', '{$widget_id}', '{$url}', '{$ws_url}', '{$type}', '{$name}');"); return $widget . $space . $link; }
public static function trace($ignoreCount = 1) { $result = ""; self::$traceId++; $traceId = "aTrace" . self::$traceId; $traceIdShow = $traceId . "Show"; $traceIdHide = $traceId . "Hide"; sfContext::getInstance()->getConfiguration()->loadHelpers(array('Tag', 'JavascriptBase')); $result .= "<div class='aTrace'>Trace " . link_to_function(">>>", "document.getElementById('{$traceId}').style.display = 'block'; " . "document.getElementById('{$traceIdShow}').style.display = 'none'; " . "document.getElementById('{$traceIdHide}').style.display = 'inline'", array("id" => $traceIdShow)) . link_to_function("<<<", "document.getElementById('{$traceId}').style.display = 'none'; " . "document.getElementById('{$traceIdHide}').style.display = 'none'; " . "document.getElementById('{$traceIdShow}').style.display = 'inline'", array("id" => $traceIdHide, "style" => 'display: none')); $result .= "</div>"; $result .= "<pre id='{$traceId}' style='display: none'>\n"; $result .= self::traceText($ignoreCount + 1); $result .= "</pre>\n"; return $result; }
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('highlight', 'mark_' . $question->getId()))); } } else { return link_to_function('interested?', visual_effect('blind_down', 'login', array('duration' => 0.5))); } }
/** * Renders the editor * * @return string * */ public function render() { $idLanguage = 0; $isMain = 0; $languageName = ''; if ($this->language != null) { $idLanguage = $this->language->getId(); $isMain = $this->language->getMainLanguage(); $languageName = $this->language->getLanguage(); } $setEnabled = $idLanguage == 0 || $idLanguage != 0 && $isMain == 0 ? '' : 'DISABLED'; $function = $idLanguage == 0 ? link_to_function(__('Add Language'), 'W3sLanguage.add()', 'class="link_button"') : link_to_function(__('Edit Language'), 'W3sLanguage.edit()', 'class="link_button"'); $additionalInfo = $idLanguage == 0 ? '<div id="w3s_message"><p class="error_message">' . __('PAY ATTENTION: This operation will also insert all contents for the new language. These contents will be copied from the main language of your website.') . '</p></div>' : ''; $checked = $isMain == 1 ? 'CHECKED' : ''; return sprintf($this->editorSkeleton, label_for('language_name', __('Language name:')), input_tag('w3s_language_name', $languageName), label_for('main_language', __('Main language:')), sprintf('<input name="w3s_main_language" id="w3s_main_language" %s type="checkbox" %s />', $setEnabled, $checked), $function, $additionalInfo); }
function link_to_asset_action($text, $asset) { $user = sfContext::getInstance()->getUser(); if ($user->hasAttribute('popup', 'sf_admin/sf_asset/navigation')) { switch ($user->getAttribute('popup', null, 'sf_admin/sf_asset/navigation')) { case 1: // popup called from a Rich Text Editor (ex: TinyMCE) return link_to($text, "sfAsset/tinyConfigMedia?id=" . $asset->getId(), 'title=' . $asset->getFilename()); case 2: // popup called from a simple form input (or via input_sf_asset_tag) return link_to_function($text, "setImageField('" . $asset->getUrl() . "')"); } } else { // case : sf view (i.e. module sfAsset, view list) return link_to($text, "sfAsset/edit?id=" . $asset->getId(), 'title=' . $asset->getFilename()); } }
/** * @param string $text * @param sfAsset $asset * @return string */ function link_to_asset_action($text, $asset) { $user = sfContext::getInstance()->getUser(); if ($user->hasAttribute('popup', 'sf_admin/sf_asset/navigation')) { switch ($user->getAttribute('popup', null, 'sf_admin/sf_asset/navigation')) { case 1: // popup called from a Rich Text Editor (ex: TinyMCE) #return link_to($text, '@sf_asset_library_tiny_config?id=' . $asset->getId(), 'title=' . $asset->getFilename()); throw new sfAssetException('this option should be unused...'); case 2: // popup called from a simple form input (or via input_sf_asset_tag) return link_to_function($text, "setImageField('" . $asset->getUrl() . "','" . $asset->getUrl('small') . "'," . $asset->getId() . ')'); } } else { // case : sf view (i.e. module sfAsset, view list) return link_to($text, '@sf_asset_library_edit?id=' . $asset->getId(), 'title=' . $asset->getFilename()); } }
function filters_switcher_link($mainFilterSwitchOn) { $options_on = $options_off = array(); $options_on['id'] = 'filter_switch_on'; $options_off['id'] = 'filter_switch_off'; if ($mainFilterSwitchOn) { $options_off['style'] = 'display: none;'; } else { $options_on['style'] = 'display: none;'; } $html = picto_tag('action_on', __('some filters active'), $options_on); $html .= picto_tag('action_off', __('some filters have been defined but are not activated'), $options_off); if (defined('PUN_ROOT')) { // we are in the forum // it is not possible to activate/disactivate filter because the FiltersSwitchFilter will not get executed. // moreover, forums are not filtered on activities, regions, langs. return $html; } else { return link_to_function($html, "\$('#indicator').show();" . "\$.ajax('" . url_for('@default?module=common&action=switchallfilters') . "')" . ".done(function() { \$('#filter_switch_on, #filter_switch_off').toggle(); window.location.reload(); })" . ".always(function() { \$('#indicator').hide(); })"); } }
<?php use_helper('Date', 'I18N', 'Number', 'Javascript', 'Global'); ?> <div id="edit-tasks-holder"> <?php if ($collapsable) { ?> <?php echo link_to_function('Project Tasks', visual_effect('toggle_blind', 'project-tasks', array('duration' => 0.5)), array('class' => 'titlebar-clickable project-titlebar')); ?> <?php } else { ?> <div class="project-titlebar"> <?php echo ucwords(__('project tasks')); ?> </div> <?php } ?> <div id="project-tasks" <?php if ($collapsable) { echo 'style="display:true;"'; } ?> > <?php if ($project->getTasks() != null) {
<td rowspan="2" class="infos"> <a name="<?php echo $i ?>" class="ancre">#<?php echo $i ?></a> <?php if(!$obj->is_delete): ?> <?php echo link_to_function( image_tag('/vjCommentPlugin/images/comments.png', array( 'alt' => 'reply' )) , "reply('".$obj->getId()."','".$obj->getAuthor()."')", array('title' => __('Reply to this comment', array(), 'vjComment'))) ?> <?php echo link_to_function( image_tag('/vjCommentPlugin/images/error.png', array( 'alt' => 'report' )) , 'window.open( \''.url_for('@comment_reporting?id='.$obj->getId().'&num='.$i).'\', \''.__('Add new comment', array(), 'vjComment').'\', "menubar=no, status=no, scrollbars=no, menubar=no, width=565, height=300")', array('target' => '_blank', 'title' => __('Report this comment - New window', array(), 'vjComment') )) ?><br /> <?php endif; ?> <?php if(commentTools::isGravatarAvailable() && !$obj->is_delete): ?> <?php echo gravatar_image_tag($obj->getEmail()) ?> <?php endif ?> </td>
<?php op_include_box('noJoinCommunity', __('You don\'t have any joined %community%.', array('%community%' => $op_term['community']->pluralize())), array('title' => __('Joined %community%', array('%community%' => $op_term['community']->pluralize()->titleize())))); ?> <?php use_helper('Javascript'); op_include_line('backLink', link_to_function(__('Back to previous page'), 'history.back()'));
$i = 0; foreach ($pager->getResults() as $ng_reg_test_period) { ?> <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 link_to_function(strlen($ng_reg_test_period->getName()) > 0 ? $ng_reg_test_period->getName() : 'n/a', visual_effect('toggle_appear', 'row_' . $ng_reg_period->getId(), array('onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $ng_reg_period->getId(); ?> " style="display:none;">. <?php if ($can_edit) { echo link_to_remote(__('edit'), array('url' => 'ng_reg_detail/editOther?id=' . $ng_reg_test_period->getId() . '&ng_reg_period_id=' . $ng_reg_period->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'blue')); } ?> <?php if ($can_remove) { echo link_to_remote(__('delete'), array('url' => 'ng_reg_detail/deleteOther?id=' . $ng_reg_test_period->getId() . '&ng_reg_period_id=' . $ng_reg_period->getId(), 'confirm' => __('Are you sure? Other Data Related will be deleted'), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'red')); } ?>
$has_avalanche_link = $has_avalanche_last_link || $has_avalanche_archive_link; if ($has_weather_link || $has_avalanche_link) { ?> <div class="one_kind_association no_print"> <div class="association_content"> <?php if ($has_box) { $label = array(); if ($has_weather_link) { $label[] = __('Weather forecast'); } if ($has_avalanche_link) { $label[] = __('Avalanche bulletin'); } $label = '<span class="assoc_img picto_open_light" id="toggle_weather"></span>' . '<span class="linked_elt">' . implode(', ', $label) . '</span>'; echo '<div class="box_title" id="weather_box_title" title="' . __('section open') . '">' . link_to_function($label, "C2C.toggleBox('weather')") . '</div>' . '<div id="weather_box" style="display:none;">'; } if ($has_weather_link) { echo '<div class="section_subtitle assoc_img picto_weather" id="_weather_forecast" title="' . __('Weather forecast') . '"><span>' . __('Weather forecast') . __(' :') . '</span></div>'; if (count($weather_link_list) > 1) { foreach ($weather_link_list as $key => $link) { $weather_link_list[$key] = $weather_title_list[$key] . $link; } } if ($has_box) { foreach ($weather_link_list as $link) { echo '<div class="linked_elt">' . $link . '</div>'; } } else { echo '<div class="linked_elt">' . implode(', ', $weather_link_list) . '</div>'; }
<?php if ($previous_page >= 0) { ?> <span id="jquery_search_navigation_previous"> <?php echo link_to_function(__("Previous"), "{$js_var_name}.search({$previous_page})"); ?> </span> <?php } ?> <?php if (count($results) == $limit) { ?> <span id="jquery_search_navigation_next"> <?php echo link_to_function(__("Next"), "{$js_var_name}.search({$next_page})"); ?> </span> <?php } ?> <?php }
$i = 0; foreach ($pager->getResults() as $student) { ?> <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 link_to_function(strlen($student->getCode()) > 0 ? $student->getCode() : 'n/a', visual_effect('toggle_appear', 'row_' . $student->getId(), array('onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $student->getId(); ?> " style="display: none;">. <?php echo link_to_remote(__('detail'), array('url' => 'subject_plan/showStudent?id=' . $student->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'green', 'style' => 'font-size:10px;')); ?> <br> . <?php echo link_to_remote(__('student course'), array('url' => 'student_course/list?student_id=' . $student->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white', 'style' => 'font-size:10px;')); ?> </p> </td> <td><?php
<?php use_helper('JavascriptBase', 'I18N') ?> <?php use_stylesheet('/vjCommentPlugin/css/reported.min.css') ?> <div id="report-sent"> <span><?php echo __('Report sent.', array(), 'vjComment') ?><br/><?php echo __('The moderation team has been notified.', array(), 'vjComment') ?></span><br /><br /> <?php echo link_to_function(__('Close the popup', array(), 'vjComment'), 'window.close()') ?> </div>
<p><?php echo __('Example: %embed%', array('%embed%' => htmlspecialchars('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="291" ...</object>')), 'apostrophe'); ?> </p> <input type="hidden" name="first_pass" value="1" /> </div> <ul class="a-controls a-media-upload-form-footer" id="a-media-video-add-by-embed-form-submit"> <li><input type="submit" value="<?php echo __('Go', null, 'apostrophe'); ?> " class="a-submit" /></li> <li> <?php echo link_to_function(__("Cancel", null, 'apostrophe'), "\$('#a-media-video-add-by-embed-form').hide(); \n\t\t\t\t\t \$('#a-media-video-add-by-embed-heading').hide(); \n\t\t\t\t\t \$('#a-media-video-buttons').show();", array("class" => "a-btn a-cancel")); ?> </li> </ul> </form> <?php } ?> <div id="a-media-video-search-results-container">Placeholder text</div> </div> </div> <script type="text/javascript" charset="utf-8"> $(document).ready(function() {
foreach ($sub_comps as $sub_comp) { ?> <tr class="list<?php ++$j; if ($j % 2 == 0) { echo ' even'; } ?> "> <td></td> <td><?php echo $j; ?> </td> <td class='first'><?php echo link_to_function($sub_comp->getDetail() ? $sub_comp->getDetail() : 'n/a', visual_effect('toggle_appear', 'row_' . $sub_comp->getId(), array('duration' => 0.5, 'onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $sub_comp->getId(); ?> " style="display:none;">. <?php echo link_to_remote(__('edit'), array('url' => 'subject_competency/editCompetency?subject_grading_id=' . $subject_grading->getId() . '&id=' . $sub_comp->getId(), 'update' => 'subject_list', 'script' => 'true', 'before' => "this.blur();showIndicator('subject_list', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'blue')); ?> <?php echo link_to_remote(__('delete'), array('url' => 'subject_competency/deleteCompetency?subject_grading_id=' . $subject_grading->getId() . '&id=' . $sub_comp->getId(), 'confirm' => __('Are you sure?'), 'update' => 'subject_list', 'script' => 'true', 'before' => "this.blur();showIndicator('subject_list', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'red', 'style' => 'font-size:10px;')); ?> </p> </td> </tr> <?php
<td width="50%" valign="top"> <table class="form"> <tr><td class="form"> <table class="form_content" width="100%"> <tbody> <tr> <td class="first"> <label><?php echo __('Pembayaran Untuk Bulan :'); ?> </label><br /><br /> <div id='month_list' style="overflow: auto; width: 100%; height: 37em;border: 1px solid black;"> <?php use_helper('Object'); echo include_partial('global/title', array('type' => '', 'title' => '', 'actions' => $actions3, 'subtitle' => __('_CHOICE_') . ': ' . link_to_function(__('_CHOICE_ALL_'), "\n\t\t\t\t\t\tvar fields = Form.getElements('month_list_form');\n\t\t\t\t\t\t\tfields.each( function(field){\n\t\t\t\t\t\t\tif (field.id == 'months') {\n\t\t\t\t\t\t\t\tfield.checked = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t", array('class' => 'black')) . ' • ' . link_to_function(__('_CHOICE_NONE_'), "\n\t\t\t\t\t\tvar fields = Form.getElements('month_list_form');\n\t\t\t\t\t\t\tfields.each( function(field){\n\t\t\t\t\t\t\tif (field.id == 'months') {\n\t\t\t\t\t\t\t\tfield.checked = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t", array('class' => 'black')) . ' • ' . link_to_function(__('_CHOICE_REV_'), "\n\t\t\t\t\t\tvar fields = Form.getElements('month_list_form');\n\t\t\t\t\t\t\tfields.each( function(field){\n\t\t\t\t\t\t\tif (field.id == 'months') {\n\t\t\t\t\t\t\t\tfield.checked = !field.checked;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t", array('class' => 'black')) . ($sf_request->hasErrors() ? '<br><div class=form_error>* ' . __('_FORM_HAS_ERROR_') . '</div>' : ''))); echo form_remote_tag(array('url' => 'payment_student/listMonth', 'update' => 'month_list', 'script' => 'true', 'before' => "this.blur(); showIndicator('month_list', 'snakebig_black');", 'complete' => "hideIndicator()"), array('name' => 'month_list_form', 'id' => 'month_list_form')); ?> <table class="list"> <tr> <td class="list"> <table class="list_content"> <thead> <tr> <th width="2%">#</th> <th class='first'><?php echo __('Bulan'); ?> </th> <th style="text-align:right;"><?php echo __('Amount');
*/ require_once __DIR__ . '/../../bootstrap/unit.php'; require_once __DIR__ . '/../../../lib/helper/TagHelper.php'; require_once __DIR__ . '/../../../lib/helper/JavascriptBaseHelper.php'; $t = new lime_test(9, new lime_output_color()); // boolean_for_javascript() $t->diag('boolean_for_javascript()'); $t->is(boolean_for_javascript(true), 'true', 'boolean_for_javascript() makes a javascript representation of the boolean if the param is boolean'); $t->is(boolean_for_javascript(false), 'false', 'boolean_for_javascript() makes a javascript representation of the boolean if the param is boolean'); $t->is(boolean_for_javascript(1 == 0), 'false', 'boolean_for_javascript() makes a javascript representation of the boolean if the param is boolean'); $t->is(boolean_for_javascript('dummy'), 'dummy', 'boolean_for_javascript() makes a javascript representation of the boolean if the param is boolean'); //options_for_javascript() $t->diag('options_for_javascript()'); $t->is(options_for_javascript(array("'a'" => "'b'", "'c'" => false)), "{'a':'b', 'c':false}", 'options_for_javascript() makes a javascript representation of the passed array'); $t->is(options_for_javascript(array("'a'" => array("'b'" => "'c'"))), "{'a':{'b':'c'}}", 'options_for_javascript() works with nested arrays'); //javascript_tag() $t->diag('javascript_tag()'); $expect = <<<EOT <script type="text/javascript"> //<![CDATA[ alert("foo"); //]]> </script> EOT; $t->is(javascript_tag('alert("foo");'), $expect, 'javascript_tag() takes the content as string parameter'); //link_to_function() $t->diag('link_to_function()'); $t->is(link_to_function('foo', 'alert(\'bar\')'), '<a href="#" onclick="alert(\'bar\'); return false;">foo</a>', 'link_to_function generates a link with onClick handler for function'); //#4152 $t->is(link_to_function('foo', 'alert(\'bar\')', array('confirm' => 'sure?')), '<a href="#" onclick="if(window.confirm(\'sure?\')){ alert(\'bar\');}; return false;">foo</a>', 'link_to_function works fine with confirm dialog');
$j = 0; foreach ($locates as $locate) { ?> <tr class="list<?php ++$j; if ($j % 2 == 0) { echo ' even'; } ?> "> <td style="text-align:center;"><?php echo $j + ($pager2->getPage() - 1) * $pager2->getMaxPerPage(); ?> </td> <td class='first'><?php echo link_to_function(strlen($locate->getCode()) > 0 ? $locate->getCode() : 'n/a', visual_effect('toggle_appear', 'row_' . $locate->getId(), array('duration' => 0.5, 'onclick' => 'this.blur()'))); ?> <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 input_tag('nickname'); ?> <label for="password"><?php echo __('password:'******'password'); ?> <?php echo input_hidden_tag('referer', $sf_params->get('referer') ? $sf_params->get('referer') : $sf_request->getUri()); ?> <?php echo submit_tag(__('login')); ?> <?php echo link_to_function(__('cancel'), visual_effect('blind_up', 'login', array('duration' => 0.5))); ?> </form> </div> <div id="content"> <div id="content_main"> <?php echo $content; ?> <div class="verticalalign"></div> </div> <div id="content_bar"> <div class="topbar"></div> <?php
$i = 0; foreach ($pager->getResults() as $subject_curr) { ?> <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 link_to_function($subject_curr->getSubject() && strlen($subject_curr->getSubject()->getCode()) > 0 ? $subject_curr->getSubject()->getCode() : 'n/a', visual_effect('toggle_appear', 'row_' . $subject_curr->getId(), array('duration' => 0.5, 'onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $subject_curr->getId(); ?> " style="display:none;">. <?php echo link_to_remote(__('detail'), array('url' => 'subject/show?id=' . $subject_curr->getSubject()->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'green')); ?> <?php if ($can_edit) { echo link_to_remote(__('edit'), array('url' => 'subject_curr/edit?id=' . $subject_curr->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'blue')); } ?> <?php if ($can_remove) {