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


PHP label_tag函数代码示例

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


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

示例1: render

 /**
  * Render form control
  *
  * @param string $control_name
  * @return string
  */
 function render($control_name)
 {
     $value = $this->getValue();
     $dimensions = Dimensions::instance()->findAll();
     $permission_group_ids = ContactPermissionGroups::getPermissionGroupIdsByContactCSV(logged_user()->getId(), false);
     $out = '';
     foreach ($dimensions as $dim) {
         /* @var $dim Dimension */
         if ($dim->getOptions(1) && isset($dim->getOptions(1)->hidden) && $dim->getOptions(1)->hidden) {
             continue;
         }
         if (!$dim->getDefinesPermissions() || !$dim->deniesAllForContact($permission_group_ids)) {
             if (array_search($dim->getId(), $value) !== false) {
                 $checked = 1;
             } else {
                 $checked = 0;
             }
             $out .= '<div class="dimension" >';
             $out .= label_tag($dim->getName(), null, false, array('style' => 'display:inline;margin:10px;vertical-align:super;'));
             $out .= checkbox_field($control_name . '[' . $dim->getId() . ']', $checked);
             $out .= '</div >';
         }
     }
     $out .= '<input type="hidden" name="' . $control_name . '[0]" value=" ">';
     return $out;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:32,代码来源:RootDimensionsConfigHandler.class.php

示例2: smarty_function_with_successive_milestones

/**
 * with_successive_milestones helper
 *
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_with_successive_milestones($params, &$smarty)
{
    static $counter = 1;
    $name = array_var($params, 'name');
    if (empty($name)) {
        return new InvalidParamError('name', $name, '$name value is required', true);
    }
    // if
    $milestone = array_var($params, 'milestone');
    if (!instance_of($milestone, 'Milestone')) {
        return new InvalidParamError('milestone', $milestone, '$milestone value is expected to be an instance of Milestone class', true);
    }
    // if
    $id = array_var($params, 'id');
    if (empty($id)) {
        $id = 'with_successive_milestones_' . $counter;
        $counter++;
    }
    // if
    $value = array_var($params, 'value');
    $action = array_var($value, 'action', 'dont_move');
    $milestones = array_var($value, 'milestones');
    if (!is_array($milestones)) {
        $milestones = array();
    }
    // if
    $logged_user = $smarty->get_template_vars('logged_user');
    $successive_milestones = Milestones::findSuccessiveByMilestone($milestone, STATE_VISIBLE, $logged_user->getVisibility());
    if (!is_foreachable($successive_milestones)) {
        return '<p class="details">' . lang('This milestone does not have any successive milestones') . '</p>';
    }
    // if
    $result = "<div class=\"with_successive_milestones\">\n<div class=\"options\">\n";
    $options = array('dont_move' => lang("Don't change anything"), 'move_all' => lang('Adjust all successive milestone by the same number of days'), 'move_selected' => lang('Adjust only selected successive milestones by the same number of days'));
    foreach ($options as $k => $v) {
        $radio = radio_field($name . '[action]', $k == $action, array('value' => $k, 'id' => $id . '_' . $k));
        $label = label_tag($v, $id . '_' . $k, false, array('class' => 'inline'), '');
        $result .= '<span class="block">' . $radio . ' ' . $label . "</span>\n";
    }
    // if
    $result .= "</div>\n<div class=\"successive_milestones\">";
    foreach ($successive_milestones as $successive_milestone) {
        $input_attributes = array('name' => $name . '[milestones][]', 'id' => $id . '_milestones_' . $successive_milestone->getId(), 'type' => 'checkbox', 'value' => $successive_milestone->getId(), 'class' => 'auto');
        if (in_array($successive_milestone->getId(), $milestones)) {
            $input_attributes['checked'] = true;
        }
        // if
        $input = open_html_tag('input', $input_attributes, true);
        $label = label_tag($successive_milestone->getName(), $id . '_milestones_' . $successive_milestone->getId(), false, array('class' => 'inline'), '');
        $result .= '<span class="block">' . $input . ' ' . $label . "</span>\n";
    }
    // foreach
    $result .= "</div>\n</div>\n";
    return $result;
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:62,代码来源:function.with_successive_milestones.php

示例3: render

 /**
  * Render form control
  *
  * @param string $control_name        	
  * @return string
  */
 function render($control_name)
 {
     $value = $this->getValue();
     $fields = array('street', 'city', 'state', 'zip_code', 'country');
     $out = '';
     foreach ($fields as $field) {
         $checked = array_search($field, $value) !== false;
         $out .= '<div class="checkbox-config-option">';
         $out .= label_tag(lang($field));
         $out .= checkbox_field($control_name . '[' . $field . ']', $checked);
         $out .= '</div>';
     }
     $out .= '<div class="clear"></div>';
     return $out;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:21,代码来源:AddressFieldsConfigHandler.class.php

示例4: render

 function render($control_name)
 {
     $genid = gen_id();
     $object_types = ObjectTypes::getAvailableObjectTypes();
     $value = $this->getValue();
     $out = '';
     foreach ($object_types as $ot) {
         $checked = array_search($ot->getId(), $value) !== false;
         $out .= '<div  class="checkbox-config-option">';
         $out .= label_tag(lang($ot->getName()), $genid . '_' . $control_name . '_' . $ot->getId(), false, array('style' => 'cursor:pointer;'), '');
         $out .= checkbox_field($control_name . '[' . $ot->getId() . ']', $checked, array('id' => $genid . '_' . $control_name . '_' . $ot->getId()));
         $out .= '</div >';
     }
     $out .= '<input type="hidden" name="' . $control_name . '[0]" value=" "><div class="clear"></div>';
     return $out;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:16,代码来源:MultipleObjectTypeConfigHandler.class.php

示例5: render

 function render($control_name)
 {
     $genid = gen_id();
     $object_types = ObjectTypes::getAvailableObjectTypesWithDimensionObjects(" AND `name` IN ('task', 'project', 'sample')");
     $value = $this->getValue();
     $out = '';
     foreach ($object_types as $ot) {
         $checked = array_search($ot->getId(), $value) !== false;
         $out .= '<div style="float:left; margin-right: 15px; min-width: 130px;">';
         $out .= label_tag(lang($ot->getName()), $genid . '_' . $control_name . '_' . $ot->getId(), false, array('style' => 'cursor:pointer;'), '');
         $out .= checkbox_field($control_name . '[' . $ot->getId() . ']', $checked, array('id' => $genid . '_' . $control_name . '_' . $ot->getId()));
         $out .= '</div >';
     }
     $out .= '<input type="hidden" name="' . $control_name . '[0]" value=" "><div class="clear"></div>';
     return $out;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:16,代码来源:MultipleObjectTypePrefixConfigHandler.class.php

示例6: render

 function render($control_name)
 {
     $genid = gen_id();
     $groups = PermissionGroups::findAll(array('conditions' => "`type`='roles' AND `parent_id`>0"));
     $value = $this->getValue();
     $out = '';
     foreach ($groups as $group) {
         /* @var $dim Dimension */
         $checked = array_search($group->getId(), $value) !== false;
         $out .= '<div class="checkbox-config-option">';
         $out .= label_tag($group->getName(), $genid . '_' . $control_name . '_' . $group->getId(), false, array('style' => 'cursor:pointer;'), '');
         $out .= checkbox_field($control_name . '[' . $group->getId() . ']', $checked, array('id' => $genid . '_' . $control_name . '_' . $group->getId()));
         $out .= '</div >';
     }
     $out .= '<input type="hidden" name="' . $control_name . '[0]" value=" "><div class="clear"></div>';
     return $out;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:17,代码来源:UserTypeMultipleConfigHandler.class.php

示例7: render

   /**
    * Render form control
    *
    * @param string $control_name
    * @return string
    */
    function render($control_name) {
       $value =  $this->getValue();
       $dimensions  = Dimensions::instance()->findAll();
       $permission_group_ids = ContactPermissionGroups::getPermissionGroupIdsByContactCSV(logged_user()->getId(),false);
       $out = '' ;
       foreach ($dimensions as $dim) { /* @var $dim Dimension */
			if ( $dim->getOptions(1) && isset($dim->getOptions(1)->hidden) && $dim->getOptions(1)->hidden ) {
				continue ;
			}
       		if (!$dim->getDefinesPermissions() || !$dim->deniesAllForContact($permission_group_ids)) {
	       		if  (array_search($dim->getId(), $value) !== false ){
	       			$checked = 1 ; 	
	       		}else{
	       			$checked = 0 ;
	       		}
	       		$out.='<div class="dimension" >';
	       		$out.=label_tag($dim->getName());
	       		$out.=checkbox_field($control_name.'['.$dim->getId().']',$checked );
	       		$out.='</div >';
       		}
       }
	   return $out ;	 
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:RootDimensionsConfigHandler.class.php

示例8: label_tag

}
?>

  <div>
    <?php 
echo label_tag(lang('email address'), 'profileFormEmail', true);
?>
    <?php 
echo text_field('user[email]', array_var($user_data, 'email'), array('id' => 'profileFormEmail', 'tabindex' => '2700', 'class' => 'long'));
?>
  </div>
  
  
  <div>
    <?php 
echo label_tag(lang('user title'), 'profileFormTitle');
?>
    <?php 
echo text_field('user[title]', array_var($user_data, 'title'), array('id' => 'profileFormTitle', 'tabindex' => '2800'));
?>
  </div>
  
  	<?php 
if ($cps > 0) {
    ?>
  	<div id='<?php 
    echo $genid;
    ?>
add_custom_properties_div' style="">
		<fieldset>
			<legend><?php 
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:edit_profile.php

示例9: select_workspaces

?>
</h2></th>
	</tr>
	<tr>
	<td style="padding: 5px;"></td>
	<td style="padding: 5px;">
	<?php 
echo select_workspaces("ws_ids", null, $selected, $genid);
?>
	</td>
	<td style="padding: 5px;">  
<?php 
echo "<p>" . lang("assign contact to workspace desc") . "</p><br />";
foreach ($projects as $project) {
    echo '<div id="role_' . $project->getId() . '_' . $genid . '" style="display:none">';
    echo label_tag(lang("role"), null, false, array("style" => "display:inline;padding-right:10px"));
    echo text_field("contact[role_pid_" . $project->getId() . "]", array_var($contact_data, 'role_pid_' . $project->getId()), array('tabindex' => '20'));
    echo '</div>';
}
?>
	
	</td>
</table>
<?php 
echo submit_button(lang('update contact'));
?>
</div>
</div>


</form>
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:assign_to_project.php

示例10: form_tag

if (!isset($_REQUEST['input_format'])) {
    $_REQUEST['input_format'] = 'guess';
}
// Display the form, if raw option isn't set
if (!isset($_REQUEST['raw'])) {
    print "<html>\n";
    print "<head><title>EasyRdf Converter</title></head>\n";
    print "<body>\n";
    print "<h1>EasyRdf Converter</h1>\n";
    print "<div style='margin: 10px'>\n";
    print form_tag();
    print label_tag('data', 'Input Data: ') . '<br />' . text_area_tag('data', '', array('cols' => 80, 'rows' => 10)) . "<br />\n";
    print label_tag('uri', 'or Uri: ') . text_field_tag('uri', 'http://www.dajobe.org/foaf.rdf', array('size' => 80)) . "<br />\n";
    print label_tag('input_format', 'Input Format: ') . select_tag('input_format', $input_format_options) . "<br />\n";
    print label_tag('output_format', 'Output Format: ') . select_tag('output_format', $output_format_options) . "<br />\n";
    print label_tag('raw', 'Raw Output: ') . check_box_tag('raw') . "<br />\n";
    print reset_tag() . submit_tag();
    print form_end_tag();
    print "</div>\n";
}
if (isset($_REQUEST['uri']) or isset($_REQUEST['data'])) {
    // Parse the input
    $graph = new EasyRdf_Graph($_REQUEST['uri']);
    if (empty($_REQUEST['data'])) {
        $graph->load($_REQUEST['uri'], $_REQUEST['input_format']);
    } else {
        $graph->parse($_REQUEST['data'], $_REQUEST['input_format'], $_REQUEST['uri']);
    }
    // Lookup the output format
    $format = EasyRdf_Format::getFormat($_REQUEST['output_format']);
    // Serialise to the new output format
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:converter.php

示例11: tpl_display

<?php 
tpl_display(get_template_path('form_errors'));
?>
  
    <div>
      <?php 
echo label_tag(lang('massmailer subject'), 'massmailerFormRecipient', true);
?>
      <?php 
echo text_field('massmailer[subject]', array_var($massmailer_data, 'subject'), array('id' => 'massmailerFormRecipient', 'class' => 'title'));
?>
    </div>
    
    <div>
      <?php 
echo label_tag(lang('massmailer message'), 'massmailerFormMessage', true);
?>
      <?php 
echo textarea_field('massmailer[message]', array_var($massmailer_data, 'message'), array('id' => 'massmailerFormMessage', 'class' => 'editor'));
?>
    </div>
    
    <h2><?php 
echo lang('massmailer recipients');
?>
</h2>
    
<?php 
foreach ($grouped_users as $company_name => $company_details) {
    $company_id = $company_details['details']->getId();
    ?>
开发者ID:ukd1,项目名称:Project-Pier,代码行数:31,代码来源:tool_mass_mailer.php

示例12: label_tag

  <div>
    <?php 
echo label_tag(lang('password again'), 'adminPasswordA', true);
?>
    <?php 
echo password_field('form[admin_password_a]', null, array('id' => 'adminPasswordA', 'class' => 'medium'));
?>
  </div>
  
  <h2><?php 
echo lang('company');
?>
</h2>
  
  <div>
    <?php 
echo label_tag(lang('name'), 'companyName', true);
?>
    <?php 
echo text_field('form[company_name]', array_var($form_data, 'company_name'), array('id' => 'companyName', 'class' => 'long'));
?>
  </div>
  
  <input type="hidden" name="form[submitted]" value="submitted" />
  
  <?php 
echo submit_button('submit');
?>
  
</form>
开发者ID:469306621,项目名称:Languages,代码行数:30,代码来源:complete_installation.php

示例13: tpl_display

<form action="<?php 
    echo $folder->getEditUrl();
    ?>
" method="post">
<?php 
}
// if
?>

<?php 
tpl_display(get_template_path('form_errors'));
?>
  
  <div>
    <?php 
echo label_tag(lang('name'), 'folderFormName');
?>
    <?php 
echo text_field('folder[name]', array_var($folder_data, 'name'), array('id' => 'folderFormName'));
?>
  </div>
  
  <?php 
echo submit_button($folder->isNew() ? lang('add folder') : lang('edit folder'));
?>
 <a href="<?php 
echo get_url('files');
?>
"><?php 
echo lang('cancel');
?>
开发者ID:469306621,项目名称:Languages,代码行数:31,代码来源:add_folder.php

示例14: radio_field

echo radio_field('load[what]', true, array('value' => 'locale', 'id' => 'loadFormWhatLocale'));
?>
    <?php 
echo label_tag(lang('locale'), 'loadFormLocale', false);
?>
    <?php 
echo select_locale('load[locale]', array_var($load_data, 'locales1'), array('value' => 'existing', 'id' => 'loadFormLocale'));
?>
  </div>

  <div>
    <?php 
echo radio_field('load[what]', false, array('value' => 'file', 'id' => 'loadFormWhatFile'));
?>
    <?php 
echo label_tag(lang('files'), 'loadFormFile', false);
?>
    <?php 
echo select_locale('load[file]', array_var($load_data, 'locales2'), array('id' => 'loadFormFile'));
?>
  </div>
  </fieldset>

  <p><?php 
echo lang('maximum execution time', $load_data['max_time']) . ' ' . $load_data['max_time'] . ' seconds';
?>
</p>

  <?php 
echo submit_button(lang('load'));
?>
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:load_values.php

示例15: label_tag

">
      <?php 
            echo label_tag(lang($page_attachment->getObjectLangName()), 'project[page_attachments][' . $page_attachment->getId() . '][label]', false, array('class' => 'checkbox'));
            ?>
      <?php 
            echo $page_attachment->render('project[page_attachments][' . $page_attachment->getId() . '][text]');
            ?>
      <?php 
            echo $page_attachment->renderControl('project[page_attachments][' . $page_attachment->getId() . '][rel_object_id]');
            ?>
      <?php 
            echo text_field('project[page_attachments][' . $page_attachment->getId() . '][order]', $page_attachment->getOrder(), array('class' => 'short pageAttachmentOrder'));
            ?>
      <span class="pageAttachmentDeleteBlock">
      <?php 
            echo label_tag(lang('delete'), 'project[page_attachments][' . $page_attachment->getId() . '][delete]', false, array('class' => 'checkbox'));
            ?>
      <?php 
            echo checkbox_field('project[page_attachments][' . $page_attachment->getId() . '][delete]', false, array('class' => 'checkbox pageAttachmentDelete', 'id' => 'project[page_attachments][' . $page_attachment->getId() . '][delete]'));
            ?>
      <input type="hidden" name="<?php 
            echo 'project[page_attachments][' . $page_attachment->getId() . '][rel_object_manager]';
            ?>
" value="<?php 
            echo $page_attachment->getRelObjectManager();
            ?>
"/>
      </span>
      <div class="clear"></div>
    </div>
    <div class="attachmentActions">
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:add_project.php


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