<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WORKS-BB</title>
	<atom:link href="http://works-bb.net/feed" rel="self" type="application/rss+xml" />
	<link>http://works-bb.net</link>
	<description>オープンソース、PHP開発、ホームページ作成、ブログカスタマイズ</description>
	<lastBuildDate>Thu, 11 Aug 2011 01:17:22 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress 3.1.2アップデート</title>
		<link>http://works-bb.net/2011/05/12/442.html</link>
		<comments>http://works-bb.net/2011/05/12/442.html#comments</comments>
		<pubDate>Thu, 12 May 2011 07:55:52 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=442</guid>
		<description><![CDATA[初めて自動アップデートなるもので、このホームページのWordPressのアップデートを行ってみた。 何が起こるか分からず怖いので、事前にデータベースとディレクトリ丸ごとバックアップし、ここを参考に、一部の PHP ファイルを CGI モードで実行するよう編集して、「えいやっ」でアップデートを実行。 何の問題も発生しなかったので、プラグインも自動アップデートを実行。自作のプラグインも無事生き残ってるし、無事アップデータ完了。]]></description>
			<content:encoded><![CDATA[				<p>初めて自動アップデートなるもので、このホームページのWordPressのアップデートを行ってみた。<br />
				何が起こるか分からず怖いので、事前にデータベースとディレクトリ丸ごとバックアップし、<a href="http://www.templatestyle.in/item/wordpress-auto-update-xrea-coreserver.html">ここ</a>を参考に、一部の PHP ファイルを CGI モードで実行するよう編集して、「えいやっ」でアップデートを実行。<br />
				何の問題も発生しなかったので、プラグインも自動アップデートを実行。自作のプラグインも無事生き残ってるし、無事アップデータ完了。</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2011/05/12/442.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zen Cart 管理者機能の設定内容</title>
		<link>http://works-bb.net/2010/03/31/435.html</link>
		<comments>http://works-bb.net/2010/03/31/435.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 07:03:23 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Zen Cart]]></category>
		<category><![CDATA[Zen Cart カスタマイズ]]></category>
		<category><![CDATA[モジュールインストール]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=435</guid>
		<description><![CDATA[管理者機能の管理者機能の設定内容は、TABLE_CONFIGURATION で定義されたテーブルに格納されます。 1. 例えば、配送方法に関するモジュールをインストールした場合には、 　　configuration_key = &#8216;MODULE_SHIPPING_INSTALLED&#8217; のレコードにモジュールファイル名がセミコロン区切りで設定されています。 2. モジュール固有の設定項目も同じテーブルに追加されます。各モジュールが持つ設定項目のキーは、モジュールクラスの keys メソッドで取得することができます。 　]]></description>
			<content:encoded><![CDATA[				<p>管理者機能の管理者機能の設定内容は、TABLE_CONFIGURATION で定義されたテーブルに格納されます。</p>
				<p>1. 例えば、配送方法に関するモジュールをインストールした場合には、<br />
				　　configuration_key = &#8216;MODULE_SHIPPING_INSTALLED&#8217;<br />
				のレコードにモジュールファイル名がセミコロン区切りで設定されています。</p>
				<p>2. モジュール固有の設定項目も同じテーブルに追加されます。各モジュールが持つ設定項目のキーは、モジュールクラスの keys メソッドで取得することができます。<br />
				　</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2010/03/31/435.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zen Cart 管理者機能の追加</title>
		<link>http://works-bb.net/2010/03/31/423.html</link>
		<comments>http://works-bb.net/2010/03/31/423.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 06:49:48 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Zen Cart]]></category>
		<category><![CDATA[Zen Cart カスタマイズ]]></category>
		<category><![CDATA[管理者機能の追加]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=423</guid>
		<description><![CDATA[Zen Cart に管理者機能を追加する際のファイルの配置は以下の通りです。以下は、ext_customers での例になります。 1. 機能の本体（リクエストされるファイル） 　　admin/ext_customers.php 2. プログラム本体から直接 include するPHPファイル、及び css、js、画像 　　admin/ext_customers/ 　PHP ファイルは、外部から参照されては困るため、ディレクトリ内に次の内容で .htaccess を配置します。 &#60;Files *.php&#62; Order Deny,Allow Deny from all Allow from localhost &#60;/Files&#62; 3. プログラムが利用する関数の定義 　　admin/include/functions/extra_functions/ext_customers.php]]></description>
			<content:encoded><![CDATA[				<p>Zen Cart に管理者機能を追加する際のファイルの配置は以下の通りです。以下は、ext_customers での例になります。</p>
				<p>1. 機能の本体（リクエストされるファイル）<br />
				　　admin/ext_customers.php</p>
				<p>2. プログラム本体から直接 include するPHPファイル、及び css、js、画像<br />
				　　admin/ext_customers/<br />
				　PHP ファイルは、外部から参照されては困るため、ディレクトリ内に次の内容で .htaccess を配置します。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
&lt;Files *.php&gt;
Order Deny,Allow
Deny from all
Allow from localhost
&lt;/Files&gt;
</pre>
				</div>
				<p>3. プログラムが利用する関数の定義<br />
				　　admin/include/functions/extra_functions/ext_customers.php</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2010/03/31/423.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zen Cart 管理者サブメニュー追加</title>
		<link>http://works-bb.net/2010/03/31/419.html</link>
		<comments>http://works-bb.net/2010/03/31/419.html#comments</comments>
		<pubDate>Wed, 31 Mar 2010 06:23:51 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Zen Cart]]></category>
		<category><![CDATA[Zen Cart カスタマイズ]]></category>
		<category><![CDATA[サブメニュー]]></category>
		<category><![CDATA[管理者]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=419</guid>
		<description><![CDATA[Zen Cartのカスタマイズ案件を引き受けた際に、ファイル配置について意外と悩みましたので、今後のためにメモしておきます。 拡張のサブメニューを作成するなら、 　　admin/includes/boxes/extra_boxes/ にファイルを追加します。 ファイル名の規則は次の通り。 　　(機能名)_(メインメニュー名)_dhtml.php メインメニュー名のところに指定したメニューのサブメニューとして自動で追加されます。 ファイルに記載する内容は、同一ディレクトリ内の 　　product_music_extras_dhtml.php が参考になります。 ファイル内に記載する文字列定義は、 　　admin/includes/languages/(言語)/extra_definitions/ の下に言語ごとに作成することが推奨されます。ファイル名は、機能名と一致させておくと良いです。 言語ごとに定義の必要のない項目（ファイル名など）は、 　　admin/includes/extra_definitions/ の下に作成することが推奨されます。やはり、ファイル名は、機能名と一致させておくと良いです。]]></description>
			<content:encoded><![CDATA[				<p>Zen Cartのカスタマイズ案件を引き受けた際に、ファイル配置について意外と悩みましたので、今後のためにメモしておきます。</p>
				<p>拡張のサブメニューを作成するなら、<br />
				　　admin/includes/boxes/extra_boxes/<br />
				にファイルを追加します。</p>
				<p>ファイル名の規則は次の通り。<br />
				　　(機能名)_(メインメニュー名)_dhtml.php<br />
				メインメニュー名のところに指定したメニューのサブメニューとして自動で追加されます。<br />
				ファイルに記載する内容は、同一ディレクトリ内の<br />
				　　product_music_extras_dhtml.php<br />
				が参考になります。</p>
				<p>ファイル内に記載する文字列定義は、<br />
				　　admin/includes/languages/(言語)/extra_definitions/<br />
				の下に言語ごとに作成することが推奨されます。ファイル名は、機能名と一致させておくと良いです。</p>
				<p>言語ごとに定義の必要のない項目（ファイル名など）は、<br />
				　　admin/includes/extra_definitions/<br />
				の下に作成することが推奨されます。やはり、ファイル名は、機能名と一致させておくと良いです。</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2010/03/31/419.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.9.2アップデート</title>
		<link>http://works-bb.net/2010/03/24/409.html</link>
		<comments>http://works-bb.net/2010/03/24/409.html#comments</comments>
		<pubDate>Wed, 24 Mar 2010 07:49:18 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=409</guid>
		<description><![CDATA[しばらくホームページのメンテを怠っており、その間にWordPressも随分とバージョンが新しくなっていました。という訳で、本サイトもWordPress 2.9.2日本語版にアップデートしてみました。プラグインのアップデートも合わせて行いました。 見た目上、特に何も変わっていないので、問題なくアップデートが行えたようです。]]></description>
			<content:encoded><![CDATA[				<p>しばらくホームページのメンテを怠っており、その間にWordPressも随分とバージョンが新しくなっていました。という訳で、本サイトもWordPress 2.9.2日本語版にアップデートしてみました。プラグインのアップデートも合わせて行いました。<br />
				見た目上、特に何も変わっていないので、問題なくアップデートが行えたようです。</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2010/03/24/409.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>お知らせをプラグイン化</title>
		<link>http://works-bb.net/2009/06/09/388.html</link>
		<comments>http://works-bb.net/2009/06/09/388.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 23:01:18 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ウィジェットプラグイン]]></category>
		<category><![CDATA[ウィジェット開発]]></category>
		<category><![CDATA[プラグイン開発]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=388</guid>
		<description><![CDATA[WordPress2.7.1のアップデートによって、サイドバーのお知らせの日付表示が機能しなくなっていました。この機能はWordPress本体を修正して実現していたため、アップデートで該当ファイルが上書きされたことが原因でした。 毎回アップデート後にWordPress本体に修正を加えるのは面倒なため、この機能を「最近の投稿（日時あり）」ウィジェットプラグインとして実現することにしました。基本的な機能は、既存の「最近の投稿」ウィジェットと同じで、加えて「日付フォーマット」と「タイトルの前に表示する文字」をウィジェットの管理から設定可能としています。 「最近の投稿（日付あり）」ウィジェットプラグイン ダウンロードしたファイルを展開して出来たディレクトリ（widget-recent-entries-with-date）をプラグインディレクトリにコピーし、プラグイン管理から「Recent entries with date widget」を「使用する」で利用可能です。 ※本プログラムは、WordPressのウィジェット、プラグインの開発方法の学習用に作成したものです。ご利用時のトラブルの責任は負いかねますので、その点はご了承ください。]]></description>
			<content:encoded><![CDATA[				<p>WordPress2.7.1のアップデートによって、<a href="/2009/01/09/235.html">サイドバーのお知らせの日付表示</a>が機能しなくなっていました。この機能はWordPress本体を修正して実現していたため、アップデートで該当ファイルが上書きされたことが原因でした。</p>
				<p>毎回アップデート後にWordPress本体に修正を加えるのは面倒なため、この機能を「最近の投稿（日時あり）」ウィジェットプラグインとして実現することにしました。基本的な機能は、既存の「最近の投稿」ウィジェットと同じで、加えて「日付フォーマット」と「タイトルの前に表示する文字」をウィジェットの管理から設定可能としています。</p>
				<p><a href='/wp-content/widget-recent-entries-with-date.zip'>「最近の投稿（日付あり）」ウィジェットプラグイン</a></p>
				<p>ダウンロードしたファイルを展開して出来たディレクトリ（widget-recent-entries-with-date）をプラグインディレクトリにコピーし、プラグイン管理から「Recent entries with date widget」を「使用する」で利用可能です。</p>
				<p><span class="notice_small">※本プログラムは、WordPressのウィジェット、プラグインの開発方法の学習用に作成したものです。ご利用時のトラブルの責任は負いかねますので、その点はご了承ください。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2009/06/09/388.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7.1アップデート</title>
		<link>http://works-bb.net/2009/05/18/381.html</link>
		<comments>http://works-bb.net/2009/05/18/381.html#comments</comments>
		<pubDate>Mon, 18 May 2009 06:56:18 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.7.1]]></category>
		<category><![CDATA[アップデート]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=381</guid>
		<description><![CDATA[WordPress 2.7.1日本語版がいつの間にかリリースされていましたので、本サイトもアップデートしてみました。とりあえず問題は発生していないようです。]]></description>
			<content:encoded><![CDATA[				<p>WordPress 2.7.1日本語版がいつの間にかリリースされていましたので、本サイトもアップデートしてみました。とりあえず問題は発生していないようです。</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2009/05/18/381.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP 10.2 ACL 開発例の補足</title>
		<link>http://works-bb.net/2009/02/12/337.html</link>
		<comments>http://works-bb.net/2009/02/12/337.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 23:30:56 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[チュートリアル]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=337</guid>
		<description><![CDATA[CakePHPのオンラインドキュメントには、親切な開発例が２つ掲載されており、基本的な開発手順を学ぶ助けとなります。 しかし、「10.2 ACL を制御するシンプルなアプリケーション」では、手順が若干省略されているために分かりにくい個所がいくつかあります。 ここでは、学習の手助けとなる補足情報を記載しておきます。 10.2.1 アプリケーションの準備 この章では、bakeを利用した各テーブルに対するモデル、コントローラ、ビューの作成手順が省略されています。 以下に、bakeを利用したモデル、コントローラ、ビューの作成手順を記載します。（bakeでappディレクトリの初期設定が行われている事が前提） 1. bakeを起動すると、コマンドの一覧が表示されます。 $ cd (appディレクトリ) $ cake bake Welcome to CakePHP v1.2.1.8004 Console --------------------------------------------------------------- App : (app名) Path: (appディレクトリ) --------------------------------------------------------------- Interactive Bake Shell --------------------------------------------------------------- [ D]atabase Configuration [ M]odel [ V]iew [ C]ontroller [ P]roject [ Q]uit What would you like to Bake? (D/M/V/C/P/Q) 2. モデルを作成するためMを選択すると、データベースの一覧が表示されます。最初にGroupのモデルを作成するために1を選択し、対話形式で設定を行います。 [...]]]></description>
			<content:encoded><![CDATA[				<p><a href="http://book.cakephp.org/ja">CakePHPのオンラインドキュメント</a>には、親切な開発例が２つ掲載されており、基本的な開発手順を学ぶ助けとなります。<br />
				しかし、「10.2 ACL を制御するシンプルなアプリケーション」では、手順が若干省略されているために分かりにくい個所がいくつかあります。<br />
				ここでは、学習の手助けとなる補足情報を記載しておきます。</p>
				<p><a href="http://book.cakephp.org/ja/view/642/アプリケーションの準備">10.2.1 アプリケーションの準備</a><br />
				この章では、bakeを利用した各テーブルに対するモデル、コントローラ、ビューの作成手順が省略されています。<br />
				以下に、bakeを利用したモデル、コントローラ、ビューの作成手順を記載します。（bakeでappディレクトリの初期設定が行われている事が前提）</p>
				<p>1. bakeを起動すると、コマンドの一覧が表示されます。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
$ cd (appディレクトリ)
$ cake bake
Welcome to CakePHP v1.2.1.8004 Console
---------------------------------------------------------------
App : (app名)
Path: (appディレクトリ)
---------------------------------------------------------------
Interactive Bake Shell
---------------------------------------------------------------
[ D]atabase Configuration
[ M]odel
[ V]iew
[ C]ontroller
[ P]roject
[ Q]uit
What would you like to Bake? (D/M/V/C/P/Q)
</pre>
				</div>
				<p>2. モデルを作成するためMを選択すると、データベースの一覧が表示されます。最初にGroupのモデルを作成するために1を選択し、対話形式で設定を行います。<br />
				Would you like to supply validation criteria for the fields in your model? (y/n)<br />
				でyを選択すると、一部のフィールドでvalidation optionsの選択を要求されますが、全て初期設定のままリターンキーで問題ありません。<br />
				Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)? (y/n)<br />
				はnを選択し、<br />
				Cake test suite not installed.  Do you want to bake unit test files anyway? (y/n)<br />
				はyを選択します。<br />
				一通り設定が終わると初期画面に戻りますので、Groupと同様の手順でPost、User、Widgetのモデルを作成していきます。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
> M
---------------------------------------------------------------
Bake Model
Path: (appディレクトリ)/models/
---------------------------------------------------------------
Possible Models based on your current database:
1. Group
2. Post
3. User
4. Widget
Enter a number from the list above, type in the name of another model, or 'q' to exit
[q] > 1
Would you like to supply validation criteria for the fields in your model? (y/n)
[y] > 

Field: id
Type: integer
---------------------------------------------------------------
Please select one of the following validation options:
---------------------------------------------------------------
1 - alphaNumeric
2 - between
3 - blank
.
.
27 - url
28 - userDefined
29 - Do not do any validation on this field.
... or enter in a valid regex validation string.

[29] >
.
.
Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)? (y/n)
[y] > n

---------------------------------------------------------------
The following Model will be created:
---------------------------------------------------------------
Name:       Group
Validation: Array
(
    [name] => notempty
)

Associations:
---------------------------------------------------------------
Look okay? (y/n)
[y] > y

Baking model class for Group...

Creating file (appディレクトリ)/models/group.php
Wrote (appディレクトリ)/models/group.php
Cake test suite not installed.  Do you want to bake unit test files anyway? (y/n)
[y] > 

You can download the Cake test suite from http://cakeforge.org/projects/testsuite/

Baking test fixture for Group...

Creating file (appディレクトリ)/tests/fixtures/group_fixture.php
Wrote (appディレクトリ)/tests/fixtures/group_fixture.php

Baking unit test for Group...

Creating file (appディレクトリ)/tests/cases/models/group.test.php
Wrote (appディレクトリ)/tests/cases/models/group.test.php
</pre>
				</div>
				<p>3. 次にコントローラを作成するためCを選択します。モデルと同様に、Group、Post、User、Widgetに対して処理を行います。<br />
				ほとんどは初期設定のままリターンキーで問題ありませんが、<br />
				Would you like to use scaffolding? (y/n)<br />
				はnを、<br />
				Would you like to include some basic class methods (index(), add(), view(), edit())? (y/n)<br />
				はyを選択します。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
> C
---------------------------------------------------------------
Bake Controller
Path: (appディレクトリ)/controllers/
---------------------------------------------------------------
Possible Controllers based on your current database:
1. Groups
2. Posts
3. Users
4. Widgets
Enter a number from the list above, type in the name of another controller, or 'q' to exit
[q] > 1
---------------------------------------------------------------
Baking GroupsController
---------------------------------------------------------------
Would you like to build your controller interactively? (y/n)
[y] >
Would you like to use scaffolding? (y/n)
[n] > n
Would you like to include some basic class methods (index(), add(), view(), edit())? (y/n)
[n] > y
Would you like to create the methods for admin routing? (y/n)
[n] >
Would you like this controller to use other helpers besides HtmlHelper and FormHelper? (y/n)
[n] >
Would you like this controller to use any components? (y/n)
[n] >
Would you like to use Sessions? (y/n)
[y] > 

---------------------------------------------------------------
The following controller will be created:
---------------------------------------------------------------
Controller Name:  Groups
---------------------------------------------------------------
Look okay? (y/n)
[y] >  

Creating file (appディレクトリ)/controllers/groups_controller.php
Wrote (appディレクトリ)/controllers/groups_controller.php
Cake test suite not installed.  Do you want to bake unit test files anyway? (y/n)
[y] > 

You can download the Cake test suite from http://cakeforge.org/projects/testsuite/

Baking unit test for Groups...

Creating file (appディレクトリ)/tests/cases/controllers/groups_controller.test.php
Wrote (appディレクトリ)/tests/cases/controllers/groups_controller.test.php
</pre>
				</div>
				<p>4. 最後にビューを作成するためVを選択します。他と同様に、Group、Post、User、Widgetに対して処理を行います。<br />
				Would you like to create some scaffolded views (index, add, view, edit) for this controller?<br />
				NOTE: Before doing so, you&#8217;ll need to create your controller and model classes (including associated models). (y/n)<br />
				はyを<br />
				Would you like to create the views for admin routing? (y/n)<br />
				はnを選択します。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
> V
---------------------------------------------------------------
Bake View
Path: (appディレクトリ)/views/
---------------------------------------------------------------
Possible Controllers based on your current database:
1. Groups
2. Posts
3. Users
4. Widgets
Enter a number from the list above, type in the name of another controller, or 'q' to exit
[q] > 1
Would you like to create some scaffolded views (index, add, view, edit) for this controller?
NOTE: Before doing so, you'll need to create your controller and model classes (including associated models). (y/n)
[n] > y
Would you like to create the views for admin routing? (y/n)
[y] > n

Creating file (appディレクトリ)/views/groups/index.ctp
Wrote (appディレクトリ)/views/groups/index.ctp

Creating file (appディレクトリ)/views/groups/view.ctp
Wrote (appディレクトリ)/views/groups/view.ctp

Creating file (appディレクトリ)/views/groups/add.ctp
Wrote (appディレクトリ)/views/groups/add.ctp

Creating file (appディレクトリ)/views/groups/edit.ctp
Wrote (appディレクトリ)/views/groups/edit.ctp
---------------------------------------------------------------

View Scaffolding Complete.
</pre>
				</div>
				<p><a href="http://book.cakephp.org/ja/view/643/Auth-を追加する準備">10.2.2 Auth を追加する準備</a></p>
				<p><a href="http://book.cakephp.org/ja/view/644/ACL-のデータベーステーブルの初期化">10.2.3 ACL のデータベーステーブルの初期化</a></p>
				<p><a href="http://book.cakephp.org/ja/view/645/リクエスタとして振舞う">10.2.4 リクエスタとして振舞う</a><br />
				後半にグループの追加について記載がありますが、こちらはWebブラウザで</p>
				<p>http://(アプリケーションURL)/groups/add</p>
				<p>にアクセスし、グループを作成することを指しています。<br />
				ユーザの追加についても同様で、</p>
				<p>http://(アプリケーションURL)/users/add</p>
				<p>でユーザを作成することを指しています。Groupの欄には、グループのidを指定します。</p>
				<p><a href="http://book.cakephp.org/ja/view/646/ACO-の作成">10.2.5 ACO の作成</a><br />
				ここでは、controllersという名のトップレベルのACOの作成手順が解説してありますが、作成方法として<br />
				・コマンドラインから作成する方法<br />
				・プログラムの中にACL作成用のコードを一時的に作成し、一度だけ実行後にコードを削除する方法<br />
				の２種類が解説されています。前者の方法を選ぶのが素直に思います。<br />
				尚、AuthComponent に根ノードの存在を教えるコードは、AppControllerクラスのbeforeFilter()メソッドの最後に追加します。</p>
				<div class="wb_syntax">
				<pre>
function beforeFilter() {
    // AuthComponent のコンフィギュレーション
    $this->Auth->authorize = 'actions';
    $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
    $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
    $this->Auth->loginRedirect = array('controller' => 'posts', 'action' => 'add');

    $this->Auth->actionPath = 'controllers/';
}
</pre>
				</div>
				<p><a href="http://book.cakephp.org/ja/view/647/ACO-の作成を自動化するツール">10.2.6 ACO の作成を自動化するツール</a><br />
				ここでは、前ページで作成した controllers ACOの下に、app/controllers ディレクトリ内に準備した全てのコントローラ、及びアクションのACOを自動作成する手順が記載されています。<br />
				AppControllerクラスに、buildAcl()メソッドを作成し、beforeFilter()メソッドの最後にbuildAcl()を呼び出すコードを記述するのが素直かと思います。</p>
				<div class="wb_syntax">
				<pre>
function beforeFilter() {
    // AuthComponent のコンフィギュレーション
    $this->Auth->authorize = 'actions';
    $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
    $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
    $this->Auth->loginRedirect = array('controller' => 'posts', 'action' => 'add');

    $this->Auth->actionPath = 'controllers/';

    $this->buildAcl();
}
</pre>
				</div>
				<p>ブラウザで、</p>
				<p>http://(アプリケーションURL)/users</p>
				<p>等に一回アクセスしACOの作成が確認できたら、AppControllerクラスからbuildAcl()メソッドと、beforeFilter()メソッド内のbuildAcl()の呼び出し行を削除します。<br />
				最後にAuthComponentを無効化するコードの除去の記述がありますが、これは、GroupsController、UsersControllerクラスとに追加したbeforeFilter()メソッド内の<br />
				$this->Auth->allowedActions = array(&#8216;*&#8217;);<br />
				の行の削除を指しますが、これは後で行います。</p>
				<p><a href="http://book.cakephp.org/ja/view/648/パーミッションの設定">10.2.7 パーミッションの設定</a><br />
				最初にコマンドラインからパーミッションを設定する方法が記載されていますが、これはコマンド利用方法の解説であり、そのまま実行しても機能しません。<br />
				ここでも、やはり一時的なコードを使ってパーミッションを設定します。UsersControllerクラスにinitDB()メソッドを追加し、beforeFilter()メソッドの最後にinitDB()の呼び出し行を追加します。</p>
				<div class="wb_syntax">
				<pre>
function beforeFilter() {
    parent::beforeFilter();
    $this->Auth->allowedActions = array('*');
    $this->initDB();
}
</pre>
				</div>
				<p>尚、initDB()メソッドですが、次のように修正しておく必要があります。</p>
				<div class="wb_syntax">
				<pre>
function initDB() {
    //$group =&#038; $this->User->Group;
    App::import('Model', 'Group');
    $group = new Group();

    // 管理者グループには全てを許可する
    $group->id = 1;
    $this->Acl->allow($group, 'controllers');

    // マネージャグループには posts と widgets に対するアクセスを許可する
    $group->id = 2;
    $this->Acl->deny($group, 'controllers');
    $this->Acl->allow($group, 'controllers/Posts');
    $this->Acl->allow($group, 'controllers/Widgets');
    $this->Acl->allow($group, 'controllers/Users/logout');

    // ユーザグループには posts と widgets に対する追加と編集を許可する
    $group->id = 3;
    $this->Acl->deny($group, 'controllers');
    $this->Acl->allow($group, 'controllers/Posts/add');
    $this->Acl->allow($group, 'controllers/Posts/edit');
    $this->Acl->allow($group, 'controllers/Widgets/add');
    $this->Acl->allow($group, 'controllers/Widgets/edit');
    $this->Acl->allow($group, 'controllers/Users/logout');
}
</pre>
				</div>
				<p>先頭部分は、$this->User->GroupがNULLであるためにエラーが発生する問題の対応です。<br />
				あと、マネージャグループ、ユーザグループのユーザでログインするとログアウトできない問題があったため、それぞれallowパーミッションを追加しています。</p>
				<p>ブラウザで、</p>
				<p>http://(アプリケーションURL)/users</p>
				<p>等に一回アクセスしパーミッションの作成が確認できたら、UsersControllerクラスからinitDB()メソッドと、beforeFilter()メソッド内のinitDB()の呼び出し行を削除します。併せて、GroupsController、UsersControllerクラスのbeforeFilter()メソッドから<br />
				$this->Auth->allowedActions = array(&#8216;*&#8217;);<br />
				の行を削除します。</p>
				<div class="wb_syntax">
				<pre>
function beforeFilter() {
    parent::beforeFilter();
    //$this->Auth->allowedActions = array('*');
    //$this->initDB();
}
</pre>
				</div>
				<p><a href="http://book.cakephp.org/ja/view/649/ログイン">10.2.8 ログイン</a></p>
				<p><a href="http://book.cakephp.org/ja/view/650/ログアウト">10.2.9 ログアウト</a></p>
				<p><a href="http://book.cakephp.org/ja/view/651/最後に">10.2.10 最後に</a></p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2009/02/12/337.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>macportsアップグレードの注意</title>
		<link>http://works-bb.net/2009/02/09/331.html</link>
		<comments>http://works-bb.net/2009/02/09/331.html#comments</comments>
		<pubDate>Sun, 08 Feb 2009 23:30:51 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Mac OS X開発環境]]></category>
		<category><![CDATA[installed]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=331</guid>
		<description><![CDATA[近ごろでは、Mac OS Xの開発サーバ用のソフトウェアの殆どはmacportsを利用してインストールしています。主なものだけでも、Apache2.2.11、PostgreSQL8.3.5、MySQL5.0.75、PHP5.2.8、Subversion1.5.5と、ほぼ最新の開発環境が手に入ります。 インストール済みのソフトウェアを最新に保つための手順は以下の通りですが、事前に各ソフトウェアの設定ファイルはバックアップした方が良いようです。特にapache2の場合、conf/extra、conf/extras-conf以下のファイルが上書きされてしまうため、注意が必要です。 sudo port selfupdate sudo port upgrade installed]]></description>
			<content:encoded><![CDATA[				<p>近ごろでは、Mac OS Xの開発サーバ用のソフトウェアの殆どはmacportsを利用してインストールしています。主なものだけでも、Apache2.2.11、PostgreSQL8.3.5、MySQL5.0.75、PHP5.2.8、Subversion1.5.5と、ほぼ最新の開発環境が手に入ります。</p>
				<p>インストール済みのソフトウェアを最新に保つための手順は以下の通りですが、事前に各ソフトウェアの設定ファイルはバックアップした方が良いようです。特にapache2の場合、conf/extra、conf/extras-conf以下のファイルが上書きされてしまうため、注意が必要です。</p>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
sudo port selfupdate
sudo port upgrade installed
</pre>
				</div>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2009/02/09/331.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>スタイルシートの@import</title>
		<link>http://works-bb.net/2009/02/02/293.html</link>
		<comments>http://works-bb.net/2009/02/02/293.html#comments</comments>
		<pubDate>Sun, 01 Feb 2009 23:30:19 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[スタイルシート]]></category>
		<category><![CDATA[@import]]></category>

		<guid isPermaLink="false">http://works-bb.net/?p=293</guid>
		<description><![CDATA[スタイルシートの@importの規則として、 　スタイルシート内のどのスタイル宣言よりも前に記述しなくてはならない、 というものがあります。 この規則ですが、Internet Explorer 7 では、より制約が厳しいので注意が必要です。例えば、次のような記述では、category1_index.cssを組み込んだページは期待通りの結果を得られない事があります。 base_index.cssの内容 @import url(theme.css); // theme.css を基本とし、Webサイト全体の共通の定義を記述 body { background-color: #F5F5DC; } category1_index.cssの内容 @import url(base_index.css); // base_index.css から変更したい部分のみを記述 body { color: 555555; } この問題の対処方法は次のようになります。 base_index.cssの内容 // theme.css を基本とし、Webサイト全体の共通の定義を記述 body { background-color: #F5F5DC; } category1_index.cssの内容 @import url(theme.css); @import url(base_index.css); // base_index.css から変更したい部分のみを記述 body { color: 555555; } FireFox3、Safari3、Chrome等のブラウザでは前者の方法でも問題ありませんが、Internet Explorer 7では@importが記述されたスタイルシートの@importにうまく対応できていないようです。]]></description>
			<content:encoded><![CDATA[				<p>スタイルシートの@importの規則として、<br />
				　スタイルシート内のどのスタイル宣言よりも前に記述しなくてはならない、<br />
				というものがあります。</p>
				<p>この規則ですが、Internet Explorer 7 では、より制約が厳しいので注意が必要です。例えば、次のような記述では、category1_index.cssを組み込んだページは期待通りの結果を得られない事があります。</p>
				<h4>base_index.cssの内容</h4>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
@import url(theme.css);

// theme.css を基本とし、Webサイト全体の共通の定義を記述
body {
    background-color: #F5F5DC;
}
</pre>
				</div>
				<h4> category1_index.cssの内容 </h4>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
@import url(base_index.css);

// base_index.css から変更したい部分のみを記述
body {
    color: 555555;
}
</pre>
				</div>
				<p>この問題の対処方法は次のようになります。</p>
				<h4>base_index.cssの内容</h4>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
// theme.css を基本とし、Webサイト全体の共通の定義を記述
body {
    background-color: #F5F5DC;
}
</pre>
				</div>
				<h4> category1_index.cssの内容 </h4>
				<div class="wb_terminal">
				<pre id="wb_terminal_inner">
@import url(theme.css);
@import url(base_index.css);

// base_index.css から変更したい部分のみを記述
body {
    color: 555555;
}
</pre>
				</div>
				<p>FireFox3、Safari3、Chrome等のブラウザでは前者の方法でも問題ありませんが、Internet Explorer 7では@importが記述されたスタイルシートの@importにうまく対応できていないようです。</p>
]]></content:encoded>
			<wfw:commentRss>http://works-bb.net/2009/02/02/293.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

