doc/app/classes/Cms/SectionsController.html in browsercms-3.0.6 vs doc/app/classes/Cms/SectionsController.html in browsercms-3.1.0

- old
+ new

@@ -86,25 +86,26 @@ <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000648">cms_groups</a>&nbsp;&nbsp; - <a href="#M000638">create</a>&nbsp;&nbsp; - <a href="#M000641">destroy</a>&nbsp;&nbsp; - <a href="#M000639">edit</a>&nbsp;&nbsp; - <a href="#M000643">file_browser</a>&nbsp;&nbsp; - <a href="#M000645">handle_file_browser_upload</a>&nbsp;&nbsp; - <a href="#M000635">index</a>&nbsp;&nbsp; - <a href="#M000644">load_parent</a>&nbsp;&nbsp; - <a href="#M000642">move</a>&nbsp;&nbsp; - <a href="#M000637">new</a>&nbsp;&nbsp; - <a href="#M000647">public_groups</a>&nbsp;&nbsp; - <a href="#M000646">render_file_browser</a>&nbsp;&nbsp; - <a href="#M000649">set_toolbar_tab</a>&nbsp;&nbsp; - <a href="#M000636">show</a>&nbsp;&nbsp; - <a href="#M000640">update</a>&nbsp;&nbsp; + <a href="#M000695">cms_groups</a>&nbsp;&nbsp; + <a href="#M000684">create</a>&nbsp;&nbsp; + <a href="#M000687">destroy</a>&nbsp;&nbsp; + <a href="#M000685">edit</a>&nbsp;&nbsp; + <a href="#M000689">file_browser</a>&nbsp;&nbsp; + <a href="#M000692">handle_file_browser_upload</a>&nbsp;&nbsp; + <a href="#M000681">index</a>&nbsp;&nbsp; + <a href="#M000690">load_parent</a>&nbsp;&nbsp; + <a href="#M000691">load_section</a>&nbsp;&nbsp; + <a href="#M000688">move</a>&nbsp;&nbsp; + <a href="#M000683">new</a>&nbsp;&nbsp; + <a href="#M000694">public_groups</a>&nbsp;&nbsp; + <a href="#M000693">render_file_browser</a>&nbsp;&nbsp; + <a href="#M000696">set_toolbar_tab</a>&nbsp;&nbsp; + <a href="#M000682">show</a>&nbsp;&nbsp; + <a href="#M000686">update</a>&nbsp;&nbsp; </div> </div> </div> @@ -122,57 +123,57 @@ <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000638" class="method-detail"> - <a name="M000638"></a> + <div id="method-M000684" class="method-detail"> + <a name="M000684"></a> <div class="method-heading"> - <a href="#M000638" class="method-signature"> + <a href="#M000684" class="method-signature"> <span class="method-name">create</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000638-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000638-source"> + onclick="toggleCode('M000684-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000684-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 22</span> -22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> -23: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>]) -24: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@parent</span> -25: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">save</span> -26: <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-node">&quot;Section '#{@section.name}' was created&quot;</span> -27: <span class="ruby-identifier">redirect_to</span> [<span class="ruby-identifier">:cms</span>, <span class="ruby-ivar">@section</span>] -28: <span class="ruby-keyword kw">else</span> -29: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'new'</span> -30: <span class="ruby-keyword kw">end</span> -31: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 23</span> +23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> +24: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>]) +25: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@parent</span> +26: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">groups</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">able_to?</span>(<span class="ruby-identifier">:administrate</span>) +27: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">save</span> +28: <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-node">&quot;Section '#{@section.name}' was created&quot;</span> +29: <span class="ruby-identifier">redirect_to</span> [<span class="ruby-identifier">:cms</span>, <span class="ruby-ivar">@section</span>] +30: <span class="ruby-keyword kw">else</span> +31: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'new'</span> +32: <span class="ruby-keyword kw">end</span> +33: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000641" class="method-detail"> - <a name="M000641"></a> + <div id="method-M000687" class="method-detail"> + <a name="M000687"></a> <div class="method-heading"> - <a href="#M000641" class="method-signature"> + <a href="#M000687" class="method-signature"> <span class="method-name">destroy</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000641-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000641-source"> + onclick="toggleCode('M000687-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000687-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 48</span> -48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span> -49: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]) + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 49</span> +49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span> 50: <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span> 51: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">deletable?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">destroy</span> 52: <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Section '#{@section.name}' was deleted.&quot;</span> 53: <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-identifier">message</span>; <span class="ruby-identifier">redirect_to</span>(<span class="ruby-identifier">cms_sitemap_url</span>) } 54: <span class="ruby-identifier">format</span>.<span class="ruby-identifier">json</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:json</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-identifier">:success</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:message</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">message</span> } } @@ -186,343 +187,366 @@ </pre> </div> </div> </div> - <div id="method-M000639" class="method-detail"> - <a name="M000639"></a> + <div id="method-M000685" class="method-detail"> + <a name="M000685"></a> <div class="method-heading"> - <a href="#M000639" class="method-signature"> + <a href="#M000685" class="method-signature"> <span class="method-name">edit</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000639-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000639-source"> + onclick="toggleCode('M000685-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000685-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 33</span> -33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">edit</span> -34: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]) -35: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Cms</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AccessDenied</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">able_to_edit?</span>(<span class="ruby-ivar">@section</span>) + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 35</span> +35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">edit</span> 36: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000643" class="method-detail"> - <a name="M000643"></a> + <div id="method-M000689" class="method-detail"> + <a name="M000689"></a> <div class="method-heading"> - <a href="#M000643" class="method-signature"> + <a href="#M000689" class="method-signature"> <span class="method-name">file_browser</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000643-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000643-source"> + onclick="toggleCode('M000689-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000689-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 72</span> -72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_browser</span> -73: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find_by_name_path</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:CurrentFolder</span>]) -74: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">post?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>] -75: <span class="ruby-identifier">handle_file_browser_upload</span> -76: <span class="ruby-keyword kw">else</span> -77: <span class="ruby-identifier">render_file_browser</span> -78: <span class="ruby-keyword kw">end</span> -79: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 71</span> +71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_browser</span> +72: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find_by_name_path</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:CurrentFolder</span>]) +73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">post?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>] +74: <span class="ruby-identifier">handle_file_browser_upload</span> +75: <span class="ruby-keyword kw">else</span> +76: <span class="ruby-identifier">render_file_browser</span> +77: <span class="ruby-keyword kw">end</span> +78: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000635" class="method-detail"> - <a name="M000635"></a> + <div id="method-M000681" class="method-detail"> + <a name="M000681"></a> <div class="method-heading"> - <a href="#M000635" class="method-signature"> + <a href="#M000681" class="method-signature"> <span class="method-name">index</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000635-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000635-source"> + onclick="toggleCode('M000681-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000681-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 9</span> - 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span> -10: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">cms_sitemap_path</span> -11: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 10</span> +10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span> +11: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">cms_sitemap_path</span> +12: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000642" class="method-detail"> - <a name="M000642"></a> + <div id="method-M000688" class="method-detail"> + <a name="M000688"></a> <div class="method-heading"> - <a href="#M000642" class="method-signature"> + <a href="#M000688" class="method-signature"> <span class="method-name">move</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000642-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000642-source"> + onclick="toggleCode('M000688-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000688-source"> <pre> <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 63</span> 63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move</span> -64: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]) -65: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>] -66: <span class="ruby-ivar">@move_to</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>]) -67: <span class="ruby-keyword kw">else</span> -68: <span class="ruby-ivar">@move_to</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">first</span> -69: <span class="ruby-keyword kw">end</span> -70: <span class="ruby-keyword kw">end</span> +64: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>] +65: <span class="ruby-ivar">@move_to</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>]) +66: <span class="ruby-keyword kw">else</span> +67: <span class="ruby-ivar">@move_to</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">first</span> +68: <span class="ruby-keyword kw">end</span> +69: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000637" class="method-detail"> - <a name="M000637"></a> + <div id="method-M000683" class="method-detail"> + <a name="M000683"></a> <div class="method-heading"> - <a href="#M000637" class="method-signature"> + <a href="#M000683" class="method-signature"> <span class="method-name">new</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000637-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000637-source"> + onclick="toggleCode('M000683-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000683-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 17</span> -17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new</span> -18: <span class="ruby-ivar">@section</span> = <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">sections</span>.<span class="ruby-identifier">build</span> -19: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-identifier">public_groups</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">cms_groups</span> -20: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 18</span> +18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new</span> +19: <span class="ruby-ivar">@section</span> = <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">sections</span>.<span class="ruby-identifier">build</span> +20: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">groups</span> = <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">groups</span> +21: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000636" class="method-detail"> - <a name="M000636"></a> + <div id="method-M000682" class="method-detail"> + <a name="M000682"></a> <div class="method-heading"> - <a href="#M000636" class="method-signature"> + <a href="#M000682" class="method-signature"> <span class="method-name">show</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000636-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000636-source"> + onclick="toggleCode('M000682-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000682-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 13</span> -13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span> -14: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">cms_sitemap_path</span> -15: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 14</span> +14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span> +15: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">cms_sitemap_path</span> +16: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000640" class="method-detail"> - <a name="M000640"></a> + <div id="method-M000686" class="method-detail"> + <a name="M000686"></a> <div class="method-heading"> - <a href="#M000640" class="method-signature"> + <a href="#M000686" class="method-signature"> <span class="method-name">update</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000640-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000640-source"> + onclick="toggleCode('M000686-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000686-source"> <pre> <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 38</span> 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span> -39: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]) -40: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>]) -41: <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-node">&quot;Section '#{@section.name}' was updated&quot;</span> -42: <span class="ruby-identifier">redirect_to</span> [<span class="ruby-identifier">:cms</span>, <span class="ruby-ivar">@section</span>] -43: <span class="ruby-keyword kw">else</span> -44: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'edit'</span> -45: <span class="ruby-keyword kw">end</span> -46: <span class="ruby-keyword kw">end</span> +39: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'group_ids'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">able_to?</span>(<span class="ruby-identifier">:administrate</span>) +40: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section</span>] +41: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">save</span> +42: <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-node">&quot;Section '#{@section.name}' was updated&quot;</span> +43: <span class="ruby-identifier">redirect_to</span> [<span class="ruby-identifier">:cms</span>, <span class="ruby-ivar">@section</span>] +44: <span class="ruby-keyword kw">else</span> +45: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'edit'</span> +46: <span class="ruby-keyword kw">end</span> +47: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <h3 class="section-bar">Protected Instance methods</h3> - <div id="method-M000648" class="method-detail"> - <a name="M000648"></a> + <div id="method-M000695" class="method-detail"> + <a name="M000695"></a> <div class="method-heading"> - <a href="#M000648" class="method-signature"> + <a href="#M000695" class="method-signature"> <span class="method-name">cms_groups</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000648-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000648-source"> + onclick="toggleCode('M000695-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000695-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 118</span> -118: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cms_groups</span> -119: <span class="ruby-ivar">@cms_groups</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">cms_access</span>.<span class="ruby-identifier">all</span>(<span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;groups.name&quot;</span>) -120: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 123</span> +123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cms_groups</span> +124: <span class="ruby-ivar">@cms_groups</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">cms_access</span>.<span class="ruby-identifier">all</span>(<span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;groups.name&quot;</span>) +125: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000645" class="method-detail"> - <a name="M000645"></a> + <div id="method-M000692" class="method-detail"> + <a name="M000692"></a> <div class="method-heading"> - <a href="#M000645" class="method-signature"> + <a href="#M000692" class="method-signature"> <span class="method-name">handle_file_browser_upload</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000645-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000645-source"> + onclick="toggleCode('M000692-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000692-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 86</span> -86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_file_browser_upload</span> -87: <span class="ruby-keyword kw">begin</span> -88: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:Type</span>].<span class="ruby-identifier">downcase</span> -89: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span> -90: <span class="ruby-constant">FileBlock</span>.<span class="ruby-identifier">create!</span>(<span class="ruby-identifier">:section</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@section</span>, <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>]) -91: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;image&quot;</span> -92: <span class="ruby-constant">ImageBlock</span>.<span class="ruby-identifier">create!</span>(<span class="ruby-identifier">:section</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@section</span>, <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>]) -93: <span class="ruby-keyword kw">end</span> -94: <span class="ruby-identifier">result</span> = <span class="ruby-value str">&quot;0&quot;</span> -95: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> -96: <span class="ruby-identifier">result</span> = <span class="ruby-node">&quot;1,'#{escape_javascript(e.message)}'&quot;</span> -97: <span class="ruby-keyword kw">end</span> -98: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">%Q{&lt;script type=&quot;text/javascript&quot;&gt;window.parent.frames['frmUpload'].OnUploadCompleted(#{result});&lt;/script&gt;}</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span> -99: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 91</span> + 91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_file_browser_upload</span> + 92: <span class="ruby-keyword kw">begin</span> + 93: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:Type</span>].<span class="ruby-identifier">downcase</span> + 94: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span> + 95: <span class="ruby-constant">FileBlock</span>.<span class="ruby-identifier">create!</span>(<span class="ruby-identifier">:section</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@section</span>, <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>]) + 96: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;image&quot;</span> + 97: <span class="ruby-constant">ImageBlock</span>.<span class="ruby-identifier">create!</span>(<span class="ruby-identifier">:section</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@section</span>, <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:NewFile</span>]) + 98: <span class="ruby-keyword kw">end</span> + 99: <span class="ruby-identifier">result</span> = <span class="ruby-value str">&quot;0&quot;</span> +100: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span> +101: <span class="ruby-identifier">result</span> = <span class="ruby-node">&quot;1,'#{escape_javascript(e.message)}'&quot;</span> +102: <span class="ruby-keyword kw">end</span> +103: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">%Q{&lt;script type=&quot;text/javascript&quot;&gt;window.parent.frames['frmUpload'].OnUploadCompleted(#{result});&lt;/script&gt;}</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span> +104: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000644" class="method-detail"> - <a name="M000644"></a> + <div id="method-M000690" class="method-detail"> + <a name="M000690"></a> <div class="method-heading"> - <a href="#M000644" class="method-signature"> + <a href="#M000690" class="method-signature"> <span class="method-name">load_parent</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000644-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000644-source"> + onclick="toggleCode('M000690-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000690-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 82</span> -82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_parent</span> -83: <span class="ruby-ivar">@parent</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>]) + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 81</span> +81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_parent</span> +82: <span class="ruby-ivar">@parent</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:section_id</span>]) +83: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Cms</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AccessDenied</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">able_to_edit?</span>(<span class="ruby-ivar">@parent</span>) 84: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000647" class="method-detail"> - <a name="M000647"></a> + <div id="method-M000691" class="method-detail"> + <a name="M000691"></a> <div class="method-heading"> - <a href="#M000647" class="method-signature"> + <a href="#M000691" class="method-signature"> + <span class="method-name">load_section</span><span class="method-args">()</span> + </a> + </div> + + <div class="method-description"> + <p><a class="source-toggle" href="#" + onclick="toggleCode('M000691-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000691-source"> +<pre> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 86</span> +86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_section</span> +87: <span class="ruby-ivar">@section</span> = <span class="ruby-constant">Section</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>]) +88: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Cms</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AccessDenied</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">able_to_edit?</span>(<span class="ruby-ivar">@section</span>) +89: <span class="ruby-keyword kw">end</span> +</pre> + </div> + </div> + </div> + + <div id="method-M000694" class="method-detail"> + <a name="M000694"></a> + + <div class="method-heading"> + <a href="#M000694" class="method-signature"> <span class="method-name">public_groups</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000647-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000647-source"> + onclick="toggleCode('M000694-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000694-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 114</span> -114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">public_groups</span> -115: <span class="ruby-ivar">@public_groups</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">public</span>.<span class="ruby-identifier">all</span>(<span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;groups.name&quot;</span>) -116: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 119</span> +119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">public_groups</span> +120: <span class="ruby-ivar">@public_groups</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Group</span>.<span class="ruby-identifier">public</span>.<span class="ruby-identifier">all</span>(<span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;groups.name&quot;</span>) +121: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000646" class="method-detail"> - <a name="M000646"></a> + <div id="method-M000693" class="method-detail"> + <a name="M000693"></a> <div class="method-heading"> - <a href="#M000646" class="method-signature"> + <a href="#M000693" class="method-signature"> <span class="method-name">render_file_browser</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000646-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000646-source"> + onclick="toggleCode('M000693-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000693-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 101</span> -101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_file_browser</span> -102: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">&quot;text/xml&quot;</span> -103: <span class="ruby-ivar">@files</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:Type</span>].<span class="ruby-identifier">downcase</span> -104: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span> -105: <span class="ruby-constant">FileBlock</span>.<span class="ruby-identifier">by_section</span>(<span class="ruby-ivar">@section</span>) -106: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;image&quot;</span> -107: <span class="ruby-constant">ImageBlock</span>.<span class="ruby-identifier">by_section</span>(<span class="ruby-ivar">@section</span>) -108: <span class="ruby-keyword kw">else</span> -109: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">pages</span> -110: <span class="ruby-keyword kw">end</span> -111: <span class="ruby-identifier">render</span> <span class="ruby-value str">'cms/sections/file_browser.xml.builder'</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span> -112: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 106</span> +106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_file_browser</span> +107: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">&quot;text/xml&quot;</span> +108: <span class="ruby-ivar">@files</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:Type</span>].<span class="ruby-identifier">downcase</span> +109: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;file&quot;</span> +110: <span class="ruby-constant">FileBlock</span>.<span class="ruby-identifier">by_section</span>(<span class="ruby-ivar">@section</span>) +111: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;image&quot;</span> +112: <span class="ruby-constant">ImageBlock</span>.<span class="ruby-identifier">by_section</span>(<span class="ruby-ivar">@section</span>) +113: <span class="ruby-keyword kw">else</span> +114: <span class="ruby-ivar">@section</span>.<span class="ruby-identifier">pages</span> +115: <span class="ruby-keyword kw">end</span> +116: <span class="ruby-identifier">render</span> <span class="ruby-value str">'cms/sections/file_browser.xml.builder'</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span> +117: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000649" class="method-detail"> - <a name="M000649"></a> + <div id="method-M000696" class="method-detail"> + <a name="M000696"></a> <div class="method-heading"> - <a href="#M000649" class="method-signature"> + <a href="#M000696" class="method-signature"> <span class="method-name">set_toolbar_tab</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000649-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000649-source"> + onclick="toggleCode('M000696-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000696-source"> <pre> - <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 122</span> -122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_toolbar_tab</span> -123: <span class="ruby-ivar">@toolbar_tab</span> = <span class="ruby-identifier">:sitemap</span> -124: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File app/controllers/cms/sections_controller.rb, line 127</span> +127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_toolbar_tab</span> +128: <span class="ruby-ivar">@toolbar_tab</span> = <span class="ruby-identifier">:sitemap</span> +129: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> \ No newline at end of file