2013-05-28 160 views
0

我正在創建一個自定義(1.6)組件,其中用戶可以預訂露營地。如果用戶想要使用他們已經存儲的資金/信用,則需要登錄。只有某些團體可以使用這些資金/信用。Joomla ACL自定義操作

我已經創建了一個access.xml文件:

<?xml version="1.0" encoding="UTF-8"?> 
<access component="com_propbooker"> 
    <section name="booking"> 
    <action name="booking.create" title="Book Site" description="Allows users of this group to book sites." /> 
    </section> 
</access> 

和我的config.xml文件:

<config> 
    <fieldset name="API Configuration" label="API Configuration"> 
    <field name="google_api_key" label="Google API Key" type="text" size="50" default="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> 
    </fieldset> 
    <fieldset name="Booking Permissions" label="Booking Permissions" description="Set Groups that can book sites"> 
    <field name="booking_permission" label="Booking Permission" type="rules" class="inputbox" validate="rules" filter="rules" component="com_propbooker" section="booking" /> 
    </fieldset> 
</config> 

這一切都表明了罰款,當我點擊選項按鈕,但沒有改變永遠保存。當我點擊「保存」按鈕時,它總是翻轉回「繼承」。

在此先感謝您的任何見解。

回答

0

嘗試使用permissions作爲字段集名稱和rules在你的config.xml中的字段名。 像這樣:

<fieldset name="permissions" 
    label="JCONFIG_PERMISSIONS_LABEL" 
    description="JCONFIG_PERMISSIONS_DESC" > 
    <field name="rules" 
     type="rules" 
     label="JCONFIG_PERMISSIONS_LABEL" 
     class="inputbox" 
     validate="rules" 
     filter="rules" 
     component="com_propbooker" 
     section="booking" 
    /> 
</fieldset> 

我也會考慮使用部分名稱component,因爲它是默認的命名。但是您的需求可能會有所不同。

+0

TYVM,魔鬼總是在細節上。 –