Commits

Anonymous committed 356df4e

Theme enhancement: automatically switches input text to textarea when held value is too long

Comments (0)

Files changed (2)

admin/themes/paper/repository.php

 <form action="<?php echo current_url(); ?>" method="post" id="form_hgrc" name="form_hgrc">
 	<input type="hidden" name="form_action" id="form_action" value="" />
 	<tr>
-	  <td colspan="3" align="right">
+	  <td colspan="4" align="right">
 	  	<p>
 	  	<a href="<?php echo site_url('hgrepo/browse/'.the_name()); ?>" class="ui-state-default ui-corner-all dialog_link"><span class="ui-icon ui-icon-newwin"></span><?php echo lang('hgphp_action_browse'); ?></a>
 	  	<a href="<?php echo site_url('hgdir'); ?>" id="dialog_link_cancel" class="ui-state-default ui-corner-all dialog_link"><span class="ui-icon"></span><?php print lang('hgphp_action_cancel'); ?></a>
         <th><?php echo htmlentities(section_name()) ?></th> 
         <th></th> 
         <th><a href='<?php echo lang('hgphp_doclink_hgrc') . section_name() ?>' target="_blank"><?php echo lang('hgphp_title_help'); ?></a></th>  
+        <th></th> 
     </tr> 
     
     <?php $parity=0; while(has_items()): the_item(); ?>
       		<option value="false" <?php if(item_dirty_value() == 'false'){echo 'selected="selected"';} ?>>false</option>
       		<option value="true" <?php if(item_dirty_value() == 'true'){echo 'selected="selected"';} ?>>true</option>
       	</select>
+      <?php elseif(strlen(item_dirty_value()) > 70): ?>
+      	<textarea name="hgrc[<?php echo section_name() ?>][<?php echo item_name(); ?>]" style="width:90%" rows="3"><?php echo item_dirty_value(); ?></textarea>
       <?php else: ?>
-        <input type="text" name="hgrc[<?php echo section_name() ?>][<?php echo item_name(); ?>]" value="<?php echo item_dirty_value(); ?>" style="width:70%" size="150"/>
+        <input type="text" name="hgrc[<?php echo section_name() ?>][<?php echo item_name(); ?>]" value="<?php echo item_dirty_value(); ?>" style="width:90%" size="150"/>
       <?php endif; ?> 
+      </nobr>
+      </td>
+      <td style="vertical-align:middle">
       	<?php if(lang('hgphp_tooltip_hgrc_' . section_name() . '_' . item_name()) != FALSE):?>
       	<a href="#" title="<?php echo htmlentities(lang('hgphp_tooltip_hgrc_' . section_name() . '_' . item_name())); ?>" class="ui-state-default ui-corner-all">&nbsp;&nbsp;?&nbsp;&nbsp;</a>
       	<?php endif; ?>
-      </nobr>
+      </td>
       </td>
       <td style="vertical-align:middle;width:40%"><?php echo htmlentities(item_current_value()); ?></td>
     </tr>
     <?php endwhile; endwhile; ?>
  
 	<tr>
-	  <td colspan="3" align="right">
+	  <td colspan="4" align="right">
 	  	<p>
 	  	<a href="<?php echo site_url('hgrepo/browse/'.the_name()); ?>" class="ui-state-default ui-corner-all dialog_link"><span class="ui-icon ui-icon-newwin"></span><?php echo lang('hgphp_action_browse'); ?></a>
 	  	<a href="<?php echo site_url('hgdir'); ?>" id="dialog_link2_cancel" class="ui-state-default ui-corner-all dialog_link"><span class="ui-icon"></span><?php print lang('hgphp_action_cancel'); ?></a>

admin/themes/paper/sidebar.php

 <?php echo form_dropdown('prefs_profile', user_profiles(), current_profile(), 'onchange="javascript:this.form.submit();"'); ?>
 <?php endif; ?>
 </form>
-<li><a href="<?php echo hgserve_url(); ?>"><?php echo lang('hgphp_title_listingshome'); ?></a></li> 
+<li><a href="<?php echo hgserve_url(); ?>" target="_blank"><?php echo lang('hgphp_title_listingshome'); ?></a></li> 
 </ul> 
 <ul>