<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — New method for application class re-ordering the application tabs]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7056&amp;type=atom" />
	<updated>2017-10-21T10:36:15Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7056</id>
		<entry>
			<title type="html"><![CDATA[New method for application class re-ordering the application tabs]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29127#p29127" />
			<content type="html"><![CDATA[<p>Whenever a new tabbed application is added to FrontAccounting, it appears in a tab just before the Setup tab as coded in the <strong>front_accounting</strong> class method <strong>init()</strong> and invoked at the end of the <strong>includes/session.inc</strong> file.</p><p>Any new extension developer would want to position their application&#039;s tab (if it is an application predominantly residing in a separate tab) at some specific place and not just before the Setup one.</p><p>To alleviate this situation without having to code inconsistently/redundantly in each extension, it would be better to have a method in the application class (in <strong>applications/application.php</strong>) on the following lines contemplated to be in my <strong>hello_world</strong> extension for now:</p><div class="codebox"><pre><code>// Change tab order
        $i = 4; // set this extension on the 4th tab
        $x = $app-&gt;applications;
        $y = array_pop($app-&gt;applications); // this application was added last just now
        $app-&gt;applications = Array();
        $app-&gt;applications = array_merge(array_slice($x, 0, $i-1), array(&#039;hello&#039; =&gt; $y), array_slice($x, $i-1));
        unset($x,$y,$i);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-21T10:36:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29127#p29127</id>
		</entry>
</feed>
