Changeset 965
- Timestamp:
- 08/19/08 07:33:15 (3 months ago)
- Files:
-
- trunk/CrossPoster/plugins/CrossPoster/config.yaml (modified) (3 diffs)
- trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/App/CMS.pm (modified) (3 diffs)
- trunk/CrossPoster/plugins/CrossPoster/tmpl/edit_account.tmpl (modified) (6 diffs)
- trunk/CrossPoster/plugins/CrossPoster/tmpl/list_account.tmpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CrossPoster/plugins/CrossPoster/config.yaml
r964 r965 25 25 label: Vox URL 26 26 hint: A URL to your Vox blog 27 default: http:// 27 28 MovableType: 28 29 class: CrossPoster::Connector::MovableType … … 35 36 url: 36 37 label: Blog URL 37 hint: A URL to your Movable Type blog 38 hint: A URL to your Movable Type blog 39 default: http:// 38 40 LiveJournal: 39 41 class: CrossPoster::Connector::LiveJournal … … 67 69 list_filters: 68 70 crossposter_account: $CrossPoster::CrossPoster::App::CMS::load_crossposter_list_filters 71 callbacks: 72 template_source.cfg_content_nav: $CrossPoster::CrossPoster::App::CMS::_cfg_content_nav 73 template_param.edit_entry: $CrossPoster::CrossPoster::App::CMS::_edit_entry_param trunk/CrossPoster/plugins/CrossPoster/lib/CrossPoster/App/CMS.pm
r964 r965 95 95 $row->{key} = $key; 96 96 delete $row->{plugin}; 97 foreach my $k (keys %$row) { 98 my $value = $row->{$k}; 99 if (ref($value) eq 'CODE') { # handle coderefs 100 $value = $value->(@_); 101 } 102 $row->{$k} = $value; 103 } 97 _registry_code_value($row); 104 98 push @connectors_loop, $row; 105 99 } … … 116 110 $old = quotemeta($old); 117 111 my $new = <<HTML; 118 <li<mt:if name="crossposting_accounts"> class="active"</mt:if>><a href="<mt:var name="script_url">?__mode=list_crossposting_account&blog_id=<mt:var name="blog_id">">< __trans phrase="Crossposting"></a></li>112 <li<mt:if name="crossposting_accounts"> class="active"</mt:if>><a href="<mt:var name="script_url">?__mode=list_crossposting_account&blog_id=<mt:var name="blog_id">"><b><__trans phrase="Crossposting"></b></a></li> 119 113 HTML 120 114 … … 412 406 } 413 407 408 # Recursively loop through a registry hashref and if the value is a coderef, 409 # execute it so that we get a value 410 sub _registry_code_value { 411 my ($hash) = @_; 412 413 foreach my $key (keys %$hash) { 414 if(ref $hash->{$key} eq 'HASH') { 415 _registry_code_value($hash->{$key}) 416 } elsif(ref $hash->{$key} eq 'CODE') { 417 $hash->{$key} = $hash->{$key}->(); 418 } 419 } 420 } 421 414 422 1; trunk/CrossPoster/plugins/CrossPoster/tmpl/edit_account.tmpl
r938 r965 8 8 9 9 <style type="text/css"> 10 .dialog-4 #container, .dialog-4 #content { overflow: visible; }11 .dialog-4 .actions-bar { position: static;}10 .field-content { margin-left: 130px; } 11 .threequarter-width { width: 75%; } 12 12 </style> 13 13 <script type="text/javascript"> … … 57 57 } 58 58 59 if(!connector.username_label)60 connector.username_label = '<__trans phrase="Username">';61 62 if(!connector.password_label)63 connector.password_label = '<__trans phrase="Password">';64 65 if(!connector.url_label)66 connector.url_label = '<__trans phrase="Blog URL">';67 68 59 var fields = new Array('username', 'password', 'url'); 69 60 70 61 for (var i = 0; i < fields.length; i++) { 71 62 var field = fields[i]; 72 var required = field + '_required'; 73 var label = field + '_label'; 74 var hint = field + '_hint'; 75 76 if(connector[required]) { 77 show(field + '-field'); 78 79 if(connector[label]) 80 getByID(field + '-label').innerHTML = connector[label]; 81 82 if(connector[hint]) 83 DOM.getElementsByClassName(getByID(field + '-field'), 'hint')[0].innerHTML = connector[hint]; 84 63 64 if(connector[field]) { 65 show(field + '-field'); 66 67 if(connector[field].label) 68 getByID(field + '-label').innerHTML = connector[field].label; 69 70 DOM.getElementsByClassName(getByID(field + '-field'), 'hint')[0].innerHTML = (connector[field].hint || ''); 71 72 <mt:unless name="id">getByID(field).value = (connector[field].default || '');</mt:unless> 73 85 74 } else { 86 hide(field + '-field');75 hide(field + '-field'); 87 76 } 88 77 } … … 142 131 show_hint="0"> 143 132 144 <input type="text" name="name" value="<mt:var name="name">" id="name" class=" full-width" />133 <input type="text" name="name" value="<mt:var name="name">" id="name" class="threequarter-width" /> 145 134 146 135 </mtapp:setting> … … 152 141 show_hint="1"> 153 142 154 <input type="text" name="username" value="<mt:var name="username">" id="username" class=" full-width" />143 <input type="text" name="username" value="<mt:var name="username">" id="username" class="threequarter-width" /> 155 144 156 145 </mtapp:setting> … … 162 151 show_hint="1"> 163 152 164 <input type="password" name="passwd" value="<mt:var name="passwd">" id="password" class=" full-width" />153 <input type="password" name="passwd" value="<mt:var name="passwd">" id="password" class="threequarter-width" /> 165 154 166 155 <br /><a href="#" onclick="revealPassword();"><__trans phrase="Reveal Password"></a> … … 174 163 show_hint="1"> 175 164 176 <input type="text" name="url" value="<mt:var name="url">" id="url" class=" full-width" />165 <input type="text" name="url" value="<mt:var name="url">" id="url" class="threequarter-width" /> 177 166 178 167 </mtapp:setting> trunk/CrossPoster/plugins/CrossPoster/tmpl/list_account.tmpl
r938 r965 51 51 //--> 52 52 </script> 53 <style type="text/css"> 54 .content-nav #content-header #create-new-link { 55 margin-left: 140px; 56 padding-left: 20px; 57 } 58 </style> 53 59 </mt:setvarblock> 54 60 <mt:setvarblock name="list_filter_form"> … … 77 83 <mt:include name="include/cfg_content_nav.tmpl"> 78 84 </mt:setvarblock> 85 <mt:setvarblock name="content_header"> 86 <p id="create-new-link"><a href="#" onclick="return openDialog(this.form, 'edit_crossposting_account', 'blog_id=<mt:var name="blog_id">')" class="icon-left icon-create"><__trans phrase="New Crossposting Account"></a></p> 87 </mt:setvarblock> 79 88 <mt:include name="include/header.tmpl"> 80 81 <p><a href="#" onclick="return openDialog(this.form, 'edit_crossposting_account', 'blog_id=<mt:var name="blog_id">')" class="icon-left icon-create"><__trans phrase="New Crossposting Account"></a></p>82 89 83 90 <mt:var name="list_filter_form">
