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


PHP visual_effect函数代码示例

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


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

示例1: link_to_login

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)));
    }
}
开发者ID:emacsattic,项目名称:symfony,代码行数:9,代码来源:GlobalHelper.php

示例2: 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

示例3: 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

示例4: sf_simple_cms_slot

function sf_simple_cms_slot($page, $slot, $default_text = null, $default_type = 'Text')
{
    $context = sfContext::getInstance();
    $request = $context->getRequest();
    $culture = $request->getAttribute('culture');
    $slot_object = $page->getSlot($slot, constant(sfConfig::get('app_sfSimpleCMS_escaping_strategy', 'ESC_RAW')));
    if (!$slot_object) {
        $slot_object = new sfSimpleCMSSlot();
        $slot_object->setType($default_type);
        $slot_object->setCulture($culture);
    }
    $slot_value = $slot_object->getValue();
    $slot_type_name = $slot_object->getType();
    $slot_type_class = 'sfSimpleCMSSlot' . $slot_type_name;
    $slot_type = new $slot_type_class();
    if ($request->getParameter('edit') == 'true' && !$request->getParameter('preview')) {
        echo '<div class="editable_slot" title="' . __('Double-click to edit') . '" id="slot_' . $slot . '" onDblClick="Element.show(\'edit_' . $slot . '\');Element.hide(\'slot_' . $slot . '\');">';
        if ($slot_value) {
            // Get slot value from the slot type object
            echo $slot_type->getSlotValue($slot_object);
        } else {
            // default text
            echo $default_text ? $default_text : sfConfig::get('app_sfSimpleCMS_default_text', __('[add text here]'));
        }
        echo '</div>';
        echo form_remote_tag(array('url' => 'sfSimpleCMS/updateSlot', 'script' => 'true', 'update' => 'slot_' . $slot, 'success' => 'Element.show(\'slot_' . $slot . '\');
                        Element.hide(\'edit_' . $slot . '\');
                       ' . visual_effect('highlight', 'slot_' . $slot)), array('class' => 'edit_slot', 'id' => 'edit_' . $slot, 'style' => 'display:none'));
        echo input_hidden_tag('slug', $page->getSlug(), 'id=edit_path' . $slot);
        echo input_hidden_tag('slot', $slot);
        if (sfConfig::get('app_sfSimpleCMS_use_l10n', false)) {
            echo input_hidden_tag('sf_culture', $slot_object->getCulture());
        }
        // Get slot editor from the slot type object
        echo $slot_type->getSlotEditor($slot_object);
        echo label_for('slot_type', __('Type: '));
        echo select_tag('slot_type', options_for_select(sfConfig::get('app_sfSimpleCMS_slot_types', array('Text' => __('Simple Text'), 'RichText' => __('Rich text'), 'Php' => __('PHP code'), 'Image' => __('Image'), 'Modular' => __('List of partials/components'))), $slot_type_name));
        if ($rich = sfConfig::get('app_sfSimpleCMS_rich_editing', false)) {
            // activate rich text if global rich_editing is true and is the current slot is RichText
            $rich = $slot_type_name == 'RichText';
        }
        echo submit_tag('update', array('onclick' => $rich ? 'tinymceDeactivate()' . ';submitForm(\'edit_' . $slot . '\'); return false' : '', 'class' => 'submit_tag'));
        echo button_to_function('cancel', 'Element.hide(\'edit_' . $slot . '\');Element.show(\'slot_' . $slot . '\');', 'class=submit_tag');
        echo '</form>';
    } else {
        echo $slot_type->getSlotValue($slot_object);
    }
}
开发者ID:net7,项目名称:Talia-CMS,代码行数:48,代码来源:sfSimpleCMSHelper.php

示例5: 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

示例6: 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 .= "&nbsp;" . 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

示例7: 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

示例8: input_tag

echo input_tag('nickname');
?>
      <label for="password"><?php 
echo __('password:');
?>
</label><?php 
echo input_password_tag('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 
开发者ID:emacsattic,项目名称:symfony,代码行数:31,代码来源:layout.php

示例9: foreach

        $answers = $sf_poll->getsfPollAnswers();
        ?>

    <ul id="answers">
    <?php 
        foreach ($answers as $answer) {
            ?>
      <?php 
            include_partial('sfPollsAdmin/li_answer', array('answer' => $answer, 'edit_links' => $count_user_answers == 0));
            ?>
    <?php 
        }
        ?>
    </ul>
    <?php 
        if (count($answers) == 0) {
            ?>
      <p>No answer for this poll yet.</p>
    <?php 
        }
        ?>
    <?php 
        echo button_to_remote('Add a possible answer to this poll', array('url' => 'sfPollsAdmin/addAnswer?poll_id=' . $sf_poll->getId(), 'with' => "'answer_text=' + escape(prompt('Enter answer text'))", 'update' => 'answers', 'position' => 'bottom', 'complete' => visual_effect('highlight', 'answers')));
        ?>
  <?php 
    }
} else {
    ?>
  <p>Please save your poll first</p>
<?php 
}
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:_admin_answers.php

示例10: form_error

 form-error<?php 
}
?>
">
  <?php 
if ($sf_request->hasError('tarea{es_evento}')) {
    ?>
    <?php 
    echo form_error('tarea{es_evento}', array('class' => 'form-error-msg'));
    ?>
  <?php 
}
?>
  
  <?php 
$value = object_checkbox_tag($tarea, 'getEsEvento', array('control_name' => 'tarea[es_evento]', 'onchange' => visual_effect('toggle_appear', 'capa_evento') . "; Element.toggle('capa_tarea')"));
echo $value ? $value : "&nbsp;";
?>
  </div>
</div>




<div class="form-row">
  <?php 
echo label_for('tarea[resumen]', __($labels['tarea{resumen}']) . ":", '');
?>
  <div class="content<?php 
if ($sf_request->hasError('tarea{resumen}')) {
    ?>
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:31,代码来源:_edit_form.php

示例11: foreach

    $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 
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listStudentSuccess.php

示例12: use_helper

<?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) {
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:_edit_project_tasklist.php

示例13: input_hidden_tag

 echo input_hidden_tag('current_path', $current_path);
 ?>
     <?php 
 echo input_hidden_tag('name', $name);
 ?>
     <?php 
 echo input_hidden_tag('type', $type);
 ?>
     <?php 
 echo input_hidden_tag('count', $count);
 ?>
     <?php 
 echo input_tag('new_name', $name);
 ?>
     <?php 
 echo submit_to_remote('rename', __('Rename', array(), 'sfMediaLibrary'), array('url' => 'sfMediaLibrary/rename', 'update' => 'block_' . $count, 'script' => true, 'before' => visual_effect('opacity', 'block_' . $count, array('duration' => '0.5', 'from' => '1.0', 'to' => '0.3')), 'complete' => visual_effect('opacity', 'block_' . $count, array('duration' => '0.5', 'from' => '0.3', 'to' => '1.0'))), 'class=sf_asset_action_rename');
 ?>
       <?php 
 echo button_to_function(__('Cancel', array(), 'sfMediaLibrary'), "Element.hide('edit_" . $count . "');Element.show('view_" . $count . "')");
 ?>
   </form>
 </div>
 <?php 
 echo javascript_tag("Element.hide('edit_" . $count . "');");
 ?>
 <div style="text-align:right">
   <?php 
 echo $size;
 ?>
   <?php 
 echo link_to(image_tag('/sfMediaLibraryPlugin/images/delete.png', array('alt' => __('Delete', array(), 'sfMediaLibrary'), 'title' => __('Delete', array(), 'sfMediaLibrary'), 'align' => 'absmiddle')), 'sfMediaLibrary/' . $delete . '?name=' . $name . '&current_path=' . $current_path, array('confirm' => __('Are you sure to want to delete this ' . $type . '?', array(), 'sfMediaLibrary')));
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:_block.php

示例14: foreach

    $i = 0;
    foreach ($pager->getResults() as $ng_reg_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_period->getAcademicCalendarId()) > 0 ? $ng_reg_period->getAcademicCalendar()->toString() : '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 
        echo link_to_remote(__('detail'), array('url' => 'ng_reg_period/show?id=' . $ng_reg_period->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' => 'ng_reg_period/edit?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) {
开发者ID:taryono,项目名称:school,代码行数:31,代码来源:listSuccess.php

示例15: image_tag

          </form>
          <div style="height:20px">
            <p id="indicator-<?php 
echo $task->getUuid();
?>
" style="display:none">
            	<?php 
echo image_tag('indicator.gif');
?>
 Assigning users...
            </p>
          </div>
          
          <div id="task-status-holder">
          <?php 
echo form_remote_tag(array('update' => 'task-' . $task->getUuid() . '-holder', 'url' => 'project/ajaxSetTaskStatus', 'loading' => "Element.show('indicator-" . $task->getUuid() . "-status')", 'complete' => "Element.hide('indicator-" . $task->getUuid() . "-status');" . visual_effect('highlight', 'task-' . $task->getUuid())));
?>
          		<?php 
echo input_hidden_tag('task', $task->getUuid(), array());
?>
          		<?php 
echo select_tag('task-status', options_for_select(array('2' => 'Pending/In Planning', '1' => 'In Progress', '0' => 'Complete'), $task->getStatus()));
?>
          		<?php 
echo submit_tag('go', array());
?>
          	</form>
          </div>
          <div style="height:20px">
            <p id="indicator-<?php 
echo $task->getUuid();
开发者ID:sgrove,项目名称:cothinker,代码行数:31,代码来源:_edit_task_users.php


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