 	<cflocation url="#request.self#" addtoken="no">
 </cfif>
 <cfif request.adminType EQ "web">
-	
+
 </cfif>
 
 <cfscript>

<cfset plugins=array()>
<cfif StructKeyExists(session,"password"&request.adminType)>
	<cftry>
    <cfadmin
	    action="getPluginDirectory"
	    type="#request.adminType#"
	    password="#session["password"&request.adminType]#"
	    returnVariable="pluginDir">
	<cfset mappings['/lucee_plugin_directory/']=pluginDir>
	<cfapplication action="update" mappings="#mappings#">

    <cfset hasPlugin=false>
    <cfloop array="#navigation#" index="el">
    	<cfif el.action EQ "plugin"><cfset hasPlugin=true></cfif>
    </cfloop>

	<cfif not hasPlugin or (structKeyExists(session,"alwaysNew") and session.alwaysNew)>
    	<cfif not hasPlugin>
        <cfset plugin=struct(
            label:"Plugins",
            children:plugins,
            action:"plugin"
        )>
    	<cfset navigation[arrayLen(navigation)+1]=plugin>
        </cfif>

        <cfset sctNav={}>
        <cfloop array="#navigation#" index="item">
        	<cfset sctNav[item.action]=item>
        </cfloop>

        <cfdirectory directory="#plugindir#" action="list" name="plugindirs" recurse="no">
        <cfloop query="plugindirs">
            <cfif plugindirs.type EQ "dir">
                <cfset _lang=loadPluginLanguage(pluginDir,plugindirs.name)>
                <cfif isNull(_lang.__group)>
					<cfcontinue>
				</cfif>
                <cfset _act=_lang.__action>
				<cfset _group=_lang.__group>
				<cfset _pos=_lang.__position>
				<cfset StructDelete(_lang,"__action",false)>

				<cfset application.pluginLanguage[session.lucee_admin_lang][plugindirs.name]=_lang>

                <cfset item=struct(
                    label:_lang.title,
                    action:plugindirs.name,
                    _action:'plugin&plugin='&plugindirs.name
                )>

                <cfif not StructKeyExists(sctNav,_act)>
                	<cfset sctNav[_act]=struct(
						label:_group,
						children:[],
						action:_act
					)>
                    <cfif _pos GT 0 and _pos LTE arrayLen(navigation)>
                    	<cfscript>
						for(i=arrayLen(navigation)+1;i>_pos;i--){
							navigation[i]=navigation[i-1];
						}
                        navigation[_pos]=sctNav[_act];
						</cfscript>
                    <cfelse>
                    	<cfset navigation[arrayLen(navigation)+1]=sctNav[_act]>
                    </cfif>

                </cfif>

                <cfset children=sctNav[_act].children>
                <cfset isUpdate=false>
                <cfloop from="1" to="#arrayLen(children)#" index="i">
                	<cfif children[i].action EQ item.action>
                    	<cfset children[i]=item>
                        <cfset isUpdate=true>
            </cfif>
        </cfloop>
                <cfif not isUpdate>
                	<cfset children[arrayLen(children)+1]=item>
    </cfif>

</cfif>
        </cfloop>
    </cfif>
    	<cfcatch><cfrethrow></cfcatch>
    </cftry>

</cfif>
<cfsavecontent variable="arrow"><img src="resources/img/arrow.gif.cfm" width="4" height="7" /></cfsavecontent>


		try{
			admin
				action="getRHServerExtensions"
				type="#request.adminType#"
				password="#session["password"&request.adminType]#"
				returnVariable="local.qry";

			var qry = qry.filter(function(row, rowNumber, qryData){
				return row.id=='EFDEB172-F52E-4D84-9CD1A1F561B3DFC8';
			});
			session._isLuceneInstalled=qry.recordCount>0;
			return qry.recordCount>0;
